Skip to content

Commit c69cfde

Browse files
Merge pull request #37 from BenediktSchackenberg/fix/instance-required-heavy-pages
perf: require instance selection on Memory and Blocking pages
2 parents a0e511f + ad1873d commit c69cfde

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

frontend/src/pages/BlockingPage.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface BlockNode {
1919
export default function BlockingPage() {
2020
const [data, setData] = useState<BlockingRow[]>([]);
2121
const [note, setNote] = useState('');
22-
const [loading, setLoading] = useState(true);
22+
const [loading, setLoading] = useState(false);
2323
const [instances, setInstances] = useState<InstanceListRow[]>([]);
2424
const [selectedInstance, setSelectedInstance] = useState<number | undefined>();
2525

@@ -28,6 +28,7 @@ export default function BlockingPage() {
2828
}, []);
2929

3030
useEffect(() => {
31+
if (!selectedInstance) { setLoading(false); return; }
3132
setLoading(true);
3233
api.performanceBlocking(selectedInstance)
3334
.then(r => { setData(r.data || []); setNote(r.note || ''); })
@@ -119,6 +120,17 @@ export default function BlockingPage() {
119120
);
120121

121122
if (loading) return <LoadingSpinner />;
123+
if (!selectedInstance) return (
124+
<div className="flex flex-col items-center justify-center py-24 text-center">
125+
<div className="w-16 h-16 rounded-2xl bg-slate-800/50 flex items-center justify-center mb-4">
126+
<svg className="w-8 h-8 text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
127+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M5 12h14M12 5l7 7-7 7" />
128+
</svg>
129+
</div>
130+
<p className="text-gray-400 font-medium">Select an instance to load data</p>
131+
<p className="text-gray-600 text-sm mt-1">Choose a server from the dropdown above</p>
132+
</div>
133+
);
122134
const tree = buildTree();
123135

124136
return (

frontend/src/pages/MemoryPage.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function MemoryPage() {
1212
const [counters, setCounters] = useState<MemoryCounterRow[]>([]);
1313
const [clerkNote, setClerkNote] = useState('');
1414
const [counterNote, setCounterNote] = useState('');
15-
const [loading, setLoading] = useState(true);
15+
const [loading, setLoading] = useState(false);
1616
const [instances, setInstances] = useState<InstanceListRow[]>([]);
1717
const [selectedInstance, setSelectedInstance] = useState<number | undefined>();
1818
const [hours, setHours] = useState(24);
@@ -22,6 +22,7 @@ export default function MemoryPage() {
2222
}, []);
2323

2424
useEffect(() => {
25+
if (!selectedInstance) { setLoading(false); return; }
2526
setLoading(true);
2627
api.performanceMemory(selectedInstance, hours)
2728
.then(r => {
@@ -35,6 +36,17 @@ export default function MemoryPage() {
3536
}, [selectedInstance, hours]);
3637

3738
if (loading) return <LoadingSpinner />;
39+
if (!selectedInstance) return (
40+
<div className="flex flex-col items-center justify-center py-24 text-center">
41+
<div className="w-16 h-16 rounded-2xl bg-slate-800/50 flex items-center justify-center mb-4">
42+
<svg className="w-8 h-8 text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
43+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M5 12h14M12 5l7 7-7 7" />
44+
</svg>
45+
</div>
46+
<p className="text-gray-400 font-medium">Select an instance to load data</p>
47+
<p className="text-gray-600 text-sm mt-1">Choose a server from the dropdown above</p>
48+
</div>
49+
);
3850

3951
// Aggregate top clerks by name
4052
const clerkAgg = new Map<string, number>();

0 commit comments

Comments
 (0)