summaryrefslogtreecommitdiff
path: root/src/views/_sila/Overview/Inventory
diff options
context:
space:
mode:
authorMaksim Zakharov <m.zakharov@IBS.RU>2022-08-19 12:23:37 +0300
committerMaksim Zakharov <m.zakharov@IBS.RU>2022-08-19 12:23:37 +0300
commitb48f10ff093fc631761d25200b671803410564a5 (patch)
tree757d9bef16b2f91c0fbb8775d4c0456ed505dead /src/views/_sila/Overview/Inventory
parent924984aef67f97e74857789c412ae798bd0bd47c (diff)
downloadwebui-vue-b48f10ff093fc631761d25200b671803410564a5.tar.xz
remove PCI devices to Inventory
Diffstat (limited to 'src/views/_sila/Overview/Inventory')
-rw-r--r--src/views/_sila/Overview/Inventory/Inventory.vue16
-rw-r--r--src/views/_sila/Overview/Inventory/InventoryPciDevices.vue144
2 files changed, 152 insertions, 8 deletions
diff --git a/src/views/_sila/Overview/Inventory/Inventory.vue b/src/views/_sila/Overview/Inventory/Inventory.vue
index 3bf9433f..cf909423 100644
--- a/src/views/_sila/Overview/Inventory/Inventory.vue
+++ b/src/views/_sila/Overview/Inventory/Inventory.vue
@@ -44,7 +44,7 @@
<table-processors ref="processors" class="inventory-scroll" />
<!-- Assembly table -->
- <table-assembly ref="assembly" class="inventory-scroll" />
+ <pci-devices ref="pci" class="inventory-scroll" />
</b-container>
</template>
@@ -58,7 +58,7 @@ import TableFans from './InventoryTableFans';
import TableBmcManager from './InventoryTableBmcManager';
import TableChassis from './InventoryTableChassis';
import TableProcessors from './InventoryTableProcessors';
-import TableAssembly from './InventoryTableAssembly';
+import PciDevices from './InventoryPciDevices';
import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin';
import PageSection from '@/components/_sila/Global/PageSection';
import JumpLinkMixin from '@/components/_sila/Mixins/JumpLinkMixin';
@@ -75,7 +75,7 @@ export default {
TableBmcManager,
TableChassis,
TableProcessors,
- TableAssembly,
+ PciDevices,
PageSection,
},
mixins: [LoadingBarMixin, JumpLinkMixin],
@@ -131,10 +131,10 @@ export default {
linkText: this.$t('pageInventory.processors'),
},
{
- id: 'assembly',
- dataRef: 'assembly',
- href: '#assembly',
- linkText: this.$t('pageInventory.assemblies'),
+ id: 'pci',
+ dataRef: 'pci',
+ href: '#pci',
+ linkText: this.$t('pageInventory.pci'),
},
],
};
@@ -174,7 +174,7 @@ export default {
this.$root.$on('hardware-status-system-complete', () => resolve());
});
const assemblyTablePromise = new Promise((resolve) => {
- this.$root.$on('hardware-status-assembly-complete', () => resolve());
+ this.$root.$on('hardware-status-pci-complete', () => resolve());
});
// Combine all child component Promises to indicate
// when page data load complete
diff --git a/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue b/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue
new file mode 100644
index 00000000..ff1255ce
--- /dev/null
+++ b/src/views/_sila/Overview/Inventory/InventoryPciDevices.vue
@@ -0,0 +1,144 @@
+<template>
+ <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"
+ >
+ <template #cell(expandRow)="row">
+ <b-button
+ v-if="items[row.index].DeviceType !== 'SingleFunction'"
+ variant="link"
+ :title="expandRowLabel"
+ class="btn-icon-only"
+ @click="toggleRowDetails(row)"
+ >
+ <icon-chevron />
+ <span class="sr-only">{{ expandRowLabel }}</span>
+ </b-button>
+ </template>
+ <template #cell(DeviceName)="data">
+ <span v-if="items[data.index].DeviceType === 'SingleFunction'">
+ {{ data.value }}</span
+ >
+ <span v-else>
+ {{
+ items[data.index].Functions[0].DeviceName
+ ? items[data.index].Functions[0].DeviceName
+ : '--'
+ }}</span
+ >
+ </template>
+ <template #cell(health)>
+ <status-icon :status="statusIcon('OK')" />
+ {{ $t('pagePci.table.health_d') }}
+ </template>
+ <template #cell(deviceClass)="data">
+ <span v-if="items[data.index].DeviceType === 'SingleFunction'">
+ {{ data.value }}</span
+ >
+ <span v-else> {{ items[data.index].Functions[0].deviceClass }}</span>
+ </template>
+ <template #row-details="data">
+ <b-container fluid>
+ <b-row v-for="item in data.item.Functions" :key="item.deviceId">
+ <b-col xs="6">
+ <dl>
+ <dt>{{ $t('pagePci.table.name') }}:</dt>
+ <dd>{{ dataFormatter(item.DeviceName) }}</dd>
+ </dl>
+ </b-col>
+ <b-col xs="6">
+ <dl>
+ <dt>{{ $t('pagePci.table.type') }}:</dt>
+ <dd>{{ dataFormatter(item.deviceClass) }}</dd>
+ </dl>
+ </b-col>
+ </b-row>
+ </b-container>
+ </template>
+ </b-table>
+ </page-section>
+</template>
+
+<script>
+import PageSection from '@/components/_sila/Global/PageSection';
+import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
+import StatusIcon from '@/components/_sila/Global/StatusIcon';
+
+import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin';
+import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin';
+import TableRowExpandMixin, {
+ expandRowLabel,
+} from '@/components/_ibs/Mixins/TableRowExpandMixin';
+
+export default {
+ components: { PageSection, StatusIcon, IconChevron },
+ mixins: [DataFormatterMixin, LoadingBarMixin, TableRowExpandMixin],
+ data() {
+ return {
+ isBusy: true,
+ fields: [
+ {
+ key: 'expandRow',
+ label: '',
+ tdClass: 'table-row-expand',
+ sortable: false,
+ },
+ {
+ key: 'DeviceName',
+ label: this.$t('pagePci.table.name'),
+ formatter: this.dataFormatter,
+ },
+ {
+ key: 'health',
+ label: this.$t('pagePci.table.health'),
+ formatter: this.dataFormatter,
+ tdClass: 'text-nowrap',
+ },
+ {
+ key: 'deviceClass',
+ label: this.$t('pagePci.table.class'),
+ formatter: this.dataFormatter,
+ },
+ {
+ key: 'DeviceType',
+ label: this.$t('pagePci.table.type'),
+ formatter: this.dataFormatter,
+ },
+ {
+ key: 'manufacturer',
+ label: this.$t('pagePci.table.manufacturer'),
+ formatter: this.dataFormatter,
+ },
+ ],
+ expandRowLabel: expandRowLabel,
+ };
+ },
+
+ computed: {
+ items() {
+ return this.$store.getters['pci/pciDevices'];
+ },
+ },
+
+ created() {
+ return this.$store
+ .dispatch('pci/getDevices')
+ .then(() => {
+ return this.$store.dispatch('pci/getDevicesMembers');
+ })
+ .then(() => {
+ this.$store.dispatch('pci/getFunctionDevices');
+ })
+ .finally(() => {
+ this.$root.$emit('hardware-status-pci-complete');
+ this.isBusy = false;
+ });
+ },
+};
+</script>