Skip to content

Commit 9cb0f6c

Browse files
shwstpprLocharla, Sandeep
authored andcommitted
ui: show usage server restart message on usage config change (apache#11969)
Fixes apache#10853 --------- Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent f13265e commit 9cb0f6c

File tree

4 files changed

+15
-27
lines changed

4 files changed

+15
-27
lines changed

ui/public/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3750,6 +3750,7 @@
37503750
"message.resource.not.found": "Resource not found.",
37513751
"message.restart.mgmt.server": "Please restart your management server(s) for your new settings to take effect.",
37523752
"message.restart.network": "All services provided by this Network will be interrupted. Please confirm that you want to restart this Network.",
3753+
"message.restart.usage.server": "Please restart your usage server(s) for your new settings to take effect.",
37533754
"message.restart.vm.to.update.settings": "Update in fields other than name and display name will require the Instance to be restarted.",
37543755
"message.restart.vpc": "Please confirm that you want to restart the VPC.",
37553756
"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
@@ -1263,15 +1263,7 @@ export default {
12631263
this.editableValueKey = null
12641264
this.$store.dispatch('RefreshFeatures')
12651265
this.$messageConfigSuccess(`${this.$t('message.setting.updated')} ${record.name}`, record)
1266-
if (json.updateconfigurationresponse &&
1267-
json.updateconfigurationresponse.configuration &&
1268-
!json.updateconfigurationresponse.configuration.isdynamic &&
1269-
['Admin'].includes(this.$store.getters.userInfo.roletype)) {
1270-
this.$notification.warning({
1271-
message: this.$t('label.status'),
1272-
description: this.$t('message.restart.mgmt.server')
1273-
})
1274-
}
1266+
this.$notifyConfigurationValueChange(json?.updateconfigurationresponse?.configuration || null)
12751267
}).catch(error => {
12761268
console.error(error)
12771269
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
@@ -301,15 +301,7 @@ export default {
301301
this.$emit('change-config', { value: newValue })
302302
this.$store.dispatch('RefreshFeatures')
303303
this.$messageConfigSuccess(`${this.$t('message.setting.updated')} ${configrecord.name}`, configrecord)
304-
if (json.updateconfigurationresponse &&
305-
json.updateconfigurationresponse.configuration &&
306-
!json.updateconfigurationresponse.configuration.isdynamic &&
307-
['Admin'].includes(this.$store.getters.userInfo.roletype)) {
308-
this.$notification.warning({
309-
message: this.$t('label.status'),
310-
description: this.$t('message.restart.mgmt.server')
311-
})
312-
}
304+
this.$notifyConfigurationValueChange(json?.updateconfigurationresponse?.configuration || null)
313305
}).catch(error => {
314306
this.editableValue = this.actualValue
315307
console.error(error)
@@ -345,15 +337,7 @@ export default {
345337
this.$emit('change-config', { value: newValue })
346338
this.$store.dispatch('RefreshFeatures')
347339
this.$messageConfigSuccess(`${this.$t('label.setting')} ${configrecord.name} ${this.$t('label.reset.config.value')}`, configrecord)
348-
if (json.resetconfigurationresponse &&
349-
json.resetconfigurationresponse.configuration &&
350-
!json.resetconfigurationresponse.configuration.isdynamic &&
351-
['Admin'].includes(this.$store.getters.userInfo.roletype)) {
352-
this.$notification.warning({
353-
message: this.$t('label.status'),
354-
description: this.$t('message.restart.mgmt.server')
355-
})
356-
}
340+
this.$notifyConfigurationValueChange(json?.resetconfigurationresponse?.configuration || null)
357341
}).catch(error => {
358342
this.editableValue = this.actualValue
359343
console.error(error)

0 commit comments

Comments
 (0)