summaryrefslogtreecommitdiff
path: root/src/store/modules/Configuration/FirmwareStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/Configuration/FirmwareStore.js')
-rw-r--r--src/store/modules/Configuration/FirmwareStore.js72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/store/modules/Configuration/FirmwareStore.js b/src/store/modules/Configuration/FirmwareStore.js
index c99e7eb8..be9f50b6 100644
--- a/src/store/modules/Configuration/FirmwareStore.js
+++ b/src/store/modules/Configuration/FirmwareStore.js
@@ -10,8 +10,8 @@ import i18n from '@/i18n';
*/
function getBackupFirmwareLocation(list, currentLocation) {
return list
- .map(item => item['@odata.id'])
- .find(location => {
+ .map((item) => item['@odata.id'])
+ .find((location) => {
const id = location.split('/').pop();
const currentId = currentLocation.split('/').pop();
return id !== currentId;
@@ -27,7 +27,7 @@ const FirmwareStore = {
currentLocation: null,
backupVersion: null,
backupState: null,
- backupLocation: null
+ backupLocation: null,
},
hostFirmware: {
currentVersion: null,
@@ -35,19 +35,19 @@ const FirmwareStore = {
currentLocation: null,
backupVersion: null,
backupState: null,
- backupLocation: null
+ backupLocation: null,
},
- applyTime: null
+ applyTime: null,
},
getters: {
- bmcFirmwareCurrentVersion: state => state.bmcFirmware.currentVersion,
- bmcFirmwareCurrentState: state => state.bmcFirmware.currentState,
- bmcFirmwareBackupVersion: state => state.bmcFirmware.backupVersion,
- bmcFirmwareBackupState: state => state.bmcFirmware.backupState,
- hostFirmwareCurrentVersion: state => state.hostFirmware.currentVersion,
- hostFirmwareCurrentState: state => state.hostFirmware.currentState,
- hostFirmwareBackupVersion: state => state.hostFirmware.backupVersion,
- hostFirmwareBackupState: state => state.hostFirmware.backupState
+ bmcFirmwareCurrentVersion: (state) => state.bmcFirmware.currentVersion,
+ bmcFirmwareCurrentState: (state) => state.bmcFirmware.currentState,
+ bmcFirmwareBackupVersion: (state) => state.bmcFirmware.backupVersion,
+ bmcFirmwareBackupState: (state) => state.bmcFirmware.backupState,
+ hostFirmwareCurrentVersion: (state) => state.hostFirmware.currentVersion,
+ hostFirmwareCurrentState: (state) => state.hostFirmware.currentState,
+ hostFirmwareBackupVersion: (state) => state.hostFirmware.backupVersion,
+ hostFirmwareBackupState: (state) => state.hostFirmware.backupState,
},
mutations: {
setBmcFirmwareCurrent: (state, { version, location, status }) => {
@@ -70,13 +70,13 @@ const FirmwareStore = {
state.hostFirmware.backupState = status;
state.hostFirmware.backupLocation = location;
},
- setApplyTime: (state, applyTime) => (state.applyTime = applyTime)
+ setApplyTime: (state, applyTime) => (state.applyTime = applyTime),
},
actions: {
async getFirmwareInformation({ dispatch }) {
return await api.all([
dispatch('getBmcFirmware'),
- dispatch('getHostFirmware')
+ dispatch('getHostFirmware'),
]);
},
async getBmcFirmware({ commit }) {
@@ -102,15 +102,15 @@ const FirmwareStore = {
commit('setBmcFirmwareCurrent', {
version: currentData?.data?.Version,
location: currentData?.data?.['@odata.id'],
- status: currentData?.data?.Status?.State
+ status: currentData?.data?.Status?.State,
});
commit('setBmcFirmwareBackup', {
version: backupData.data?.Version,
location: backupData.data?.['@odata.id'],
- status: backupData.data?.Status?.State
+ status: backupData.data?.Status?.State,
});
})
- .catch(error => console.log(error));
+ .catch((error) => console.log(error));
},
async getHostFirmware({ commit }) {
return await api
@@ -134,15 +134,15 @@ const FirmwareStore = {
commit('setHostFirmwareCurrent', {
version: currentData?.data?.Version,
location: currentData?.data?.['@odata.id'],
- status: currentData?.data?.Status?.State
+ status: currentData?.data?.Status?.State,
});
commit('setHostFirmwareBackup', {
version: backupData.data?.Version,
location: backupData.data?.['@odata.id'],
- status: backupData.data?.Status?.State
+ status: backupData.data?.Status?.State,
});
})
- .catch(error => console.log(error));
+ .catch((error) => console.log(error));
},
getUpdateServiceApplyTime({ commit }) {
api
@@ -152,20 +152,20 @@ const FirmwareStore = {
data.HttpPushUriOptions.HttpPushUriApplyTime.ApplyTime;
commit('setApplyTime', applyTime);
})
- .catch(error => console.log(error));
+ .catch((error) => console.log(error));
},
setApplyTimeImmediate({ commit }) {
const data = {
HttpPushUriOptions: {
HttpPushUriApplyTime: {
- ApplyTime: 'Immediate'
- }
- }
+ ApplyTime: 'Immediate',
+ },
+ },
};
return api
.patch('/redfish/v1/UpdateService', data)
.then(() => commit('setApplyTime', 'Immediate'))
- .catch(error => console.log(error));
+ .catch((error) => console.log(error));
},
async uploadFirmware({ state, dispatch }, image) {
if (state.applyTime !== 'Immediate') {
@@ -175,11 +175,11 @@ const FirmwareStore = {
}
return await api
.post('/redfish/v1/UpdateService', image, {
- headers: { 'Content-Type': 'application/octet-stream' }
+ headers: { 'Content-Type': 'application/octet-stream' },
})
.then(() => dispatch('getSystemFirwareVersion'))
.then(() => i18n.t('pageFirmware.toast.successUploadMessage'))
- .catch(error => {
+ .catch((error) => {
console.log(error);
throw new Error(i18n.t('pageFirmware.toast.errorUploadAndReboot'));
});
@@ -187,7 +187,7 @@ const FirmwareStore = {
async uploadFirmwareTFTP({ state, dispatch }, { address, filename }) {
const data = {
TransferProtocol: 'TFTP',
- ImageURI: `${address}/${filename}`
+ ImageURI: `${address}/${filename}`,
};
if (state.applyTime !== 'Immediate') {
// ApplyTime must be set to Immediate before making
@@ -201,7 +201,7 @@ const FirmwareStore = {
)
.then(() => dispatch('getSystemFirwareVersion'))
.then(() => i18n.t('pageFirmware.toast.successUploadMessage'))
- .catch(error => {
+ .catch((error) => {
console.log(error);
throw new Error(i18n.t('pageFirmware.toast.errorUploadAndReboot'));
});
@@ -211,19 +211,19 @@ const FirmwareStore = {
const data = {
Links: {
ActiveSoftwareImage: {
- '@odata.id': backupLoaction
- }
- }
+ '@odata.id': backupLoaction,
+ },
+ },
};
return await api
.patch('/redfish/v1/Managers/bmc', data)
.then(() => i18n.t('pageFirmware.toast.successRebootFromBackup'))
- .catch(error => {
+ .catch((error) => {
console.log(error);
throw new Error(i18n.t('pageFirmware.toast.errorRebootFromBackup'));
});
- }
- }
+ },
+ },
};
export default FirmwareStore;