diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-04 12:02:52 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-04 12:02:52 +0300 |
commit | 03080e30d351494fbedef1b1c616bddb6bfe13cc (patch) | |
tree | 352f769075b6f4668d4106d0f6acc7c05a773ae5 /src/views/Fans/StaticInformation | |
parent | 17c1d8bdaf236f1209b7283bbf75a4c062c7a6ad (diff) | |
parent | c8d25fd2b9ecb1395fa086a727d238489d568908 (diff) | |
download | webui-vue-03080e30d351494fbedef1b1c616bddb6bfe13cc.tar.xz |
Merge branch 'template-bugs' into sila-dev
Diffstat (limited to 'src/views/Fans/StaticInformation')
-rw-r--r-- | src/views/Fans/StaticInformation/FansStaticPage.vue | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/src/views/Fans/StaticInformation/FansStaticPage.vue b/src/views/Fans/StaticInformation/FansStaticPage.vue index 7c5e6059..a9f2d68b 100644 --- a/src/views/Fans/StaticInformation/FansStaticPage.vue +++ b/src/views/Fans/StaticInformation/FansStaticPage.vue @@ -10,7 +10,8 @@ responsive="md" show-empty class="bootstrap-rounded-table" - :items="items" + :items="filteredSensors" + :busy="isBusy" :fields="fields" :empty-text="$t('global.table.emptyMessage')" > @@ -28,6 +29,9 @@ </span> </div> </template> + <template #cell(currentValue)="data"> + {{ data.value }} + </template> </b-table> </page-section> </b-container> @@ -37,8 +41,12 @@ import PageTitle from '@/components/Global/PageTitle'; import PageSection from '@/components/Global/PageSection'; +import TableFilterMixin from '@/components/Mixins/TableFilterMixin'; +import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin'; + export default { components: { PageTitle, PageSection }, + mixins: [TableFilterMixin, DataFormatterMixin], data() { return { isBusy: true, @@ -72,11 +80,11 @@ export default { tdClass: 'regular-12px bootstrap-rounded-table__td', }, { - key: 'value', + key: 'currentValue', label: 'Номинальная скорость, об/мин', formatter: this.dataFormatter, thClass: 'semi-bold-12px__caps bootstrap-rounded-table__head_bg', - class: `bootstrap-rounded-table__column-last + class: `bootstrap-rounded-table__column-last fans-table-col-third`, tdClass: 'regular-12px bootstrap-rounded-table__td', }, @@ -101,8 +109,40 @@ export default { value: '2400', }, ], + activeFilters: [], }; }, + + 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"> |