From 8ecaf595590c501b79655d9c339fbbe0d048f9b4 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 15 Sep 2025 12:03:59 -0400 Subject: [PATCH 01/14] fix: update banner when PR plugin updates? --- .github/scripts/generate-pr-plugin.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index bc220ea9b..660c054f7 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -206,7 +206,7 @@ echo "⚠️ Remove this plugin before applying production updates" echo "====================================" echo "WebGUI PR Test Plugin Update" echo "====================================" -echo "Version: &version;" +echo "Version: VERSION_PLACEHOLDER" echo "" BACKUP_DIR="/boot/config/plugins/webgui-pr-PR_PLACEHOLDER/backups" @@ -250,6 +250,23 @@ echo "" + + + + + $(function() { + caPluginUpdateCheck("webgui-pr-PR_PLACEHOLDER.plg"); + addBannerWarning("Modified GUI installed via webgui-pr-PR_PLACEHOLDER plugin",false,true); + }); + +]]> + + + @@ -289,6 +306,8 @@ fi # Clean up echo "Cleaning up plugin files..." +# Remove the banner +rm -rf "/usr/local/emhttp/plugins/webgui-pr-PR_PLACEHOLDER" # Remove the plugin directory (which includes the tarball and backups) rm -rf "/boot/config/plugins/webgui-pr-PR_PLACEHOLDER" # Remove the plugin file itself From fbb6ad481e177d8127bf860faa7931456075368d Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 15 Sep 2025 12:06:26 -0400 Subject: [PATCH 02/14] fix: update plugin URL generation and ensure newline at end of Main.page --- .github/scripts/generate-pr-plugin.sh | 2 +- emhttp/plugins/dynamix/Main.page | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index 660c054f7..983bd4cbc 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -21,7 +21,7 @@ fi # If no plugin URL provided, generate one based on R2 location if [ -z "$PLUGIN_URL" ]; then # Extract base URL from TXZ_URL and use consistent filename - PLUGIN_URL=$(echo "$TXZ_URL" | sed "s|\.tar\.gz|.plg|") + PLUGIN_URL="${TXZ_URL%.tar.gz}.plg" fi # Use consistent filename (no version in filename, version is inside the plugin) diff --git a/emhttp/plugins/dynamix/Main.page b/emhttp/plugins/dynamix/Main.page index b68dcf2f0..81d5a7c30 100644 --- a/emhttp/plugins/dynamix/Main.page +++ b/emhttp/plugins/dynamix/Main.page @@ -1,4 +1,4 @@ Menu="Tasks:1" Type="xmenu" Code="e908" -Load="30" \ No newline at end of file +Load="30" From 94a0a929ccdabe44389dee7d6cb1c0028fb0f752 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 15 Sep 2025 12:08:26 -0400 Subject: [PATCH 03/14] fix: add uninstall button to PR plugin banner --- .github/scripts/generate-pr-plugin.sh | 43 ++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index 983bd4cbc..bcbbf7281 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -259,8 +259,49 @@ Link='nav-user' --- ]]> From a3341d3b749ec3a3a1db0aacc3b58658266dce15 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 15 Sep 2025 12:13:16 -0400 Subject: [PATCH 04/14] fix: enhance uninstall functionality for PR plugin with confirmation dialog and improved messaging --- .github/scripts/generate-pr-plugin.sh | 60 ++++++++++++++------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index bcbbf7281..3931b6fbe 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -262,45 +262,47 @@ Link='nav-user' // Check for updates caPluginUpdateCheck("webgui-pr-PR_PLACEHOLDER.plg"); - // Create banner with uninstall button - var bannerMessage = "Modified GUI installed via webgui-pr-PR_PLACEHOLDER plugin " + - ""; + // Create banner with uninstall link (following Unraid's pattern) + var bannerMessage = " " + + "Modified GUI installed via webgui-pr-PR_PLACEHOLDER plugin. " + + "Click here to uninstall"; addBannerWarning(bannerMessage, false, true); // Define uninstall function window.uninstallPRPlugin = function() { - if (confirm("Are you sure you want to uninstall the PR test plugin? This will restore all original files.")) { - // Show progress - var originalMessage = $(".banner-warning").html(); - $(".banner-warning").html("Uninstalling plugin, please wait..."); - - // Execute uninstall command - $.post("/webGui/include/PluginHelpers.php", { - action: "remove", - plugin: "webgui-pr-PR_PLACEHOLDER.plg" - }).done(function(data) { - // Remove banner and reload page - removeBannerWarning(); - setTimeout(function() { - location.reload(); - }, 1000); - }).fail(function() { - // Fallback to command execution - $.post("/webGui/include/CommandLine.php", { - command: "/usr/local/sbin/plugin remove webgui-pr-PR_PLACEHOLDER.plg" + swal({ + title: "Uninstall PR Test Plugin?", + text: "This will restore all original files and remove the test plugin.", + type: "warning", + showCancelButton: true, + confirmButtonText: "Yes, uninstall", + cancelButtonText: "Cancel", + closeOnConfirm: false, + showLoaderOnConfirm: true + }, function(isConfirm) { + if (isConfirm) { + // Execute plugin removal + $.post("/plugins/dynamix.plugin.manager/scripts/plugin", { + "#command": "/plugins/dynamix.plugin.manager/scripts/plugin", + "#arg[1]": "remove", + "#arg[2]": "webgui-pr-PR_PLACEHOLDER.plg" }).done(function() { - removeBannerWarning(); + swal({ + title: "Success!", + text: "Plugin uninstalled successfully. Page will reload.", + type: "success", + timer: 2000, + showConfirmButton: false + }); setTimeout(function() { location.reload(); - }, 1000); + }, 2000); }).fail(function() { - $(".banner-warning").html(originalMessage); - alert("Failed to uninstall plugin. Please remove it manually from Plugins → Installed Plugins"); + swal("Error", "Failed to uninstall plugin. Please remove it manually from Plugins → Installed Plugins", "error"); }); - }); - } + } + }); }; }); From 82710b0ebfa4d85aeba9c9ac149eec21b1feccc5 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 15 Sep 2025 12:16:47 -0400 Subject: [PATCH 05/14] fix: update generate-pr-plugin.sh to include installation method and remove unnecessary method attribute from Banner-PR_PLACEHOLDER.page --- .github/scripts/generate-pr-plugin.sh | 4 +++- emhttp/plugins/dynamix/Main.page | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index 3931b6fbe..780653aff 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -246,12 +246,14 @@ fi echo "Step 2: Update will now proceed with installation of new PR files..." echo "" + +# The update continues by running the install method which will extract new files ]]> - + Date: Mon, 15 Sep 2025 12:18:11 -0400 Subject: [PATCH 06/14] fix: update generate-pr-plugin.sh to specify installation method for Banner-PR_PLACEHOLDER.page --- .github/scripts/generate-pr-plugin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index 780653aff..41fb3f145 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -253,7 +253,7 @@ echo "" - + Date: Mon, 15 Sep 2025 12:19:20 -0400 Subject: [PATCH 07/14] chore: change main.page back to trigger build --- emhttp/plugins/dynamix/Main.page | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emhttp/plugins/dynamix/Main.page b/emhttp/plugins/dynamix/Main.page index b68dcf2f0..81d5a7c30 100644 --- a/emhttp/plugins/dynamix/Main.page +++ b/emhttp/plugins/dynamix/Main.page @@ -1,4 +1,4 @@ Menu="Tasks:1" Type="xmenu" Code="e908" -Load="30" \ No newline at end of file +Load="30" From 755885c6c81d308136b081af7d1fb06882bfee7c Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 15 Sep 2025 12:23:32 -0400 Subject: [PATCH 08/14] fix: improve uninstall link styling in PR plugin banner --- .github/scripts/generate-pr-plugin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index 41fb3f145..276a00bf2 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -267,7 +267,7 @@ Link='nav-user' // Create banner with uninstall link (following Unraid's pattern) var bannerMessage = " " + "Modified GUI installed via webgui-pr-PR_PLACEHOLDER plugin. " + - "Click here to uninstall"; + "Click here to uninstall"; addBannerWarning(bannerMessage, false, true); From 06d50f131b8732444d93ac8f0d765e9367699c63 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 15 Sep 2025 12:25:52 -0400 Subject: [PATCH 09/14] fix: streamline plugin removal process in generate-pr-plugin.sh by using openPlugin method and adjusting reload timing --- .github/scripts/generate-pr-plugin.sh | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index 276a00bf2..815eebd4f 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -284,25 +284,13 @@ Link='nav-user' showLoaderOnConfirm: true }, function(isConfirm) { if (isConfirm) { - // Execute plugin removal - $.post("/plugins/dynamix.plugin.manager/scripts/plugin", { - "#command": "/plugins/dynamix.plugin.manager/scripts/plugin", - "#arg[1]": "remove", - "#arg[2]": "webgui-pr-PR_PLACEHOLDER.plg" - }).done(function() { - swal({ - title: "Success!", - text: "Plugin uninstalled successfully. Page will reload.", - type: "success", - timer: 2000, - showConfirmButton: false - }); - setTimeout(function() { - location.reload(); - }, 2000); - }).fail(function() { - swal("Error", "Failed to uninstall plugin. Please remove it manually from Plugins → Installed Plugins", "error"); - }); + // Execute plugin removal using openPlugin (Unraid's standard method) + openPlugin("plugin remove webgui-pr-PR_PLACEHOLDER.plg", "Removing PR Test Plugin"); + + // Monitor for completion and reload + setTimeout(function() { + location.reload(); + }, 3000); } }); }; From 3eb9b42829838bb6958641b96fac9fa44a857c78 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 15 Sep 2025 12:26:35 -0400 Subject: [PATCH 10/14] fix: ensure new banner file creation by removing old banner in generate-pr-plugin.sh --- .github/scripts/generate-pr-plugin.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index 815eebd4f..67d0c5846 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -212,6 +212,10 @@ echo "" BACKUP_DIR="/boot/config/plugins/webgui-pr-PR_PLACEHOLDER/backups" MANIFEST="/boot/config/plugins/webgui-pr-PR_PLACEHOLDER/installed_files.txt" +# Remove old banner file to ensure new one gets created +echo "Removing old banner file..." +rm -rf "/usr/local/emhttp/plugins/webgui-pr-PR_PLACEHOLDER" + # First restore original files to ensure clean state if [ -f "$MANIFEST" ]; then echo "Step 1: Restoring original files before update..." From ee9f51555109e8ab2e6fca62f2460e0369c7e45c Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Mon, 15 Sep 2025 12:28:42 -0400 Subject: [PATCH 11/14] fix: update PR plugin banner behavior to make update checks non-dismissible and adjust uninstall link dismissibility --- .github/scripts/generate-pr-plugin.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/scripts/generate-pr-plugin.sh b/.github/scripts/generate-pr-plugin.sh index 67d0c5846..3cc2b480e 100755 --- a/.github/scripts/generate-pr-plugin.sh +++ b/.github/scripts/generate-pr-plugin.sh @@ -265,15 +265,16 @@ Link='nav-user' ---