summaryrefslogtreecommitdiff
path: root/src/env/store
diff options
context:
space:
mode:
authorYoshie Muranaka <yoshiemuranaka@gmail.com>2021-02-11 20:23:14 +0300
committerDerick Montague <derick.montague@ibm.com>2021-02-17 00:00:41 +0300
commit7cc1fd48e64ff01dc80eb6323c1175b2fa42a2d0 (patch)
treef5378a6f69cc482abceca3463fdfdbca239cf135 /src/env/store
parentfc387aa2963042f4cb75c000811c99aa66abb8ff (diff)
downloadwebui-vue-7cc1fd48e64ff01dc80eb6323c1175b2fa42a2d0.tar.xz
Update single file firmware TFTP upload option
Adds API check for the UpdateService allowable values to determine whether or not a TFTP upload option is available in UI. This is part of an effort to make the firmware page more dynamic. These changes are only visisble with ibm dotenv variables. Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Change-Id: Ied8ac5fa9f0441b1a0762c7a5267e298294eea32
Diffstat (limited to 'src/env/store')
-rw-r--r--src/env/store/FirmwareSingleImage/FirmwareSingleImageStore.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/env/store/FirmwareSingleImage/FirmwareSingleImageStore.js b/src/env/store/FirmwareSingleImage/FirmwareSingleImageStore.js
index 91bcb9fe..b16cac8a 100644
--- a/src/env/store/FirmwareSingleImage/FirmwareSingleImageStore.js
+++ b/src/env/store/FirmwareSingleImage/FirmwareSingleImageStore.js
@@ -16,6 +16,7 @@ const FirmwareSingleImageStore = {
status: null,
},
applyTime: null,
+ tftpAvailable: false,
},
getters: {
systemFirmwareVersion: (state) => state.activeFirmware.version,
@@ -23,7 +24,8 @@ const FirmwareSingleImageStore = {
backupFirmwareStatus: (state) => state.backupFirmware.status,
isRebootFromBackupAvailable: (state) =>
state.backupFirmware.id ? true : false,
- bmcFirmwareCurrentVersion: (state) => state.activeFirmware.version, //this getter is needed for the Overview page
+ bmcFirmwareCurrentVersion: (state) => state.activeFirmware.version, //this getter is needed for the Overview page,
+ isTftpUploadAvailable: (state) => state.tftpAvailable,
},
mutations: {
setActiveFirmware: (state, { version, id, location }) => {
@@ -38,6 +40,8 @@ const FirmwareSingleImageStore = {
state.backupFirmware.status = status;
},
setApplyTime: (state, applyTime) => (state.applyTime = applyTime),
+ setTftpUploadAvailable: (state, tftpAvailable) =>
+ (state.tftpAvailable = tftpAvailable),
},
actions: {
async getFirmwareInformation({ commit }) {
@@ -77,13 +81,21 @@ const FirmwareSingleImageStore = {
})
.catch((error) => console.log(error));
},
- getUpdateServiceApplyTime({ commit }) {
+ getUpdateServiceSettings({ commit }) {
api
.get('/redfish/v1/UpdateService')
.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));
},