Skip to content

Commit

Permalink
Displaying MinMif on GUI (#264)
Browse files Browse the repository at this point in the history
* Displaying MinMif on GUI

- Displaying the minimum firmware version on GUI
- Defect - https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=594018
- Jira Story - https://jsw.ibm.com/browse/PFEBMC-2049

Signed-off-by: Vedangi Mittal <[email protected]>

* Update FirmwareStore.js

Fixed Variable name

* Update Firmware.vue

Made Version value bold

* Update Firmware.vue

Fixed indentation

---------

Signed-off-by: Vedangi Mittal <[email protected]>
Co-authored-by: Nikhil Ashoka <[email protected]>
  • Loading branch information
vedangimittal and Nikhil-Ashoka authored Aug 7, 2024
1 parent d6e3684 commit 65bd39b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 3 deletions.
31 changes: 31 additions & 0 deletions src/store/modules/Operations/FirmwareStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const FirmwareStore = {
hostActiveFirmwareId: null,
applyTime: null,
firmwareBootSide: null,
lowestSupportedFirmwareVersion: '',
showAlert: false,
},
getters: {
isSingleFileUploadEnabled: (state) => state.hostFirmware.length === 0,
Expand All @@ -34,6 +36,9 @@ const FirmwareStore = {
);
},
firmwareBootSide: (state) => state.firmwareBootSide,
lowestSupportedFirmwareVersion: (state) =>
state.lowestSupportedFirmwareVersion,
showAlert: (state) => state.showAlert,
},
mutations: {
setActiveBmcFirmwareId: (state, id) => (state.bmcActiveFirmwareId = id),
Expand All @@ -45,8 +50,34 @@ const FirmwareStore = {
setApplyTime: (state, applyTime) => (state.applyTime = applyTime),
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');
Expand Down
39 changes: 36 additions & 3 deletions src/views/Operations/Firmware/Firmware.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@
</b-row>

<!-- Update firmware-->
<page-section
:section-title="$t('pageFirmware.sectionTitleUpdateFirmware')"
>
<page-section :section-title="$t('pageFirmware.sectionTitleUpdateFirmware')"
><b-row>
<b-col sm="14" md="10" xl="6">
<alert :show="showAlert" variant="info" class="mb-5">
<p class="mb-0 p1">{{ $t('global.toast.minMifMessage') }}:</p>
<p class="font-weight-bold p2">
{{ lowestSupportedFirmwareVersion }}
</p>
</alert>
</b-col>
</b-row>
<b-row>
<b-col class="mb-4" sm="8" md="6" xl="4">
<!-- Update form -->
Expand All @@ -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';
Expand All @@ -63,6 +72,7 @@ export default {
HostCards,
PageSection,
PageTitle,
Alert,
},
mixins: [LoadingBarMixin],
beforeRouteLeave(to, from, next) {
Expand All @@ -74,6 +84,8 @@ export default {
loading,
isServerPowerOffRequired:
process.env.VUE_APP_SERVER_OFF_REQUIRED === 'true',
lowestSupportedFirmwareVersion: '',
showAlert: false,
};
},
computed: {
Expand All @@ -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: {
Expand All @@ -108,3 +132,12 @@ export default {
},
};
</script>
<style scoped>
.p1 {
display: inline-block;
}
.p2 {
margin-left: 5px;
display: inline-block;
}
</style>

0 comments on commit 65bd39b

Please sign in to comment.