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,20 @@
import type { BUN_SQLITE_WGUI_VARIABLES } from "@/db/types/db";
type Params = {
variables?: BUN_SQLITE_WGUI_VARIABLES[];
};
export default function checkIfMainHostIsSet({ variables }: Params) {
const is_main_host_set =
Boolean(
variables?.find((v) => v.key == "main_host_wg_ip_address")?.value,
) &&
Boolean(
variables?.find((v) => v.key == "main_host_wg_private_key")?.value,
) &&
Boolean(
variables?.find((v) => v.key == "main_host_wg_public_key")?.value,
);
return is_main_host_set;
}