call table update
This commit is contained in:
@@ -14,7 +14,7 @@ const inputCls =
|
||||
function filterCalls(calls: CallRecord[], filters: Filters): CallRecord[] {
|
||||
const q = filters.query.trim().toLowerCase();
|
||||
const tgid = filters.tgid.trim();
|
||||
const fromMs = filters.dateFrom ? new Date(filters.dateFrom).getTime() : null;
|
||||
const fromMs = filters.dateFrom ? new Date(filters.dateFrom + "T00:00:00").getTime() : null;
|
||||
const toMs = filters.dateTo ? new Date(filters.dateTo + "T23:59:59").getTime() : null;
|
||||
|
||||
return calls.filter((c) => {
|
||||
@@ -248,7 +248,7 @@ export default function CallsPage() {
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{!activeFilters && ended.length >= limitCount && (
|
||||
{ended.length >= limitCount && (
|
||||
<button
|
||||
onClick={() => setLimitCount((n) => n + 100)}
|
||||
className="mt-4 text-sm text-indigo-400 hover:text-indigo-300 font-mono transition-colors"
|
||||
|
||||
@@ -68,7 +68,19 @@ export function CallRow({ call, systemName, isAdmin }: Props) {
|
||||
onClick={() => hasDetails && setExpanded((v) => !v)}
|
||||
>
|
||||
<td className="px-4 py-2 text-gray-400 text-xs">
|
||||
{new Date(call.started_at).toLocaleTimeString()}
|
||||
{(() => {
|
||||
const d = new Date(call.started_at);
|
||||
const today = new Date();
|
||||
const isToday = d.toDateString() === today.toDateString();
|
||||
return isToday ? (
|
||||
d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })
|
||||
) : (
|
||||
<span>
|
||||
<span className="text-gray-600">{d.toLocaleDateString([], { month: "short", day: "numeric" })} </span>
|
||||
{d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })}
|
||||
</span>
|
||||
);
|
||||
})()}
|
||||
</td>
|
||||
<td className="px-4 py-2 text-gray-300">
|
||||
<span>{call.talkgroup_name || call.talkgroup_id || "—"}</span>
|
||||
|
||||
Reference in New Issue
Block a user