Skip to content

Commit 449a217

Browse files
committed
feat(pbs): Implement sub-tabs for multiple PBS instances
1 parent 599b943 commit 449a217

File tree

3 files changed

+170
-319
lines changed

3 files changed

+170
-319
lines changed

src/public/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,13 @@
354354
</div>
355355
</div>
356356
<div id="pbs" class="tab-content hidden bg-white dark:bg-gray-800 p-4 border border-t-0 border-gray-300 dark:border-gray-700 rounded-b-lg shadow-sm">
357-
<div id="pbs-instances-container" class="space-y-6">
357+
<!-- Sub-tab navigation -->
358+
<div id="pbs-sub-tabs-nav" class="flex border-b border-gray-200 dark:border-gray-700 mb-4">
359+
<!-- Sub-tab buttons will be dynamically inserted here by JavaScript -->
360+
</div>
361+
<!-- Sub-tab content panels -->
362+
<div id="pbs-sub-tabs-content" class="space-y-6">
363+
<!-- Content for each PBS instance will be dynamically inserted here -->
358364
<p id="pbs-loading-message" class="text-gray-500 dark:text-gray-400">Loading PBS data...</p>
359365
</div>
360366
</div>

src/public/js/state.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ PulseApp.state = (() => {
22
const savedSortState = JSON.parse(localStorage.getItem('pulseSortState')) || {};
33
const savedFilterState = JSON.parse(localStorage.getItem('pulseFilterState')) || {};
44
const savedThresholdState = JSON.parse(localStorage.getItem('pulseThresholdState')) || {};
5+
const savedPbsShowDetails = JSON.parse(localStorage.getItem('pulsePbsShowDetails')) || {};
56

67
let internalState = {
78
nodesData: [],
@@ -35,7 +36,8 @@ PulseApp.state = (() => {
3536
},
3637
activeLogSessions: {},
3738
thresholdLogEntries: [],
38-
activeLoggingThresholds: null
39+
activeLoggingThresholds: null,
40+
pbsShowDetails: savedPbsShowDetails
3941
};
4042

4143
// Initialize thresholdState by merging saved state with defaults
@@ -81,6 +83,10 @@ PulseApp.state = (() => {
8183
localStorage.setItem('pulseSortState', JSON.stringify(stateToSave));
8284
}
8385

86+
function savePbsShowDetailsState() {
87+
localStorage.setItem('pulsePbsShowDetails', JSON.stringify(internalState.pbsShowDetails));
88+
}
89+
8490
return {
8591
get: (key) => internalState[key],
8692
set: (key, value) => {
@@ -134,6 +140,16 @@ PulseApp.state = (() => {
134140
},
135141
clearDashboardHistoryEntry: (guestId) => {
136142
delete internalState.dashboardHistory[guestId];
143+
},
144+
getPbShowDetailsState: (instanceId, defaultValue) => {
145+
if (typeof internalState.pbsShowDetails[instanceId] === 'boolean') {
146+
return internalState.pbsShowDetails[instanceId];
147+
}
148+
return defaultValue;
149+
},
150+
setPbShowDetailsState: (instanceId, value) => {
151+
internalState.pbsShowDetails[instanceId] = !!value;
152+
savePbsShowDetailsState();
137153
}
138154
};
139155
})();

0 commit comments

Comments
 (0)