Add host setup functions and client components

This commit is contained in:
2026-09-13 10:52:30 +01:00
parent 76679aabe7
commit 86eb3a0b05
53 changed files with 1284 additions and 1325 deletions
@@ -0,0 +1,31 @@
import { useAdminCrudGet } from "@/src/hooks/use-admin-crud-get";
import type {
BUN_SQLITE_WGUI_CLIENTS,
BUN_SQLITE_WGUI_HOSTS,
BUN_SQLITE_WGUI_VARIABLES,
} from "@/db/types/db";
export default function useDashboardData() {
const clients_res = useAdminCrudGet<BUN_SQLITE_WGUI_CLIENTS>({
table: "clients",
sql_query: {
order: { field: "created_at", strategy: "DESC" },
limit: 100,
},
});
const hosts_res = useAdminCrudGet<BUN_SQLITE_WGUI_HOSTS>({
table: "hosts",
limit: 100,
});
const variables_res = useAdminCrudGet<BUN_SQLITE_WGUI_VARIABLES>({
table: "variables",
});
return {
clients: clients_res.res,
hosts: hosts_res.res,
variables: variables_res.res,
};
}