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:
Brandon Walter 2026-02-24 08:57:57 -05:00
parent fc33c0d11e
commit 22ed2c6e12
2 changed files with 11 additions and 1 deletions

View file

@ -969,6 +969,7 @@
html += '<div class="stage-error-line">' + s.bad_blocks + ' bad block(s) found</div>'; html += '<div class="stage-error-line">' + s.bad_blocks + ' bad block(s) found</div>';
} }
html += '</div>'; html += '</div>';
});
} else { } else {
html += '<div class="drawer-empty">No stage data yet.</div>'; html += '<div class="drawer-empty">No stage data yet.</div>';
} }

View file

@ -312,6 +312,13 @@
<button type="button" class="btn-secondary" id="cancel-settings-btn">Cancel</button> <button type="button" class="btn-secondary" id="cancel-settings-btn">Cancel</button>
<span id="save-result" class="settings-test-result" style="display:none"></span> <span id="save-result" class="settings-test-result" style="display:none"></span>
</div> </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>&#9888; 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> </form>
<script> <script>
@ -365,7 +372,9 @@
'poll_interval_seconds','stale_threshold_seconds','allowed_ips','log_level']; 'poll_interval_seconds','stale_threshold_seconds','allowed_ips','log_level'];
var savedKeys = data.keys || []; var savedKeys = data.keys || [];
var needsRestart = savedKeys.some(function(k) { return systemFields.indexOf(k) >= 0; }); 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 { } else {
showResult(saveResult, false, data.detail || 'Save failed'); showResult(saveResult, false, data.detail || 'Save failed');
} }