diff --git a/nezha-fronted/src/components/common/mixin/system/systemMixin.js b/nezha-fronted/src/components/common/mixin/system/systemMixin.js index fd725c7a0..615ae875f 100644 --- a/nezha-fronted/src/components/common/mixin/system/systemMixin.js +++ b/nezha-fronted/src/components/common/mixin/system/systemMixin.js @@ -81,7 +81,8 @@ export default { metrics_storage_s3_endpoint: '', metrics_storage_s3_secret_access_key: '', metrics_storage_type: '', - prometheus_federation_enabled: '' + prometheus_federation_enabled: '', + interface_name: [] }, monitorRules: { // alert_api: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }], @@ -253,6 +254,13 @@ export default { this.$refs.emailForm.clearValidate() } if (type == 'monitor') { + if(response.data.interface_name){ + let arr = response.data.interface_name.split(',') + this.monitor.interface_name = arr.map(item=>{ + return {text: item} + + }) + } localStorage.setItem('nz-prometheus-federation-enabled', this.monitor.prometheus_federation_enabled) } this[type + 'Copy'] = Object.assign({}, this[type]) @@ -270,6 +278,12 @@ export default { param.map_center_config = JSON.stringify(mapConfig) param.pin_policy = JSON.stringify(this.basic.pin_policy) } + if(type == 'monitor') { + let str = this.monitor.interface_name.map(item=>{ + return item.text + }) + param.interface_name = str.join(',') + } const postParam = Object.assign({}, param) for (const key in postParam[type]) { postParam[type][key] = postParam[type][key] + '' diff --git a/nezha-fronted/src/components/page/config/monitor.vue b/nezha-fronted/src/components/page/config/monitor.vue index d47506631..f5265aa0c 100644 --- a/nezha-fronted/src/components/page/config/monitor.vue +++ b/nezha-fronted/src/components/page/config/monitor.vue @@ -27,6 +27,15 @@ + + +
{{$t('config.system.monitor.metricsTitle')}}
@@ -110,13 +119,18 @@ +