From c567890bfa4b5bd0b62ee7f2e6b537a795d97a71 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Tue, 14 Jul 2026 10:35:23 -0500 Subject: [PATCH] feat(runbackup): "do not close window" warning + "update is running" overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Backup progress screen shows a prominent warning not to close or switch windows until the backup finishes (hidden once it completes/errors). - After the backup hands back to an extension update, a full-screen "update is running — please wait" overlay is shown while the re-fired update POST processes, so the user knows it is working (not stuck). Adds language strings (component + plugin) and a cfg.updateRunningText option. Claude-Session: https://claude.ai/code/session_01WbGBN9VyRK61zczYWcCQ2i --- .../language/en-GB/com_mokosuitebackup.ini | 2 ++ .../language/en-US/com_mokosuitebackup.ini | 2 ++ .../tmpl/runbackup/default.php | 8 +++++ .../en-GB/plg_system_mokosuitebackup.ini | 1 + .../en-US/plg_system_mokosuitebackup.ini | 1 + .../media/js/installer-backup.js | 31 +++++++++++++++++++ .../src/Extension/MokoSuiteBackup.php | 2 ++ 7 files changed, 47 insertions(+) diff --git a/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini b/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini index 4d4bb101..14c2d8ed 100644 --- a/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini +++ b/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini @@ -350,6 +350,8 @@ COM_MOKOJOOMBACKUP_RUNBACKUP_BACK_TO_DASHBOARD="Back to dashboard" COM_MOKOJOOMBACKUP_RUNBACKUP_VIEW_RECORD="View backup record" COM_MOKOJOOMBACKUP_RUNBACKUP_LEAVE_WARNING="A backup is in progress. Leaving now will cancel it." COM_MOKOJOOMBACKUP_RUNBACKUP_AUTOCONTINUE="Automatically continue the update when the backup finishes" +COM_MOKOJOOMBACKUP_RUNBACKUP_DONT_CLOSE="Please do not close this window or switch to another window until the backup finishes." +COM_MOKOJOOMBACKUP_RUNBACKUP_UPDATE_RUNNING="Backup complete. The update is now running — please wait and do not close this window…" COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_UPDATE="Continue the update" COM_MOKOJOOMBACKUP_CONFIG_CLEANUP="Cleanup Defaults" diff --git a/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini b/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini index 7f32636b..1985d78e 100644 --- a/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini +++ b/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini @@ -72,6 +72,8 @@ COM_MOKOJOOMBACKUP_RUNBACKUP_BACK_TO_DASHBOARD="Back to dashboard" COM_MOKOJOOMBACKUP_RUNBACKUP_VIEW_RECORD="View backup record" COM_MOKOJOOMBACKUP_RUNBACKUP_LEAVE_WARNING="A backup is in progress. Leaving now will cancel it." COM_MOKOJOOMBACKUP_RUNBACKUP_AUTOCONTINUE="Automatically continue the update when the backup finishes" +COM_MOKOJOOMBACKUP_RUNBACKUP_DONT_CLOSE="Please do not close this window or switch to another window until the backup finishes." +COM_MOKOJOOMBACKUP_RUNBACKUP_UPDATE_RUNNING="Backup complete. The update is now running — please wait and do not close this window…" COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_UPDATE="Continue the update" COM_MOKOJOOMBACKUP_CONFIG_CLEANUP="Cleanup Defaults" diff --git a/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php b/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php index 06fe95ad..9a447d5f 100644 --- a/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php +++ b/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php @@ -120,6 +120,11 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku
+ +
@@ -159,6 +164,7 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku track: document.querySelector('.msb-rb-progress'), phase: document.getElementById('msb-rb-phase'), status: document.getElementById('msb-rb-status'), + warn: document.getElementById('msb-rb-warn'), title: document.getElementById('msb-rb-title'), actions: document.getElementById('msb-rb-actions'), retry: document.getElementById('msb-rb-retry'), @@ -204,6 +210,7 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku el.bar.classList.add('is-success'); setBar(100, false); el.title.textContent = L.complete || 'Backup complete'; + if (el.warn) { el.warn.classList.add('d-none'); } /* Set the one-shot skip flag for THIS action so the following server-side onExtensionBefore(Update|Uninstall) backup is skipped once @@ -254,6 +261,7 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku running = false; el.bar.classList.remove('is-animated'); el.bar.classList.add('is-danger'); + if (el.warn) { el.warn.classList.add('d-none'); } el.title.textContent = L.failed || 'Backup failed'; setStatus(message || 'Backup failed'); showActions(); diff --git a/source/packages/plg_system_mokosuitebackup/language/en-GB/plg_system_mokosuitebackup.ini b/source/packages/plg_system_mokosuitebackup/language/en-GB/plg_system_mokosuitebackup.ini index a465eb30..7cc78952 100644 --- a/source/packages/plg_system_mokosuitebackup/language/en-GB/plg_system_mokosuitebackup.ini +++ b/source/packages/plg_system_mokosuitebackup/language/en-GB/plg_system_mokosuitebackup.ini @@ -14,3 +14,4 @@ PLG_SYSTEM_MOKOJOOMBACKUP_BACKING_UP="Backing up…" PLG_SYSTEM_MOKOJOOMBACKUP_BACKUP_COMPLETE="Backup complete — safe to update." PLG_SYSTEM_MOKOJOOMBACKUP_BACKUP_FAILED="Backup failed" PLG_SYSTEM_MOKOJOOMBACKUP_BACKUP_STARTING="Starting backup…" +PLG_SYSTEM_MOKOSUITEBACKUP_UPDATE_RUNNING="Backup complete. The update is now running — please wait and do not close this window…" diff --git a/source/packages/plg_system_mokosuitebackup/language/en-US/plg_system_mokosuitebackup.ini b/source/packages/plg_system_mokosuitebackup/language/en-US/plg_system_mokosuitebackup.ini index 03a35287..12552aea 100644 --- a/source/packages/plg_system_mokosuitebackup/language/en-US/plg_system_mokosuitebackup.ini +++ b/source/packages/plg_system_mokosuitebackup/language/en-US/plg_system_mokosuitebackup.ini @@ -14,3 +14,4 @@ PLG_SYSTEM_MOKOJOOMBACKUP_BACKING_UP="Backing up…" PLG_SYSTEM_MOKOJOOMBACKUP_BACKUP_COMPLETE="Backup complete — safe to update." PLG_SYSTEM_MOKOJOOMBACKUP_BACKUP_FAILED="Backup failed" PLG_SYSTEM_MOKOJOOMBACKUP_BACKUP_STARTING="Starting backup…" +PLG_SYSTEM_MOKOSUITEBACKUP_UPDATE_RUNNING="Backup complete. The update is now running — please wait and do not close this window…" diff --git a/source/packages/plg_system_mokosuitebackup/media/js/installer-backup.js b/source/packages/plg_system_mokosuitebackup/media/js/installer-backup.js index cb64a736..ea20bef0 100644 --- a/source/packages/plg_system_mokosuitebackup/media/js/installer-backup.js +++ b/source/packages/plg_system_mokosuitebackup/media/js/installer-backup.js @@ -101,6 +101,31 @@ window.location.href = target; }, true); + /* Full-screen "update is running" overlay shown while the re-fired update + POST processes, so the user knows it is working and not to close/switch. */ + function showUpdateOverlay() { + if (document.getElementById('msb-update-overlay')) { return; } + + var o = document.createElement('div'); + o.id = 'msb-update-overlay'; + o.setAttribute('role', 'status'); + o.style.cssText = 'position:fixed;inset:0;z-index:2147483647;background:#000;color:#fff;' + + 'display:flex;flex-direction:column;align-items:center;justify-content:center;' + + 'text-align:center;padding:2rem;font-size:1.15rem;font-weight:600;'; + + var spin = document.createElement('span'); + spin.className = 'spinner-border mb-3'; + spin.setAttribute('aria-hidden', 'true'); + + var msg = document.createElement('div'); + msg.textContent = (cfg && cfg.updateRunningText) + || 'Backup complete. The update is now running — please wait and do not close this window…'; + + o.appendChild(spin); + o.appendChild(msg); + document.body.appendChild(o); + } + /* On return from the backup screen: restore the selection and re-fire. */ function resume() { var params = new URLSearchParams(window.location.search); @@ -145,6 +170,12 @@ window.__msbResuming = true; + /* Show a full-screen "update is running" overlay so the user gets clear + feedback that the update is proceeding while the re-fired POST runs. + It persists until the page navigates away (the update finishes and + redirects), matching the black full-screen backup screen. */ + showUpdateOverlay(); + /* Re-fire the toolbar action. The `task` attribute is on the OUTER , but its click handler is bound to the INNER