mirror of
https://github.com/myronblair/novacpx
synced 2026-06-30 17:50:41 -05:00
Fix proxy settings modal never saving — wrong third arg to Nova.modal
Nova.modal(title, bodyHtml, footerHtml) expects footerHtml as an HTML string, but an async callback was passed instead. The function got stringified as garbage text in the footer with no save button, so nothing ever saved regardless of mode chosen. Replaced with proper footer HTML (Cancel + Save buttons) and wired the save logic as an event listener on the save button. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3054,7 +3054,13 @@ window.proxySettings = async () => {
|
||||
<span id="ps-test-result" style="margin-left:0.75rem;font-size:0.85rem"></span>
|
||||
</div>
|
||||
</div>
|
||||
`, async () => {
|
||||
`,
|
||||
`<button class="btn btn-ghost" onclick="this.closest('.modal-overlay').remove()">Cancel</button>
|
||||
<button class="btn btn-primary" id="ps-save-btn">Save Settings</button>`
|
||||
);
|
||||
ov.querySelector('#ps-save-btn').addEventListener('click', async () => {
|
||||
const btn = ov.querySelector('#ps-save-btn');
|
||||
btn.disabled = true; btn.textContent = 'Saving…';
|
||||
const mode = document.getElementById('ps-mode')?.value;
|
||||
const pass = document.getElementById('ps-pass')?.value;
|
||||
const body = {
|
||||
@@ -3066,7 +3072,8 @@ window.proxySettings = async () => {
|
||||
};
|
||||
const r = await Nova.api('proxy', 'settings', { method: 'POST', body });
|
||||
Nova.toast(r?.success ? 'Settings saved' : (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 Settings'; }
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user