fix: add dynamic text to container control loading modal

- Update LoadingModal to display action text (Starting/Stopping LXC/VM)
- Update handleStartStop to include container type (LXC/VM) in action text
- Show clear feedback when starting or stopping containers
This commit is contained in:
Michel Roegl-Brunner
2025-11-29 15:58:30 +01:00
parent 93d7842f6c
commit 5564ae0393
2 changed files with 9 additions and 2 deletions

View File

@@ -709,6 +709,8 @@ export function InstalledScriptsTab() {
return;
}
const containerType = script.is_vm ? "VM" : "LXC";
setConfirmationModal({
isOpen: true,
variant: "simple",
@@ -718,7 +720,7 @@ export function InstalledScriptsTab() {
setControllingScriptId(script.id);
setLoadingModal({
isOpen: true,
action: `${action === "start" ? "Starting" : "Stopping"} container ${script.container_id}...`,
action: `${action === "start" ? "Starting" : "Stopping"} ${containerType}...`,
});
void controlContainerMutation.mutate({ id: script.id, action });
setConfirmationModal(null);

View File

@@ -16,7 +16,7 @@ interface LoadingModalProps {
export function LoadingModal({
isOpen,
action: _action,
action,
logs = [],
isComplete = false,
title,
@@ -64,6 +64,11 @@ export function LoadingModal({
)}
</div>
{/* Action text - displayed prominently */}
{action && (
<p className="text-foreground text-base font-medium">{action}</p>
)}
{/* Static title text */}
{title && <p className="text-muted-foreground text-sm">{title}</p>}