summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikhil Ashoka <a.nikhil@ibm.com>2024-06-11 09:49:11 +0300
committerNikhil Ashoka <a.nikhil@ibm.com>2024-07-16 16:18:51 +0300
commitbc49e09187cab43f8564f2adb6b8860544870641 (patch)
tree47b3b12bbd84b84c52386e77e5af11e9e3e60609
parent210b12760d2c4020387e132c759ec2ae9b5f5490 (diff)
downloadwebui-vue-bc49e09187cab43f8564f2adb6b8860544870641.tar.xz
Removed TFTP code update option
- Removed TFTP server firmware update ability in the UI. Signed-off-by: Nikhil Ashoka <a.nikhil@ibm.com> Change-Id: Icbeddc7a3faa262f12e85268206ae70850f37905
-rw-r--r--src/locales/en-US.json1
-rw-r--r--src/locales/ru-RU.json1
-rw-r--r--src/store/modules/Operations/FirmwareStore.js26
-rw-r--r--src/views/Operations/Firmware/FirmwareFormUpdate.vue74
4 files changed, 4 insertions, 98 deletions
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index 44a63de3..55ff937f 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -347,7 +347,6 @@
"fileSource": "File source",
"imageFile": "Image file",
"startUpdate": "Start update",
- "tftpServer": "TFTP server",
"workstation": "Workstation"
}
},
diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json
index dcf7c597..43854d3b 100644
--- a/src/locales/ru-RU.json
+++ b/src/locales/ru-RU.json
@@ -347,7 +347,6 @@
"fileSource": "Источник файла",
"imageFile": "Файл образа",
"startUpdate": "Начать обновление",
- "tftpServer": "TFTP сервер",
"workstation": "Рабочая станция"
}
},
diff --git a/src/store/modules/Operations/FirmwareStore.js b/src/store/modules/Operations/FirmwareStore.js
index f6f965f9..ca3ed523 100644
--- a/src/store/modules/Operations/FirmwareStore.js
+++ b/src/store/modules/Operations/FirmwareStore.js
@@ -10,10 +10,8 @@ const FirmwareStore = {
hostActiveFirmwareId: null,
applyTime: null,
httpPushUri: null,
- tftpAvailable: false,
},
getters: {
- isTftpUploadAvailable: (state) => state.tftpAvailable,
isSingleFileUploadEnabled: (state) => state.hostFirmware.length === 0,
activeBmcFirmware: (state) => {
return state.bmcFirmware.find(
@@ -43,8 +41,6 @@ const FirmwareStore = {
setHostFirmware: (state, firmware) => (state.hostFirmware = firmware),
setApplyTime: (state, applyTime) => (state.applyTime = applyTime),
setHttpPushUri: (state, httpPushUri) => (state.httpPushUri = httpPushUri),
- setTftpUploadAvailable: (state, tftpAvailable) =>
- (state.tftpAvailable = tftpAvailable),
},
actions: {
async getFirmwareInformation({ dispatch }) {
@@ -111,16 +107,9 @@ const FirmwareStore = {
.then(({ data }) => {
const applyTime =
data.HttpPushUriOptions.HttpPushUriApplyTime.ApplyTime;
- const allowableActions =
- data?.Actions?.['#UpdateService.SimpleUpdate']?.[
- 'TransferProtocol@Redfish.AllowableValues'
- ];
commit('setApplyTime', applyTime);
const httpPushUri = data.HttpPushUri;
commit('setHttpPushUri', httpPushUri);
- if (allowableActions?.includes('TFTP')) {
- commit('setTftpUploadAvailable', true);
- }
})
.catch((error) => console.log(error));
},
@@ -134,21 +123,6 @@ const FirmwareStore = {
throw new Error(i18n.t('pageFirmware.toast.errorUpdateFirmware'));
});
},
- async uploadFirmwareTFTP(fileAddress) {
- const data = {
- TransferProtocol: 'TFTP',
- ImageURI: fileAddress,
- };
- 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/FirmwareFormUpdate.vue b/src/views/Operations/Firmware/FirmwareFormUpdate.vue
index ac4b23fc..4c302df6 100644
--- a/src/views/Operations/Firmware/FirmwareFormUpdate.vue
+++ b/src/views/Operations/Firmware/FirmwareFormUpdate.vue
@@ -2,21 +2,8 @@
<div>
<div class="form-background p-3">
<b-form @submit.prevent="onSubmitUpload">
- <b-form-group
- v-if="isTftpUploadAvailable"
- :label="$t('pageFirmware.form.updateFirmware.fileSource')"
- :disabled="isPageDisabled"
- >
- <b-form-radio v-model="isWorkstationSelected" :value="true">
- {{ $t('pageFirmware.form.updateFirmware.workstation') }}
- </b-form-radio>
- <b-form-radio v-model="isWorkstationSelected" :value="false">
- {{ $t('pageFirmware.form.updateFirmware.tftpServer') }}
- </b-form-radio>
- </b-form-group>
-
<!-- Workstation Upload -->
- <template v-if="isWorkstationSelected">
+ <template>
<b-form-group
:label="$t('pageFirmware.form.updateFirmware.imageFile')"
label-for="image-file"
@@ -37,25 +24,6 @@
</b-form-group>
</template>
- <!-- TFTP Server Upload -->
- <template v-else>
- <b-form-group
- :label="$t('pageFirmware.form.updateFirmware.fileAddress')"
- label-for="tftp-address"
- >
- <b-form-input
- id="tftp-address"
- v-model="tftpFileAddress"
- type="text"
- :state="getValidationState($v.tftpFileAddress)"
- :disabled="isPageDisabled"
- @input="$v.tftpFileAddress.$touch()"
- />
- <b-form-invalid-feedback role="alert">
- {{ $t('global.form.fieldRequired') }}
- </b-form-invalid-feedback>
- </b-form-group>
- </template>
<b-btn
data-test-id="firmware-button-startUpdate"
type="submit"
@@ -73,7 +41,7 @@
</template>
<script>
-import { requiredIf } from 'vuelidate/lib/validators';
+import { required } from 'vuelidate/lib/validators';
import BVToastMixin from '@/components/Mixins/BVToastMixin';
import LoadingBarMixin, { loading } from '@/components/Mixins/LoadingBarMixin';
@@ -99,36 +67,15 @@ export default {
data() {
return {
loading,
- isWorkstationSelected: true,
file: null,
- tftpFileAddress: null,
isServerPowerOffRequired:
process.env.VUE_APP_SERVER_OFF_REQUIRED === 'true',
};
},
- computed: {
- isTftpUploadAvailable() {
- return this.$store.getters['firmware/isTftpUploadAvailable'];
- },
- },
- watch: {
- isWorkstationSelected: function () {
- this.$v.$reset();
- this.file = null;
- this.tftpFileAddress = null;
- },
- },
validations() {
return {
file: {
- required: requiredIf(function () {
- return this.isWorkstationSelected;
- }),
- },
- tftpFileAddress: {
- required: requiredIf(function () {
- return !this.isWorkstationSelected;
- }),
+ required,
},
};
},
@@ -149,11 +96,7 @@ export default {
title: this.$t('pageFirmware.toast.updateStarted'),
timestamp: true,
});
- if (this.isWorkstationSelected) {
- this.dispatchWorkstationUpload(timerId);
- } else {
- this.dispatchTftpUpload(timerId);
- }
+ this.dispatchWorkstationUpload(timerId);
},
dispatchWorkstationUpload(timerId) {
this.$store
@@ -164,15 +107,6 @@ export default {
clearTimeout(timerId);
});
},
- dispatchTftpUpload(timerId) {
- this.$store
- .dispatch('firmware/uploadFirmwareTFTP', this.tftpFileAddress)
- .catch(({ message }) => {
- this.endLoader();
- this.errorToast(message);
- clearTimeout(timerId);
- });
- },
onSubmitUpload() {
this.$v.$touch();
if (this.$v.$invalid) return;