diff --git a/frontend/src/components/resources/deployment/index.tsx b/frontend/src/components/resources/deployment/index.tsx index 3b88def20..b25027b11 100644 --- a/frontend/src/components/resources/deployment/index.tsx +++ b/frontend/src/components/resources/deployment/index.tsx @@ -1,7 +1,7 @@ import { useLocalStorage, useRead } from "@lib/hooks"; import { Types } from "komodo_client"; import { RequiredResourceComponents } from "@types"; -import { HardDrive, Rocket, Server } from "lucide-react"; +import { CircleArrowUp, HardDrive, Rocket, Server } from "lucide-react"; import { cn } from "@lib/utils"; import { useServer } from "../server"; import { @@ -200,34 +200,7 @@ export const DeploymentComponents: RequiredResourceComponents = { }, Status: { - UpdateAvailable: ({ id }) => { - const info = useDeployment(id)?.info; - const state = info?.state ?? Types.DeploymentState.Unknown; - if ( - !info || - !info?.update_available || - [ - Types.DeploymentState.NotDeployed, - Types.DeploymentState.Unknown, - ].includes(state) - ) { - return null; - } - return ( - - - -
- Update Available -
-
-
- - There is a newer image available - -
- ); - }, + UpdateAvailable: ({ id }) => , }, Info: { @@ -327,3 +300,45 @@ export const DeploymentComponents: RequiredResourceComponents = { ); }, }; + +export const UpdateAvailable = ({ + id, + small, +}: { + id: string; + small?: boolean; +}) => { + const info = useDeployment(id)?.info; + const state = info?.state ?? Types.DeploymentState.Unknown; + if ( + !info || + !info?.update_available || + [Types.DeploymentState.NotDeployed, Types.DeploymentState.Unknown].includes( + state + ) + ) { + return null; + } + return ( + + + + + {!small && ( +
+ Update Available +
+ )} +
+
+ + There is a newer image available + +
+ ); +}; diff --git a/frontend/src/components/resources/deployment/table.tsx b/frontend/src/components/resources/deployment/table.tsx index e4caa4f84..9069eb757 100644 --- a/frontend/src/components/resources/deployment/table.tsx +++ b/frontend/src/components/resources/deployment/table.tsx @@ -3,7 +3,7 @@ import { Types } from "komodo_client"; import { DataTable, SortableHeader } from "@ui/data-table"; import { useRead, useSelectedResources } from "@lib/hooks"; import { ResourceLink } from "../common"; -import { DeploymentComponents } from "."; +import { DeploymentComponents, UpdateAvailable } from "."; import { HardDrive } from "lucide-react"; import { useCallback } from "react"; @@ -35,7 +35,10 @@ export const DeploymentTable = ({ ), cell: ({ row }) => ( - +
+ + +
), size: 200, }, diff --git a/frontend/src/components/resources/stack/index.tsx b/frontend/src/components/resources/stack/index.tsx index b33557059..329734ddb 100644 --- a/frontend/src/components/resources/stack/index.tsx +++ b/frontend/src/components/resources/stack/index.tsx @@ -468,15 +468,23 @@ export const UpdateAvailable = ({ return ( - + -
- Update - {(info?.services.filter((s) => s.update_available).length ?? 0) > 1 - ? "s" - : ""}{" "} - {!small && "Available"} -
+ {!small && ( +
+ Update + {(info?.services.filter((s) => s.update_available).length ?? 0) > + 1 + ? "s" + : ""}{" "} + Available +
+ )}