Add a manual refresh button to the Array section on System
Some checks failed
Deploy / deploy (push) Has been cancelled
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:
parent
106bd16de8
commit
2dedd4e915
4 changed files with 137 additions and 87 deletions
12
app.py
12
app.py
|
|
@ -1855,6 +1855,18 @@ def system_page():
|
|||
ombi=r["ombi"], admin_unwatched=r["admin_unwatched"])
|
||||
|
||||
|
||||
@app.route("/api/array/refresh")
|
||||
@login_required
|
||||
def api_array_refresh():
|
||||
"""Re-renders just the Array section's markup for P105's refresh
|
||||
button. Unraid's stats aren't cached (get_unraid_stats hits the
|
||||
GraphQL API live on every call), so this is a plain re-fetch — the
|
||||
button exists for the visitor's own peace of mind, not to bypass a
|
||||
cache. Returns HTML, not JSON: swapped directly into #array-section
|
||||
rather than re-implementing the table/bar/disk-row markup in JS."""
|
||||
return render_template("_array_section.html", unraid=get_unraid_stats())
|
||||
|
||||
|
||||
@app.route("/activity")
|
||||
@login_required
|
||||
def activity_page():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue