diff options
Diffstat (limited to 'src/views/_sila/Fans/StaticInformation')
-rw-r--r-- | src/views/_sila/Fans/StaticInformation/FansStaticPage.vue | 152 | ||||
-rw-r--r-- | src/views/_sila/Fans/StaticInformation/index.js | 2 |
2 files changed, 154 insertions, 0 deletions
diff --git a/src/views/_sila/Fans/StaticInformation/FansStaticPage.vue b/src/views/_sila/Fans/StaticInformation/FansStaticPage.vue new file mode 100644 index 00000000..b661bfdf --- /dev/null +++ b/src/views/_sila/Fans/StaticInformation/FansStaticPage.vue @@ -0,0 +1,152 @@ +<template> + <b-container + :style="{ display: 'flex', 'flex-direction': 'column' }" + fluid="xxl pt-0 m-0" + > + <page-title :description="$t('appNavigation.specification')" /> + <span class="bold-16px">{{ $t('tablesDescription.installedFans') }}</span> + <page-section class="bootstrap-table__section"> + <b-table + responsive="md" + show-empty + class="table-rounded" + no-border-collapse + :items="items" + :busy="isBusy" + :fields="fields" + :empty-text="$t('global.table.emptyMessage')" + > + <template #cell(status)="{ value }"> + <div v-if="value" class="fans-table-col-first__cell"> + <img class="status__img" src="@/assets/images/status/on.svg" /> + <span> + {{ $t('global.status.inWork') }} + </span> + </div> + <div v-else class="fans-table-col-first__cell"> + <img class="status__img" src="@/assets/images/_sila/status/off.svg" /> + <span> + {{ $t('global.status.outWorking') }} + </span> + </div> + </template> + <template #cell(currentValue)="data"> + {{ data.value }} + </template> + </b-table> + </page-section> + </b-container> +</template> + +<script> +import PageTitle from '@/components/Global/PageTitle'; +import PageSection from '@/components/Global/PageSection'; + +import TableFilterMixin from '@/components/Mixins/TableFilterMixin'; +import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin'; +import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin'; + +export default { + components: { PageTitle, PageSection }, + mixins: [TableFilterMixin, DataFormatterMixin, LoadingBarMixin], + data() { + return { + isBusy: true, + isAddersСolon: false, + fields: [ + { + key: 'status', + label: 'Статус', + formatter: this.dataFormatter, + thStyle: { width: '25%' }, + }, + { + key: 'name', + label: 'Имя', + formatter: this.dataFormatter, + thStyle: { width: '25%' }, + }, + { + key: 'type', + label: 'Тип', + formatter: this.dataFormatter, + thStyle: { width: '25%' }, + }, + { + key: 'currentValue', + label: 'Текущая скорость, об/мин', + formatter: this.dataFormatter, + thStyle: { width: '25%' }, + }, + ], + items: [ + { + status: true, + name: 'Венититор 1', + type: 'Системная плата', + value: '2100', + }, + { + status: true, + name: 'Венититор 2', + type: 'Системная плата', + value: '2300', + }, + { + status: false, + name: 'Венититор 3', + type: 'Системная плата', + 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.startLoader(); + this.$store.dispatch('sensors/getFanSensors').finally(() => { + this.endLoader(); + this.isBusy = false; + }); + }, +}; +</script> +<style lang="scss" scoped> +.row { + margin: 0px; +} + +.status__img { + margin-right: 7px; +} + +.bold-16px { + margin: 24px 0 0 2rem; +} +</style> diff --git a/src/views/_sila/Fans/StaticInformation/index.js b/src/views/_sila/Fans/StaticInformation/index.js new file mode 100644 index 00000000..9a5d913d --- /dev/null +++ b/src/views/_sila/Fans/StaticInformation/index.js @@ -0,0 +1,2 @@ +import FansStaticPage from './FansStaticPage.vue'; +export default FansStaticPage; |