From 4e18a6ff42e5e92bbcc55af6af0aeaebaa90c8dc Mon Sep 17 00:00:00 2001 From: librelad Date: Sun, 31 May 2026 02:53:57 +0100 Subject: [PATCH] fix(webui): render App-Updater tasks as standard tasks in the panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updater_check/apply/apply_all/rollback tasks fell through every per-type branch of the Tasks panel, so they showed the generic custom gear icon, a raw/truncated command title, and (for the app:'updater' sentinel) a broken hidden app icon. Wired them in like every other task type: - tasks-format.js formatCommandForUser PATTERNS: added the 'libreportal updater' command rows (Apps - Check for Updates / Update All / - Update / - Roll Back) — only the *self*-update 'libreportal update' was mapped. - tasks-format.js formatActionTitle: added the updater_* short labels. - tasks-list-render.js getTaskTypeIcon: updater_check 🔍 / apply âŦ†ī¸ / apply_all âŦ†ī¸ / rollback â†Šī¸ (reusing existing verify/update/restore classes). - tasks-list-render.js renderTaskIcons: treat app:'updater' as a sentinel like app:'system' so updater_check/apply_all fall back to the LibrePortal logo instead of a 404'd /core/icons/apps/updater.svg (apply/rollback keep their real app icon). node --check clean. Signed-off-by: librelad --- .../frontend/components/tasks/js/tasks-format.js | 8 ++++++++ .../components/tasks/js/tasks-list-render.js | 14 ++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/containers/libreportal/frontend/components/tasks/js/tasks-format.js b/containers/libreportal/frontend/components/tasks/js/tasks-format.js index a942be5..ae9a8ef 100644 --- a/containers/libreportal/frontend/components/tasks/js/tasks-format.js +++ b/containers/libreportal/frontend/components/tasks/js/tasks-format.js @@ -24,6 +24,12 @@ Object.assign(TasksManager.prototype, { { match: /^libreportal update (apply|now)\b/, title: 'LibrePortal - Update' }, { match: /^libreportal update check\b/, title: 'LibrePortal - Check for Updates' }, + // -- App updater (per-app updates + CVE scan; snapshots before applying) + { match: /^libreportal updater check\b/, title: 'Apps - Check for Updates' }, + { match: /^libreportal updater apply-all\b/, title: 'Apps - Update All' }, + { match: /^libreportal updater apply (\S+)/, title: (m) => `${displayName(m[1])} - Update` }, + { match: /^libreportal updater rollback (\S+)/, title: (m) => `${displayName(m[1])} - Roll Back` }, + // -- Peers ------------------------------------------------------------- { match: /^libreportal peer add\b/, title: 'LibrePortal - Add Peer' }, { match: /^libreportal peer remove\b/, title: 'LibrePortal - Remove Peer' }, @@ -130,6 +136,8 @@ Object.assign(TasksManager.prototype, { 'config_update': 'Update Config', 'update_config': 'Update Config', 'system_update': 'Update System', 'system_reclaim': 'Reclaim Space', 'system_image_rm': 'Remove Images', 'verify': 'Verify System', + 'updater_check': 'Check for Updates', 'updater_apply': 'Update', + 'updater_apply_all': 'Update All', 'updater_rollback': 'Roll Back', 'setup-config': 'Apply Configuration', 'setup-finalize': 'Finalize Setup' }; diff --git a/containers/libreportal/frontend/components/tasks/js/tasks-list-render.js b/containers/libreportal/frontend/components/tasks/js/tasks-list-render.js index 4b7c2f4..1fde72a 100644 --- a/containers/libreportal/frontend/components/tasks/js/tasks-list-render.js +++ b/containers/libreportal/frontend/components/tasks/js/tasks-list-render.js @@ -256,10 +256,12 @@ Object.assign(TasksManager.prototype, { }, renderTaskIcons(task) { const typeIcon = `${this.getTaskTypeIcon(task).icon}`; - // `app: 'system'` is a category sentinel (config_update, system_update, â€Ļ), - // not a real app slug, so it has no /core/icons/apps/system.svg — fall through - // to the LibrePortal-system branch so those tasks still get a logo. - const isSystemSentinel = task.app === 'system'; + // `app: 'system'` and `app: 'updater'` are category sentinels (config_update, + // system_update, updater_check/apply_all, â€Ļ), not real app slugs, so they have + // no /core/icons/apps/.svg — fall through to the LibrePortal-system branch + // so those tasks still get a logo. (updater_apply/rollback carry a real app + // slug and keep their own app icon.) + const isSystemSentinel = task.app === 'system' || task.app === 'updater'; if (task.app && !isSystemSentinel) { const appIconPath = this.getAppIconPath(task); return `${typeIcon}${task.app}`; @@ -307,6 +309,10 @@ Object.assign(TasksManager.prototype, { 'verify': { icon: 'đŸ›Ąī¸', class: 'verify' }, 'setup-config': { icon: 'đŸ› ī¸', class: 'setup' }, 'setup-finalize': { icon: '🎉', class: 'setup' }, + 'updater_check': { icon: '🔍', class: 'verify' }, + 'updater_apply': { icon: 'âŦ†ī¸', class: 'update' }, + 'updater_apply_all': { icon: 'âŦ†ī¸', class: 'update' }, + 'updater_rollback': { icon: 'â†Šī¸', class: 'restore' }, 'custom': { icon: 'âš™ī¸', class: 'custom' } };