feat(platform-services): add platform service log retrieval and display in the services UI
This commit is contained in:
@@ -108,6 +108,7 @@ export class ObViewServices extends DeesElement {
|
||||
platformServices: [],
|
||||
currentPlatformService: null,
|
||||
currentPlatformServiceStats: null,
|
||||
currentPlatformServiceLogs: [],
|
||||
};
|
||||
|
||||
@state()
|
||||
@@ -357,10 +358,10 @@ export class ObViewServices extends DeesElement {
|
||||
|
||||
private navigateToPlatformDetail(type: string): void {
|
||||
this.selectedPlatformType = type;
|
||||
// Fetch stats for this platform service
|
||||
appstate.servicesStatePart.dispatchAction(appstate.fetchPlatformServiceStatsAction, {
|
||||
serviceType: type as interfaces.data.TPlatformServiceType,
|
||||
});
|
||||
// Fetch stats and logs for this platform service
|
||||
const serviceType = type as interfaces.data.TPlatformServiceType;
|
||||
appstate.servicesStatePart.dispatchAction(appstate.fetchPlatformServiceStatsAction, { serviceType });
|
||||
appstate.servicesStatePart.dispatchAction(appstate.fetchPlatformServiceLogsAction, { serviceType });
|
||||
this.currentView = 'platform-detail';
|
||||
}
|
||||
|
||||
@@ -398,7 +399,11 @@ export class ObViewServices extends DeesElement {
|
||||
metrics,
|
||||
}
|
||||
: null}
|
||||
.logs=${[]}
|
||||
.logs=${this.servicesState.currentPlatformServiceLogs.map((log) => ({
|
||||
timestamp: new Date(log.timestamp).toLocaleString(),
|
||||
level: log.level,
|
||||
message: log.message,
|
||||
}))}
|
||||
@back=${() => {
|
||||
this.currentView = 'list';
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user