Add host setup functions and client components
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user