diff --git a/panel/public/assets/js/admin.js b/panel/public/assets/js/admin.js
index 40671c1..e539d0c 100644
--- a/panel/public/assets/js/admin.js
+++ b/panel/public/assets/js/admin.js
@@ -2749,7 +2749,7 @@ window.proxySync = async () => {
};
window.proxyAddHost = () => {
- Nova.modal('Add Proxy Host', `
+ const ov = Nova.modal('Add Proxy Host', `
Upstream URL
@@ -2787,7 +2794,13 @@ window.proxyEditHost = async (id) => {
Custom Nginx Config (overrides auto-generated)
Leave blank to use auto-generated config
- `, async () => {
+ `,
+ `
Cancel
+
Save Changes `
+ );
+ ov.querySelector('#phe-save-btn').addEventListener('click', async () => {
+ const btn = ov.querySelector('#phe-save-btn');
+ btn.disabled = true; btn.textContent = 'Saving…';
const r = await Nova.api('proxy', 'host', {
method: 'PUT',
body: { id,
@@ -2798,7 +2811,8 @@ window.proxyEditHost = async (id) => {
}
});
Nova.toast(r?.success ? 'Updated' : (r?.message || 'Failed'), r?.success ? 'success' : 'error');
- if (r?.success) Nova.loadPage('nginx-proxy', window._novaPages);
+ if (r?.success) { ov.remove(); Nova.loadPage('nginx-proxy', window._novaPages); }
+ else { btn.disabled = false; btn.textContent = 'Save Changes'; }
});
};
@@ -2892,7 +2906,7 @@ window.proxySetupInstructions = async () => {
};
window.proxySwitchLocal = () => {
- Nova.modal('Enable Local Nginx Proxy', `
+ const slOv = Nova.modal('Enable Local Nginx Proxy', `
Nginx will be installed on this server and take over ports 80/443. Apache moves to an internal port and keeps serving all PHP sites — end users see no change.
What will happen:
@@ -2909,7 +2923,12 @@ window.proxySwitchLocal = () => {
- `, () => {
+ `,
+ `
Cancel
+
Switch Now `
+ );
+ slOv.querySelector('#sl-switch-btn').addEventListener('click', () => {
+ slOv.remove();
const port = parseInt(document.getElementById('sl-port')?.value) || 8090;
const ov = Nova.modal('Switching to Local Proxy Mode', `
Moving Apache to port ${port} and starting nginx on 80/443…
@@ -2947,7 +2966,7 @@ window.proxySwitchLocal = () => {
}).catch(e => { log.textContent += '\n— Connection error: ' + e.message + '\n'; });
ov.querySelector('.modal-close')?.addEventListener('click', () => { done = true; });
- }, { confirmLabel: 'Switch Now' });
+ });
};
window.proxyDisableLocal = () => {
@@ -3017,18 +3036,25 @@ window.proxyRunSetup = () => {
};
window.proxyUninstall = () => {
- Nova.modal('Uninstall Nginx Proxy', `
+ const ov = Nova.modal('Uninstall Nginx Proxy', `
Choose what to remove from the remote proxy VM :
Remove proxy host configs only (keep nginx running)
Remove everything (uninstall nginx, delete all configs, disable proxy mode)
- `, async () => {
- const full = document.querySelector('input[name="uninst"]:checked')?.value === 'full';
+ `,
+ `
Cancel
+
Uninstall `
+ );
+ ov.querySelector('#uninst-btn').addEventListener('click', async () => {
+ const btn = ov.querySelector('#uninst-btn');
+ btn.disabled = true; btn.textContent = 'Removing…';
+ const full = ov.querySelector('input[name="uninst"]:checked')?.value === 'full';
const r = await Nova.api('proxy', 'uninstall', { method: 'DELETE', body: { remove_nginx: full } });
Nova.toast(r?.data?.result || r?.message || 'Done', r?.success ? 'success' : 'error');
- if (r?.success) Nova.loadPage('nginx-proxy', window._novaPages);
- }, { confirmLabel: 'Uninstall', danger: true });
+ if (r?.success) { ov.remove(); Nova.loadPage('nginx-proxy', window._novaPages); }
+ else { btn.disabled = false; btn.textContent = 'Uninstall'; }
+ });
};
window.proxySettings = async () => {