Skip to content

Commit 2558288

Browse files
committed
Improve scan UI refresh frequency and add manual refresh
- Changed scan/activity refresh interval from 5s to 2s for real-time updates - Status/notifications still refresh every 5s (less critical) - Added manual refresh buttons to Pending Scans and Activities sections - Users can now manually refresh scan status anytime - More responsive UI for tracking scan progress
1 parent 5dd4975 commit 2558288

2 files changed

Lines changed: 51 additions & 8 deletions

File tree

webui/src/App.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,18 @@ body {
10861086
margin-bottom: 2rem;
10871087
}
10881088

1089+
.section-header-with-refresh {
1090+
display: flex;
1091+
justify-content: space-between;
1092+
align-items: center;
1093+
margin-bottom: 1rem;
1094+
}
1095+
1096+
.section-header-with-refresh h2 {
1097+
margin: 0;
1098+
font-size: 1.5rem;
1099+
}
1100+
10891101
.pending-scans-section h2 {
10901102
margin-bottom: 1rem;
10911103
font-size: 1.5rem;
@@ -1164,7 +1176,7 @@ body {
11641176
}
11651177

11661178
.plex-activities-section h2 {
1167-
margin-bottom: 1rem;
1179+
margin: 0;
11681180
font-size: 1.5rem;
11691181
}
11701182

webui/src/App.jsx

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,20 @@ function App() {
4949
fetchNotifications();
5050
fetchPendingScans();
5151
fetchPlexActivities();
52-
const interval = setInterval(() => {
53-
fetchStatus();
54-
fetchNotifications();
52+
// Refresh scans and activities more frequently (2 seconds) for real-time updates
53+
const scanInterval = setInterval(() => {
5554
fetchPendingScans();
5655
fetchPlexActivities();
57-
}, 5000); // Refresh every 5 seconds
58-
return () => clearInterval(interval);
56+
}, 2000); // Refresh scans every 2 seconds
57+
// Refresh other data less frequently (5 seconds)
58+
const statusInterval = setInterval(() => {
59+
fetchStatus();
60+
fetchNotifications();
61+
}, 5000); // Refresh status every 5 seconds
62+
return () => {
63+
clearInterval(scanInterval);
64+
clearInterval(statusInterval);
65+
};
5966
}, []);
6067

6168
const fetchStatus = async () => {
@@ -322,7 +329,19 @@ function App() {
322329
</section>
323330

324331
<section className="pending-scans-section">
325-
<h2>Pending Scans</h2>
332+
<div className="section-header-with-refresh">
333+
<h2>Pending Scans</h2>
334+
<button
335+
className="btn btn-secondary btn-small"
336+
onClick={() => {
337+
fetchPendingScans();
338+
fetchPlexActivities();
339+
}}
340+
title="Refresh scan status"
341+
>
342+
🔄 Refresh
343+
</button>
344+
</div>
326345
{pendingScans.length > 0 ? (
327346
<div className="pending-scans-list">
328347
{pendingScans.map((scan) => (
@@ -354,7 +373,19 @@ function App() {
354373

355374
{plexActivities.length > 0 && (
356375
<section className="plex-activities-section">
357-
<h2>Plex Activities & Queued Scans</h2>
376+
<div className="section-header-with-refresh">
377+
<h2>Plex Activities & Queued Scans</h2>
378+
<button
379+
className="btn btn-secondary btn-small"
380+
onClick={() => {
381+
fetchPlexActivities();
382+
fetchPendingScans();
383+
}}
384+
title="Refresh activities"
385+
>
386+
🔄 Refresh
387+
</button>
388+
</div>
358389
<div className="activities-list">
359390
{plexActivities.map((activity, idx) => (
360391
<div key={activity.uuid || idx} className="activity-card">

0 commit comments

Comments
 (0)