Skip to content

Commit

Permalink
Rename host firmware to bios firmware
Browse files Browse the repository at this point in the history
Problem:
- Host firmware naming was inconsistent with actual functionality

Changes:
- Rename hostFirmware to biosFirmware in store
- Update component names and references
- Modify i18n translation keys

Tested:
- Verified store mutations/actions
- Confirmed component rendering
- Checked i18n translations
- npx eslint without error related to 'host'

Change-Id: Ib97e4682f649d4a52f65e69df50422d84f23e916
Signed-off-by: Shane Lin <hslin@nvidia.com>
  • Loading branch information
x86driver committed Feb 4, 2025
1 parent 6e53b14 commit 85b2d31
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
"cardTitleRunning": "Running image",
"sectionTitleBmcCards": "BMC",
"sectionTitleBmcCardsCombined": "BMC and server",
"sectionTitleHostCards": "Host",
"sectionTitleBiosCards": "BIOS",
"sectionTitleUpdateFirmware": "Update firmware",
"alert": {
"operationInProgress": "Server power operation in progress.",
Expand Down
2 changes: 1 addition & 1 deletion src/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
"cardTitleRunning": "Рабочий образ",
"sectionTitleBmcCards": "BMC",
"sectionTitleBmcCardsCombined": "BMC и сервер",
"sectionTitleHostCards": "Хост",
"sectionTitleBiosCards": "BIOS",
"sectionTitleUpdateFirmware": "Обновить встроенное ПО",
"alert": {
"operationInProgress": "Выполняется операция управления питанием сервера.",
Expand Down
34 changes: 17 additions & 17 deletions src/store/modules/Operations/FirmwareStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,49 @@ const FirmwareStore = {
namespaced: true,
state: {
bmcFirmware: [],
hostFirmware: [],
biosFirmware: [],
bmcActiveFirmwareId: null,
hostActiveFirmwareId: null,
biosActiveFirmwareId: null,
applyTime: null,
multipartHttpPushUri: null,
httpPushUri: null,
},
getters: {
isSingleFileUploadEnabled: (state) => state.hostFirmware.length === 0,
isSingleFileUploadEnabled: (state) => state.biosFirmware.length === 0,
activeBmcFirmware: (state) => {
return state.bmcFirmware.find(
(firmware) => firmware.id === state.bmcActiveFirmwareId,
);
},
activeHostFirmware: (state) => {
return state.hostFirmware.find(
(firmware) => firmware.id === state.hostActiveFirmwareId,
activeBiosFirmware: (state) => {
return state.biosFirmware.find(
(firmware) => firmware.id === state.biosActiveFirmwareId,
);
},
backupBmcFirmware: (state) => {
return state.bmcFirmware.find(
(firmware) => firmware.id !== state.bmcActiveFirmwareId,
);
},
backupHostFirmware: (state) => {
return state.hostFirmware.find(
(firmware) => firmware.id !== state.hostActiveFirmwareId,
backupBiosFirmware: (state) => {
return state.biosFirmware.find(
(firmware) => firmware.id !== state.biosActiveFirmwareId,
);
},
},
mutations: {
setActiveBmcFirmwareId: (state, id) => (state.bmcActiveFirmwareId = id),
setActiveHostFirmwareId: (state, id) => (state.hostActiveFirmwareId = id),
setActiveBiosFirmwareId: (state, id) => (state.biosActiveFirmwareId = id),
setBmcFirmware: (state, firmware) => (state.bmcFirmware = firmware),
setHostFirmware: (state, firmware) => (state.hostFirmware = firmware),
setBiosFirmware: (state, firmware) => (state.biosFirmware = firmware),
setApplyTime: (state, applyTime) => (state.applyTime = applyTime),
setHttpPushUri: (state, httpPushUri) => (state.httpPushUri = httpPushUri),
setMultipartHttpPushUri: (state, multipartHttpPushUri) =>
(state.multipartHttpPushUri = multipartHttpPushUri),
},
actions: {
async getFirmwareInformation({ dispatch }) {
dispatch('getActiveHostFirmware');
dispatch('getActiveBiosFirmware');
dispatch('getActiveBmcFirmware');
return await dispatch('getFirmwareInventory');
},
Expand All @@ -60,12 +60,12 @@ const FirmwareStore = {
})
.catch((error) => console.log(error));
},
async getActiveHostFirmware({ commit }) {
async getActiveBiosFirmware({ commit }) {
return api
.get(`${await this.dispatch('global/getSystemPath')}/Bios`)
.then(({ data: { Links } }) => {
const id = Links?.ActiveSoftwareImage['@odata.id'].split('/').pop();
commit('setActiveHostFirmwareId', id);
commit('setActiveBiosFirmwareId', id);
})
.catch((error) => console.log(error));
},
Expand All @@ -80,7 +80,7 @@ const FirmwareStore = {
.all(inventoryList)
.then((response) => {
const bmcFirmware = [];
const hostFirmware = [];
const biosFirmware = [];
response.forEach(({ data }) => {
const firmwareType = data?.RelatedItem?.[0]?.['@odata.id']
.split('/')
Expand All @@ -94,11 +94,11 @@ const FirmwareStore = {
if (firmwareType === 'bmc') {
bmcFirmware.push(item);
} else if (firmwareType === 'Bios') {
hostFirmware.push(item);
biosFirmware.push(item);
}
});
commit('setBmcFirmware', bmcFirmware);
commit('setHostFirmware', hostFirmware);
commit('setBiosFirmware', biosFirmware);
})
.catch((error) => {
console.log(error);
Expand Down
8 changes: 4 additions & 4 deletions src/views/Operations/Firmware/Firmware.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
:is-server-off="isServerOff"
/>

<!-- Host Firmware -->
<host-cards v-if="!isSingleFileUploadEnabled" />
<!-- Bios Firmware -->
<bios-cards v-if="!isSingleFileUploadEnabled" />
</b-col>
</b-row>

Expand All @@ -41,7 +41,7 @@
import AlertsServerPower from './FirmwareAlertServerPower';
import BmcCards from './FirmwareCardsBmc';
import FormUpdate from './FirmwareFormUpdate';
import HostCards from './FirmwareCardsHost';
import BiosCards from './FirmwareCardsBios';
import PageSection from '@/components/Global/PageSection';
import PageTitle from '@/components/Global/PageTitle';
Expand All @@ -54,7 +54,7 @@ export default {
AlertsServerPower,
BmcCards,
FormUpdate,
HostCards,
BiosCards,
PageSection,
PageTitle,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<page-section :section-title="$t('pageFirmware.sectionTitleHostCards')">
<page-section :section-title="$t('pageFirmware.sectionTitleBiosCards')">
<b-card-group deck>
<!-- Running image -->
<b-card>
Expand Down Expand Up @@ -49,10 +49,10 @@ export default {
},
computed: {
running() {
return this.$store.getters['firmware/activeHostFirmware'];
return this.$store.getters['firmware/activeBiosFirmware'];
},
backup() {
return this.$store.getters['firmware/backupHostFirmware'];
return this.$store.getters['firmware/backupBiosFirmware'];
},
runningVersion() {
return this.running?.version || '--';
Expand Down

0 comments on commit 85b2d31

Please sign in to comment.