This commit is contained in:
Benjamin Toby 2026-03-10 11:52:02 +00:00
parent f3b42bc206
commit 29a8b17c61
2 changed files with 50 additions and 32 deletions

View File

@ -13,6 +13,8 @@ import {
ParsedDeploymentServiceConfig,
} from "@/src/types";
import Select, { TWUISelectOptionObject } from "@/twui/components/form/Select";
import Input from "@/twui/components/form/Input";
import AceEditor from "@/twui/components/editors/AceEditor";
type Props = {
service: ParsedDeploymentServiceConfig;
@ -34,12 +36,14 @@ export default function ServiceClusterServerLogSelector({
const [log, setLog] = useState(log_strings?.[0]);
const [isCustomLog, setIsCustomLog] = useState(false);
const customLogRef = useRef("");
useEffect(() => {
externalSetLog(log);
}, [log]);
return (
<Stack className="w-full gap-0">
<Stack className="w-full gap-2">
<Select
options={[
...(log_strings?.map(
@ -60,7 +64,14 @@ export default function ServiceClusterServerLogSelector({
}
}}
/>
{isCustomLog}
{isCustomLog ? (
<AceEditor
placeholder="Enter custom command"
onChange={(v) => {
customLogRef.current = v;
}}
/>
) : null}
</Stack>
);
}

View File

@ -2,44 +2,51 @@ import LinkList from "@/twui/components/elements/LinkList";
import Main from "@/twui/components/layout/Main";
import Row from "@/twui/components/layout/Row";
import Stack from "@/twui/components/layout/Stack";
import { PropsWithChildren } from "react";
import { Fragment, PropsWithChildren } from "react";
import { AdminAsideLinks } from "./(data)/links";
import Header from "./header";
import { twMerge } from "tailwind-merge";
import Spacer from "@/twui/components/layout/Spacer";
import Head from "next/head";
type Props = PropsWithChildren & {};
export default function Layout({ children }: Props) {
return (
<Main
className="w-screen h-screen overflow-hidden p-4 lg:p-10"
id="admin-main"
>
<div className="grid-frame grid-cols-6 w-full h-full grid-rows-[64px_47px] xl:grid-rows-[64px_auto]">
<Header />
<Stack className="grid-cell col-span-6 xl:col-span-1 gap-0">
<LinkList
links={AdminAsideLinks}
className="w-full xl:flex-col"
linkProps={{
className: "turboci-admin-aside-link",
}}
/>
</Stack>
<Stack
className={twMerge(
"grid-cell col-span-6 xl:col-span-5 gap-0",
"overflow-auto pb-[200px]",
)}
>
{children}
<div
className="h-[400px] w-full block"
style={{ height: "400px" }}
/>
</Stack>
</div>
</Main>
<Fragment>
<Head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ace.min.js" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ext-language_tools.min.js" />
</Head>
<Main
className="w-screen h-screen overflow-hidden p-4 lg:p-10"
id="admin-main"
>
<div className="grid-frame grid-cols-6 w-full h-full grid-rows-[64px_47px] xl:grid-rows-[64px_auto]">
<Header />
<Stack className="grid-cell col-span-6 xl:col-span-1 gap-0">
<LinkList
links={AdminAsideLinks}
className="w-full xl:flex-col"
linkProps={{
className: "turboci-admin-aside-link",
}}
/>
</Stack>
<Stack
className={twMerge(
"grid-cell col-span-6 xl:col-span-5 gap-0",
"overflow-auto pb-[200px]",
)}
>
{children}
<div
className="h-[400px] w-full block"
style={{ height: "400px" }}
/>
</Stack>
</div>
</Main>
</Fragment>
);
}