Report failures where the operator can still see them
The 55 alert() calls carried the same suppression as the confirms, and go wrong in the worse direction: a silenced confirm makes a button do nothing, while a silenced alert lets the action run and says nothing about it failing. vvAlert returns a promise nobody has to await, so these converted by rename with no caller becoming async. The icon is inferred from the message rather than asked of fifty call sites, and an explicit type still wins.
This commit is contained in:
@@ -2636,14 +2636,14 @@ async function vvDockerAction(action, name, webui) {
|
||||
// The endpoint reports refusals as ok:false with a reason — container not found, a non-zero
|
||||
// docker exit. Discarding that made a failed stop look exactly like a successful one, since
|
||||
// the card it would have changed is redrawn from a payload either way.
|
||||
if (!d || !d.ok) alert('Container ' + action + ' failed: ' + ((d && (d.error || d.output)) || 'unknown error'));
|
||||
if (!d || !d.ok) vvAlert('Container ' + action + ' failed: ' + ((d && (d.error || d.output)) || 'unknown error'));
|
||||
vvDfActive = null;
|
||||
// The endpoint drops the monitor cache on success, and this poll asks for a live collection
|
||||
// besides — either alone is enough, but between them the card cannot redraw itself from a
|
||||
// payload assembled before the action happened.
|
||||
setTimeout(() => vvPollMonitor(true), 1500);
|
||||
})
|
||||
.catch(() => alert('Container ' + action + ' failed: request error'));
|
||||
.catch(() => vvAlert('Container ' + action + ' failed: request error'));
|
||||
}
|
||||
|
||||
function vvRenderDockerFolders(data) {
|
||||
|
||||
Reference in New Issue
Block a user