feat(scheduler): persist invert preference in localStorage

This commit is contained in:
Gmer4Lfe
2026-05-24 20:00:00 -04:00
parent 51fe2664b8
commit 376c7f7bc8
@@ -184,7 +184,7 @@ foreach ($tree as $orch) {
<input type="checkbox" id="vv-scroll-lock" onchange="vvToggleScrollLock(this)"> <span>Scroll Lock</span>
</label>
<label id="vv-invert-log-label" class="vv-log-label" title="Show newest lines at top" style="display:none">
<input type="checkbox" id="vv-invert-log" onchange="vvFetchRight()"> <span>Invert</span>
<input type="checkbox" id="vv-invert-log" onchange="vvToggleInvert(this)"> <span>Invert</span>
</label>
<button id="vv-save-script-btn" class="vv-btn-sm vv-save-script-btn-style" onclick="vvSaveScript()" style="display:none">Save Script</button>
<button id="vv-save-conf-btn" class="vv-btn-sm vv-save-script-btn-style" onclick="vvSaveConf()" style="display:none">Save Config</button>
@@ -392,6 +392,16 @@ function vvRestoreScrollLock() {
document.getElementById('vv-log-pre').style.overflowY = on ? 'hidden' : '';
}
function vvToggleInvert(cb) {
localStorage.setItem('vv-invert-log', cb.checked ? '1' : '0');
vvFetchRight();
}
function vvRestoreInvert() {
const val = localStorage.getItem('vv-invert-log');
if (val !== null) document.getElementById('vv-invert-log').checked = val === '1';
}
function vvBackToSuggestions() {
if (vvActiveId) {
const old = document.querySelector('[data-id="' + CSS.escape(vvActiveId) + '"]');
@@ -816,6 +826,7 @@ function vvToggleSugBlock(bi) {
<script>
requestAnimationFrame(function() {
vvRestoreScrollLock();
vvRestoreInvert();
const last = localStorage.getItem('vv-last-job');
if (last && document.querySelector('[data-id="' + CSS.escape(last) + '"]')) {
vvOpenRight(last);