Skip to content

Commit 572aa19

Browse files
authored
ui: show usage server restart message on usage config change (#11969)
Fixes #10853 --------- Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 21d5c10 commit 572aa19

4 files changed

Lines changed: 15 additions & 27 deletions

File tree

ui/public/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3735,6 +3735,7 @@
37353735
"message.resource.not.found": "Resource not found.",
37363736
"message.restart.mgmt.server": "Please restart your management server(s) for your new settings to take effect.",
37373737
"message.restart.network": "All services provided by this Network will be interrupted. Please confirm that you want to restart this Network.",
3738+
"message.restart.usage.server": "Please restart your usage server(s) for your new settings to take effect.",
37383739
"message.restart.vm.to.update.settings": "Update in fields other than name and display name will require the Instance to be restarted.",
37393740
"message.restart.vpc": "Please confirm that you want to restart the VPC.",
37403741
"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>",

ui/src/components/view/ListView.vue

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,15 +1234,7 @@ export default {
12341234
this.editableValueKey = null
12351235
this.$store.dispatch('RefreshFeatures')
12361236
this.$messageConfigSuccess(`${this.$t('message.setting.updated')} ${record.name}`, record)
1237-
if (json.updateconfigurationresponse &&
1238-
json.updateconfigurationresponse.configuration &&
1239-
!json.updateconfigurationresponse.configuration.isdynamic &&
1240-
['Admin'].includes(this.$store.getters.userInfo.roletype)) {
1241-
this.$notification.warning({
1242-
message: this.$t('label.status'),
1243-
description: this.$t('message.restart.mgmt.server')
1244-
})
1245-
}
1237+
this.$notifyConfigurationValueChange(json?.updateconfigurationresponse?.configuration || null)
12461238
}).catch(error => {
12471239
console.error(error)
12481240
this.$message.error(this.$t('message.error.save.setting'))

ui/src/utils/plugins.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,17 @@ export const dialogUtilPlugin = {
550550
onOk: () => callback(configRecord)
551551
})
552552
}
553+
554+
app.config.globalProperties.$notifyConfigurationValueChange = function (configRecord) {
555+
if (!configRecord || configRecord.isdynamic || store.getters.userInfo?.roletype !== 'Admin') {
556+
return
557+
}
558+
const server = configRecord.group === 'Usage Server' ? 'usage' : 'mgmt'
559+
this.$notification.warning({
560+
message: this.$t('label.status'),
561+
description: this.$t('message.restart.' + server + '.server')
562+
})
563+
}
553564
}
554565
}
555566

ui/src/views/setting/ConfigurationValue.vue

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,7 @@ export default {
299299
this.$emit('change-config', { value: newValue })
300300
this.$store.dispatch('RefreshFeatures')
301301
this.$messageConfigSuccess(`${this.$t('message.setting.updated')} ${configrecord.name}`, configrecord)
302-
if (json.updateconfigurationresponse &&
303-
json.updateconfigurationresponse.configuration &&
304-
!json.updateconfigurationresponse.configuration.isdynamic &&
305-
['Admin'].includes(this.$store.getters.userInfo.roletype)) {
306-
this.$notification.warning({
307-
message: this.$t('label.status'),
308-
description: this.$t('message.restart.mgmt.server')
309-
})
310-
}
302+
this.$notifyConfigurationValueChange(json?.updateconfigurationresponse?.configuration || null)
311303
}).catch(error => {
312304
this.editableValue = this.actualValue
313305
console.error(error)
@@ -341,15 +333,7 @@ export default {
341333
this.$emit('change-config', { value: newValue })
342334
this.$store.dispatch('RefreshFeatures')
343335
this.$messageConfigSuccess(`${this.$t('label.setting')} ${configrecord.name} ${this.$t('label.reset.config.value')}`, configrecord)
344-
if (json.resetconfigurationresponse &&
345-
json.resetconfigurationresponse.configuration &&
346-
!json.resetconfigurationresponse.configuration.isdynamic &&
347-
['Admin'].includes(this.$store.getters.userInfo.roletype)) {
348-
this.$notification.warning({
349-
message: this.$t('label.status'),
350-
description: this.$t('message.restart.mgmt.server')
351-
})
352-
}
336+
this.$notifyConfigurationValueChange(json?.resetconfigurationresponse?.configuration || null)
353337
}).catch(error => {
354338
this.editableValue = this.actualValue
355339
console.error(error)

0 commit comments

Comments
 (0)