admin docs and layout refresh, build 2702261314
This commit is contained in:
@@ -1262,6 +1262,86 @@ export default function SettingsPage({ section }: SettingsPageProps) {
|
||||
}
|
||||
}
|
||||
|
||||
const cacheSourceLabel =
|
||||
formValues.requests_data_source === 'always_js'
|
||||
? 'Jellyseerr direct'
|
||||
: formValues.requests_data_source === 'prefer_cache'
|
||||
? 'Saved requests only'
|
||||
: 'Saved requests only'
|
||||
const cacheTtlLabel = formValues.requests_sync_ttl_minutes || '60'
|
||||
const cacheRail = showCacheExtras ? (
|
||||
<div className="admin-rail-stack">
|
||||
<div className="admin-rail-card cache-rail-card">
|
||||
<span className="admin-rail-eyebrow">Cache control</span>
|
||||
<h2>Saved requests</h2>
|
||||
<p>Load and inspect cached request entries from the right rail.</p>
|
||||
<div className="cache-rail-metrics">
|
||||
<div className="cache-rail-metric">
|
||||
<span>Data source</span>
|
||||
<strong>{cacheSourceLabel}</strong>
|
||||
</div>
|
||||
<div className="cache-rail-metric">
|
||||
<span>Refresh TTL</span>
|
||||
<strong>{cacheTtlLabel} min</strong>
|
||||
</div>
|
||||
<div className="cache-rail-metric">
|
||||
<span>Rows loaded</span>
|
||||
<strong>{cacheRows.length}</strong>
|
||||
</div>
|
||||
<div className="cache-rail-metric">
|
||||
<span>Live updates</span>
|
||||
<strong>{liveStreamConnected ? 'Connected' : 'Polling'}</strong>
|
||||
</div>
|
||||
</div>
|
||||
<label className="cache-rail-limit">
|
||||
<span>Rows to load</span>
|
||||
<select
|
||||
value={cacheCount}
|
||||
onChange={(event) => setCacheCount(Number(event.target.value))}
|
||||
>
|
||||
<option value={25}>25</option>
|
||||
<option value={50}>50</option>
|
||||
<option value={100}>100</option>
|
||||
<option value={200}>200</option>
|
||||
</select>
|
||||
</label>
|
||||
<button type="button" onClick={loadCache} disabled={cacheLoading}>
|
||||
{cacheLoading ? (
|
||||
<>
|
||||
<span className="spinner button-spinner" aria-hidden="true" />
|
||||
Loading saved requests
|
||||
</>
|
||||
) : (
|
||||
'Load saved requests'
|
||||
)}
|
||||
</button>
|
||||
{cacheStatus && <div className="error-banner">{cacheStatus}</div>}
|
||||
</div>
|
||||
<div className="admin-rail-card cache-rail-card">
|
||||
<span className="admin-rail-eyebrow">Artwork</span>
|
||||
<h2>Cache stats</h2>
|
||||
<div className="cache-rail-metrics">
|
||||
<div className="cache-rail-metric">
|
||||
<span>Missing artwork</span>
|
||||
<strong>{artworkSummary?.missing_artwork ?? '--'}</strong>
|
||||
</div>
|
||||
<div className="cache-rail-metric">
|
||||
<span>Cache size</span>
|
||||
<strong>{formatBytes(artworkSummary?.cache_bytes)}</strong>
|
||||
</div>
|
||||
<div className="cache-rail-metric">
|
||||
<span>Cached files</span>
|
||||
<strong>{artworkSummary?.cache_files ?? '--'}</strong>
|
||||
</div>
|
||||
<div className="cache-rail-metric">
|
||||
<span>Mode</span>
|
||||
<strong>{artworkSummary?.cache_mode ?? '--'}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : undefined
|
||||
|
||||
if (loading) {
|
||||
return <main className="card">Loading admin settings...</main>
|
||||
}
|
||||
@@ -1270,6 +1350,7 @@ export default function SettingsPage({ section }: SettingsPageProps) {
|
||||
<AdminShell
|
||||
title={SECTION_LABELS[section] ?? 'Settings'}
|
||||
subtitle={SECTION_DESCRIPTIONS[section] ?? 'Manage settings.'}
|
||||
rail={cacheRail}
|
||||
actions={
|
||||
<button type="button" onClick={() => router.push('/admin')}>
|
||||
Back to settings
|
||||
@@ -1893,32 +1974,7 @@ export default function SettingsPage({ section }: SettingsPageProps) {
|
||||
<section className="admin-section" id="cache">
|
||||
<div className="section-header">
|
||||
<h2>Saved requests (cache)</h2>
|
||||
<div className="log-actions">
|
||||
<label className="recent-filter">
|
||||
<span>Rows to show</span>
|
||||
<select
|
||||
value={cacheCount}
|
||||
onChange={(event) => setCacheCount(Number(event.target.value))}
|
||||
>
|
||||
<option value={25}>25</option>
|
||||
<option value={50}>50</option>
|
||||
<option value={100}>100</option>
|
||||
<option value={200}>200</option>
|
||||
</select>
|
||||
</label>
|
||||
<button type="button" onClick={loadCache} disabled={cacheLoading}>
|
||||
{cacheLoading ? (
|
||||
<>
|
||||
<span className="spinner button-spinner" aria-hidden="true" />
|
||||
Loading saved requests
|
||||
</>
|
||||
) : (
|
||||
'Load saved requests'
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{cacheStatus && <div className="error-banner">{cacheStatus}</div>}
|
||||
<div className="cache-table">
|
||||
<div className="cache-row cache-head">
|
||||
<span>Request</span>
|
||||
|
||||
Reference in New Issue
Block a user