diff --git a/frontend/src/components/resources/deployment/actions.tsx b/frontend/src/components/resources/deployment/actions.tsx index 3ae3bf084..cdb8b1043 100644 --- a/frontend/src/components/resources/deployment/actions.tsx +++ b/frontend/src/components/resources/deployment/actions.tsx @@ -3,7 +3,7 @@ import { ActionWithDialog, ConfirmButton, } from "@components/util"; -import { Play, Trash, Pause, Rocket, Pen, Loader2 } from "lucide-react"; +import { Play, Trash, Pause, Rocket, Pen } from "lucide-react"; import { useExecute, useInvalidate, useRead, useWrite } from "@lib/hooks"; import { useNavigate } from "react-router-dom"; import { Input } from "@ui/input"; @@ -32,7 +32,7 @@ export const RedeployContainer = ({ id }: DeploymentId) => { [deployment?.config.termination_signal] ); - const { mutate, isPending } = useExecute("Deploy"); + const { mutate: deploy, isPending } = useExecute("Deploy"); const deployments = useRead("ListDeployments", {}).data; const deployment_item = deployments?.find((d) => d.id === id); @@ -48,31 +48,37 @@ export const RedeployContainer = ({ id }: DeploymentId) => { deployment_item?.info.state !== DockerContainerState.NotDeployed && deployment_item?.info.state !== DockerContainerState.Unknown; - return ( - - ) : ( - - ) - } - onClick={() => mutate({ deployment: id, stop_signal: signal })} - disabled={pending} - loading={pending} - additional={ - deployed && deployment.config.term_signal_labels.length > 1 ? ( - - ) : undefined - } - /> - ); + if (deployed) { + return ( + } + onClick={() => deploy({ deployment: id, stop_signal: signal })} + disabled={pending} + loading={pending} + additional={ + deployed && deployment.config.term_signal_labels.length > 1 ? ( + + ) : undefined + } + /> + ); + } else { + return ( + } + onClick={() => deploy({ deployment: id })} + disabled={pending} + loading={pending} + /> + ); + } }; const StartContainer = ({ id }: DeploymentId) => { @@ -87,7 +93,7 @@ const StartContainer = ({ id }: DeploymentId) => { return ( } onClick={() => mutate({ deployment: id })} disabled={pending} diff --git a/frontend/src/pages/home/all_resources.tsx b/frontend/src/pages/home/all_resources.tsx index 11e2fd467..c83036adf 100644 --- a/frontend/src/pages/home/all_resources.tsx +++ b/frontend/src/pages/home/all_resources.tsx @@ -1,3 +1,4 @@ +import { OpenAlerts } from "@components/alert"; import { Page, Section } from "@components/layouts"; import { ResourceComponents } from "@components/resources"; import { TagsFilter, useTagsFilter } from "@components/tags"; @@ -25,6 +26,7 @@ export const AllResources = () => { } > + {Object.entries(ResourceComponents).map(([type, Components]) => ( ))} diff --git a/frontend/src/pages/home/tree.tsx b/frontend/src/pages/home/tree.tsx index 8e8fd9e00..a1ee4a73a 100644 --- a/frontend/src/pages/home/tree.tsx +++ b/frontend/src/pages/home/tree.tsx @@ -1,3 +1,4 @@ +import { OpenAlerts } from "@components/alert"; import { Page, Section } from "@components/layouts"; import { ResourceComponents } from "@components/resources"; import { DeploymentTable } from "@components/resources/deployment/table"; @@ -14,6 +15,7 @@ export const Tree = () => { const servers = useRead("ListServers", { query: { tags } }).data; return ( }> + {servers?.map((server) => (