summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikhil Ashoka <a.nikhil@ibm.com>2024-06-11 09:49:11 +0300
committerSurya Venkatesan <suryav@ami.com>2024-07-31 17:43:43 +0300
commit2d65f4aa2f9f8ac2c521facd1df8b5f5cf48f897 (patch)
tree2d092316828b5d9569eb3631cfe1a56e15771292
parent01aeaf04086f8eef776f9c84e0a59445bcca170c (diff)
downloadwebui-vue-2d65f4aa2f9f8ac2c521facd1df8b5f5cf48f897.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> Signed-off-by: Surya Venkatesan <suryav@ami.com> Change-Id: Icbeddc7a3faa262f12e85268206ae70850f37905
-rw-r--r--package-lock.json10
-rw-r--r--package.json1
-rw-r--r--src/locales/en-US.json1
-rw-r--r--src/locales/ru-RU.json1
-rw-r--r--src/store/modules/Operations/FirmwareStore.js28
-rw-r--r--src/views/Operations/Firmware/FirmwareFormUpdate.vue74
6 files changed, 15 insertions, 100 deletions
diff --git a/package-lock.json b/package-lock.json
index 155ad16b..922db5b5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -27,6 +27,7 @@
"vue-i18n": "9.13.1",
"vue-loader": "17.4.2",
"vue-router": "4.4.0",
+ "vuelidate": "0.7.7",
"vuex": "4.1.0",
"webpack-cli": "5.1.4",
"xterm": "4.19.0",
@@ -27089,6 +27090,15 @@
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.29.tgz",
"integrity": "sha512-hQ2gAQcBO/CDpC82DCrinJNgOHI2v+FA7BDW4lMSPeBpQ7sRe2OLHWe5cph1s7D8DUQAwRt18dBDfJJ220APEA=="
},
+ "node_modules/vuelidate": {
+ "version": "0.7.7",
+ "resolved": "https://registry.npmjs.org/vuelidate/-/vuelidate-0.7.7.tgz",
+ "integrity": "sha512-pT/U2lDI67wkIqI4tum7cMSIfGcAMfB+Phtqh2ttdXURwvHRBJEAQ0tVbUsW9Upg83Q5QH59bnCoXI7A9JDGnA==",
+ "engines": {
+ "node": ">= 4.0.0",
+ "npm": ">= 3.0.0"
+ }
+ },
"node_modules/vuepress": {
"version": "1.9.7",
"resolved": "https://registry.npmjs.org/vuepress/-/vuepress-1.9.7.tgz",
diff --git a/package.json b/package.json
index 8b593c54..f80e620f 100644
--- a/package.json
+++ b/package.json
@@ -34,6 +34,7 @@
"vue-i18n": "9.13.1",
"vue-loader": "17.4.2",
"vue-router": "4.4.0",
+ "vuelidate": "0.7.7",
"vuex": "4.1.0",
"webpack-cli": "5.1.4",
"xterm": "4.19.0",
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 e6df3fba..83871092 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));
},
@@ -136,23 +125,6 @@ const FirmwareStore = {
);
});
},
- 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.global.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 dc3161b2..c4d2c00c 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/validators';
+import { required } from 'vuelidate/lib/validators';
import BVToastMixin from '@/components/Mixins/BVToastMixin';
import LoadingBarMixin, { loading } from '@/components/Mixins/LoadingBarMixin';
@@ -108,36 +76,15 @@ export default {
return {
$t: useI18n().t,
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,
},
};
},
@@ -161,11 +108,7 @@ export default {
title: i18n.global.t('pageFirmware.toast.updateStarted'),
timestamp: true,
});
- if (this.isWorkstationSelected) {
- this.dispatchWorkstationUpload(timerId);
- } else {
- this.dispatchTftpUpload(timerId);
- }
+ this.dispatchWorkstationUpload(timerId);
},
dispatchWorkstationUpload(timerId) {
this.$store
@@ -176,15 +119,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;