Initialize client forms
This commit is contained in:
@@ -15,8 +15,6 @@ type Props = {
|
||||
};
|
||||
|
||||
export default function AdminHero({ title, description, buttons }: Props) {
|
||||
const { pageProps } = useContext(AppContext);
|
||||
|
||||
return (
|
||||
<Section>
|
||||
<Stack className="w-full items-stretch">
|
||||
@@ -30,18 +28,6 @@ export default function AdminHero({ title, description, buttons }: Props) {
|
||||
description
|
||||
)
|
||||
) : null}
|
||||
<Breadcrumbs
|
||||
dividerProps={{
|
||||
className: "-skew-10",
|
||||
}}
|
||||
currentLinkProps={{
|
||||
className:
|
||||
"text-slate-400! pointer-events-none",
|
||||
}}
|
||||
pageUrl={pageProps?.url?.pathname}
|
||||
backButton
|
||||
skipHome
|
||||
/>
|
||||
</Stack>
|
||||
<Row>{buttons}</Row>
|
||||
</Row>
|
||||
|
||||
@@ -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