forked from github-starred/komodo
fix updates
This commit is contained in:
@@ -22,7 +22,13 @@ import { PlusCircle } from "lucide-react";
|
||||
import { ReactNode, useEffect, useState } from "react";
|
||||
import { CopyGithubWebhook, LabelsConfig, ResourceSelector } from "../common";
|
||||
|
||||
export const BuildConfig = ({ id, titleOther }: { id: string; titleOther: ReactNode }) => {
|
||||
export const BuildConfig = ({
|
||||
id,
|
||||
titleOther,
|
||||
}: {
|
||||
id: string;
|
||||
titleOther: ReactNode;
|
||||
}) => {
|
||||
const perms = useRead("GetPermissionLevel", {
|
||||
target: { type: "Build", id },
|
||||
}).data;
|
||||
@@ -159,12 +165,13 @@ export const BuildConfig = ({ id, titleOther }: { id: string; titleOther: ReactN
|
||||
<AddExtraArgMenu
|
||||
type="Build"
|
||||
onSelect={(suggestion) =>
|
||||
set({
|
||||
set((update) => ({
|
||||
...update,
|
||||
extra_args: [
|
||||
...(update.extra_args ?? config.extra_args ?? []),
|
||||
suggestion,
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
disabled={disabled}
|
||||
/>
|
||||
@@ -188,13 +195,13 @@ export const BuildConfig = ({ id, titleOther }: { id: string; titleOther: ReactN
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
set(update => ({
|
||||
...update,
|
||||
labels: [
|
||||
...(update.labels ?? config.labels ?? []),
|
||||
{ variable: "", value: "" },
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
|
||||
@@ -59,7 +59,7 @@ const AwsBuilderConfig = ({ id }: { id: string }) => {
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
set(update => ({
|
||||
...update,
|
||||
security_group_ids: [
|
||||
...(update.security_group_ids ??
|
||||
@@ -67,7 +67,7 @@ const AwsBuilderConfig = ({ id }: { id: string }) => {
|
||||
[]),
|
||||
"",
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
@@ -95,7 +95,7 @@ const AwsBuilderConfig = ({ id }: { id: string }) => {
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
set(update => ({
|
||||
...update,
|
||||
github_accounts: [
|
||||
...(update.github_accounts ??
|
||||
@@ -103,7 +103,7 @@ const AwsBuilderConfig = ({ id }: { id: string }) => {
|
||||
[]),
|
||||
"",
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
@@ -131,7 +131,7 @@ const AwsBuilderConfig = ({ id }: { id: string }) => {
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
set((update) => ({
|
||||
...update,
|
||||
docker_accounts: [
|
||||
...(update.docker_accounts ??
|
||||
@@ -139,7 +139,7 @@ const AwsBuilderConfig = ({ id }: { id: string }) => {
|
||||
[]),
|
||||
"",
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
|
||||
@@ -132,13 +132,13 @@ export const DeploymentConfig = ({
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
set((update) => ({
|
||||
...update,
|
||||
ports: [
|
||||
...(update.ports ?? config.ports ?? []),
|
||||
{ container: "", local: "" },
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
@@ -163,13 +163,13 @@ export const DeploymentConfig = ({
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
set((update) => ({
|
||||
...update,
|
||||
volumes: [
|
||||
...(update.volumes ?? config.volumes ?? []),
|
||||
{ container: "", local: "" },
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
@@ -195,12 +195,13 @@ export const DeploymentConfig = ({
|
||||
<AddExtraArgMenu
|
||||
type="Deployment"
|
||||
onSelect={(suggestion) =>
|
||||
set({
|
||||
set((update) => ({
|
||||
...update,
|
||||
extra_args: [
|
||||
...(update.extra_args ?? config.extra_args ?? []),
|
||||
suggestion,
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
disabled={disabled}
|
||||
/>
|
||||
|
||||
@@ -69,7 +69,7 @@ export const AwsServerTemplateConfig = ({ id }: { id: string }) => {
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
set((update) => ({
|
||||
...update,
|
||||
security_group_ids: [
|
||||
...(update.security_group_ids ??
|
||||
@@ -77,7 +77,7 @@ export const AwsServerTemplateConfig = ({ id }: { id: string }) => {
|
||||
[]),
|
||||
"",
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
@@ -104,13 +104,13 @@ export const AwsServerTemplateConfig = ({ id }: { id: string }) => {
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
set((update) => ({
|
||||
...update,
|
||||
volumes: [
|
||||
...(update.volumes ?? config.volumes ?? []),
|
||||
newVolume((update.volumes ?? config.volumes).length),
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
|
||||
@@ -140,13 +140,13 @@ export const HetznerServerTemplateConfig = ({ id }: { id: string }) => {
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
set((update) => ({
|
||||
...update,
|
||||
firewall_ids: [
|
||||
...(update.firewall_ids ?? config.firewall_ids ?? []),
|
||||
0,
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
@@ -271,13 +271,13 @@ export const HetznerServerTemplateConfig = ({ id }: { id: string }) => {
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() =>
|
||||
set({
|
||||
set((update) => ({
|
||||
...update,
|
||||
ssh_keys: [
|
||||
...(update.ssh_keys ?? config.ssh_keys ?? []),
|
||||
"",
|
||||
],
|
||||
})
|
||||
}))
|
||||
}
|
||||
className="flex items-center gap-2 w-[200px]"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user