From 233c8a06c855ef5e3ef6b66ef45d6e6de7669752 Mon Sep 17 00:00:00 2001 From: Meliox Date: Wed, 10 Jun 2026 22:01:46 +0200 Subject: [PATCH] upload patches --- .../patches/01-proxmoxlib-js-nagscreen.patch | 43 ++++++++++++++++++- .../patches/02-index-html-tpl-mobilenag.patch | 26 +++++++++++ src/NagScreen/patches/patches.list | 1 + src/NagScreen/patches/post-apply.sh | 23 ++-------- src/NagScreen/patches/post-revert.sh | 20 ++------- 5 files changed, 75 insertions(+), 38 deletions(-) create mode 100644 src/NagScreen/patches/02-index-html-tpl-mobilenag.patch diff --git a/src/NagScreen/patches/01-proxmoxlib-js-nagscreen.patch b/src/NagScreen/patches/01-proxmoxlib-js-nagscreen.patch index 33052a3..dff07b9 100644 --- a/src/NagScreen/patches/01-proxmoxlib-js-nagscreen.patch +++ b/src/NagScreen/patches/01-proxmoxlib-js-nagscreen.patch @@ -1 +1,42 @@ -gain \ No newline at end of file +--- /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2026-05-26 16:26:59.000000000 +0200 ++++ /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2026-06-10 21:12:31.349760790 +0200 +@@ -599,37 +599,8 @@ + Ext.Msg.alert(gettext('Error'), res.htmlStatus || res.result.message), + + checked_command: function (orig_cmd) { +- Proxmox.Utils.API2Request({ +- url: '/nodes/localhost/subscription', +- method: 'GET', +- failure: function (response, opts) { +- Ext.Msg.alert(gettext('Error'), response.htmlStatus); +- }, +- success: function (response, opts) { +- let res = response.result; +- if ( +- res === null || +- res === undefined || +- !res || +- res.data.status.toLowerCase() !== 'active' +- ) { +- Ext.Msg.show({ +- title: gettext('No valid subscription'), +- icon: Ext.Msg.WARNING, +- message: Proxmox.Utils.getNoSubKeyHtml(res.data.url), +- buttons: Ext.Msg.OK, +- callback: function (btn) { +- if (btn !== 'ok') { +- return; +- } +- orig_cmd(); +- }, +- }); +- } else { +- orig_cmd(); +- } +- }, +- }); ++ // disable subscription nag screen ++ orig_cmd(); + }, + + assemble_field_data: function (values, data) { \ No newline at end of file diff --git a/src/NagScreen/patches/02-index-html-tpl-mobilenag.patch b/src/NagScreen/patches/02-index-html-tpl-mobilenag.patch new file mode 100644 index 0000000..5e61fc2 --- /dev/null +++ b/src/NagScreen/patches/02-index-html-tpl-mobilenag.patch @@ -0,0 +1,26 @@ +--- /usr/share/pve-yew-mobile-gui/index.html.tpl 2026-06-10 21:39:42.012286927 +0200 ++++ /usr/share/pve-yew-mobile-gui/index.html.tpl 2026-06-10 21:40:47.815781830 +0200 +@@ -59,3 +59,23 @@ + + + ++ ++ diff --git a/src/NagScreen/patches/patches.list b/src/NagScreen/patches/patches.list index ba7233a..2de8bfe 100644 --- a/src/NagScreen/patches/patches.list +++ b/src/NagScreen/patches/patches.list @@ -2,3 +2,4 @@ # Format: [section.key=value] 01-proxmoxlib-js-nagscreen.patch +02-index-html-tpl-mobilenag.patch diff --git a/src/NagScreen/patches/post-apply.sh b/src/NagScreen/patches/post-apply.sh index c4f0b96..4cc679d 100644 --- a/src/NagScreen/patches/post-apply.sh +++ b/src/NagScreen/patches/post-apply.sh @@ -1,26 +1,9 @@ #!/usr/bin/env bash # post-apply hook for the nag_screen mod. # Runs after nag_screen patches are applied. Provided env: MOD_CONF, STASH_DIR, -# CONFD_DIR. Replaces the minified proxmoxlib with a symlink to the patched -# unminified copy so the browser serves the patched code. The original minified -# file is stashed (it is a non-patch binary replacement, so `patch -R` cannot -# restore it). Exit codes: 0 = no change, 100 = changed, other = error. +# CONFD_DIR. Requests a pveproxy restart so the patched UI is served. +# Exit codes: 0 = no change, 100 = changed (restart pveproxy), other = error. set -u -PROXMOXLIB_JS="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js" -PROXMOXLIB_MIN_JS="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js" -STASH_DIR="${STASH_DIR:-/var/lib/pve-mod/backup}" - -if [[ ! -L "$PROXMOXLIB_MIN_JS" ]]; then - mkdir -p "$STASH_DIR" - if [[ -f "$PROXMOXLIB_MIN_JS" ]]; then - mv "$PROXMOXLIB_MIN_JS" \ - "$STASH_DIR/proxmoxlib.min.js.$(date +%Y%m%d_%H%M%S)" 2>/dev/null || true - fi - ln -sf "$PROXMOXLIB_JS" "$PROXMOXLIB_MIN_JS" - echo "[pve-mod] Symlinked proxmoxlib.min.js -> proxmoxlib.js" - exit 100 -fi - -exit 0 +exit 100 \ No newline at end of file diff --git a/src/NagScreen/patches/post-revert.sh b/src/NagScreen/patches/post-revert.sh index 45c9df3..9a2a6d0 100644 --- a/src/NagScreen/patches/post-revert.sh +++ b/src/NagScreen/patches/post-revert.sh @@ -1,23 +1,9 @@ #!/usr/bin/env bash # post-revert hook for the nag_screen mod. # Runs before nag_screen patches are reverted. Provided env: MOD_CONF, -# STASH_DIR, CONFD_DIR. Removes the min.js symlink and restores the original -# minified file from the stash. Exit codes: 0 = no change, 100 = changed. +# STASH_DIR, CONFD_DIR. Requests a pveproxy restart so the original UI is served. +# Exit codes: 0 = no change, 100 = changed (restart pveproxy), other = error. set -u -PROXMOXLIB_MIN_JS="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js" -STASH_DIR="${STASH_DIR:-/var/lib/pve-mod/backup}" - -if [[ -L "$PROXMOXLIB_MIN_JS" ]]; then - rm -f "$PROXMOXLIB_MIN_JS" - latest=$(find "$STASH_DIR" -name "proxmoxlib.min.js.*" -type f -printf '%T+ %p\n' 2>/dev/null \ - | sort -r | head -n1 | awk '{print $2}') - if [[ -n "$latest" ]]; then - cp "$latest" "$PROXMOXLIB_MIN_JS" - echo "[pve-mod] Restored proxmoxlib.min.js from stash" - fi - exit 100 -fi - -exit 0 +exit 100