diff --git a/frontend/src/components/alert/details.tsx b/frontend/src/components/alert/details.tsx index 747367eed..396631e02 100644 --- a/frontend/src/components/alert/details.tsx +++ b/frontend/src/components/alert/details.tsx @@ -58,7 +58,7 @@ export const AlertDetailsDialogContent = ({ return ( -
+
-
+
{/** Alert type */}
type:
{" "} diff --git a/frontend/src/components/resources/server/tabs.tsx b/frontend/src/components/resources/server/tabs.tsx index 3307ee8b5..7d2340170 100644 --- a/frontend/src/components/resources/server/tabs.tsx +++ b/frontend/src/components/resources/server/tabs.tsx @@ -15,6 +15,7 @@ import { StackTable } from "../stack/table"; import { RepoTable } from "../repo/table"; import { ServerTerminals } from "@components/terminal/server"; import { Card, CardHeader, CardTitle } from "@ui/card"; +import { Types } from "komodo_client"; type ServerTabView = "Config" | "Stats" | "Docker" | "Resources" | "Terminals"; @@ -65,7 +66,7 @@ export const ServerTabs = ({ id }: { id: string }) => { }, { value: "Terminals", - hidden: + disabled: !specificTerminal || (terminals_disabled && container_terminals_disabled), }, @@ -170,36 +171,48 @@ const ServerTabsTerminals = ({ }) => { const { specificTerminal } = usePermissions({ type: "Server", id }); const server_info = useServer(id)?.info; + const state = server_info?.state ?? Types.ServerState.NotOk; const terminals_disabled = server_info?.terminals_disabled ?? true; const container_terminals_disabled = server_info?.container_terminals_disabled ?? true; - return ( - <> - {(!terminals_disabled || !container_terminals_disabled) && - specificTerminal && } - {terminals_disabled && - container_terminals_disabled && - specificTerminal && ( -
- - - Terminals are disabled on this Server. - - -
- )} - {!specificTerminal && ( -
- - - - User does not have permission to use Terminals. - - - -
- )} - - ); + if (!specificTerminal) { + return ( +
+ + + + User does not have permission to use Terminals on this Server. + + + +
+ ); + } + + if (state !== Types.ServerState.Ok) { + return ( +
+ + + Server is not connected + + +
+ ); + } + + if (terminals_disabled && container_terminals_disabled) { + return ( +
+ + + Terminals are disabled on this Server. + + +
+ ); + } + + return ; }; diff --git a/frontend/src/components/topbar/components.tsx b/frontend/src/components/topbar/components.tsx index 9bb3b0aea..be2b174f7 100644 --- a/frontend/src/components/topbar/components.tsx +++ b/frontend/src/components/topbar/components.tsx @@ -503,7 +503,7 @@ export const TopbarAlerts = () => { {data?.alerts.map((alert) => ( setAlert(alert)} >