diff --git a/libs/i18n/locales/en/translation.json b/libs/i18n/locales/en/translation.json
index e6b0ee214..9b6cccaf4 100644
--- a/libs/i18n/locales/en/translation.json
+++ b/libs/i18n/locales/en/translation.json
@@ -608,13 +608,11 @@
"Restarts": "Restarts",
"Workload applications": "Workload applications",
"Virtual machines": "Virtual machines",
+ "The application has restarted {{ restartDelta }} times this session and may be misconfigured. Stop the application to prevent further restarts and investigate the issue.": "The application has restarted {{ restartDelta }} times this session and may be misconfigured. Stop the application to prevent further restarts and investigate the issue.",
+ "The application has restarted {{ restartDelta }} times this session and may be misconfigured. Contact an administrator to stop the application and investigate the issue.": "The application has restarted {{ restartDelta }} times this session and may be misconfigured. Contact an administrator to stop the application and investigate the issue.",
"Stop application": "Stop application",
"Restart loop detected": "Restart loop detected",
- "This application has restarted {{ count }} times this session. Stop the application to prevent further restarts and investigate the issue._one": "This application has restarted {{ count }} times this session. Stop the application to prevent further restarts and investigate the issue.",
- "This application has restarted {{ count }} times this session. Stop the application to prevent further restarts and investigate the issue._other": "This application has restarted {{ count }} times this session. Stop the application to prevent further restarts and investigate the issue.",
"This application is restarting repeatedly": "This application is restarting repeatedly",
- "The application has restarted {{ count }} times this session and may be misconfigured. Stop the application to prevent further restarts and investigate the issue._one": "The application has restarted {{ count }} times this session and may be misconfigured. Stop the application to prevent further restarts and investigate the issue.",
- "The application has restarted {{ count }} times this session and may be misconfigured. Stop the application to prevent further restarts and investigate the issue._other": "The application has restarted {{ count }} times this session and may be misconfigured. Stop the application to prevent further restarts and investigate the issue.",
"No applications found": "No applications found",
"Applications": "Applications",
"Message": "Message",
@@ -1871,8 +1869,10 @@
"{{ numberOfItems }} items": "{{ numberOfItems }} items",
"Search value cannot contain spaces": "Search value cannot contain spaces",
"The virtual machine is starting. Console will be available once running.": "The virtual machine is starting. Console will be available once running.",
+ "The virtual machine is stopped. Start the VM to access the console.": "The virtual machine is stopped. Start the VM to access the console.",
+ "The virtual machine is stopping. Start the VM to access the console.": "The virtual machine is stopping. Start the VM to access the console.",
"The virtual machine is not running. Start the VM to access the console.": "The virtual machine is not running. Start the VM to access the console.",
- "Connection was closed": "Connection was closed",
+ "Connection was closed. The VM may be starting, stopping, or stopped.": "Connection was closed. The VM may be starting, stopping, or stopped.",
"Reconnect": "Reconnect",
"Connected to serial console: {{ appName }}": "Connected to serial console: {{ appName }}",
"No virtual machines found. Create a virtual machine to access its serial console.": "No virtual machines found. Create a virtual machine to access its serial console.",
@@ -1884,9 +1884,11 @@
"End active console session?": "End active console session?",
"This will terminate the existing console session for \"{{appName}}\". If another user is connected, they will be disconnected immediately.": "This will terminate the existing console session for \"{{appName}}\". If another user is connected, they will be disconnected immediately.",
"End session and connect": "End session and connect",
+ "Connection was closed": "Connection was closed",
"Waiting for terminal session to open...": "Waiting for terminal session to open...",
"Only one serial console session can be active at a time. Another user or browser tab may already be connected to this virtual machine. Close any other active session, then try again.": "Only one serial console session can be active at a time. Another user or browser tab may already be connected to this virtual machine. Close any other active session, then try again.",
"This console session was ended because another user connected to the same virtual machine.": "This console session was ended because another user connected to the same virtual machine.",
+ "The virtual machine console is unavailable at the moment. The VM may be starting, stopping, or stopped.": "The virtual machine console is unavailable at the moment. The VM may be starting, stopping, or stopped.",
"You do not have permission to access the virtual machine console.": "You do not have permission to access the virtual machine console.",
"The virtual machine application was not found.": "The virtual machine application was not found.",
"Timed out connecting to the virtual machine console. The VM may still be starting.": "Timed out connecting to the virtual machine console. The VM may still be starting.",
diff --git a/libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx b/libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx
index 00abd875a..1b793430b 100644
--- a/libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx
+++ b/libs/ui-components/src/components/DetailsPage/Tables/ApplicationLifecycleActions.tsx
@@ -19,6 +19,7 @@ import { getDisabledTooltipProps } from '../../../utils/tooltip';
import {
type ApplicationLifecycleAction,
hasAplicationStatusMismatch,
+ isAppConsoleAvailable,
startableStatuses,
stoppableStatuses,
transitionalStatuses,
@@ -108,6 +109,7 @@ const ApplicationLifecycleActions = ({
const isAppRunning = appStatus === ApplicationStatusType.ApplicationStatusRunning;
const desiredStateIsStopped = desiredState === ApplicationDesiredState.ApplicationDesiredStateStopped;
+ const canOpenConsole = isAppConsoleAvailable(appStatus, desiredState);
const canStart = startableStatuses.includes(appStatus);
const canStop = stoppableStatuses.includes(appStatus);
const isTransitioning = transitionalStatuses.includes(appStatus);
@@ -192,7 +194,7 @@ const ApplicationLifecycleActions = ({
}
- isDisabled={!isAppRunning}
+ isDisabled={!canOpenConsole}
onClick={() => onOpenConsole?.(appStatusObj.name)}
>
{t('Open console')}
diff --git a/libs/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.tsx b/libs/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.tsx
index ceb0a054a..a3bd974de 100644
--- a/libs/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.tsx
+++ b/libs/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.tsx
@@ -89,27 +89,49 @@ const AppExpandedDetails = ({
return ;
};
-type RestartLoopStopButtonProps = {
- onStop: () => void;
- isDisabled: boolean;
- isLoading: boolean;
-};
-
-const RestartLoopStopButton = ({ onStop, isDisabled, isLoading }: RestartLoopStopButtonProps) => {
- const { t } = useTranslation();
- return (
-
- );
-};
-
type RestartLoopWarningProps = {
restartDelta: number;
canStop: boolean;
stopDisabled: boolean;
stopLoading: boolean;
- onStop: () => void;
+ onStop: VoidFunction;
+};
+
+const RestartLoopWarningContent = ({
+ restartDelta,
+ canStop,
+ stopDisabled,
+ stopLoading,
+ onStop,
+}: RestartLoopWarningProps) => {
+ const { t } = useTranslation();
+ return (
+
+
+ {canStop
+ ? t(
+ 'The application has restarted {{ restartDelta }} times this session and may be misconfigured. Stop the application to prevent further restarts and investigate the issue.',
+ { restartDelta },
+ )
+ : t(
+ 'The application has restarted {{ restartDelta }} times this session and may be misconfigured. Contact an administrator to stop the application and investigate the issue.',
+ { restartDelta },
+ )}
+
+ {canStop && (
+
+ )}
+
+ );
};
const AppRestartsWarning = ({
@@ -121,31 +143,23 @@ const AppRestartsWarning = ({
onStop,
}: RestartLoopWarningProps & { restarts: number }) => {
const { t } = useTranslation();
+ const warningTitle = t('Restart loop detected');
return (
-
- {t(
- 'This application has restarted {{ count }} times this session. Stop the application to prevent further restarts and investigate the issue.',
- {
- count: restartDelta,
- },
- )}
-
-
- {canStop && (
-
-
-
- )}
-
+
}
withFocusTrap={false}
>
-