diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-01 14:46:40 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-01 14:46:40 +0300 |
commit | d686e23f1f4d7ab873d6d8631c84564b291364fa (patch) | |
tree | 290e4e6ae898784f4d7d4d51d9b57bd5a3583952 | |
parent | 42eec917d4181481b41e61f85766e45ab45a90ef (diff) | |
download | webui-vue-d686e23f1f4d7ab873d6d8631c84564b291364fa.tar.xz |
add fans info
-rw-r--r-- | src/components/AppNavigation/AppNavigationMixin.js | 34 | ||||
-rw-r--r-- | src/components/Mixins/TableFilterMixin.js | 2 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/SensorsStore.js | 3 | ||||
-rw-r--r-- | src/views/Fans/StaticInformation/FansStaticPage.vue | 38 | ||||
-rw-r--r-- | src/views/HardwareStatus/Sensors/Sensors.vue | 7 |
5 files changed, 64 insertions, 20 deletions
diff --git a/src/components/AppNavigation/AppNavigationMixin.js b/src/components/AppNavigation/AppNavigationMixin.js index 2e2c4e71..fc34b3af 100644 --- a/src/components/AppNavigation/AppNavigationMixin.js +++ b/src/components/AppNavigation/AppNavigationMixin.js @@ -129,23 +129,23 @@ export const AppNavigationMixin = { // }, // ], // }, - // { - // id: 'fans', - // label: this.$t('appNavigation.fans'), - // icon: 'iconChevronUp', - // children: [ - // { - // id: 'fans-static', - // label: this.$t('appNavigation.statisticInformation'), - // route: '/fans-static', - // }, - // { - // id: 'fans', - // label: this.$t('appNavigation.dynamicInformation'), - // route: '/fans', - // }, - // ], - // }, + { + id: 'fans', + label: this.$t('appNavigation.fans'), + icon: 'iconChevronUp', + children: [ + { + id: 'fans-static', + label: this.$t('appNavigation.statisticInformation'), + route: '/fans-static', + }, + { + id: 'fans', + label: this.$t('appNavigation.dynamicInformation'), + route: '/fans', + }, + ], + }, // { // id: 'physical-drives', // label: this.$t('appNavigation.physicalDrives'), diff --git a/src/components/Mixins/TableFilterMixin.js b/src/components/Mixins/TableFilterMixin.js index 7a2cc540..4c3b4334 100644 --- a/src/components/Mixins/TableFilterMixin.js +++ b/src/components/Mixins/TableFilterMixin.js @@ -7,6 +7,7 @@ const TableFilterMixin = { return [...arr, ...filter.values]; }, []); // If no filters are active, then return all table data + console.log('tableData!', tableData); if (filterItems.length === 0) return tableData; // Check if row property value is included in list of @@ -20,6 +21,7 @@ const TableFilterMixin = { break; } } + console.log('returnRow!', returnRow); return returnRow; }); }, diff --git a/src/store/modules/HardwareStatus/SensorsStore.js b/src/store/modules/HardwareStatus/SensorsStore.js index 287796d9..ecf2c401 100644 --- a/src/store/modules/HardwareStatus/SensorsStore.js +++ b/src/store/modules/HardwareStatus/SensorsStore.js @@ -16,6 +16,7 @@ const SensorsStore = { }, actions: { async getAllSensors({ dispatch }) { + console.log('getAllSensors@@@'); const collection = await dispatch('getChassisCollection'); if (!collection) return; const promises = collection.reduce((acc, id) => { @@ -35,10 +36,12 @@ const SensorsStore = { .catch((error) => console.log(error)); }, async getSensors({ commit }, id) { + console.log('getSensors@@@'); const sensors = await api .get(`${id}/Sensors`) .then((response) => response.data.Members) .catch((error) => console.log(error)); + console.log('sensors@@@', sensors); if (!sensors) return; const promises = sensors.map((sensor) => { return api.get(sensor['@odata.id']).catch((error) => { diff --git a/src/views/Fans/StaticInformation/FansStaticPage.vue b/src/views/Fans/StaticInformation/FansStaticPage.vue index 7c5e6059..041046c1 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 }} {{ data.item.units }} + </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,32 @@ export default { value: '2400', }, ], + activeFilters: [], }; }, + + computed: { + allSensors() { + return this.$store.getters['sensors/sensors']; + }, + + filteredSensors() { + console.log('wow!'); + console.log('this.allSensors!', this.allSensors); + console.log('this.activeFilters!', this.activeFilters); + console.log( + 'eeeeeeeeeeeeeee!', + this.getFilteredTableData(this.allSensors, this.activeFilters) + ); + return this.getFilteredTableData(this.allSensors, this.activeFilters); + }, + }, + + created() { + this.$store.dispatch('sensors/getAllSensors').finally(() => { + this.isBusy = false; + }); + }, }; </script> <style lang="scss"> diff --git a/src/views/HardwareStatus/Sensors/Sensors.vue b/src/views/HardwareStatus/Sensors/Sensors.vue index 6329d9d8..b5ccb42f 100644 --- a/src/views/HardwareStatus/Sensors/Sensors.vue +++ b/src/views/HardwareStatus/Sensors/Sensors.vue @@ -217,6 +217,13 @@ export default { : this.filteredSensors.length; }, filteredSensors() { + console.log('wow!'); + console.log('this.allSensors!', this.allSensors); + console.log('this.activeFilters!', this.activeFilters); + console.log( + 'eeeeeeeeeeeeeee!', + this.getFilteredTableData(this.allSensors, this.activeFilters) + ); return this.getFilteredTableData(this.allSensors, this.activeFilters); }, }, |