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,16 +2,22 @@ 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 (
<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"
@ -41,5 +47,6 @@ export default function Layout({ children }: Props) {
</Stack>
</div>
</Main>
</Fragment>
);
}