From 0f8a4e3bb69556341578bfec38f62403c298663e Mon Sep 17 00:00:00 2001 From: Nikhil Ashoka <96164786+Nikhil-Ashoka@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:17:41 +0530 Subject: [PATCH 01/15] Implemented Predictive dynamic memory deallocation (#258) - Added Predictive dynamic memory deallocation to enable and disable in Memory page. - JIRA: https://jsw.ibm.com/browse/PFEBMC-2309 Signed-off-by: Nikhil Ashoka --- src/locales/en-US.json | 5 ++ .../ResourceManagement/ResourceMemoryStore.js | 50 +++++++++++++ .../ResourceManagement/Memory/Memory.vue | 74 +++++++++++++++++++ 3 files changed, 129 insertions(+) diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 38132fca45..f4203bd631 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -1135,6 +1135,9 @@ "logicalMemorySizeHeading": "Logical memory block size is used for partitioning. Changing the logical memory block size impacts system resource management.", "maxNumHugePages": "Max number huge pages", "memoryBlockSize": "Memory block size", + "predictiveMemoryGuardHeader": "Predictive Memory Guard", + "predictiveMemoryGuardTitle": "Predictive dynamic memory deallocation", + "predictiveMemoryGuardDescription": "Enable or Disable Predictive Guard for Memory Errors.", "requestedHugePageMemory": "Requested huge page memory", "slotCountForNode0": "Slot Count for Node 0", "systemMemoryPageSetup": "Improve the application's performance by setting large virtual memory page sizes of 16GB each.", @@ -1157,6 +1160,7 @@ }, "toast": { "errorSavingActiveMemoryMirroringMode": "Error updating active memory mirroring mode", + "errorSavingPredictiveMemoryGuard": "Error updating predictive dynamic memory deallocation", "errorSavingAdapterEnlargedCapacity": "Error updating I/O adapter enlarged capacity", "errorSavingLogicalMemory": "Error updating logical memory block size ", "errorSavingPageSetup": "Error updating system memory page setup", @@ -1164,6 +1168,7 @@ "successSavingAdapterEnlargedCapacity": "Successfully updated I/O adapter enlarged capacity", "successSavingLogicalMemory": "Successfully updated logical memory block size", "successSavingActiveMemoryMirroringMode": "Successfully updated active memory mirroring mode", + "successSavingPredictiveMemoryGuard": "Successfully updated predictive dynamic memory deallocation", "successSavingPageSetup": "Successfully updated system memory page setup", "successSavingAdapterDynamicCapacity": "Successfully updated I/O adapter drawer attachment", "errorSavingAdapterDynamicCapacity": "Error updating dynamic I/O adapter drawer attachment" diff --git a/src/store/modules/ResourceManagement/ResourceMemoryStore.js b/src/store/modules/ResourceManagement/ResourceMemoryStore.js index 6c16ddecdf..ae4677a59a 100644 --- a/src/store/modules/ResourceManagement/ResourceMemoryStore.js +++ b/src/store/modules/ResourceManagement/ResourceMemoryStore.js @@ -13,6 +13,7 @@ const ResourceMemoryStore = { numHugePages: null, hmcManaged: null, memoryMirroringMode: null, + predictiveMemoryGuard: null, }, getters: { logicalMemorySizeOptions: (state) => state.logicalMemorySizeOptions, @@ -25,6 +26,7 @@ const ResourceMemoryStore = { numHugePages: (state) => state.numHugePages, hmcManaged: (state) => state.hmcManaged, memoryMirroringMode: (state) => state.memoryMirroringMode, + predictiveMemoryGuard: (state) => state.predictiveMemoryGuard, }, mutations: { setLogicalMemorySizeOptions: (state, logicalMemorySizeOptions) => @@ -47,6 +49,8 @@ const ResourceMemoryStore = { setHmcManaged: (state, hmcManaged) => (state.hmcManaged = hmcManaged), setMemoryMirroringMode: (state, memoryMirroringMode) => (state.memoryMirroringMode = memoryMirroringMode), + setPredictiveMemoryGuard: (state, predictiveMemoryGuard) => + (state.predictiveMemoryGuard = predictiveMemoryGuard), }, actions: { async getMemorySizeOptions({ commit }) { @@ -204,6 +208,52 @@ const ResourceMemoryStore = { ); }); }, + async getPredictiveMemoryGuard({ commit }) { + return await api + .get( + '/redfish/v1/Registries/BiosAttributeRegistry/BiosAttributeRegistry' + ) + .then(({ data: { RegistryEntries } }) => { + const predictiveMemoryGuard = RegistryEntries.Attributes.filter( + (Attribute) => Attribute.AttributeName == 'hb_predictive_mem_guard' + ); + if (predictiveMemoryGuard.length > 0) { + let predictiveMemoryGuardValue = + predictiveMemoryGuard[0].CurrentValue; + let predictiveMemValue = + predictiveMemoryGuardValue == 'Enabled' ? true : false; + commit('setPredictiveMemoryGuard', predictiveMemValue); + } + }) + .catch((error) => console.log(error)); + }, + async savePredictiveMemoryGuard( + { commit }, + activePredictiveMemoryGuardValue + ) { + let updatedMirroringModeValue = activePredictiveMemoryGuardValue + ? 'Enabled' + : 'Disabled'; + commit('setPredictiveMemoryGuard', activePredictiveMemoryGuardValue); + const updatedPredictiveMemoryGuard = { + Attributes: { hb_predictive_mem_guard: updatedMirroringModeValue }, + }; + return api + .patch( + '/redfish/v1/Systems/system/Bios/Settings', + updatedPredictiveMemoryGuard + ) + .then(() => { + return i18n.t('pageMemory.toast.successSavingPredictiveMemoryGuard'); + }) + .catch((error) => { + console.log(error); + commit('setPredictiveMemoryGuard', !activePredictiveMemoryGuardValue); + throw new Error( + i18n.t('pageMemory.toast.errorSavingPredictiveMemoryGuard') + ); + }); + }, async savePageSetup({ commit }) { const updatedNumHugePages = { Attributes: { diff --git a/src/views/ResourceManagement/Memory/Memory.vue b/src/views/ResourceManagement/Memory/Memory.vue index 9b507ddc6d..dc5952fe17 100644 --- a/src/views/ResourceManagement/Memory/Memory.vue +++ b/src/views/ResourceManagement/Memory/Memory.vue @@ -306,6 +306,59 @@ +
+ + + +

{{ $t('pageMemory.predictiveMemoryGuardDescription') }}

+
+
+ + +
+
+ {{ $t('pageMemory.predictiveMemoryGuardHeader') }} +
+
+ + {{ '--' }} + + + {{ $t('global.status.enabled') }} + + {{ $t('global.status.disabled') }} +
+
+ + {{ '--' }} + + + + {{ $t('global.status.enabled') }} + + {{ $t('global.status.disabled') }} + +
+
+
+
+
@@ -363,6 +416,12 @@ export default { href: '#toggleActiveMemoryMirroring', linkText: this.$t('pageMemory.activeMemoryMirroringTitle'), }, + { + id: 'togglePredictiveMemoryGuard', + dataRef: 'togglePredictiveMemoryGuard', + href: '#togglePredictiveMemoryGuard', + linkText: this.$t('pageMemory.predictiveMemoryGuardTitle'), + }, ], }; }, @@ -379,6 +438,14 @@ export default { return newValue; }, }, + predictiveMemoryGuardState: { + get() { + return this.$store.getters['resourceMemory/predictiveMemoryGuard']; + }, + set(newValue) { + return newValue; + }, + }, maxHugePageLimit() { return this.$store.getters['resourceMemory/maxNumHugePages']; }, @@ -456,6 +523,7 @@ export default { this.$store.dispatch('resourceMemory/getMaxNumHugePages'), this.$store.dispatch('resourceMemory/getHmcManaged'), this.$store.dispatch('resourceMemory/getActiveMemoryMirroring'), + this.$store.dispatch('resourceMemory/getPredictiveMemoryGuard'), ]).finally(() => this.endLoader()); }, methods: { @@ -517,6 +585,12 @@ export default { .then((message) => this.successToast(message)) .catch(({ message }) => this.errorToast(message)); }, + changePredictiveMemoryGuardState(state) { + this.$store + .dispatch('resourceMemory/savePredictiveMemoryGuard', state) + .then((message) => this.successToast(message)) + .catch(({ message }) => this.errorToast(message)); + }, }, }; From 263b39f27d0ef550d4be22e08a69318ef6530d8a Mon Sep 17 00:00:00 2001 From: vedangimittal <69679625+vedangimittal@users.noreply.github.com> Date: Wed, 21 Aug 2024 21:31:47 +0530 Subject: [PATCH 02/15] Made changes in API to upload firmware via GUI (#266) - Made changes in API to upload firmware via GUI - Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=637715 Signed-off-by: Vedangi Mittal --- src/store/modules/Operations/FirmwareStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/Operations/FirmwareStore.js b/src/store/modules/Operations/FirmwareStore.js index 08644ea333..f430057191 100644 --- a/src/store/modules/Operations/FirmwareStore.js +++ b/src/store/modules/Operations/FirmwareStore.js @@ -175,7 +175,7 @@ const FirmwareStore = { await dispatch('setApplyTimeImmediate'); } return await api - .post('/redfish/v1/UpdateService', image, { + .post('/redfish/v1/UpdateService/update', image, { headers: { 'Content-Type': 'application/octet-stream' }, }) .catch((error) => { From a117fd1574c16f7c76817218d0a1bd9a8c3b6669 Mon Sep 17 00:00:00 2001 From: vedangimittal <69679625+vedangimittal@users.noreply.github.com> Date: Thu, 22 Aug 2024 00:23:05 +0530 Subject: [PATCH 03/15] Adding SNMP IP via GUI (#260) - Adding SNMP IP via GUI - Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=626030 Signed-off-by: Vedangi Mittal --- src/views/Settings/SnmpAlerts/SnmpAlerts.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/Settings/SnmpAlerts/SnmpAlerts.vue b/src/views/Settings/SnmpAlerts/SnmpAlerts.vue index 8472d25c0a..d29455e3b0 100644 --- a/src/views/Settings/SnmpAlerts/SnmpAlerts.vue +++ b/src/views/Settings/SnmpAlerts/SnmpAlerts.vue @@ -187,7 +187,6 @@ export default { const data = { Destination: destination, SubscriptionType: 'SNMPTrap', - DeliveryRetryPolicy: 'TerminateAfterRetries', Protocol: 'SNMPv2c', }; this.startLoader(); From e093cdf5936732b7713ddd001d3c454bc34273f1 Mon Sep 17 00:00:00 2001 From: vedangimittal <69679625+vedangimittal@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:22:32 +0530 Subject: [PATCH 04/15] Monitoring tasks while generating resource dump (#256) - Monitoring the task while generating the resource dump to alert the user of any failures during the process. - Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=383586 Signed-off-by: Vedangi Mittal --- src/locales/en-US.json | 2 ++ src/store/modules/Logs/DumpsStore.js | 3 ++ src/views/Logs/Dumps/DumpsForm.vue | 48 ++++++++++++++++++++++++++-- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/src/locales/en-US.json b/src/locales/en-US.json index f4203bd631..5c61dbef80 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -624,6 +624,8 @@ "errorStartResourceDumpInvalidSelector": "Error initiating dump. Invalid resource selector.", "errorStartResourceDumpInvalidPassword": "Error initiating dump. Invalid password.", "errorStartSystemDump": "Error starting new System dump.", + "resourceDumpSuccess": "Resource Dump created successfully.", + "resourceDumpFailed": "Resource Dump creation failed.", "successDeleteDump": "Successfully deleted %{count} dump. | Successfully deleted %{count} dumps.", "successStartBmcDumpTitle": "BMC dump started", "successStartDump": "The dump will take some time to complete.", diff --git a/src/store/modules/Logs/DumpsStore.js b/src/store/modules/Logs/DumpsStore.js index cc41bec494..e3a7916653 100644 --- a/src/store/modules/Logs/DumpsStore.js +++ b/src/store/modules/Logs/DumpsStore.js @@ -23,6 +23,9 @@ const DumpsStore = { }, }, actions: { + async getTask() { + return await api.get('/redfish/v1/TaskService/Tasks'); + }, async getBmcDumpEntries() { return api .get('/redfish/v1/') diff --git a/src/views/Logs/Dumps/DumpsForm.vue b/src/views/Logs/Dumps/DumpsForm.vue index c0f4114c73..37bcdd0bd9 100644 --- a/src/views/Logs/Dumps/DumpsForm.vue +++ b/src/views/Logs/Dumps/DumpsForm.vue @@ -103,6 +103,7 @@ export default { resourceSelectorValue: null, resourcePassword: null, dumpTypeOptions: [], + taskProgress: '', }; }, computed: { @@ -178,6 +179,46 @@ export default { }; }, methods: { + async checkTask() { + //getting list of all tasks and getting the api to the most recent task + const data = await this.$store.dispatch('dumps/getTask'); + this.taskProgress = data.Members[data.Members.length - 1]; + const taskLink = this.taskProgress['@odata.id']; + //going to the most recent task + const currentTask = async () => { + return await this.$store.dispatch('global/getCurrentTask', taskLink); + }; + const currentTaskProgress = (checkCounter = 0) => { + checkCounter++; + //if 'TaskState' is in running state for more than 20 mins, error message will be displayed to the user + if (checkCounter > 40) { + return this.errorToast(this.$t('pageDumps.toast.resourceDumpFailed')); + } + Promise.all([currentTask()]).then((res) => { + //monitor the value of parameter 'TaskState' + const taskState = res[0]['TaskState']; + //if TaskState is completed + if (taskState == 'Completed') { + this.successToast(this.$t('pageDumps.toast.resourceDumpSuccess')); + //if TaskState is running/in progress + } else if (taskState == 'Running') { + //reload the api after every 30 seconds till 20 mins to check if the 'TaskState' is changed to Completed or Cancelled + setTimeout(() => { + currentTaskProgress(checkCounter); + }, 30000); + //if TaskState is Cancelled + } else if (taskState == 'Cancelled') { + this.errorToast(this.$t('pageDumps.toast.resourceDumpFailed')); + } + }); + }; + //trigger funtion to check 'TaskState' + if (taskLink) { + currentTaskProgress(0); + } else { + return this.errorToast(this.$t('pageDumps.toast.resourceDumpFailed')); + } + }, checkForUserData() { if (!this.currentUser) { this.$store.dispatch('userManagement/getUsers'); @@ -216,12 +257,13 @@ export default { // If not logged as service, '' must be used resourcePassword: this.resourcePassword || '', }) - .then(() => + .then(() => { this.infoToast(this.$t('pageDumps.toast.successStartDump'), { title: this.$t('pageDumps.toast.successStartResourceDumpTitle'), timestamp: true, - }) - ) + }); + this.checkTask(); + }) .catch(({ message }) => this.errorToast(message)); } // BMC dump initiation From ad2cad344505c153d2440055fa3079c0ab41f432 Mon Sep 17 00:00:00 2001 From: tiwari-nishant <152953092+tiwari-nishant@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:51:44 +0530 Subject: [PATCH 05/15] =?UTF-8?q?=E2=80=A2=09Fixed=20conditional=20alert?= =?UTF-8?q?=20informational=20message=20when=20the=20system=20is=20hmc-man?= =?UTF-8?q?aged=E2=80=A8=E2=80=A8=20(#271)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=638513 --- .../ServerPowerOperations/BootSettings.vue | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/views/Operations/ServerPowerOperations/BootSettings.vue b/src/views/Operations/ServerPowerOperations/BootSettings.vue index 12b4584c69..31af8820b7 100644 --- a/src/views/Operations/ServerPowerOperations/BootSettings.vue +++ b/src/views/Operations/ServerPowerOperations/BootSettings.vue @@ -88,6 +88,7 @@ export default { .dispatch('serverBootSettings/saveSettings', settings) .then((message) => { this.componentKey += 1; + let hmcManaged = this.$store.getters['resourceMemory/hmcManaged']; if (!this.isUpdated) { if (settings.biosSettings.pvm_default_os_type == 'Linux KVM') { this.successToast( @@ -102,27 +103,27 @@ export default { this.isAtleastPhypInStandby) ) { if (this.isInPhypStandby) { - this.infoToast( - this.$t( - 'pageServerPowerOperations.toast.successSaveIBMiStandby' - ) - ), - this.successToast( + if (hmcManaged != 'Enabled') { + this.infoToast( this.$t( - 'pageServerPowerOperations.toast.successSaveSettings' + 'pageServerPowerOperations.toast.successSaveIBMiStandby' ) ); + } + this.successToast( + this.$t('pageServerPowerOperations.toast.successSaveSettings') + ); } else { - this.infoToast( - this.$t( - 'pageServerPowerOperations.toast.successSaveIbmiOsRunningInfo' - ) - ), - this.successToast( + if (hmcManaged != 'Enabled') { + this.infoToast( this.$t( - 'pageServerPowerOperations.toast.successSaveSettings' + 'pageServerPowerOperations.toast.successSaveIbmiOsRunningInfo' ) ); + } + this.successToast( + this.$t('pageServerPowerOperations.toast.successSaveSettings') + ); } } else { this.successToast(message); From dd57568d12c1872e71c263fd81546049048a8131 Mon Sep 17 00:00:00 2001 From: tiwari-nishant <152953092+tiwari-nishant@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:52:17 +0530 Subject: [PATCH 06/15] Fixed values updation on Capacity on Demand page (#270) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * • Fixed refetching of values for capacity on demand page on new license activation. • Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=638365 * • Fixed refetching of values for capacity on demand page on new license activation. • Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=638365 * • Fixed refetching of values for capacity on demand page on new license activation. • Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=638365 Signed-off-by: tiwari-nishant * • Fixed refetching of values for capacity on demand page on new license activation. • Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=638365 --------- Signed-off-by: tiwari-nishant --- .../CapacityOnDemandActivation.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/views/ResourceManagement/CapacityOnDemand/CapacityOnDemandActivation.vue b/src/views/ResourceManagement/CapacityOnDemand/CapacityOnDemandActivation.vue index 320420fcf6..43ef421e8d 100644 --- a/src/views/ResourceManagement/CapacityOnDemand/CapacityOnDemandActivation.vue +++ b/src/views/ResourceManagement/CapacityOnDemand/CapacityOnDemandActivation.vue @@ -113,11 +113,7 @@ export default { }, }, created() { - Promise.all([ - this.$store.dispatch('global/getSystemInfo'), - this.$store.dispatch('global/getBootProgress'), - this.$store.dispatch('licenses/getLicenses'), - ]); + this.fetchInfo(); }, methods: { submitForm() { @@ -126,11 +122,21 @@ export default { this.startLoader(); this.$store .dispatch('licenses/activateLicense', this.licenseKey) - .then((success) => this.successToast(success)) + .then((success) => { + this.successToast(success); + this.fetchInfo(); + }) .catch(({ message }) => this.errorToast(message)) .finally(() => this.endLoader()); } }, + fetchInfo() { + Promise.all([ + this.$store.dispatch('global/getSystemInfo'), + this.$store.dispatch('global/getBootProgress'), + this.$store.dispatch('licenses/getLicenses'), + ]); + }, }, }; From f1a5c793f27c2198ae13df341715134e13e0b6f5 Mon Sep 17 00:00:00 2001 From: tiwari-nishant <152953092+tiwari-nishant@users.noreply.github.com> Date: Tue, 3 Sep 2024 19:54:44 +0530 Subject: [PATCH 07/15] =?UTF-8?q?=E2=80=A2=20Fixed=20alert=20message=20inf?= =?UTF-8?q?o=20when=20dump=20is=20being=20generated=20(#276)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=641159 --- src/store/modules/Logs/DumpsStore.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/store/modules/Logs/DumpsStore.js b/src/store/modules/Logs/DumpsStore.js index e3a7916653..b87528f26b 100644 --- a/src/store/modules/Logs/DumpsStore.js +++ b/src/store/modules/Logs/DumpsStore.js @@ -67,16 +67,25 @@ const DumpsStore = { ) .catch((error) => { console.log(error); - const messageId = + const errorMsg = error.response.data.error?.['@Message.ExtendedInfo'][0].MessageId; - const message = REGEX_MAPPINGS.resourceInStandby.test(messageId) - ? i18n.t('pageDumps.toast.errorStartDumpAnotherInProgress', { - dump: dumpType, - }) - : i18n.t('pageDumps.toast.errorStartBmcDump'); - - throw new Error(message); + switch (true) { + case REGEX_MAPPINGS.resourceInUse.test(errorMsg): + throw new Error( + i18n.t('pageDumps.toast.errorStartDumpAnotherInProgress', { + dump: dumpType, + }) + ); + case REGEX_MAPPINGS.resourceInStandby.test(errorMsg): + throw new Error( + i18n.t('pageDumps.toast.errorStartDumpResourceInStandby', { + dump: dumpType, + }) + ); + default: + throw new Error(i18n.t('pageDumps.toast.errorStartSystemDump')); + } }); }, async createResourceDump(_, { resourceSelector, resourcePassword }) { From c4f033ea27c644be35c8e76847ece98cd66ae10f Mon Sep 17 00:00:00 2001 From: Nikhil Ashoka <96164786+Nikhil-Ashoka@users.noreply.github.com> Date: Tue, 17 Sep 2024 19:38:38 +0530 Subject: [PATCH 08/15] Updated Predictive dynamic memory dealloc help text (#287) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated the Predictive dynamic memory deallocation help-text in
Memory page. - Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=648506 Signed-off-by: Nikhil Ashoka --- src/locales/en-US.json | 9 ++- .../ResourceManagement/ResourceMemoryStore.js | 59 ++++++++++++------- .../ResourceManagement/Memory/Memory.vue | 55 ++++++++++------- 3 files changed, 77 insertions(+), 46 deletions(-) diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 5c61dbef80..dabe00c502 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -1137,9 +1137,8 @@ "logicalMemorySizeHeading": "Logical memory block size is used for partitioning. Changing the logical memory block size impacts system resource management.", "maxNumHugePages": "Max number huge pages", "memoryBlockSize": "Memory block size", - "predictiveMemoryGuardHeader": "Predictive Memory Guard", - "predictiveMemoryGuardTitle": "Predictive dynamic memory deallocation", - "predictiveMemoryGuardDescription": "Enable or Disable Predictive Guard for Memory Errors.", + "predictiveDynamicMemoryDeallocationTitle": "Predictive dynamic memory deallocation", + "predictiveDynamicMemoryDeallocationDescription": "The Hypervisor dynamically removes memory pages from memory that detected predictive failures. If this option is disabled, dynamic memory deallocation will not occur for the predictive memory failures.", "requestedHugePageMemory": "Requested huge page memory", "slotCountForNode0": "Slot Count for Node 0", "systemMemoryPageSetup": "Improve the application's performance by setting large virtual memory page sizes of 16GB each.", @@ -1162,7 +1161,7 @@ }, "toast": { "errorSavingActiveMemoryMirroringMode": "Error updating active memory mirroring mode", - "errorSavingPredictiveMemoryGuard": "Error updating predictive dynamic memory deallocation", + "errorSavingPredictiveDynamicMemoryDeallocation": "Error updating predictive dynamic memory deallocation", "errorSavingAdapterEnlargedCapacity": "Error updating I/O adapter enlarged capacity", "errorSavingLogicalMemory": "Error updating logical memory block size ", "errorSavingPageSetup": "Error updating system memory page setup", @@ -1170,7 +1169,7 @@ "successSavingAdapterEnlargedCapacity": "Successfully updated I/O adapter enlarged capacity", "successSavingLogicalMemory": "Successfully updated logical memory block size", "successSavingActiveMemoryMirroringMode": "Successfully updated active memory mirroring mode", - "successSavingPredictiveMemoryGuard": "Successfully updated predictive dynamic memory deallocation", + "successSavingPredictiveDynamicMemoryDeallocation": "Successfully updated predictive dynamic memory deallocation", "successSavingPageSetup": "Successfully updated system memory page setup", "successSavingAdapterDynamicCapacity": "Successfully updated I/O adapter drawer attachment", "errorSavingAdapterDynamicCapacity": "Error updating dynamic I/O adapter drawer attachment" diff --git a/src/store/modules/ResourceManagement/ResourceMemoryStore.js b/src/store/modules/ResourceManagement/ResourceMemoryStore.js index ae4677a59a..38e09e5346 100644 --- a/src/store/modules/ResourceManagement/ResourceMemoryStore.js +++ b/src/store/modules/ResourceManagement/ResourceMemoryStore.js @@ -13,7 +13,7 @@ const ResourceMemoryStore = { numHugePages: null, hmcManaged: null, memoryMirroringMode: null, - predictiveMemoryGuard: null, + predictiveDynamicMemoryDeallocation: null, }, getters: { logicalMemorySizeOptions: (state) => state.logicalMemorySizeOptions, @@ -26,7 +26,8 @@ const ResourceMemoryStore = { numHugePages: (state) => state.numHugePages, hmcManaged: (state) => state.hmcManaged, memoryMirroringMode: (state) => state.memoryMirroringMode, - predictiveMemoryGuard: (state) => state.predictiveMemoryGuard, + predictiveDynamicMemoryDeallocation: (state) => + state.predictiveDynamicMemoryDeallocation, }, mutations: { setLogicalMemorySizeOptions: (state, logicalMemorySizeOptions) => @@ -49,8 +50,11 @@ const ResourceMemoryStore = { setHmcManaged: (state, hmcManaged) => (state.hmcManaged = hmcManaged), setMemoryMirroringMode: (state, memoryMirroringMode) => (state.memoryMirroringMode = memoryMirroringMode), - setPredictiveMemoryGuard: (state, predictiveMemoryGuard) => - (state.predictiveMemoryGuard = predictiveMemoryGuard), + setPredictiveDynamicMemoryDeallocation: ( + state, + predictiveDynamicMemoryDeallocation + ) => + (state.predictiveDynamicMemoryDeallocation = predictiveDynamicMemoryDeallocation), }, actions: { async getMemorySizeOptions({ commit }) { @@ -208,49 +212,64 @@ const ResourceMemoryStore = { ); }); }, - async getPredictiveMemoryGuard({ commit }) { + async getPredictiveDynamicMemoryDeallocation({ commit }) { return await api .get( '/redfish/v1/Registries/BiosAttributeRegistry/BiosAttributeRegistry' ) .then(({ data: { RegistryEntries } }) => { - const predictiveMemoryGuard = RegistryEntries.Attributes.filter( + const predictiveDynamicMemoryDeallocation = RegistryEntries.Attributes.filter( (Attribute) => Attribute.AttributeName == 'hb_predictive_mem_guard' ); - if (predictiveMemoryGuard.length > 0) { - let predictiveMemoryGuardValue = - predictiveMemoryGuard[0].CurrentValue; + if (predictiveDynamicMemoryDeallocation.length > 0) { + let predictiveDynamicMemoryDeallocationValue = + predictiveDynamicMemoryDeallocation[0].CurrentValue; let predictiveMemValue = - predictiveMemoryGuardValue == 'Enabled' ? true : false; - commit('setPredictiveMemoryGuard', predictiveMemValue); + predictiveDynamicMemoryDeallocationValue == 'Enabled' + ? true + : false; + commit( + 'setPredictiveDynamicMemoryDeallocation', + predictiveMemValue + ); } }) .catch((error) => console.log(error)); }, - async savePredictiveMemoryGuard( + async savePredictiveDynamicMemoryDeallocation( { commit }, - activePredictiveMemoryGuardValue + activePredictiveDynamicMemoryDeallocationValue ) { - let updatedMirroringModeValue = activePredictiveMemoryGuardValue + let updatedMirroringModeValue = activePredictiveDynamicMemoryDeallocationValue ? 'Enabled' : 'Disabled'; - commit('setPredictiveMemoryGuard', activePredictiveMemoryGuardValue); - const updatedPredictiveMemoryGuard = { + commit( + 'setPredictiveDynamicMemoryDeallocation', + activePredictiveDynamicMemoryDeallocationValue + ); + const updatedPredictiveDynamicMemoryDeallocation = { Attributes: { hb_predictive_mem_guard: updatedMirroringModeValue }, }; return api .patch( '/redfish/v1/Systems/system/Bios/Settings', - updatedPredictiveMemoryGuard + updatedPredictiveDynamicMemoryDeallocation ) .then(() => { - return i18n.t('pageMemory.toast.successSavingPredictiveMemoryGuard'); + return i18n.t( + 'pageMemory.toast.successSavingPredictiveDynamicMemoryDeallocation' + ); }) .catch((error) => { console.log(error); - commit('setPredictiveMemoryGuard', !activePredictiveMemoryGuardValue); + commit( + 'setPredictiveDynamicMemoryDeallocation', + !activePredictiveDynamicMemoryDeallocationValue + ); throw new Error( - i18n.t('pageMemory.toast.errorSavingPredictiveMemoryGuard') + i18n.t( + 'pageMemory.toast.errorSavingPredictiveDynamicMemoryDeallocation' + ) ); }); }, diff --git a/src/views/ResourceManagement/Memory/Memory.vue b/src/views/ResourceManagement/Memory/Memory.vue index dc5952fe17..708cba3ef8 100644 --- a/src/views/ResourceManagement/Memory/Memory.vue +++ b/src/views/ResourceManagement/Memory/Memory.vue @@ -308,14 +308,18 @@
-

{{ $t('pageMemory.predictiveMemoryGuardDescription') }}

+

+ {{ + $t('pageMemory.predictiveDynamicMemoryDeallocationDescription') + }} +

@@ -326,30 +330,30 @@ >
- {{ $t('pageMemory.predictiveMemoryGuardHeader') }} + {{ $t('pageMemory.predictiveDynamicMemoryDeallocationTitle') }}
- + {{ '--' }} - + {{ $t('global.status.enabled') }} {{ $t('global.status.disabled') }}
- + {{ '--' }} - + {{ $t('global.status.enabled') }} {{ $t('global.status.disabled') }} @@ -417,10 +421,12 @@ export default { linkText: this.$t('pageMemory.activeMemoryMirroringTitle'), }, { - id: 'togglePredictiveMemoryGuard', - dataRef: 'togglePredictiveMemoryGuard', - href: '#togglePredictiveMemoryGuard', - linkText: this.$t('pageMemory.predictiveMemoryGuardTitle'), + id: 'togglePredictiveDynamicMemoryDeallocation', + dataRef: 'togglePredictiveDynamicMemoryDeallocation', + href: '#togglePredictiveDynamicMemoryDeallocation', + linkText: this.$t( + 'pageMemory.predictiveDynamicMemoryDeallocationTitle' + ), }, ], }; @@ -438,9 +444,11 @@ export default { return newValue; }, }, - predictiveMemoryGuardState: { + predictiveDynamicMemoryDeallocationState: { get() { - return this.$store.getters['resourceMemory/predictiveMemoryGuard']; + return this.$store.getters[ + 'resourceMemory/predictiveDynamicMemoryDeallocation' + ]; }, set(newValue) { return newValue; @@ -523,7 +531,9 @@ export default { this.$store.dispatch('resourceMemory/getMaxNumHugePages'), this.$store.dispatch('resourceMemory/getHmcManaged'), this.$store.dispatch('resourceMemory/getActiveMemoryMirroring'), - this.$store.dispatch('resourceMemory/getPredictiveMemoryGuard'), + this.$store.dispatch( + 'resourceMemory/getPredictiveDynamicMemoryDeallocation' + ), ]).finally(() => this.endLoader()); }, methods: { @@ -585,9 +595,12 @@ export default { .then((message) => this.successToast(message)) .catch(({ message }) => this.errorToast(message)); }, - changePredictiveMemoryGuardState(state) { + changePredictiveDynamicMemoryDeallocationState(state) { this.$store - .dispatch('resourceMemory/savePredictiveMemoryGuard', state) + .dispatch( + 'resourceMemory/savePredictiveDynamicMemoryDeallocation', + state + ) .then((message) => this.successToast(message)) .catch(({ message }) => this.errorToast(message)); }, From c99a97f87ef8f00668c9d9b9f0c355ba6d818b00 Mon Sep 17 00:00:00 2001 From: Nikhil Ashoka <96164786+Nikhil-Ashoka@users.noreply.github.com> Date: Tue, 17 Sep 2024 19:38:50 +0530 Subject: [PATCH 09/15] Updated Redfish URI for Executing Panel functions (#288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated the Redfish end-point URI to execute Panel functions. - /redfish/v1/Systems/system/Actions/Oem/OemComputerSystem.ExecutePanelFunction —> /redfish/v1/Systems/system/Actions/Oem/IBM/IBMComputerSystem.ExecutePanelFunction - JIRA: https://jsw.ibm.com/browse/PFEBMC-3369 Signed-off-by: Nikhil Ashoka --- src/store/modules/Logs/IBMiServiceFunctionsStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/Logs/IBMiServiceFunctionsStore.js b/src/store/modules/Logs/IBMiServiceFunctionsStore.js index e449a08665..7ea52a3a18 100644 --- a/src/store/modules/Logs/IBMiServiceFunctionsStore.js +++ b/src/store/modules/Logs/IBMiServiceFunctionsStore.js @@ -23,7 +23,7 @@ const IBMiServiceFunctionsStore = { async executeServiceFunction({ dispatch }, value) { return await api .post( - '/redfish/v1/Systems/system/Actions/Oem/OemComputerSystem.ExecutePanelFunction', + '/redfish/v1/Systems/system/Actions/Oem/IBM/IBMComputerSystem.ExecutePanelFunction', { FuncNo: value } ) .then(() => { From 355b755a049f1b09498ee200493654819d047eed Mon Sep 17 00:00:00 2001 From: Nabil Ananthamangalath Date: Wed, 25 Sep 2024 20:52:38 +0530 Subject: [PATCH 10/15] Fix service login certificate expiry checks (#289) - Service login certificate says expired but the user was able to login to BMC GUI with service user. Expiry condition checks in the GUI was not correct. - Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=650735 Signed-off-by: Nabil Ananthamangalath --- src/views/SecurityAndAccess/Certificates/Certificates.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/SecurityAndAccess/Certificates/Certificates.vue b/src/views/SecurityAndAccess/Certificates/Certificates.vue index 0397560666..d634961acd 100644 --- a/src/views/SecurityAndAccess/Certificates/Certificates.vue +++ b/src/views/SecurityAndAccess/Certificates/Certificates.vue @@ -209,7 +209,7 @@ export default { expiredCertificateTypes() { return this.certificates.reduce((acc, val) => { const daysUntilExpired = this.getDaysUntilExpired(val.validUntil); - if (daysUntilExpired < 1) { + if (daysUntilExpired < 0) { acc.push(val.certificate); } return acc; @@ -218,7 +218,7 @@ export default { expiringCertificateTypes() { return this.certificates.reduce((acc, val) => { const daysUntilExpired = this.getDaysUntilExpired(val.validUntil); - if (daysUntilExpired < 31 && daysUntilExpired > 0) { + if (daysUntilExpired < 31 && daysUntilExpired >= 0) { acc.push(val.certificate); } return acc; @@ -364,7 +364,7 @@ export default { }, getIconStatus(date) { const daysUntilExpired = this.getDaysUntilExpired(date); - if (daysUntilExpired < 1) { + if (daysUntilExpired < 0) { return 'danger'; } else if (daysUntilExpired < 31) { return 'warning'; From caa9653d267fc54edf6c67fb0755fbdac14e0949 Mon Sep 17 00:00:00 2001 From: Nikhil Ashoka <96164786+Nikhil-Ashoka@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:05:35 +0530 Subject: [PATCH 11/15] Updated Power Restore Policy (#285) - Removed the Hardcoded ComputerSystem.json and fetching the data using the Uri. - Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=646661 Signed-off-by: Nikhil Ashoka --- .../modules/Settings/PowerPolicyStore.js | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/src/store/modules/Settings/PowerPolicyStore.js b/src/store/modules/Settings/PowerPolicyStore.js index 54efa2c1c7..e9854e7272 100644 --- a/src/store/modules/Settings/PowerPolicyStore.js +++ b/src/store/modules/Settings/PowerPolicyStore.js @@ -20,27 +20,36 @@ const PowerPolicyStore = { actions: { async getPowerRestorePolicies({ commit }) { return await api - .get('/redfish/v1/JsonSchemas/ComputerSystem/ComputerSystem.json') - .then( - ({ - data: { - definitions: { PowerRestorePolicyTypes = {} }, - }, - }) => { - let powerPoliciesData = PowerRestorePolicyTypes.enum.map( - (powerState) => { - let desc = `${i18n.t( - `pagePowerRestorePolicy.policies.${powerState}` - )} - ${PowerRestorePolicyTypes.enumDescriptions[powerState]}`; - return { - state: powerState, - desc, - }; + .get('/redfish/v1/JsonSchemas/ComputerSystem') + .then(async (response) => { + if ( + response.data?.Location.length > 0 && + response.data?.Location[0].Uri + ) { + return await api.get(response.data?.Location[0].Uri).then( + ({ + data: { + definitions: { PowerRestorePolicyTypes = {} }, + }, + }) => { + let powerPoliciesData = PowerRestorePolicyTypes.enum.map( + (powerState) => { + let desc = `${i18n.t( + `pagePowerRestorePolicy.policies.${powerState}` + )} - ${ + PowerRestorePolicyTypes.enumDescriptions[powerState] + }`; + return { + state: powerState, + desc, + }; + } + ); + commit('setPowerRestorePolicies', powerPoliciesData); } ); - commit('setPowerRestorePolicies', powerPoliciesData); } - ); + }); }, async getPowerRestoreCurrentPolicy({ commit }) { return await api From 76251a73b03b9354c1ae05aacc03701c4cece503 Mon Sep 17 00:00:00 2001 From: Nikhil Ashoka <96164786+Nikhil-Ashoka@users.noreply.github.com> Date: Fri, 4 Oct 2024 19:12:59 +0530 Subject: [PATCH 12/15] Removed grey out option in Policies page (#292) - Removed grey out option for USB firmware update policy in Policies page for read-only users. - Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=653718 Signed-off-by: Nikhil Ashoka --- src/views/SecurityAndAccess/Policies/Policies.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/SecurityAndAccess/Policies/Policies.vue b/src/views/SecurityAndAccess/Policies/Policies.vue index 97c4e2338b..97e9245d2f 100644 --- a/src/views/SecurityAndAccess/Policies/Policies.vue +++ b/src/views/SecurityAndAccess/Policies/Policies.vue @@ -146,7 +146,6 @@ Date: Wed, 9 Oct 2024 18:57:51 +0530 Subject: [PATCH 13/15] Removed compression Plugin. (#273) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DEFLATE Data Compression Algorithm Used for HTTPS which may be vulnerable to breach attack Defect: jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=579318 Signed-off-by: Steffi Antony <“steffiantony196@gmail.com”> Co-authored-by: Steffi Antony <“steffiantony196@gmail.com”> --- vue.config.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/vue.config.js b/vue.config.js index 7274b1c42b..07d76b427b 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,5 +1,3 @@ -const CompressionPlugin = require('compression-webpack-plugin'); - module.exports = { css: { loaderOptions: { @@ -85,14 +83,6 @@ module.exports = { ] = `@/env/components/AppNavigation/${envName}.js`; } } - - if (process.env.NODE_ENV === 'production') { - config.plugins.push( - new CompressionPlugin({ - deleteOriginalAssets: true, - }) - ); - } }, pluginOptions: { i18n: { From 7c04048009fa0092b879bd41e1f97fbd25ba75a7 Mon Sep 17 00:00:00 2001 From: vedangimittal <69679625+vedangimittal@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:46:15 +0530 Subject: [PATCH 14/15] Immediate Test Request (#299) - Immediate test request options 'Run now' and 'Stop Diagnostinc test run' working in the first go - Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=649408 Signed-off-by: Vedangi Mittal --- .../SystemParameters/RuntimeProcessorDiagnostic.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/ResourceManagement/SystemParameters/RuntimeProcessorDiagnostic.vue b/src/views/ResourceManagement/SystemParameters/RuntimeProcessorDiagnostic.vue index 7c0b91e974..b36bc0290a 100644 --- a/src/views/ResourceManagement/SystemParameters/RuntimeProcessorDiagnostic.vue +++ b/src/views/ResourceManagement/SystemParameters/RuntimeProcessorDiagnostic.vue @@ -343,7 +343,9 @@ export default { this.$store.dispatch('systemParameters/saveImmediateTestRequested', { value: value ? 'Enabled' : 'Disabled', }), - this.$store.dispatch('systemParameters/getBiosAttributesRegistry'), + setTimeout(() => { + this.$store.dispatch('systemParameters/getBiosAttributesRegistry'); + }, 5000), ]) .then((message) => { if (value && this.isServerOff) { @@ -353,7 +355,7 @@ export default { ) ); } else { - this.successToast(message); + this.successToast(message[0]); } }) .catch(({ message }) => this.errorToast(message)) From 6fb1086484f7d066bc6ea7fc512d64e365b1ef4f Mon Sep 17 00:00:00 2001 From: vedangimittal <69679625+vedangimittal@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:46:47 +0530 Subject: [PATCH 15/15] Removed display of information message when readonly user is logged in (#268) - Removed display of information message when readonly user is logged in - Defect: https://jazz07.rchland.ibm.com:13443/jazz/web/projects/CSSD#action=com.ibm.team.workitem.viewWorkItem&id=635517 Signed-off-by: Vedangi Mittal --- src/store/modules/Operations/ControlStore.js | 66 ++++++++++------- .../ServerPowerOperations.vue | 72 +++++++++++++++---- 2 files changed, 98 insertions(+), 40 deletions(-) diff --git a/src/store/modules/Operations/ControlStore.js b/src/store/modules/Operations/ControlStore.js index 9b8bf73dcc..f16ed81e52 100644 --- a/src/store/modules/Operations/ControlStore.js +++ b/src/store/modules/Operations/ControlStore.js @@ -34,11 +34,13 @@ const ControlStore = { isOperationInProgress: false, lastPowerOperationTime: null, lastBmcRebootTime: null, + displayInfoToast: false, }, getters: { isOperationInProgress: (state) => state.isOperationInProgress, lastPowerOperationTime: (state) => state.lastPowerOperationTime, lastBmcRebootTime: (state) => state.lastBmcRebootTime, + displayInfoToast: (state) => state.displayInfoToast, }, mutations: { setOperationInProgress: (state, inProgress) => @@ -47,6 +49,8 @@ const ControlStore = { (state.lastPowerOperationTime = lastPowerOperationTime), setLastBmcRebootTime: (state, lastBmcRebootTime) => (state.lastBmcRebootTime = lastBmcRebootTime), + setDisplayInfoToast: (state, displayInfoToast) => + (state.displayInfoToast = displayInfoToast), }, actions: { async getLastPowerOperationTime({ commit }) { @@ -82,47 +86,57 @@ const ControlStore = { throw new Error(i18n.t('pageRebootBmc.toast.errorRebootStart')); }); }, - async serverPowerOn({ dispatch, commit }) { - const data = { ResetType: 'On' }; - dispatch('serverPowerChange', data); - await checkForServerStatus.bind(this, 'on')(); + async powerOps({ dispatch, commit }, { thisVal, value }) { + await checkForServerStatus.bind(thisVal, value)(); commit('setOperationInProgress', false); dispatch('getLastPowerOperationTime'); }, - async serverSoftReboot({ dispatch, commit }) { + async serverPowerOn({ dispatch }) { + const value = 'on'; + const data = { ResetType: 'On' }; + const displayInfo = await dispatch('serverPowerChange', data); + dispatch('powerOps', { thisVal: this, value }); + return Promise.resolve(displayInfo); + }, + async serverSoftReboot({ dispatch }) { + const value = 'on'; const data = { ResetType: 'GracefulRestart' }; - dispatch('serverPowerChange', data); - await checkForServerStatus.bind(this, 'on')(); - commit('setOperationInProgress', false); - dispatch('getLastPowerOperationTime'); + const displayInfo = await dispatch('serverPowerChange', data); + dispatch('powerOps', { thisVal: this, value }); + return Promise.resolve(displayInfo); }, - async serverHardReboot({ dispatch, commit }) { + async serverHardReboot({ dispatch }) { + const value = 'on'; const data = { ResetType: 'ForceRestart' }; - dispatch('serverPowerChange', data); - await checkForServerStatus.bind(this, 'on')(); - commit('setOperationInProgress', false); - dispatch('getLastPowerOperationTime'); + const displayInfo = await dispatch('serverPowerChange', data); + dispatch('powerOps', { thisVal: this, value }); + return Promise.resolve(displayInfo); }, - async serverSoftPowerOff({ dispatch, commit }) { + async serverSoftPowerOff({ dispatch }) { + const value = 'off'; const data = { ResetType: 'GracefulShutdown' }; - dispatch('serverPowerChange', data); - await checkForServerStatus.bind(this, 'off')(); - commit('setOperationInProgress', false); - dispatch('getLastPowerOperationTime'); + const displayInfo = await dispatch('serverPowerChange', data); + dispatch('powerOps', { thisVal: this, value }); + return Promise.resolve(displayInfo); }, - async serverHardPowerOff({ dispatch, commit }) { + async serverHardPowerOff({ dispatch }) { + const value = 'off'; const data = { ResetType: 'ForceOff' }; - dispatch('serverPowerChange', data); - await checkForServerStatus.bind(this, 'off')(); - commit('setOperationInProgress', false); - dispatch('getLastPowerOperationTime'); + const displayInfo = await dispatch('serverPowerChange', data); + dispatch('powerOps', { thisVal: this, value }); + return Promise.resolve(displayInfo); }, - serverPowerChange({ commit }, data) { + serverPowerChange({ commit, state }, data) { commit('setOperationInProgress', true); - api + return api .post('/redfish/v1/Systems/system/Actions/ComputerSystem.Reset', data) + .then(() => { + state.displayInfoToast = true; + return state.displayInfoToast; + }) .catch((error) => { console.log(error); + state.displayInfoToast = false; commit('setOperationInProgress', false); }); }, diff --git a/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue b/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue index 4a86b779d8..3e9c8643a8 100644 --- a/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue +++ b/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue @@ -344,8 +344,16 @@ export default { this.bmc.statusState === 'Enabled' && this.bmc.health === 'OK' ) { - this.$store.dispatch('controls/serverPowerOn'); - this.infoToast(this.$t('pageServerPowerOperations.userRefresh')); + this.$store + .dispatch('controls/serverPowerOn') + .then((response) => { + if (response === true) { + this.infoToast(this.$t('pageServerPowerOperations.userRefresh')); + } + }) + .catch((error) => { + console.log(error); + }); } else { this.errorToast( this.$t('pageServerPowerOperations.toast.errorPowerOn') @@ -373,10 +381,18 @@ export default { .msgBoxConfirm(modalMessage, modalOptions) .then((confirmed) => { if (confirmed) { - this.$store.dispatch('controls/serverSoftReboot'); - this.infoToast( - this.$t('pageServerPowerOperations.userRefresh') - ); + this.$store + .dispatch('controls/serverSoftReboot') + .then((response) => { + if (response === true) { + this.infoToast( + this.$t('pageServerPowerOperations.userRefresh') + ); + } + }) + .catch((error) => { + console.log(error); + }); } }); } else if (this.form.rebootOption === 'immediate') { @@ -384,10 +400,18 @@ export default { .msgBoxConfirm(modalMessage, modalOptions) .then((confirmed) => { if (confirmed) { - this.$store.dispatch('controls/serverHardReboot'); - this.infoToast( - this.$t('pageServerPowerOperations.userRefresh') - ); + this.$store + .dispatch('controls/serverHardReboot') + .then((response) => { + if (response === true) { + this.infoToast( + this.$t('pageServerPowerOperations.userRefresh') + ); + } + }) + .catch((error) => { + console.log(error); + }); } }); } @@ -413,8 +437,18 @@ export default { .msgBoxConfirm(modalMessage, modalOptions) .then((confirmed) => { if (confirmed) { - this.$store.dispatch('controls/serverSoftPowerOff'); - this.infoToast(this.$t('pageServerPowerOperations.userRefresh')); + this.$store + .dispatch('controls/serverSoftPowerOff') + .then((response) => { + if (response === true) { + this.infoToast( + this.$t('pageServerPowerOperations.userRefresh') + ); + } + }) + .catch((error) => { + console.log(error); + }); } }); } @@ -423,8 +457,18 @@ export default { .msgBoxConfirm(modalMessage, modalOptions) .then((confirmed) => { if (confirmed) { - this.$store.dispatch('controls/serverHardPowerOff'); - this.infoToast(this.$t('pageServerPowerOperations.userRefresh')); + this.$store + .dispatch('controls/serverHardPowerOff') + .then((response) => { + if (response === true) { + this.infoToast( + this.$t('pageServerPowerOperations.userRefresh') + ); + } + }) + .catch((error) => { + console.log(error); + }); } }); }