diff options
author | Anna Tsyganova <ATSyganova@IBS.RU> | 2022-08-17 10:26:18 +0300 |
---|---|---|
committer | Anna Tsyganova <ATSyganova@IBS.RU> | 2022-08-17 10:26:18 +0300 |
commit | e7444631a3a0da657ae829c4da51b4d378ba32e8 (patch) | |
tree | e12ed86503195ca21eb7a7366075c07f3231618f /src/views/_sila | |
parent | c2010ac12e7cbf81e9c3e81589fd29e411de6b8d (diff) | |
parent | 0237b9c60425bbcd2417bf31000cbd74d0112645 (diff) | |
download | webui-vue-e7444631a3a0da657ae829c4da51b4d378ba32e8.tar.xz |
Merge branch 'sila' of git.sila.ru:pub/openbmc/webui-vue into sila
Diffstat (limited to 'src/views/_sila')
-rw-r--r-- | src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue | 65 | ||||
-rw-r--r-- | src/views/_sila/Memory/Dynamic/MemoryTemp.vue | 82 | ||||
-rw-r--r-- | src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue | 51 | ||||
-rw-r--r-- | src/views/_sila/Power/Dynamic/PowerTemp.vue | 85 | ||||
-rw-r--r-- | src/views/_sila/Processors/Dynamic/CpuTemp.vue | 84 |
5 files changed, 269 insertions, 98 deletions
diff --git a/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue b/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue index 10f6c9c5..018e19a1 100644 --- a/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue +++ b/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue @@ -8,11 +8,11 @@ <img src="@/assets/images/_sila/collapsed/fan.svg" /> </template> <page-section> - <!-- <b-row class="align-items-end limit-container"> + <!-- <b-row class="align-items-end limit-container"> <b-col xs="12" md="6" xl="3" class="pt-4"> <b-form-group :label="$t('pageFans.labels.warning')"> <b-form-input - v-model="warning" + v-model.number="warning" type="number" :min="0" :max="shutdown" @@ -23,7 +23,7 @@ <b-col xs="12" md="6" xl="3" class="pt-4"> <b-form-group :label="$t('pageFans.labels.shutdown')"> <b-form-input - v-model="shutdown" + v-model.number="shutdown" :min="warning" :max="10000" type="number" @@ -31,18 +31,18 @@ </b-form-group> </b-col> <b-col xs="12" md="6" xl="3" class="pt-4"> - <b-button variant="primary" style="height: 35px"> + <b-button variant="primary" style="height: 35px" @click="saveLimit"> {{ $t('global.action.save') }} </b-button> </b-col> - </b-row> --> + </b-row>--> <chart type="fans" :colors="colors" :time-scale="timeScale" :data="filteredForChart" - :warning="warning" - :shutdown="shutdown" + :warning="warningLimit" + :shutdown="shutdownLimit" ></chart> <b-table @@ -94,14 +94,15 @@ import PageSection from '@/components/Global/PageSection'; import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin'; import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin'; import TableFilterMixin from '@/components/_sila/Mixins/TableFilterMixin'; +import BVToastMixin from '@/components/_sila/Mixins/BVToastMixin'; import Collapse from '@/components/_sila/Global/Collapse'; -import { getItems } from '@/utilities/_sila/metricProperties'; +import { getGroups, getItems } from '@/utilities/_sila/metricProperties'; import { fanFilter } from '@/utilities/_sila/psuFilter'; export default { components: { PageSection, Chart, Collapse }, - mixins: [DataFormatterMixin, LoadingBarMixin, TableFilterMixin], + mixins: [DataFormatterMixin, LoadingBarMixin, TableFilterMixin, BVToastMixin], props: { timeScale: { type: String, @@ -110,8 +111,8 @@ export default { }, data() { return { - warning: 7500, - shutdown: 8500, + warning: null, + shutdown: null, isBusy: true, fields: [ { @@ -151,6 +152,9 @@ export default { }, computed: { + groups() { + return getGroups(this.filteredSensors); + }, items() { const allArr = getItems(this.filteredSensors); @@ -172,6 +176,27 @@ export default { }); }, + limits() { + return this.$store.getters['fan/limits']; + }, + + warningLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdNonCritical && + this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdNonCritical; + }, + + shutdownLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdCritical && this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdCritical; + }, + allSensors() { return this.timeScale === 'hour' ? this.$store.getters['fan/fansLastHour'] @@ -212,6 +237,16 @@ export default { }, methods: { + saveLimit() { + this.startLoader(); + this.$store + .dispatch('fan/patchLimits', { + warning: this.warning, + groups: this.groups, + }) + .catch(({ message }) => this.errorToast(message)) + .finally(() => this.endLoader()); + }, getPwmByCpu(cpu) { switch (cpu) { case 'CPU1_Fan': @@ -237,8 +272,12 @@ export default { this.startLoader(); this.$store.dispatch('fan/getFansDynamic', payload).finally(() => { - this.endLoader(); - this.isBusy = false; + this.$store.dispatch('fan/getLimits').finally(() => { + this.warning = this.warningLimit; + this.shutdown = this.shutdownLimit; + this.endLoader(); + this.isBusy = false; + }); }); }, }, diff --git a/src/views/_sila/Memory/Dynamic/MemoryTemp.vue b/src/views/_sila/Memory/Dynamic/MemoryTemp.vue index 3505f827..f69e797a 100644 --- a/src/views/_sila/Memory/Dynamic/MemoryTemp.vue +++ b/src/views/_sila/Memory/Dynamic/MemoryTemp.vue @@ -4,11 +4,11 @@ <img src="@/assets/images/_sila/collapsed/temperature.svg" /> {{ $t('pageMemory.temperature') }} </b-col> - <!-- <b-row class="align-items-end limit-container"> + <b-row class="align-items-end limit-container"> <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-form-group :label="$t('pageMemory.labels.notNormal')"> + <b-form-group :label="$t('pageMemory.labels.warning')"> <b-form-input - v-model="notNormal" + v-model.number="warning" type="number" :min="0" :max="critical" @@ -18,39 +18,27 @@ <b-col xs="12" sm="6" xl="3" class="pt-4"> <b-form-group :label="$t('pageMemory.labels.critical')"> <b-form-input - v-model="critical" - type="number" - :min="notNormal" - :max="warning" - > - </b-form-input> - </b-form-group> - </b-col> - <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-form-group :label="$t('pageMemory.labels.warning')"> - <b-form-input - v-model="warning" + v-model.number="critical" type="number" - :min="critical" + :min="warning" :max="100" > </b-form-input> </b-form-group> </b-col> <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-button variant="primary" style="height: 35px"> + <b-button variant="primary" style="height: 35px" @click="saveLimit"> {{ $t('global.action.save') }} </b-button> </b-col> - </b-row> --> + </b-row> <chart type="memory" :colors="colors" :time-scale="timeScale" :data="filteredSensors" - :warning="warning" - :not-normal="notNormal" - :critical="critical" + :warning="warningLimit" + :critical="criticalLimit" ></chart> <b-table responsive="md" @@ -94,12 +82,13 @@ import Chart from '@/components/_sila/Global/Chart'; import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin'; import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin'; import TableFilterMixin from '@/components/_sila/Mixins/TableFilterMixin'; +import BVToastMixin from '@/components/_sila/Mixins/BVToastMixin'; -import { getItems } from '@/utilities/_sila/metricProperties'; +import { getGroups, getItems } from '@/utilities/_sila/metricProperties'; export default { components: { Chart }, - mixins: [DataFormatterMixin, LoadingBarMixin, TableFilterMixin], + mixins: [DataFormatterMixin, LoadingBarMixin, TableFilterMixin, BVToastMixin], props: { timeScale: { type: String, @@ -108,9 +97,8 @@ export default { }, data() { return { - warning: 72, - notNormal: 44, - critical: 55, + warning: null, + critical: null, isBusy: true, fields: [ { @@ -146,10 +134,34 @@ export default { }, computed: { + groups() { + return getGroups(this.filteredSensors); + }, items() { return getItems(this.filteredSensors); }, + limits() { + return this.$store.getters['memory/limits']; + }, + + warningLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdNonCritical && + this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdNonCritical; + }, + + criticalLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdCritical && this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdCritical; + }, + allSensors() { return this.timeScale === 'hour' ? this.$store.getters['memory/dimmsLastHour'] @@ -180,6 +192,16 @@ export default { }, methods: { + saveLimit() { + this.startLoader(); + this.$store + .dispatch('memory/patchLimits', { + warning: this.warning, + groups: this.groups, + }) + .catch(({ message }) => this.errorToast(message)) + .finally(() => this.endLoader()); + }, loadData() { let payload = { lastHour: false }; if (this.timeScale === 'hour') { @@ -188,8 +210,12 @@ export default { this.startLoader(); this.$store.dispatch('memory/getMemoryDynamic', payload).finally(() => { - this.endLoader(); - this.isBusy = false; + this.$store.dispatch('memory/getLimits').finally(() => { + this.warning = this.warningLimit; + this.critical = this.criticalLimit; + this.endLoader(); + this.isBusy = false; + }); }); }, }, diff --git a/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue b/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue index f01c4280..5fac0a89 100644 --- a/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue +++ b/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue @@ -5,11 +5,11 @@ {{ $t('pageMotherboard.temperature') }} </b-col> - <!-- <b-row class="align-items-end limit-container"> + <b-row class="align-items-end limit-container"> <b-col xs="12" sm="6" xl="3" class="pt-4"> <b-form-group :label="$t('pageMotherboard.labels.warning')"> <b-form-input - v-model="warning" + v-model.number="warning" type="number" :min="0" :max="100" @@ -17,17 +17,17 @@ </b-form-group> </b-col> <b-col xs="12" sm="6" class="pt-4"> - <b-button variant="primary" style="height: 35px"> + <b-button variant="primary" style="height: 35px" @click="saveLimit"> {{ $t('global.action.save') }} </b-button> </b-col> - </b-row> --> + </b-row> <chart type="motherboard" :time-scale="timeScale" :colors="colors" :data="filteredSensors" - :warning="warning" + :warning="warningLimit" ></chart> <b-table responsive="md" @@ -71,12 +71,13 @@ import Chart from '@/components/_sila/Global/Chart'; import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin'; import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin'; import TableFilterMixin from '@/components/_sila/Mixins/TableFilterMixin'; +import BVToastMixin from '@/components/_sila/Mixins/BVToastMixin'; -import { getItems } from '@/utilities/_sila/metricProperties'; +import { getItems, getGroups } from '@/utilities/_sila/metricProperties'; export default { components: { Chart }, - mixins: [DataFormatterMixin, LoadingBarMixin, TableFilterMixin], + mixins: [DataFormatterMixin, LoadingBarMixin, TableFilterMixin, BVToastMixin], props: { timeScale: { type: String, @@ -85,7 +86,7 @@ export default { }, data() { return { - warning: 72, + warning: null, isBusy: true, fields: [ { @@ -121,10 +122,27 @@ export default { }, computed: { + groups() { + return getGroups(this.filteredSensors); + }, + items() { return getItems(this.filteredSensors); }, + limits() { + return this.$store.getters['motherboard/limits']; + }, + + warningLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdNonCritical && + this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdNonCritical; + }, + allSensors() { return this.timeScale === 'hour' ? this.$store.getters['motherboard/motherboardLastHour'] @@ -155,6 +173,16 @@ export default { }, methods: { + saveLimit() { + this.startLoader(); + this.$store + .dispatch('motherboard/patchLimits', { + warning: this.warning, + groups: this.groups, + }) + .catch(({ message }) => this.errorToast(message)) + .finally(() => this.endLoader()); + }, loadData() { let payload = { lastHour: false }; if (this.timeScale === 'hour') { @@ -165,8 +193,11 @@ export default { this.$store .dispatch('motherboard/getMotherboardDynamic', payload) .finally(() => { - this.endLoader(); - this.isBusy = false; + this.$store.dispatch('motherboard/getLimits').finally(() => { + this.warning = this.warningLimit; + this.endLoader(); + this.isBusy = false; + }); }); }, }, diff --git a/src/views/_sila/Power/Dynamic/PowerTemp.vue b/src/views/_sila/Power/Dynamic/PowerTemp.vue index e0d4d154..1d18e8b1 100644 --- a/src/views/_sila/Power/Dynamic/PowerTemp.vue +++ b/src/views/_sila/Power/Dynamic/PowerTemp.vue @@ -8,43 +8,42 @@ <img src="@/assets/images/_sila/collapsed/temperature.svg" /> </template> <page-section> - <!-- <b-row class="align-items-end limit-container"> + <b-row class="align-items-end limit-container"> <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-form-group :label="$t('pagePowerSup.labels.notNormal')"> + <b-form-group :label="$t('pagePowerSup.labels.warning')"> <b-form-input - v-model="notNormal" + v-model.number="warning" type="number" :min="0" :max="100" - ></b-form-input> - </b-form-group> - </b-col> - <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-form-group :label="$t('pagePowerSup.labels.critical')"> - <b-form-input v-model="critical" type="number" :min="0" :max="100"> + > </b-form-input> </b-form-group> </b-col> <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-form-group :label="$t('pagePowerSup.labels.warning')"> - <b-form-input v-model="warning" type="number" :min="0" :max="100"> + <b-form-group :label="$t('pagePowerSup.labels.critical')"> + <b-form-input + v-model.number="critical" + type="number" + :min="0" + :max="100" + > </b-form-input> </b-form-group> </b-col> <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-button variant="primary" style="height: 35px"> + <b-button variant="primary" style="height: 35px" @click="saveLimit"> {{ $t('global.action.save') }} </b-button> </b-col> - </b-row> --> + </b-row> <chart type="processors" :time-scale="timeScale" :data="allSensors" :colors="colors" - :warning="+warning" - :not-normal="+notNormal" - :critical="+critical" + :warning="warningLimit" + :critical="criticalLimit" ></chart> <b-table responsive="md" @@ -90,13 +89,14 @@ import PageSection from '@/components/Global/PageSection'; import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin'; import TableFilterMixin from '@/components/_sila/Mixins/TableFilterMixin'; import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin'; +import BVToastMixin from '@/components/_sila/Mixins/BVToastMixin'; import Collapse from '@/components/_sila/Global/Collapse'; -import { getItems } from '@/utilities/_sila/metricProperties'; +import { getGroups, getItems } from '@/utilities/_sila/metricProperties'; export default { components: { PageSection, Chart, Collapse }, - mixins: [DataFormatterMixin, TableFilterMixin, LoadingBarMixin], + mixins: [DataFormatterMixin, TableFilterMixin, LoadingBarMixin, BVToastMixin], props: { timeScale: { type: String, @@ -105,9 +105,8 @@ export default { }, data() { return { - warning: 72, - notNormal: 44, - critical: 55, + warning: null, + critical: null, isBusy: true, fields: [ { @@ -144,10 +143,35 @@ export default { }, computed: { + groups() { + return getGroups(this.allSensors); + }, + items() { return getItems(this.allSensors); }, + limits() { + return this.$store.getters['powerSupply/limitsTemp']; + }, + + warningLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdNonCritical && + this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdNonCritical; + }, + + criticalLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdCritical && this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdCritical; + }, + allSensors() { return this.timeScale === 'hour' ? this.$store.getters['powerSupply/psuTempLastHour'] @@ -171,6 +195,16 @@ export default { this.loadData(); }, methods: { + saveLimit() { + this.startLoader(); + this.$store + .dispatch('powerSupply/patchLimitsTemp', { + warning: this.warning, + groups: this.groups, + }) + .catch(({ message }) => this.errorToast(message)) + .finally(() => this.endLoader()); + }, onOpened(state) { if (state) { this.loadData(); @@ -183,9 +217,12 @@ export default { } this.startLoader(); this.$store.dispatch('powerSupply/getPsu', payload).finally(() => { - this.$root.$emit('psu-temp'); - this.isBusy = false; - this.endLoader(); + this.$store.dispatch('powerSupply/getLimitsTemp').finally(() => { + this.warning = this.warningLimit; + this.critical = this.criticalLimit; + this.endLoader(); + this.isBusy = false; + }); }); }, }, diff --git a/src/views/_sila/Processors/Dynamic/CpuTemp.vue b/src/views/_sila/Processors/Dynamic/CpuTemp.vue index 60813f9b..e3185aaa 100644 --- a/src/views/_sila/Processors/Dynamic/CpuTemp.vue +++ b/src/views/_sila/Processors/Dynamic/CpuTemp.vue @@ -8,43 +8,42 @@ <img src="@/assets/images/_sila/collapsed/temperature.svg" /> </template> <page-section> - <!-- <b-row class="align-items-end limit-container"> + <b-row class="align-items-end limit-container"> <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-form-group :label="$t('pageProcessors.labels.notNormal')"> + <b-form-group :label="$t('pageProcessors.labels.warning')"> <b-form-input - v-model="notNormal" + v-model.number="warning" type="number" :min="0" :max="100" - ></b-form-input> - </b-form-group> - </b-col> - <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-form-group :label="$t('pageProcessors.labels.critical')"> - <b-form-input v-model="critical" type="number" :min="0" :max="100"> + > </b-form-input> </b-form-group> </b-col> <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-form-group :label="$t('pageProcessors.labels.warning')"> - <b-form-input v-model="warning" type="number" :min="0" :max="100"> + <b-form-group :label="$t('pageProcessors.labels.critical')"> + <b-form-input + v-model.number="critical" + type="number" + :min="0" + :max="100" + > </b-form-input> </b-form-group> </b-col> <b-col xs="12" sm="6" xl="3" class="pt-4"> - <b-button variant="primary" style="height: 35px"> + <b-button variant="primary" style="height: 35px" @click="saveLimit"> {{ $t('global.action.save') }} </b-button> </b-col> - </b-row> --> + </b-row> <chart type="processors" :time-scale="timeScale" :data="filteredSensors" :colors="colors" - :warning="+warning" - :not-normal="+notNormal" - :critical="+critical" + :warning="warningLimit" + :critical="criticalLimit" ></chart> <b-table responsive="md" @@ -90,13 +89,14 @@ import PageSection from '@/components/Global/PageSection'; import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin'; import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin'; import TableFilterMixin from '@/components/_sila/Mixins/TableFilterMixin'; +import BVToastMixin from '@/components/_sila/Mixins/BVToastMixin'; import Collapse from '@/components/_sila/Global/Collapse'; -import { getItems } from '@/utilities/_sila/metricProperties'; +import { getGroups, getItems } from '@/utilities/_sila/metricProperties'; export default { components: { PageSection, Chart, Collapse }, - mixins: [DataFormatterMixin, LoadingBarMixin, TableFilterMixin], + mixins: [DataFormatterMixin, LoadingBarMixin, TableFilterMixin, BVToastMixin], props: { timeScale: { type: String, @@ -105,9 +105,8 @@ export default { }, data() { return { - warning: 72, - notNormal: 44, - critical: 55, + warning: null, + critical: null, isBusy: true, fields: [ { @@ -144,10 +143,35 @@ export default { }, computed: { + groups() { + return getGroups(this.filteredSensors); + }, + items() { return getItems(this.filteredSensors); }, + limits() { + return this.$store.getters['processors/limitsTemp']; + }, + + warningLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdNonCritical && + this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdNonCritical; + }, + + criticalLimit() { + return this.limits.find((limit) => { + return ( + limit?.UpperThresholdCritical && this.groups.includes(limit.MemberId) + ); + })?.UpperThresholdCritical; + }, + allSensors() { return this.timeScale === 'hour' ? this.$store.getters['processors/cpuTempLastHour'] @@ -176,6 +200,16 @@ export default { this.loadData(); }, methods: { + saveLimit() { + this.startLoader(); + this.$store + .dispatch('processors/patchLimitsTemp', { + warning: this.warning, + groups: this.groups, + }) + .catch(({ message }) => this.errorToast(message)) + .finally(() => this.endLoader()); + }, onOpened(state) { if (state) { this.loadData(); @@ -192,8 +226,12 @@ export default { this.$store .dispatch('processors/getCpuTempDynamic', payload) .finally(() => { - this.endLoader(); - this.isBusy = false; + this.$store.dispatch('processors/getLimitsTemp').finally(() => { + this.warning = this.warningLimit; + this.critical = this.criticalLimit; + this.endLoader(); + this.isBusy = false; + }); }); }, }, |