This is an automated email from the ASF dual-hosted git repository.

shwstppr pushed a commit to branch 4.22
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.22 by this push:
     new 572aa195649 ui: show usage server restart message on usage config 
change (#11969)
572aa195649 is described below

commit 572aa1956493d58a0efa283d2f75d876d92a5ad9
Author: Abhishek Kumar <[email protected]>
AuthorDate: Wed Jan 28 11:01:53 2026 +0530

    ui: show usage server restart message on usage config change (#11969)
    
    Fixes #10853
    
    ---------
    
    Signed-off-by: Abhishek Kumar <[email protected]>
---
 ui/public/locales/en.json                   |  1 +
 ui/src/components/view/ListView.vue         | 10 +---------
 ui/src/utils/plugins.js                     | 11 +++++++++++
 ui/src/views/setting/ConfigurationValue.vue | 20 ++------------------
 4 files changed, 15 insertions(+), 27 deletions(-)

diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json
index 275b8dbb0fe..74715496434 100644
--- a/ui/public/locales/en.json
+++ b/ui/public/locales/en.json
@@ -3735,6 +3735,7 @@
 "message.resource.not.found": "Resource not found.",
 "message.restart.mgmt.server": "Please restart your management server(s) for 
your new settings to take effect.",
 "message.restart.network": "All services provided by this Network will be 
interrupted. Please confirm that you want to restart this Network.",
+"message.restart.usage.server": "Please restart your usage server(s) for your 
new settings to take effect.",
 "message.restart.vm.to.update.settings": "Update in fields other than name and 
display name will require the Instance to be restarted.",
 "message.restart.vpc": "Please confirm that you want to restart the VPC.",
 "message.restart.vpc.remark": "Please confirm that you want to restart the VPC 
<p><i>Remark: making a non-redundant VPC redundant will force a clean up. The 
Networks will not be available for a couple of minutes</i>.</p>",
diff --git a/ui/src/components/view/ListView.vue 
b/ui/src/components/view/ListView.vue
index 168e355cbc8..79ec5a18207 100644
--- a/ui/src/components/view/ListView.vue
+++ b/ui/src/components/view/ListView.vue
@@ -1234,15 +1234,7 @@ export default {
         this.editableValueKey = null
         this.$store.dispatch('RefreshFeatures')
         this.$messageConfigSuccess(`${this.$t('message.setting.updated')} 
${record.name}`, record)
-        if (json.updateconfigurationresponse &&
-          json.updateconfigurationresponse.configuration &&
-          !json.updateconfigurationresponse.configuration.isdynamic &&
-          ['Admin'].includes(this.$store.getters.userInfo.roletype)) {
-          this.$notification.warning({
-            message: this.$t('label.status'),
-            description: this.$t('message.restart.mgmt.server')
-          })
-        }
+        
this.$notifyConfigurationValueChange(json?.updateconfigurationresponse?.configuration
 || null)
       }).catch(error => {
         console.error(error)
         this.$message.error(this.$t('message.error.save.setting'))
diff --git a/ui/src/utils/plugins.js b/ui/src/utils/plugins.js
index 306eb9d1f59..729cef84d02 100644
--- a/ui/src/utils/plugins.js
+++ b/ui/src/utils/plugins.js
@@ -550,6 +550,17 @@ export const dialogUtilPlugin = {
         onOk: () => callback(configRecord)
       })
     }
+
+    app.config.globalProperties.$notifyConfigurationValueChange = function 
(configRecord) {
+      if (!configRecord || configRecord.isdynamic || 
store.getters.userInfo?.roletype !== 'Admin') {
+        return
+      }
+      const server = configRecord.group === 'Usage Server' ? 'usage' : 'mgmt'
+      this.$notification.warning({
+        message: this.$t('label.status'),
+        description: this.$t('message.restart.' + server + '.server')
+      })
+    }
   }
 }
 
diff --git a/ui/src/views/setting/ConfigurationValue.vue 
b/ui/src/views/setting/ConfigurationValue.vue
index 662e5ef142e..31c0798a717 100644
--- a/ui/src/views/setting/ConfigurationValue.vue
+++ b/ui/src/views/setting/ConfigurationValue.vue
@@ -299,15 +299,7 @@ export default {
         this.$emit('change-config', { value: newValue })
         this.$store.dispatch('RefreshFeatures')
         this.$messageConfigSuccess(`${this.$t('message.setting.updated')} 
${configrecord.name}`, configrecord)
-        if (json.updateconfigurationresponse &&
-          json.updateconfigurationresponse.configuration &&
-          !json.updateconfigurationresponse.configuration.isdynamic &&
-          ['Admin'].includes(this.$store.getters.userInfo.roletype)) {
-          this.$notification.warning({
-            message: this.$t('label.status'),
-            description: this.$t('message.restart.mgmt.server')
-          })
-        }
+        
this.$notifyConfigurationValueChange(json?.updateconfigurationresponse?.configuration
 || null)
       }).catch(error => {
         this.editableValue = this.actualValue
         console.error(error)
@@ -341,15 +333,7 @@ export default {
         this.$emit('change-config', { value: newValue })
         this.$store.dispatch('RefreshFeatures')
         this.$messageConfigSuccess(`${this.$t('label.setting')} 
${configrecord.name} ${this.$t('label.reset.config.value')}`, configrecord)
-        if (json.resetconfigurationresponse &&
-          json.resetconfigurationresponse.configuration &&
-          !json.resetconfigurationresponse.configuration.isdynamic &&
-          ['Admin'].includes(this.$store.getters.userInfo.roletype)) {
-          this.$notification.warning({
-            message: this.$t('label.status'),
-            description: this.$t('message.restart.mgmt.server')
-          })
-        }
+        
this.$notifyConfigurationValueChange(json?.resetconfigurationresponse?.configuration
 || null)
       }).catch(error => {
         this.editableValue = this.actualValue
         console.error(error)

Reply via email to