Add Apps/Store tab, template WebUI/URL import, container RO volumes/device passthrough/run-as-user, and in-app confirm dialogs
Replaces every native confirm() with a shared P.confirm() modal (a hung native dialog was found live to block the whole tab, including auto-refresh, and once even double-confirmed an unrelated deletion). Also fixes Edit Container silently resetting to Bridge/blanking the Static IP for any container on a custom network, and a context menu losing its anchor to a mid-read auto-refresh. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,20 +72,22 @@
|
||||
return;
|
||||
}
|
||||
const totalBytes = unused.reduce(function (sum, img) { return sum + img.sizeBytes; }, 0);
|
||||
if (!confirm(
|
||||
'Remove ' + unused.length + ' image(s) not used by any container (' + P.formatBytes(totalBytes) + ')?\n\n' +
|
||||
'This removes any tagged image with zero containers using it, not just dangling ones.'
|
||||
)) return;
|
||||
|
||||
const btn = this;
|
||||
btn.disabled = true;
|
||||
P.post('images', 'prune').then(function (result) {
|
||||
btn.disabled = false;
|
||||
P.toast('Removed ' + result.removedCount + ' image(s), reclaimed ' + P.formatBytes(result.reclaimedBytes) + '.', 'success');
|
||||
return load();
|
||||
}).catch(function (err) {
|
||||
btn.disabled = false;
|
||||
P.toast('Prune failed: ' + err.message, 'error');
|
||||
P.confirm(
|
||||
'Remove ' + unused.length + ' image(s) not used by any container (' + P.formatBytes(totalBytes) + ')? ' +
|
||||
'This removes any tagged image with zero containers using it, not just dangling ones.',
|
||||
{ danger: true, confirmLabel: 'Remove' }
|
||||
).then(function (ok) {
|
||||
if (!ok) return;
|
||||
btn.disabled = true;
|
||||
P.post('images', 'prune').then(function (result) {
|
||||
btn.disabled = false;
|
||||
P.toast('Removed ' + result.removedCount + ' image(s), reclaimed ' + P.formatBytes(result.reclaimedBytes) + '.', 'success');
|
||||
return load();
|
||||
}).catch(function (err) {
|
||||
btn.disabled = false;
|
||||
P.toast('Prune failed: ' + err.message, 'error');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -110,11 +112,13 @@
|
||||
}
|
||||
|
||||
if (btn.dataset.action === 'remove') {
|
||||
if (!confirm('Remove this image?')) return;
|
||||
btn.disabled = true;
|
||||
P.post('images', 'remove', { id: id }).then(load).catch(function (err) {
|
||||
P.toast('Remove failed: ' + err.message, 'error');
|
||||
btn.disabled = false;
|
||||
P.confirm('Remove this image?', { danger: true, confirmLabel: 'Remove' }).then(function (ok) {
|
||||
if (!ok) return;
|
||||
btn.disabled = true;
|
||||
P.post('images', 'remove', { id: id }).then(load).catch(function (err) {
|
||||
P.toast('Remove failed: ' + err.message, 'error');
|
||||
btn.disabled = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user