mirror of
https://github.com/myronblair/novacpx
synced 2026-06-30 17:50:41 -05:00
Fix NovaCPX update action name mismatch and progress bar null error
- admin.js was calling 'apply-novacpx-update' but endpoint is 'apply-update' - Add null guard in nova.js progress bar setInterval — _barEl can be set to null by the fade-out timer between interval ticks, causing a crash Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1943,7 +1943,7 @@ ${dbs.map(d=>`<tr>
|
|||||||
window.applyNovaCPXUpdate = async () => {
|
window.applyNovaCPXUpdate = async () => {
|
||||||
Nova.confirm('Apply NovaCPX update? PHP syntax is checked first, and a backup is taken automatically. The panel will self-restore if anything breaks.', async () => {
|
Nova.confirm('Apply NovaCPX update? PHP syntax is checked first, and a backup is taken automatically. The panel will self-restore if anything breaks.', async () => {
|
||||||
Nova.loading('Pulling NovaCPX update from GitHub…');
|
Nova.loading('Pulling NovaCPX update from GitHub…');
|
||||||
const res = await Nova.api('system', 'apply-novacpx-update', { method: 'POST' });
|
const res = await Nova.api('system', 'apply-update', { method: 'POST' });
|
||||||
Nova.loadingDone();
|
Nova.loadingDone();
|
||||||
const d = res?.data;
|
const d = res?.data;
|
||||||
if (!res?.success) {
|
if (!res?.success) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ window.Nova = (() => {
|
|||||||
_barEl.style.width = _barPct + '%';
|
_barEl.style.width = _barPct + '%';
|
||||||
clearInterval(_barTimer);
|
clearInterval(_barTimer);
|
||||||
_barTimer = setInterval(() => {
|
_barTimer = setInterval(() => {
|
||||||
if (_barPct < 85) { _barPct += (_barPct < 50 ? 8 : _barPct < 70 ? 4 : 1); _barEl.style.width = _barPct + '%'; }
|
if (_barEl && _barPct < 85) { _barPct += (_barPct < 50 ? 8 : _barPct < 70 ? 4 : 1); _barEl.style.width = _barPct + '%'; }
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
function _barDone() {
|
function _barDone() {
|
||||||
|
|||||||
Reference in New Issue
Block a user