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 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 13:16:50 +00:00
parent 667f3b3a3c
commit 9bd78a81ea
2 changed files with 5 additions and 6 deletions
+3 -4
View File
@@ -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]]);
})(),