diff options
author | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-08-12 16:32:04 +0300 |
---|---|---|
committer | Maksim Zakharov <m.zakharov@IBS.RU> | 2022-08-12 16:32:04 +0300 |
commit | db29a8672f6737a3b112b22db53fae3366c67097 (patch) | |
tree | 539a30a46c870fc75208f72521ae6813b426bf3d /src/views | |
parent | 162e0d338f5423662829e6d9784186a362a19832 (diff) | |
download | webui-vue-db29a8672f6737a3b112b22db53fae3366c67097.tar.xz |
add PCI-devices page
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/_sila/PciDevices/PciDevices.vue | 72 | ||||
-rw-r--r-- | src/views/_sila/PciDevices/index.js | 2 |
2 files changed, 74 insertions, 0 deletions
diff --git a/src/views/_sila/PciDevices/PciDevices.vue b/src/views/_sila/PciDevices/PciDevices.vue new file mode 100644 index 00000000..76453a3a --- /dev/null +++ b/src/views/_sila/PciDevices/PciDevices.vue @@ -0,0 +1,72 @@ +<template> + <b-container fluid="xl"> + <page-title /> + <page-section :section-title="$t('pagePci.title')"> + <b-table + responsive="md" + show-empty + hover + :items="items" + :fields="fields" + :empty-text="$t('global.table.emptyMessage')" + :busy="isBusy" + > + </b-table> + </page-section> + </b-container> +</template> + +<script> +import PageTitle from '@/components/_sila/Global/PageTitle'; +import PageSection from '@/components/_sila/Global/PageSection'; + +import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin'; +import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin'; + +export default { + components: { PageTitle, PageSection }, + mixins: [DataFormatterMixin, LoadingBarMixin], + data() { + return { + isBusy: true, + fields: [ + { + key: 'id', + label: this.$t('pagePci.table.id'), + formatter: this.dataFormatter, + tdClass: 'text-nowrap', + }, + { + key: 'name', + label: this.$t('pagePci.table.name'), + formatter: this.dataFormatter, + }, + { + key: 'type', + label: this.$t('pagePci.table.type'), + formatter: this.dataFormatter, + }, + { + key: 'manufacturer', + label: this.$t('pagePci.table.manufacturer'), + formatter: this.dataFormatter, + }, + ], + }; + }, + + computed: { + items() { + return this.$store.getters['pci/pciDevices']; + }, + }, + + created() { + this.startLoader(); + this.$store.dispatch('pci/getDevices').finally(() => { + this.endLoader(); + this.isBusy = false; + }); + }, +}; +</script> diff --git a/src/views/_sila/PciDevices/index.js b/src/views/_sila/PciDevices/index.js new file mode 100644 index 00000000..800bd92a --- /dev/null +++ b/src/views/_sila/PciDevices/index.js @@ -0,0 +1,2 @@ +import PciDevices from './PciDevices.vue'; +export default PciDevices; |