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:
@@ -709,6 +709,8 @@ export function InstalledScriptsTab() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const containerType = script.is_vm ? "VM" : "LXC";
|
||||||
|
|
||||||
setConfirmationModal({
|
setConfirmationModal({
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
variant: "simple",
|
variant: "simple",
|
||||||
@@ -718,7 +720,7 @@ export function InstalledScriptsTab() {
|
|||||||
setControllingScriptId(script.id);
|
setControllingScriptId(script.id);
|
||||||
setLoadingModal({
|
setLoadingModal({
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
action: `${action === "start" ? "Starting" : "Stopping"} container ${script.container_id}...`,
|
action: `${action === "start" ? "Starting" : "Stopping"} ${containerType}...`,
|
||||||
});
|
});
|
||||||
void controlContainerMutation.mutate({ id: script.id, action });
|
void controlContainerMutation.mutate({ id: script.id, action });
|
||||||
setConfirmationModal(null);
|
setConfirmationModal(null);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ interface LoadingModalProps {
|
|||||||
|
|
||||||
export function LoadingModal({
|
export function LoadingModal({
|
||||||
isOpen,
|
isOpen,
|
||||||
action: _action,
|
action,
|
||||||
logs = [],
|
logs = [],
|
||||||
isComplete = false,
|
isComplete = false,
|
||||||
title,
|
title,
|
||||||
@@ -64,6 +64,11 @@ export function LoadingModal({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Action text - displayed prominently */}
|
||||||
|
{action && (
|
||||||
|
<p className="text-foreground text-base font-medium">{action}</p>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Static title text */}
|
{/* Static title text */}
|
||||||
{title && <p className="text-muted-foreground text-sm">{title}</p>}
|
{title && <p className="text-muted-foreground text-sm">{title}</p>}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user