diff options
-rw-r--r-- | src/locales/ru-RU.json | 2 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/MemoryStore.js | 10 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/ProcessorStore.js | 10 | ||||
-rw-r--r-- | src/store/modules/_sila/HardwareStatus/MotherboardStore.js | 10 | ||||
-rw-r--r-- | src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue | 22 | ||||
-rw-r--r-- | src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue | 26 | ||||
-rw-r--r-- | src/views/_sila/Processors/Dynamic/ProcessorsDynamicPage.vue | 24 |
7 files changed, 82 insertions, 22 deletions
diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json index 9e5da7a5..c0ee630a 100644 --- a/src/locales/ru-RU.json +++ b/src/locales/ru-RU.json @@ -87,7 +87,7 @@ "unAuthDescription": "Действие недоступно из текущей учётной записи. Свяжитесь с Вашим системным администратором для проверки прав доступа." }, "datePicker": { - "lastHour": "Последнй час", + "lastHour": "Последний час", "lastDay": "Последние сутки" } }, diff --git a/src/store/modules/HardwareStatus/MemoryStore.js b/src/store/modules/HardwareStatus/MemoryStore.js index 9d79ad10..2c8fc044 100644 --- a/src/store/modules/HardwareStatus/MemoryStore.js +++ b/src/store/modules/HardwareStatus/MemoryStore.js @@ -58,6 +58,16 @@ const MemoryStore = { }, }, actions: { + async getMemoryDynamicHour({ commit }) { + return await api + .get( + '/redfish/v1/TelemetryService/MetricReports/hour_data&id=dimm_temp&period=last_hour' + ) + .then(({ data: { MetricValues = [] } }) => + commit('setMemoryDynamic', MetricValues) + ) + .catch((error) => console.log(error)); + }, async getMemoryDynamic({ commit }) { return await api .get('/redfish/v1/TelemetryService/MetricReports/hour_data&dimm_temp') diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js index 2309f536..a28cd00c 100644 --- a/src/store/modules/HardwareStatus/ProcessorStore.js +++ b/src/store/modules/HardwareStatus/ProcessorStore.js @@ -65,6 +65,16 @@ const ProcessorStore = { }, }, actions: { + async getProcessorsDynamicHour({ commit }) { + return await api + .get( + '/redfish/v1/TelemetryService/MetricReports/hour_data&id=cpu_temp&period=last_hour' + ) + .then(({ data: { MetricValues = [] } }) => + commit('setProcessorsDynamic', MetricValues) + ) + .catch((error) => console.log(error)); + }, async getProcessorsDynamic({ commit }) { return await api .get('/redfish/v1/TelemetryService/MetricReports/hour_data&cpu_temp') diff --git a/src/store/modules/_sila/HardwareStatus/MotherboardStore.js b/src/store/modules/_sila/HardwareStatus/MotherboardStore.js index 93d655f9..71b71065 100644 --- a/src/store/modules/_sila/HardwareStatus/MotherboardStore.js +++ b/src/store/modules/_sila/HardwareStatus/MotherboardStore.js @@ -14,6 +14,16 @@ const MotherboardStore = { }, }, actions: { + async getMotherboardDynamicHour({ commit }) { + return await api + .get( + '/redfish/v1/TelemetryService/MetricReports/hour_data&id=other_temp&period=last_hour' + ) + .then(({ data: { MetricValues = [] } }) => + commit('setMotherboardDynamic', MetricValues) + ) + .catch((error) => console.log(error)); + }, async getMotherboardDynamic({ commit }) { return await api .get('/redfish/v1/TelemetryService/MetricReports/hour_data&other_temp') diff --git a/src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue b/src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue index f635e307..fb9be306 100644 --- a/src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue +++ b/src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue @@ -57,6 +57,7 @@ <chart type="memory" :colors="colors" + :time-scale="timeScale" :data="filteredSensors" :warning="temperatureWarning" :non-normal="temperatureNonNormal" @@ -186,13 +187,13 @@ export default { }, created() { - this.loadData(); + this.loadData('hour'); }, methods: { switchTimeScale(period) { this.timeScale = period; - this.loadData(); + this.loadData(period); }, updateTemperature() { @@ -201,11 +202,18 @@ export default { this.temperatureCritical = +this.temperatureCriticalInput; }, - loadData() { - this.startLoader(); - this.$store.dispatch('memory/getMemoryDynamic').finally(() => { - this.endLoader(); - }); + loadData(period) { + if (period === 'hour') { + this.startLoader(); + this.$store.dispatch('memory/getMemoryDynamicHour').finally(() => { + this.endLoader(); + }); + } else { + this.startLoader(); + this.$store.dispatch('memory/getMemoryDynamic').finally(() => { + this.endLoader(); + }); + } }, }, }; diff --git a/src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue b/src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue index 343988f1..d04e32cf 100644 --- a/src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue +++ b/src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue @@ -34,6 +34,7 @@ <b-col class="pl-4 pr-4"> <chart type="motherboard" + :time-scale="timeScale" :colors="colors" :data="filteredSensors" :warning="temperatureWarning" @@ -161,13 +162,13 @@ export default { }, created() { - this.loadData(); + this.loadData('hour'); }, methods: { switchTimeScale(period) { this.timeScale = period; - this.loadData(); + this.loadData(period); }, updateTemperature() { @@ -176,11 +177,22 @@ export default { this.temperatureCritical = +this.temperatureCriticalInput; }, - loadData() { - this.startLoader(); - this.$store.dispatch('motherboard/getMotherboardDynamic').finally(() => { - this.endLoader(); - }); + loadData(period) { + if (period === 'hour') { + this.startLoader(); + this.$store + .dispatch('motherboard/getMotherboardDynamicHour') + .finally(() => { + this.endLoader(); + }); + } else { + this.startLoader(); + this.$store + .dispatch('motherboard/getMotherboardDynamic') + .finally(() => { + this.endLoader(); + }); + } }, }, }; diff --git a/src/views/_sila/Processors/Dynamic/ProcessorsDynamicPage.vue b/src/views/_sila/Processors/Dynamic/ProcessorsDynamicPage.vue index de3c3480..45ef53f6 100644 --- a/src/views/_sila/Processors/Dynamic/ProcessorsDynamicPage.vue +++ b/src/views/_sila/Processors/Dynamic/ProcessorsDynamicPage.vue @@ -60,6 +60,7 @@ </b-row> <chart type="processors" + :time-scale="timeScale" :data="filteredSensors" :colors="colors" :warning="temperatureWarning" @@ -195,13 +196,13 @@ export default { }, }, created() { - this.loadData(); + this.loadData('hour'); }, methods: { switchTimeScale(period) { this.timeScale = period; - this.loadData(); + this.loadData(period); }, updateTemperature() { @@ -210,11 +211,20 @@ export default { this.temperatureCritical = +this.temperatureCriticalInput; }, - loadData() { - this.startLoader(); - this.$store.dispatch('processors/getProcessorsDynamic').finally(() => { - this.endLoader(); - }); + loadData(period) { + if (period === 'hour') { + this.startLoader(); + this.$store + .dispatch('processors/getProcessorsDynamicHour') + .finally(() => { + this.endLoader(); + }); + } else { + this.startLoader(); + this.$store.dispatch('processors/getProcessorsDynamic').finally(() => { + this.endLoader(); + }); + } }, }, }; |