From 9bd78a81ea43ff48cb5e619355a0658d27b12675 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Tue, 9 Jun 2026 13:16:50 +0000 Subject: [PATCH] Fix uninstall not resetting to setup screen - proxy.php: always set proxy_mode=disabled and clear remote_host/backend_ip on any uninstall, not just when nginx binary is removed - admin.js: show setup cards when mode==='disabled' regardless of whether nginx binary still exists on the remote VM - Status card shows 'Disabled' instead of 'Stopped' when mode is disabled Co-Authored-By: Claude Sonnet 4.6 --- panel/api/endpoints/proxy.php | 7 +++---- panel/public/assets/js/admin.js | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/panel/api/endpoints/proxy.php b/panel/api/endpoints/proxy.php index 3809a7f..b2ac3b4 100644 --- a/panel/api/endpoints/proxy.php +++ b/panel/api/endpoints/proxy.php @@ -200,10 +200,9 @@ try { $action === 'uninstall' && $method === 'DELETE' => (function() use ($body) { $removeNginx = !empty($body['remove_nginx']); $result = ProxyManager::uninstall($removeNginx); - if ($removeNginx) { - $db = DB::getInstance(); - $db->execute("INSERT INTO settings (`key`, value) VALUES ('proxy_mode','disabled') ON DUPLICATE KEY UPDATE value='disabled'"); - } + // Always reset to disabled — configs are gone regardless of whether nginx binary was removed + $db = DB::getInstance(); + $db->execute("INSERT INTO settings (`key`, value) VALUES ('proxy_mode','disabled'),('proxy_remote_host',''),('proxy_backend_ip','') ON DUPLICATE KEY UPDATE value=VALUES(value)"); Response::json(['success' => true, 'data' => ['result' => $result]]); })(), diff --git a/panel/public/assets/js/admin.js b/panel/public/assets/js/admin.js index e539d0c..946bfad 100644 --- a/panel/public/assets/js/admin.js +++ b/panel/public/assets/js/admin.js @@ -2630,7 +2630,7 @@ async function nginxProxyPage() {
Nginx Status
-
${inst ? (run ? 'Running' : 'Stopped') : 'Not Configured'}
+
${cfg.mode === 'disabled' ? 'Disabled' : (run ? 'Running' : 'Stopped')}
${s.version || (inst ? 'nginx' : 'configure in Settings')}
@@ -2650,7 +2650,7 @@ async function nginxProxyPage() {
-${!inst ? ` +${(!inst || cfg.mode === 'disabled') ? `