Skip to content

Commit a1e56b9

Browse files
committed
ui: show usage server restart message on usage config change
Fixes #10853 Signed-off-by: Abhishek Kumar <[email protected]>
1 parent bfc4f60 commit a1e56b9

File tree

4 files changed

+17
-27
lines changed

4 files changed

+17
-27
lines changed

ui/public/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3726,6 +3726,7 @@
37263726
"message.resource.not.found": "Resource not found.",
37273727
"message.restart.mgmt.server": "Please restart your management server(s) for your new settings to take effect.",
37283728
"message.restart.network": "All services provided by this Network will be interrupted. Please confirm that you want to restart this Network.",
3729+
"message.restart.usage.server": "Please restart your usage server(s) for your new settings to take effect.",
37293730
"message.restart.vm.to.update.settings": "Update in fields other than name and display name will require the Instance to be restarted.",
37303731
"message.restart.vpc": "Please confirm that you want to restart the VPC.",
37313732
"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
@@ -1245,15 +1245,7 @@ export default {
12451245
this.editableValueKey = null
12461246
this.$store.dispatch('RefreshFeatures')
12471247
this.$messageConfigSuccess(`${this.$t('message.setting.updated')} ${record.name}`, record)
1248-
if (json.updateconfigurationresponse &&
1249-
json.updateconfigurationresponse.configuration &&
1250-
!json.updateconfigurationresponse.configuration.isdynamic &&
1251-
['Admin'].includes(this.$store.getters.userInfo.roletype)) {
1252-
this.$notification.warning({
1253-
message: this.$t('label.status'),
1254-
description: this.$t('message.restart.mgmt.server')
1255-
})
1256-
}
1248+
this.$notifyConfigurationValueChange(json?.updateconfigurationresponse?.configuration || null)
12571249
}).catch(error => {
12581250
console.error(error)
12591251
this.$message.error(this.$t('message.error.save.setting'))

ui/src/utils/plugins.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,19 @@ export const dialogUtilPlugin = {
549549
onOk: () => callback(configRecord)
550550
})
551551
}
552+
553+
app.config.globalProperties.$notifyConfigurationValueChange = function (configRecord) {
554+
console.log('1notifyConfigurationValueChange', configRecord, store.getters.userInfo?.roletype)
555+
if (!configRecord || configRecord.isdynamic || store.getters.userInfo?.roletype !== 'Admin') {
556+
return
557+
}
558+
const server = configRecord.group === 'Usage Server' ? 'usage' : 'mgmt'
559+
console.log('2notifyConfigurationValueChange', configRecord, store.getters.userInfo?.roletype, server)
560+
this.$notification.warning({
561+
message: this.$t('label.status'),
562+
description: this.$t('message.restart.' + server + '.server')
563+
})
564+
}
552565
}
553566
}
554567

ui/src/views/setting/ConfigurationValue.vue

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,7 @@ export default {
286286
this.$emit('change-config', { value: newValue })
287287
this.$store.dispatch('RefreshFeatures')
288288
this.$messageConfigSuccess(`${this.$t('message.setting.updated')} ${configrecord.name}`, configrecord)
289-
if (json.updateconfigurationresponse &&
290-
json.updateconfigurationresponse.configuration &&
291-
!json.updateconfigurationresponse.configuration.isdynamic &&
292-
['Admin'].includes(this.$store.getters.userInfo.roletype)) {
293-
this.$notification.warning({
294-
message: this.$t('label.status'),
295-
description: this.$t('message.restart.mgmt.server')
296-
})
297-
}
289+
this.$notifyConfigurationValueChange(json?.updateconfigurationresponse?.configuration || null)
298290
}).catch(error => {
299291
this.editableValue = this.actualValue
300292
console.error(error)
@@ -325,15 +317,7 @@ export default {
325317
this.$emit('change-config', { value: newValue })
326318
this.$store.dispatch('RefreshFeatures')
327319
this.$messageConfigSuccess(`${this.$t('label.setting')} ${configrecord.name} ${this.$t('label.reset.config.value')}`, configrecord)
328-
if (json.resetconfigurationresponse &&
329-
json.resetconfigurationresponse.configuration &&
330-
!json.resetconfigurationresponse.configuration.isdynamic &&
331-
['Admin'].includes(this.$store.getters.userInfo.roletype)) {
332-
this.$notification.warning({
333-
message: this.$t('label.status'),
334-
description: this.$t('message.restart.mgmt.server')
335-
})
336-
}
320+
this.$notifyConfigurationValueChange(json?.resetconfigurationresponse?.configuration || null)
337321
}).catch(error => {
338322
this.editableValue = this.actualValue
339323
console.error(error)

0 commit comments

Comments
 (0)