Initialize client forms
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
import Span from "../twui/layout/Span";
|
||||
import Tag from "../twui/elements/Tag";
|
||||
import { AppData } from "@/src/data/app-data";
|
||||
import type { APIResponseObject } from "@moduletrace/bunext/types";
|
||||
|
||||
type Props = {
|
||||
button_props?: Omit<ComponentProps<typeof Button>, "title">;
|
||||
@@ -205,11 +206,18 @@ export default function SetupMainHostButton({ button_props }: Props) {
|
||||
setLoading(true);
|
||||
setStatus(undefined);
|
||||
|
||||
fetchApi<ApiReqParams>(`/api/admin/setup-main-host`, {
|
||||
method: "POST",
|
||||
body: { ip_address: wgIP },
|
||||
})
|
||||
fetchApi<ApiReqParams, APIResponseObject>(
|
||||
`/api/admin/setup-main-host`,
|
||||
{
|
||||
method: "POST",
|
||||
body: { ip_address: wgIP },
|
||||
},
|
||||
)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
setStatus({
|
||||
success: res.success,
|
||||
error: !res.success,
|
||||
|
||||
Reference in New Issue
Block a user