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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -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>}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user