summaryrefslogtreecommitdiff
path: root/src/views/_sila/Motherboard/Dynamic
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/_sila/Motherboard/Dynamic
parentd3edcc3990d5760404cf5b78d12cfa5a70310908 (diff)
downloadwebui-vue-8e266a3de94343f789e28a5cc586426bc3b0c2dd.tar.xz
add req for hour
Diffstat (limited to 'src/views/_sila/Motherboard/Dynamic')
-rw-r--r--src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue26
1 files changed, 19 insertions, 7 deletions
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();
+ });
+ }
},
},
};