fix: JS syntax error breaking all buttons; add settings restart banner
app.js: stages.forEach callback in _drawerRenderBurnin was missing its closing });, causing a syntax error that prevented the entire script from loading — all click handlers (Short/Long SMART, Burn-In, cancel) were unregistered as a result. settings.html: add a prominent yellow restart banner with the docker command (docker compose restart app) that appears after saving any system settings that require a container restart to take effect. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fc33c0d11e
commit
22ed2c6e12
2 changed files with 11 additions and 1 deletions
|
|
@ -969,6 +969,7 @@
|
|||
html += '<div class="stage-error-line">' + s.bad_blocks + ' bad block(s) found</div>';
|
||||
}
|
||||
html += '</div>';
|
||||
});
|
||||
} else {
|
||||
html += '<div class="drawer-empty">No stage data yet.</div>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -312,6 +312,13 @@
|
|||
<button type="button" class="btn-secondary" id="cancel-settings-btn">Cancel</button>
|
||||
<span id="save-result" class="settings-test-result" style="display:none"></span>
|
||||
</div>
|
||||
|
||||
<!-- Restart required banner — shown after saving system settings -->
|
||||
<div id="restart-banner" style="display:none;margin-top:12px;padding:12px 16px;background:rgba(255,170,0,0.12);border:1px solid var(--yellow);border-radius:8px;color:var(--text-strong)">
|
||||
<strong>⚠ Container restart required</strong> — system settings are saved but won't take effect until you restart the app container:
|
||||
<pre style="margin:8px 0 0;padding:8px 10px;background:var(--bg-card);border-radius:5px;font-size:12px;color:var(--text-strong);user-select:all">docker compose restart app</pre>
|
||||
<span style="font-size:11px;color:var(--text-muted)">Run this on <strong>maple.local</strong> from <code>~/docker/stacks/truenas-burnin/</code></span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
|
@ -365,7 +372,9 @@
|
|||
'poll_interval_seconds','stale_threshold_seconds','allowed_ips','log_level'];
|
||||
var savedKeys = data.keys || [];
|
||||
var needsRestart = savedKeys.some(function(k) { return systemFields.indexOf(k) >= 0; });
|
||||
showResult(saveResult, true, needsRestart ? 'Saved — restart container to apply system changes' : 'Saved');
|
||||
showResult(saveResult, true, 'Saved');
|
||||
var restartBanner = document.getElementById('restart-banner');
|
||||
if (restartBanner) restartBanner.style.display = needsRestart ? '' : 'none';
|
||||
} else {
|
||||
showResult(saveResult, false, data.detail || 'Save failed');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue