diff --git a/src/store/modules/HardwareStatus/PowerSupplyStore.js b/src/store/modules/HardwareStatus/PowerSupplyStore.js
index 4e9c64bce9..c923f5af80 100644
--- a/src/store/modules/HardwareStatus/PowerSupplyStore.js
+++ b/src/store/modules/HardwareStatus/PowerSupplyStore.js
@@ -13,12 +13,10 @@ const PowerSupplyStore = {
setPowerSupply: (state, data) => {
state.powerSupplies = data.map((powerSupply) => {
const {
- EfficiencyRatings,
FirmwareVersion,
+ Location,
LocationIndicatorActive,
Id,
- Location,
- Manufacturer,
Model,
Name,
PartNumber,
@@ -31,11 +29,9 @@ const PowerSupplyStore = {
health: Status.Health,
partNumber: PartNumber,
serialNumber: SerialNumber,
- efficiencyPercent: EfficiencyRatings[0].EfficiencyPercent,
firmwareVersion: FirmwareVersion,
identifyLed: LocationIndicatorActive,
locationNumber: Location?.PartLocation?.ServiceLabel,
- manufacturer: Manufacturer,
model: Model,
name: Name,
sparePartNumber: SparePartNumber,
@@ -46,25 +42,9 @@ const PowerSupplyStore = {
},
},
actions: {
- async getChassisCollection() {
+ async getAllPowerSupplies({ commit }, requestBody) {
return await api
- .get('/redfish/v1/')
- .then((response) => api.get(response.data.Chassis['@odata.id']))
- .then(({ data: { Members } }) =>
- Members.map((member) => member['@odata.id'])
- )
- .catch((error) => console.log(error));
- },
- async getAllPowerSupplies({ dispatch }) {
- const collection = await dispatch('getChassisCollection');
- if (!collection) return;
- return await api
- .all(collection.map((chassis) => dispatch('getPowerSupplies', chassis)))
- .catch((error) => console.log(error));
- },
- async getPowerSupplies({ commit }, id) {
- return await api
- .get(`${id}`)
+ .get(`${requestBody.uri}`)
.then((response) => api.get(response.data.PowerSubsystem['@odata.id']))
.then((response) => api.get(response.data.PowerSupplies['@odata.id']))
.then(({ data: { Members } }) =>
@@ -89,12 +69,10 @@ const PowerSupplyStore = {
return await api.patch(uri, updatedIdentifyLedValue).catch((error) => {
console.log(error);
if (led.identifyLed) {
- throw new Error(
- i18n.t('pageHardwareStatus.toast.errorEnableIdentifyLed')
- );
+ throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed'));
} else {
throw new Error(
- i18n.t('pageHardwareStatus.toast.errorDisableIdentifyLed')
+ i18n.t('pageInventory.toast.errorDisableIdentifyLed')
);
}
});
diff --git a/src/views/HardwareStatus/Inventory/InventoryTablePowerSupplies.vue b/src/views/HardwareStatus/Inventory/InventoryTablePowerSupplies.vue
index 316513070c..b1299eb308 100644
--- a/src/views/HardwareStatus/Inventory/InventoryTablePowerSupplies.vue
+++ b/src/views/HardwareStatus/Inventory/InventoryTablePowerSupplies.vue
@@ -19,11 +19,11 @@
no-sort-reset
hover
responsive="md"
- sort-by="health"
+ sort-by="id"
show-empty
:items="powerSupplies"
:fields="fields"
- :sort-desc="true"
+ :sort-desc="false"
:sort-compare="sortCompare"
:filter="searchFilter"
:empty-text="$t('global.table.emptyMessage')"
@@ -50,12 +50,20 @@
{{ value }}
-
+
+
+ {{
+ row.item.statusState === 'Enabled'
+ ? $t('global.status.present')
+ : $t('global.status.absent')
+ }}
+
@@ -68,52 +76,29 @@
-
+
- - {{ $t('pageInventory.table.name') }}:
+ - {{ $t('pageInventory.table.name') }}
- {{ dataFormatter(item.name) }}
- - {{ $t('pageInventory.table.partNumber') }}:
+ - {{ $t('pageInventory.table.partNumber') }}
- {{ dataFormatter(item.partNumber) }}
- - {{ $t('pageInventory.table.serialNumber') }}:
+ - {{ $t('pageInventory.table.serialNumber') }}
- {{ dataFormatter(item.serialNumber) }}
+
+
+
+
- - {{ $t('pageInventory.table.sparePartNumber') }}:
+ - {{ $t('pageInventory.table.sparePartNumber') }}
- {{ dataFormatter(item.sparePartNumber) }}
- - {{ $t('pageInventory.table.model') }}:
+ - {{ $t('pageInventory.table.bmcManagerModel') }}
- {{ dataFormatter(item.model) }}
-
-
-
-
-
- - {{ $t('pageInventory.table.statusState') }}:
- - {{ dataFormatter(item.statusState) }}
-
- - {{ $t('pageInventory.table.statusHealthRollup') }}:
- - {{ dataFormatter(item.statusHealth) }}
-
- - {{ $t('pageInventory.table.efficiencyPercent') }}:
- - {{ dataFormatter(item.efficiencyPercent) }}
-
-
-
-
-
-
-
-
- - {{ $t('pageInventory.table.manufacturer') }}:
- - {{ dataFormatter(item.manufacturer) }}
-
-
-
-
- - {{ $t('pageInventory.table.firmwareVersion') }}:
+ - {{ $t('pageInventory.table.firmwareVersion') }}
- {{ dataFormatter(item.firmwareVersion) }}
@@ -139,15 +124,23 @@ import SearchFilterMixin, {
import TableRowExpandMixin, {
expandRowLabel,
} from '@/components/Mixins/TableRowExpandMixin';
+import BVToastMixin from '@/components/Mixins/BVToastMixin';
export default {
components: { IconChevron, PageSection, StatusIcon, Search, TableCellCount },
mixins: [
+ BVToastMixin,
TableRowExpandMixin,
DataFormatterMixin,
TableSortMixin,
SearchFilterMixin,
],
+ props: {
+ chassis: {
+ type: String,
+ default: '',
+ },
+ },
data() {
return {
isBusy: true,
@@ -159,8 +152,8 @@ export default {
sortable: false,
},
{
- key: 'id',
- label: this.$t('pageInventory.table.id'),
+ key: 'name',
+ label: this.$t('pageInventory.table.name'),
formatter: this.dataFormatter,
sortable: true,
},
@@ -171,6 +164,13 @@ export default {
sortable: true,
tdClass: 'text-nowrap',
},
+ {
+ key: 'status',
+ label: this.$t('pageUserManagement.table.status'),
+ formatter: this.dataFormatter,
+ sortable: true,
+ tdClass: 'text-nowrap',
+ },
{
key: 'locationNumber',
label: this.$t('pageInventory.table.locationNumber'),
@@ -197,13 +197,35 @@ export default {
powerSupplies() {
return this.$store.getters['powerSupply/powerSupplies'];
},
+ serverStatus() {
+ if (this.chassis.endsWith('chassis')) {
+ return false;
+ } else if (this.$store.getters['global/serverStatus'] !== 'on') {
+ return true;
+ } else {
+ return false;
+ }
+ },
+ },
+ watch: {
+ chassis: function (value) {
+ this.$store
+ .dispatch('powerSupply/getAllPowerSupplies', { uri: value })
+ .finally(() => {
+ // Emit initial data fetch complete to parent component
+ this.$root.$emit('hardware-status-power-supplies-complete');
+ this.isBusy = false;
+ });
+ },
},
created() {
- this.$store.dispatch('powerSupply/getAllPowerSupplies').finally(() => {
- // Emit initial data fetch complete to parent component
- this.$root.$emit('hardware-status-power-supplies-complete');
- this.isBusy = false;
- });
+ this.$store
+ .dispatch('powerSupply/getAllPowerSupplies', { uri: this.chassis })
+ .finally(() => {
+ // Emit initial data fetch complete to parent component
+ this.$root.$emit('hardware-status-power-supplies-complete');
+ this.isBusy = false;
+ });
},
methods: {
sortCompare(a, b, key) {
@@ -220,7 +242,6 @@ export default {
uri: row.uri,
identifyLed: row.identifyLed,
})
- .then((message) => this.successToast(message))
.catch(({ message }) => this.errorToast(message));
},
},