UI Updates

This commit is contained in:
Logan
2026-04-19 15:22:29 -04:00
parent 03212fca51
commit 0df53df92e
7 changed files with 181 additions and 13 deletions
+4 -2
View File
@@ -4,11 +4,13 @@ import { useState } from "react";
import { useCalls } from "@/lib/useCalls";
import { useSystems } from "@/lib/useSystems";
import { CallRow } from "@/components/CallRow";
import { useAuth } from "@/components/AuthProvider";
export default function CallsPage() {
const [limitCount, setLimitCount] = useState(100);
const { calls, loading } = useCalls(limitCount);
const { systems } = useSystems();
const { isAdmin } = useAuth();
const systemMap = Object.fromEntries(systems.map((s) => [s.system_id, s]));
const active = calls.filter((c) => c.status === "active");
@@ -41,7 +43,7 @@ export default function CallsPage() {
</thead>
<tbody>
{active.map((c) => (
<CallRow key={c.call_id} call={c} systemName={systemMap[c.system_id ?? ""]?.name} />
<CallRow key={c.call_id} call={c} systemName={systemMap[c.system_id ?? ""]?.name} isAdmin={isAdmin} />
))}
</tbody>
</table>
@@ -73,7 +75,7 @@ export default function CallsPage() {
</thead>
<tbody>
{ended.map((c) => (
<CallRow key={c.call_id} call={c} systemName={systemMap[c.system_id ?? ""]?.name} />
<CallRow key={c.call_id} call={c} systemName={systemMap[c.system_id ?? ""]?.name} isAdmin={isAdmin} />
))}
</tbody>
</table>
+3 -1
View File
@@ -8,6 +8,7 @@ import { CallRow } from "@/components/CallRow";
import { NodeConfigModal } from "@/components/NodeConfigModal";
import { useState } from "react";
import type { NodeRecord } from "@/lib/types";
import { useAuth } from "@/components/AuthProvider";
function StatCard({ label, value, accent }: { label: string; value: string | number; accent?: string }) {
return (
@@ -26,6 +27,7 @@ export default function DashboardPage() {
const { systems, error: systemsError } = useSystems();
const [configNode, setConfigNode] = useState<NodeRecord | null>(null);
const { isAdmin } = useAuth();
const systemMap = Object.fromEntries(systems.map((s) => [s.system_id, s]));
const onlineCount = nodes.filter((n) => n.status !== "offline").length;
@@ -98,7 +100,7 @@ export default function DashboardPage() {
</thead>
<tbody>
{calls.map((c) => (
<CallRow key={c.call_id} call={c} systemName={systemMap[c.system_id ?? ""]?.name} />
<CallRow key={c.call_id} call={c} systemName={systemMap[c.system_id ?? ""]?.name} isAdmin={isAdmin} />
))}
</tbody>
</table>