diff --git a/.env.ibm b/.env.ibm index 2322104279..8e49efba9b 100644 --- a/.env.ibm +++ b/.env.ibm @@ -7,5 +7,4 @@ CUSTOM_APP_NAV=true CUSTOM_ROUTER=true CUSTOM_STORE=true VUE_APP_SERVER_OFF_REQUIRED=true -VUE_APP_TFTP_SERVER=false VUE_APP_ACF_UPLOAD_REQUIRED=true diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 2d2d03b596..38132fca45 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -766,8 +766,6 @@ "imageFile": "Image file", "manageAccessKeys": "Manage access keys", "startUpdate": "Start update", - "tftpServer": "TFTP server", - "tftpServerInfo": "/.tar", "workstation": "Workstation" } }, diff --git a/src/store/modules/Operations/FirmwareStore.js b/src/store/modules/Operations/FirmwareStore.js index f7d9110efe..08644ea333 100644 --- a/src/store/modules/Operations/FirmwareStore.js +++ b/src/store/modules/Operations/FirmwareStore.js @@ -9,11 +9,11 @@ const FirmwareStore = { bmcActiveFirmwareId: null, hostActiveFirmwareId: null, applyTime: null, - tftpAvailable: false, firmwareBootSide: null, + lowestSupportedFirmwareVersion: '', + showAlert: false, }, getters: { - isTftpUploadAvailable: (state) => state.tftpAvailable, isSingleFileUploadEnabled: (state) => state.hostFirmware.length === 0, activeBmcFirmware: (state) => { return state.bmcFirmware.find( @@ -36,6 +36,9 @@ const FirmwareStore = { ); }, firmwareBootSide: (state) => state.firmwareBootSide, + lowestSupportedFirmwareVersion: (state) => + state.lowestSupportedFirmwareVersion, + showAlert: (state) => state.showAlert, }, mutations: { setActiveBmcFirmwareId: (state, id) => (state.bmcActiveFirmwareId = id), @@ -45,12 +48,36 @@ const FirmwareStore = { setBmcFirmware: (state, firmware) => (state.bmcFirmware = firmware), setHostFirmware: (state, firmware) => (state.hostFirmware = firmware), setApplyTime: (state, applyTime) => (state.applyTime = applyTime), - setTftpUploadAvailable: (state, tftpAvailable) => - (state.tftpAvailable = tftpAvailable), setFirmwareBootSide: (state, firmwareBootSide) => (state.firmwareBootSide = firmwareBootSide), + setLowestSupportedFirmwareVersion: ( + state, + lowestSupportedFirmwareVersion + ) => + (state.lowestSupportedFirmwareVersion = lowestSupportedFirmwareVersion), + setShowAlert: (state, showAlert) => (state.showAlert = showAlert), }, actions: { + async getLowestSupportedFirmwareVersion({ commit, state }) { + await api.get('/redfish/v1/Managers/bmc').then((response) => + api + .get(response.data.Links.ActiveSoftwareImage['@odata.id']) + .then((response) => { + let lowestSupportedFirmware; + if (Object.keys(response.data).includes('LowestSupportedVersion')) { + state.showAlert = true; + lowestSupportedFirmware = response.data.LowestSupportedVersion; + } else { + state.showAlert = false; + } + commit( + 'setLowestSupportedFirmwareVersion', + lowestSupportedFirmware + ); + }) + ); + return this.lowestSupportedFirmwareVersion; + }, async getFirmwareInformation({ dispatch }) { dispatch('getActiveHostFirmware'); dispatch('getActiveBmcFirmware'); @@ -124,15 +151,7 @@ const FirmwareStore = { .then(({ data }) => { const applyTime = data.HttpPushUriOptions.HttpPushUriApplyTime.ApplyTime; - const allowableActions = - data?.Actions?.['#UpdateService.SimpleUpdate']?.[ - 'TransferProtocol@Redfish.AllowableValues' - ]; - commit('setApplyTime', applyTime); - if (allowableActions?.includes('TFTP')) { - commit('setTftpUploadAvailable', true); - } }) .catch((error) => console.log(error)); }, @@ -164,26 +183,6 @@ const FirmwareStore = { throw new Error(i18n.t('pageFirmware.toast.errorUploadFirmware')); }); }, - async uploadFirmwareTFTP({ state, dispatch }, fileAddress) { - const data = { - TransferProtocol: 'TFTP', - ImageURI: fileAddress, - }; - if (state.applyTime !== 'Immediate') { - // ApplyTime must be set to Immediate before making - // request to update firmware - await dispatch('setApplyTimeImmediate'); - } - return await api - .post( - '/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate', - data - ) - .catch((error) => { - console.log(error); - throw new Error(i18n.t('pageFirmware.toast.errorUpdateFirmware')); - }); - }, async switchBmcFirmwareAndReboot({ getters }) { const backupLocation = getters.backupBmcFirmware.location; const data = { diff --git a/src/views/Operations/Firmware/Firmware.vue b/src/views/Operations/Firmware/Firmware.vue index 2449f03ffa..1d6fbdfbe5 100644 --- a/src/views/Operations/Firmware/Firmware.vue +++ b/src/views/Operations/Firmware/Firmware.vue @@ -22,9 +22,17 @@ - + + + +

{{ $t('global.toast.minMifMessage') }}:

+

+ {{ lowestSupportedFirmwareVersion }} +

+
+
+
@@ -50,6 +58,7 @@ import FormUpdate from './FirmwareFormUpdate'; import HostCards from './FirmwareCardsHost'; import PageSection from '@/components/Global/PageSection'; import PageTitle from '@/components/Global/PageTitle'; +import Alert from '@/components/Global/Alert'; import LoadingBarMixin, { loading } from '@/components/Mixins/LoadingBarMixin'; @@ -63,6 +72,7 @@ export default { HostCards, PageSection, PageTitle, + Alert, }, mixins: [LoadingBarMixin], beforeRouteLeave(to, from, next) { @@ -74,6 +84,8 @@ export default { loading, isServerPowerOffRequired: process.env.VUE_APP_SERVER_OFF_REQUIRED === 'true', + lowestSupportedFirmwareVersion: '', + showAlert: false, }; }, computed: { @@ -99,6 +111,18 @@ export default { this.$store.dispatch('licenses/getLicenses'), this.$store.dispatch('firmware/getFirmwareInformation'), this.$store.dispatch('firmware/getFirmwareBootSide'), + this.$store + .dispatch('firmware/getLowestSupportedFirmwareVersion') + .then(() => { + this.lowestSupportedFirmwareVersion = this.$store.getters[ + 'firmware/lowestSupportedFirmwareVersion' + ]; + }), + this.$store + .dispatch('firmware/getLowestSupportedFirmwareVersion') + .then(() => { + this.showAlert = this.$store.getters['firmware/showAlert']; + }), ]).finally(() => this.endLoader()); }, methods: { @@ -108,3 +132,12 @@ export default { }, }; + diff --git a/src/views/Operations/Firmware/FirmwareFormUpdate.vue b/src/views/Operations/Firmware/FirmwareFormUpdate.vue index 90ad066109..7e23a37475 100644 --- a/src/views/Operations/Firmware/FirmwareFormUpdate.vue +++ b/src/views/Operations/Firmware/FirmwareFormUpdate.vue @@ -2,68 +2,26 @@
+ - - {{ $t('pageFirmware.form.updateFirmware.workstation') }} - - - {{ $t('pageFirmware.form.updateFirmware.tftpServer') }} - - - - - - - - - + + +