summaryrefslogtreecommitdiff
path: root/src/views/_sila/Motherboard/Dynamic
diff options
context:
space:
mode:
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();
+ });
+ }
},
},
};