This commit is contained in:
2026-09-20 07:27:29 +01:00
parent dc2cd66b25
commit 8ec44ee0a7
70 changed files with 2657 additions and 128 deletions
+19 -2
View File
@@ -5,16 +5,22 @@ import Row from "@/src/components/twui/layout/Row";
import Span from "@/src/components/twui/layout/Span";
import formatUnixTimestamp from "@/src/utils/format-unix-timestamp";
import adminCrudHandler from "@/src/functions/frontend/admin-crud-handler";
import type { BUN_SQLITE_WGUI_CLIENTS } from "@/db/types/db";
import type {
BUN_SQLITE_WGUI_CLIENTS,
BUN_SQLITE_WGUI_CLIENT_RULES,
} from "@/db/types/db";
import deriveClientAccessLabel from "@/src/functions/frontend/derive-client-access-label";
type Props = {
client: BUN_SQLITE_WGUI_CLIENTS;
rules?: BUN_SQLITE_WGUI_CLIENT_RULES[];
};
export default function ClientRow({ client }: Props) {
export default function ClientRow({ client, rules }: Props) {
const [deleting, setDeleting] = useState(false);
const host_id = Number(client.host_id || 0);
const access = deriveClientAccessLabel({ rules });
async function handleDelete() {
if (
@@ -58,6 +64,17 @@ export default function ClientRow({ client }: Props) {
<td className="px-4 py-[9px] tabular text-[13px] text-foreground-light/45 dark:text-foreground-dark/45 whitespace-nowrap">
{client.allowed_ips || "—"}
</td>
<td className="px-4 py-[9px] whitespace-nowrap">
<Span
className={
access.kind == "none"
? "text-[12.5px] text-error/80"
: "text-[12.5px] text-foreground-light/60 dark:text-foreground-dark/60"
}
>
{access.text}
</Span>
</td>
<td className="px-4 py-[9px]">
<Span className="font-mono text-[12px] text-foreground-light/45 dark:text-foreground-dark/45 whitespace-nowrap">
{client.public_key