summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-07-25 16:45:04 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-07-25 16:45:04 +0300
commit8e266a3de94343f789e28a5cc586426bc3b0c2dd (patch)
treea652010b5a35790fd5f0d897b431f16d035f5451 /src/views
parentd3edcc3990d5760404cf5b78d12cfa5a70310908 (diff)
downloadwebui-vue-8e266a3de94343f789e28a5cc586426bc3b0c2dd.tar.xz
add req for hour
Diffstat (limited to 'src/views')
-rw-r--r--src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue22
-rw-r--r--src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue26
-rw-r--r--src/views/_sila/Processors/Dynamic/ProcessorsDynamicPage.vue24
3 files changed, 51 insertions, 21 deletions
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();
+ });
+ }
},
},
};