forked from github-starred/komodo
builds looking good
This commit is contained in:
@@ -129,7 +129,10 @@ export const DoubleInput = <
|
||||
return (
|
||||
<div className={cn("flex flex-col gap-4", containerClassName)}>
|
||||
{values?.map((value, i) => (
|
||||
<div className="flex items-center justify-between gap-4 flex-wrap" key={i}>
|
||||
<div
|
||||
className="flex items-center justify-between gap-4 flex-wrap"
|
||||
key={i}
|
||||
>
|
||||
<Input
|
||||
className={inputClassName}
|
||||
value={value[leftval] as any}
|
||||
@@ -204,9 +207,7 @@ export const AccountSelector = ({
|
||||
<SelectValue placeholder={placeholder} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value={"Empty"}>
|
||||
{placeholder}
|
||||
</SelectItem>
|
||||
<SelectItem value={"Empty"}>{placeholder}</SelectItem>
|
||||
{(accounts as any)?.[account_type]?.map((account: string) => (
|
||||
<SelectItem key={account} value={account}>
|
||||
{account}
|
||||
@@ -315,36 +316,38 @@ export const ConfirmUpdate = ({
|
||||
};
|
||||
|
||||
export const SystemCommand = ({
|
||||
label,
|
||||
value,
|
||||
disabled,
|
||||
set,
|
||||
}: {
|
||||
label: string;
|
||||
value?: Types.SystemCommand;
|
||||
disabled: boolean;
|
||||
set: (value: Types.SystemCommand) => void;
|
||||
}) => {
|
||||
return (
|
||||
<ConfigItem label={label} className="items-start">
|
||||
<div className="grid gap-y-4 gap-x-8 grid-cols-[auto_1fr] grid-rows-1 items-center">
|
||||
Path:
|
||||
<Input
|
||||
placeholder="Command working directory"
|
||||
value={value?.path}
|
||||
className="w-full"
|
||||
onChange={(e) => set({ ...(value || {}), path: e.target.value })}
|
||||
disabled={disabled}
|
||||
/>
|
||||
Command:
|
||||
<TextUpdateMenu
|
||||
title="Update Command"
|
||||
placeholder="Set shell command"
|
||||
value={value?.command}
|
||||
onUpdate={(command) => set({ ...(value || {}), command })}
|
||||
triggerClassName="w-[300px]"
|
||||
/>
|
||||
<div className="w-full flex justify-end flex-wrap">
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="grid gap-2">
|
||||
<div className="text-muted-foreground">Path:</div>
|
||||
<Input
|
||||
placeholder="Command working directory"
|
||||
value={value?.path}
|
||||
className="w-[200px] lg:w-[300px]"
|
||||
onChange={(e) => set({ ...(value || {}), path: e.target.value })}
|
||||
disabled={disabled}
|
||||
/>
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
<div className="text-muted-foreground">Command:</div>
|
||||
<TextUpdateMenu
|
||||
title="Update Command"
|
||||
placeholder="Set shell command"
|
||||
value={value?.command}
|
||||
onUpdate={(command) => set({ ...(value || {}), command })}
|
||||
triggerClassName="w-[200px] lg:w-[300px]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ConfigItem>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -147,20 +147,68 @@ export const BuildConfig = ({ id }: { id: string }) => {
|
||||
/>
|
||||
),
|
||||
use_buildx: true,
|
||||
labels: (l, set) => (
|
||||
<LabelsConfig labels={l ?? []} set={set} disabled={disabled} />
|
||||
),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Extra Args",
|
||||
contentHidden:
|
||||
(update.extra_args ?? config.extra_args)?.length === 0,
|
||||
actions: (
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
...update,
|
||||
extra_args: [
|
||||
...(update.extra_args ?? config.extra_args ?? []),
|
||||
"",
|
||||
],
|
||||
})
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
<PlusCircle className="w-4 h-4" />
|
||||
Add Extra Arg
|
||||
</Button>
|
||||
),
|
||||
components: {
|
||||
extra_args: (value, set) => (
|
||||
<ExtraArgs args={value ?? []} set={set} disabled={disabled} />
|
||||
),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Labels",
|
||||
contentHidden: (update.labels ?? config.labels)?.length === 0,
|
||||
actions: (
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
...update,
|
||||
labels: [
|
||||
...(update.labels ?? config.labels ?? []),
|
||||
{ variable: "", value: "" },
|
||||
],
|
||||
})
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
<PlusCircle className="w-4 h-4" />
|
||||
Add Label
|
||||
</Button>
|
||||
),
|
||||
components: {
|
||||
labels: (l, set) => (
|
||||
<LabelsConfig labels={l ?? []} set={set} disabled={disabled} />
|
||||
),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Pre Build",
|
||||
components: {
|
||||
pre_build: (value, set) => (
|
||||
<SystemCommand
|
||||
label="Pre Build"
|
||||
value={value}
|
||||
set={(value) => set({ pre_build: value })}
|
||||
disabled={disabled}
|
||||
@@ -233,44 +281,32 @@ const ExtraArgs = ({
|
||||
disabled: boolean;
|
||||
}) => {
|
||||
return (
|
||||
<ConfigItem
|
||||
label="Extra Args"
|
||||
className={args.length > 0 ? "items-start" : undefined}
|
||||
>
|
||||
<div className="flex flex-col gap-4 w-full max-w-[400px]">
|
||||
{args.map((arg, i) => (
|
||||
<div className="w-full flex gap-4" key={i}>
|
||||
<Input
|
||||
value={arg}
|
||||
placeholder="--extra-arg=value"
|
||||
onChange={(e) => {
|
||||
args[i] = e.target.value;
|
||||
set({ extra_args: [...args] });
|
||||
}}
|
||||
disabled={disabled}
|
||||
/>
|
||||
{!disabled && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({ extra_args: [...args.filter((_, idx) => idx !== i)] })
|
||||
}
|
||||
>
|
||||
<MinusCircle className="w-4 h-4" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
|
||||
<Button
|
||||
variant="secondary"
|
||||
className="flex items-center gap-2 w-[200px] place-self-end"
|
||||
onClick={() => set({ extra_args: [...args, ""] })}
|
||||
>
|
||||
<PlusCircle className="w-4 h-4" /> Add Extra Arg
|
||||
</Button>
|
||||
</div>
|
||||
</ConfigItem>
|
||||
<div className="flex flex-col justify-end gap-4 w-full">
|
||||
{args.map((arg, i) => (
|
||||
<div className="w-full flex gap-4 justify-end" key={i}>
|
||||
<Input
|
||||
value={arg}
|
||||
placeholder="--extra-arg=value"
|
||||
onChange={(e) => {
|
||||
args[i] = e.target.value;
|
||||
set({ extra_args: [...args] });
|
||||
}}
|
||||
disabled={disabled}
|
||||
className="w-[400px] max-w-full"
|
||||
/>
|
||||
{!disabled && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({ extra_args: [...args.filter((_, idx) => idx !== i)] })
|
||||
}
|
||||
>
|
||||
<MinusCircle className="w-4 h-4" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -49,16 +49,6 @@ export const ExtraArgs = ({
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
|
||||
{/* {!disabled && (
|
||||
<div className="place-self-end">
|
||||
<AddExtraArgMenu
|
||||
onSelect={(suggestion) =>
|
||||
set({ extra_args: [...args, suggestion] })
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
)} */}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -324,7 +324,7 @@ export const TextUpdateMenu = ({
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogTrigger asChild>
|
||||
<Card className="px-3 py-2 hover:bg-accent/50 transition-colors cursor-pointer">
|
||||
<Card className="px-3 py-2 hover:bg-accent/50 transition-colors cursor-pointer w-fit">
|
||||
<div
|
||||
className={cn(
|
||||
"text-sm text-nowrap overflow-hidden overflow-ellipsis",
|
||||
|
||||
Reference in New Issue
Block a user