diff --git a/frontend/src/components/config/util.tsx b/frontend/src/components/config/util.tsx index 4dbc0bdd4..ca1cef584 100644 --- a/frontend/src/components/config/util.tsx +++ b/frontend/src/components/config/util.tsx @@ -23,7 +23,7 @@ import { DialogTrigger, } from "@ui/dialog"; import { snake_case_to_upper_space_case } from "@lib/formatting"; -import { ConfirmButton } from "@components/util"; +import { ConfirmButton, TextUpdateMenu } from "@components/util"; export const ConfigItem = ({ label, @@ -34,15 +34,18 @@ export const ConfigItem = ({ children: ReactNode; className?: string; }) => ( -
- {label &&
{snake_case_to_upper_space_case(label)}
} - {children} -
+ <> +
+ {label &&
{snake_case_to_upper_space_case(label)}
} + {children} +
+
+ ); export const ConfigInput = ({ @@ -319,27 +322,23 @@ export const SystemCommand = ({ }) => { return ( -
-
- Path: - set({ ...(value || {}), path: e.target.value })} - disabled={disabled} - /> -
-
- Command: - set({ ...(value || {}), command: e.target.value })} - disabled={disabled} - /> -
+
+ Path: + set({ ...(value || {}), path: e.target.value })} + disabled={disabled} + /> + Command: + set({ ...(value || {}), command })} + triggerClassName="w-[300px]" + />
); diff --git a/frontend/src/components/resources/common.tsx b/frontend/src/components/resources/common.tsx index 0ced9f16a..569a799ce 100644 --- a/frontend/src/components/resources/common.tsx +++ b/frontend/src/components/resources/common.tsx @@ -325,3 +325,22 @@ export const CopyGithubWebhook = ({
); }; + +export const ServerSelector = ({ + selected, + set, + disabled, +}: { + selected: string | undefined; + set: (input: Partial) => void; + disabled: boolean; +}) => ( + + set({ server_id })} + disabled={disabled} + /> + +); \ No newline at end of file diff --git a/frontend/src/components/resources/deployment/config/index.tsx b/frontend/src/components/resources/deployment/config/index.tsx index c9cb8bc65..a9426c271 100644 --- a/frontend/src/components/resources/deployment/config/index.tsx +++ b/frontend/src/components/resources/deployment/config/index.tsx @@ -15,28 +15,9 @@ import { TermSignalLabels, TerminationTimeout, } from "./components/term-signal"; -import { LabelsConfig, ResourceSelector } from "@components/resources/common"; +import { LabelsConfig, ServerSelector } from "@components/resources/common"; import { TextUpdateMenu } from "@components/util"; -export const ServerSelector = ({ - selected, - set, - disabled, -}: { - selected: string | undefined; - set: (input: Partial) => void; - disabled: boolean; -}) => ( - - set({ server_id })} - disabled={disabled} - /> - -); - export const DeploymentConfig = ({ id }: { id: string }) => { const perms = useRead("GetPermissionLevel", { target: { type: "Deployment", id }, @@ -97,17 +78,6 @@ export const DeploymentConfig = ({ id }: { id: string }) => { disabled={disabled} /> ), - command: (value, set) => ( - - set({ command })} - triggerClassName="min-w-[300px] max-w-[400px]" - /> - - ), network: (value, set) => ( { extra_args: (value, set) => ( ), + command: (value, set) => ( + + set({ command })} + triggerClassName="min-w-[300px] max-w-[400px]" + /> + + ), }, settings: { send_alerts: true, diff --git a/frontend/src/components/resources/repo/config.tsx b/frontend/src/components/resources/repo/config.tsx index 36d87e38b..fbfc424f6 100644 --- a/frontend/src/components/resources/repo/config.tsx +++ b/frontend/src/components/resources/repo/config.tsx @@ -10,7 +10,7 @@ import { SelectValue, } from "@ui/select"; import { useState } from "react"; -import { CopyGithubWebhook, ResourceSelector } from "../common"; +import { CopyGithubWebhook, ServerSelector } from "../common"; export const RepoConfig = ({ id }: { id: string }) => { const perms = useRead("GetPermissionLevel", { @@ -34,16 +34,12 @@ export const RepoConfig = ({ id }: { id: string }) => { }} components={{ general: { - general: { - server_id: (selected, set) => ( - - set({ server_id })} - /> - + "": { + server_id: (value, set) => ( + ), + }, + general: { repo: true, branch: true, github_account: (value, set) => {