diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-04 18:31:58 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-04 18:31:58 +0300 |
commit | 83b1f3104e0564ca40bdeaf08f7f728e423e7f85 (patch) | |
tree | 77169f2a7747b49946387bc8cfe14fa4390c16a3 /src/views | |
parent | 62460aec15fd7bd4086810b74f8efddeb4a4cf7a (diff) | |
download | webui-vue-83b1f3104e0564ca40bdeaf08f7f728e423e7f85.tar.xz |
add other tabs
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/Fans/DynamicInformation/IndicatorsTable.vue | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/views/Fans/DynamicInformation/IndicatorsTable.vue b/src/views/Fans/DynamicInformation/IndicatorsTable.vue index de0823c0..22789bc3 100644 --- a/src/views/Fans/DynamicInformation/IndicatorsTable.vue +++ b/src/views/Fans/DynamicInformation/IndicatorsTable.vue @@ -6,7 +6,8 @@ <b-table responsive="md" class="bootstrap-fans-table bootstrap-fans-table__stripes" - :items="items" + :items="filteredSensors" + :busy="isBusy" :fields="fields" > <template #cell(name)="{ value, index }"> @@ -42,10 +43,15 @@ import PageSection from '@/components/Global/PageSection'; import { colors } from './helpers'; +import TableFilterMixin from '@/components/Mixins/TableFilterMixin'; +import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin'; + export default { components: { PageSection }, + mixins: [TableFilterMixin, DataFormatterMixin], data() { return { + isBusy: true, colors, fields: [ { @@ -56,7 +62,7 @@ export default { tdClass: 'bootstrap-fans-table__td light-12px', }, { - key: 'currentSpeed', + key: 'currentValue', label: 'Текущая', formatter: this.dataFormatter, thClass: 'bootstrap-fans-table__th medium-12px', @@ -156,6 +162,37 @@ export default { ], }; }, + + computed: { + allSensors() { + let sensors = this.$store.getters['sensors/fanSensors']; + if (this.isSensorsExist) { + sensors.forEach((sensor) => { + sensor.type = sensor.name.toLowerCase().includes('cpu') + ? this.$t('tablesDescription.cpu') + : this.$t('tablesDescription.system'); + }); + } + return sensors; + }, + + isSensorsExist() { + return ( + this.$store.getters['sensors/fanSensors'] && + this.$store.getters['sensors/fanSensors'].length > 0 + ); + }, + + filteredSensors() { + return this.getFilteredTableData(this.allSensors, this.activeFilters); + }, + }, + + created() { + this.$store.dispatch('sensors/getFanSensors').finally(() => { + this.isBusy = false; + }); + }, }; </script> <style lang="scss"> |