From a405a881da2895da1767452fe34108467dae5334 Mon Sep 17 00:00:00 2001 From: mabasian <54101509+mabasian@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:12:04 +0200 Subject: [PATCH] ADD cpu temp --- launcher/src/backend/Monitoring.js | 4 + launcher/src/background.js | 4 + .../components/cards/WidgetCard.vue | 2 +- .../components/widgets/ChartCpu.vue | 13 +- .../components/widgets/EndpointWidget.vue | 14 +- .../components/widgets/PeersOverTime.vue | 6 +- .../widgets/RPCRecievedOverTime.vue | 2 +- .../components/widgets/ServicePort.vue | 18 +- .../components/widgets/SubscribedSubnets.vue | 2 +- .../components/widgets/SyncStatus.vue | 367 ------------------ .../control-page/sections/ControlHeader.vue | 2 +- .../staking-page/components/list/ListBody.vue | 4 +- launcher/src/composables/monitoring.js | 1 + launcher/src/store/ControlService.js | 4 + launcher/src/store/theControl.js | 1 + 15 files changed, 56 insertions(+), 388 deletions(-) diff --git a/launcher/src/backend/Monitoring.js b/launcher/src/backend/Monitoring.js index 3102be30f..711f154eb 100755 --- a/launcher/src/backend/Monitoring.js +++ b/launcher/src/backend/Monitoring.js @@ -1357,8 +1357,12 @@ export class Monitoring { }; } + // const tenMinutesAgo = Math.floor(Date.now() / 1000) - 10 * 60; + // Query Prometehus for all possible labels const prometheus_result = await this.queryPrometheus('{__name__=~"' + serviceLabels.join("|") + '"}'); + + // console.log("prometheus_result ========>", prometheus_result.data.result); if (typeof prometheus_result !== "object" || !prometheus_result.hasOwnProperty("status") || prometheus_result.status != "success") { return { code: 223, diff --git a/launcher/src/background.js b/launcher/src/background.js index 00deefb3c..a1543a434 100755 --- a/launcher/src/background.js +++ b/launcher/src/background.js @@ -445,6 +445,10 @@ ipcMain.handle("writePrometheusConfig", async (event, args) => { return await nodeConnection.writePrometheusConfig(args.serviceID, args.config); }); +ipcMain.handle("getCPUTemperature", async () => { + return await monitoring.getCPUTemperature(); +}); + ipcMain.handle("getValidatorStats", async (event, args) => { return await monitoring.getValidatorStats(args); }); diff --git a/launcher/src/components/UI/control-page/components/cards/WidgetCard.vue b/launcher/src/components/UI/control-page/components/cards/WidgetCard.vue index 416915449..0342f7269 100644 --- a/launcher/src/components/UI/control-page/components/cards/WidgetCard.vue +++ b/launcher/src/components/UI/control-page/components/cards/WidgetCard.vue @@ -1,5 +1,5 @@ diff --git a/launcher/src/components/UI/control-page/components/widgets/ChartCpu.vue b/launcher/src/components/UI/control-page/components/widgets/ChartCpu.vue index 08dedf4c9..3c9bff20c 100644 --- a/launcher/src/components/UI/control-page/components/widgets/ChartCpu.vue +++ b/launcher/src/components/UI/control-page/components/widgets/ChartCpu.vue @@ -10,13 +10,13 @@ CPU -
- +
+
- -