feat(services): add platform service navigation and stats in the services UI

This commit is contained in:
2026-03-16 11:45:56 +00:00
parent 59ed7233bd
commit 3f2cd074ce
9 changed files with 159 additions and 17 deletions

View File

@@ -24,6 +24,7 @@ export class ObViewDashboard extends DeesElement {
currentServiceStats: null,
platformServices: [],
currentPlatformService: null,
currentPlatformServiceStats: null,
};
@state()
@@ -149,6 +150,7 @@ export class ObViewDashboard extends DeesElement {
],
}}
@action-click=${(e: CustomEvent) => this.handleQuickAction(e)}
@service-click=${(e: CustomEvent) => this.handlePlatformServiceClick(e)}
></sz-dashboard-view>
`;
}
@@ -161,4 +163,21 @@ export class ObViewDashboard extends DeesElement {
appstate.uiStatePart.dispatchAction(appstate.setActiveViewAction, { view: 'network' });
}
}
private handlePlatformServiceClick(e: CustomEvent) {
// Find the platform service type from the click event
const name = e.detail?.name;
const ps = this.servicesState.platformServices.find(
(p) => p.displayName === name,
);
if (ps) {
// Navigate to services tab — the ObViewServices component will pick up the type
// Store the selected platform type so the services view can open it
appstate.servicesStatePart.setState({
...appstate.servicesStatePart.getState(),
currentPlatformService: ps,
});
appstate.uiStatePart.dispatchAction(appstate.setActiveViewAction, { view: 'services' });
}
}
}