Add a manual refresh button to the Array section on System
Some checks failed
Deploy / deploy (push) Has been cancelled

Unraid's stats were already fetched live on every page load (no
server-side cache), so this doesn't bypass anything — it just lets the
section be re-fetched without a full page reload, for confirming it's
current without waiting on a reload.

Array section moves into its own partial (_array_section.html) so a new
/api/array/refresh route can re-render just that fragment and swap it
into #array-section, rather than duplicating the table/bar/disk-row
markup in JS.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LPJxtE9tPURsaWDZ6rC4Dt
This commit is contained in:
Barely Removable 2026-09-05 10:01:51 -07:00
parent 106bd16de8
commit 2dedd4e915
4 changed files with 137 additions and 87 deletions

View file

@ -307,6 +307,27 @@
if (armed && !armed.contains(e.target)) disarm();
});
/* ── Array refresh (P105) ─────────────────────────────
Unraid's stats are fetched live already, never cached server-side
(see get_unraid_stats), so this button doesn't bypass a cache —
it exists so the section can be re-fetched without a full page
reload, for the visitor's own peace of mind that it's current. */
window.refreshArray = function (btn) {
if (btn.disabled) return;
btn.disabled = true;
btn.textContent = 'REFRESHING';
fetch(BASE + '/api/array/refresh')
.then(function (r) { return r.text(); })
.then(function (html) {
var section = document.getElementById('array-section');
if (section) section.innerHTML = html;
})
.catch(function () {
btn.disabled = false;
btn.textContent = 'FAILED';
});
};
/* ── Live figures ─────────────────────────────────────
The queue and the active streams are the only two numbers
that must be accurate to the second, so they are the only