diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 925be8ede..d6a4aa55f 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -133,7 +133,8 @@ const cn = { batchDel: '批量删除', tempPrev: '模板预览', silenceAlert: '告警静默', - quickSilent: '快速静默' + quickSilent: '快速静默', + configEndpoint: '配置' }, setup: { step0: '欢迎', @@ -1298,7 +1299,10 @@ const cn = { name: '名称', configs: '配置', state: '状态', - allselect: '当前页已全部选择' + allselect: '当前页已全部选择', + enable: '开启', + disable: '关闭', + status: 'Endpoint 状态' }, metrics: { metrics: '指标', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 3103d9d0d..e9de75d16 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -138,7 +138,8 @@ const en = { batchDel: 'Batches delete', tempPrev: 'Template preview', silenceAlert: 'silence alert', - quickSilent: 'Quick silent' + quickSilent: 'Quick silent', + configEndpoint: 'Config' }, pageSize: '/page', setup: { @@ -1308,7 +1309,10 @@ const en = { name: 'Name', configs: 'Config', state: 'State', - allselect: 'The current page has all been selected' + allselect: 'The current page has all been selected', + enable: 'Enable', + disable: 'Disable', + status: 'Endpoint status' }, metrics: { metrics: 'Metrics', // "指标" diff --git a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue index c456d2472..ccfbb00b5 100644 --- a/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/addEndpointBox.vue @@ -249,6 +249,7 @@ export default { endpointNameTmpl: '{{module.name}}-{{asset.name}}', type: 'http', port: '', + enabled: 1, configs: { walk: [], snmpCredentialsId: '', @@ -672,6 +673,9 @@ export default { this.object = JSON.parse(JSON.stringify(u)) this.object.walk = this.object.configs.walk ? JSON.parse(JSON.stringify(this.object.configs.walk)) : [] this.object.configs.port && (this.object.port = this.object.configs.port) + // if (!this.object.enabled && !isNaN(this.object.enabled)) { + // this.object.enabled = 1 + // } this.rightBox.show = true }, showRightBox () { @@ -679,6 +683,9 @@ export default { this.object = { ...JSON.parse(JSON.stringify(this.blankEndpoint)), projectId: this.currentModule.projectId, moduleId: this.currentModule.id, assetName: '', type: this.currentModule.type } this.object.walk = this.object.configs.walk ? JSON.parse(JSON.stringify(this.object.configs.walk)) : [] this.object.configs.port && (this.object.port = this.object.configs.port) + // if (!this.object.enabled && !isNaN(this.object.enabled)) { + // this.object.enabled = 1 + // } this.rightBox.show = true }, editAllEndpoint () { diff --git a/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue b/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue index ebe0fa1ff..ff0dde259 100644 --- a/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue +++ b/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue @@ -91,17 +91,22 @@ - + + + + + + -
{{ $t("overall.endpointTemplate") }} - -
- {{$t('project.module.tip.defaultEndpointSet')}} -
- {{$t('project.module.tip.relation')}} -
- -
+
{{ $t("overall.configEndpoint") }} + + + + + + + +
@@ -331,6 +336,10 @@ export default { { name: this.$t('project.endpoint.authTypeWord'), value: 1 }, { name: this.$t('project.endpoint.authTypeToken'), value: 2 } ], + endpointStateList: [ + { name: this.$t('project.endpoint.enable'), value: 1 }, + { name: this.$t('project.endpoint.disable'), value: 0 } + ], configsCopyValue: '' } }, @@ -782,7 +791,7 @@ export default { .half-form-item { width: calc(50% - 30px); display: inline-block; - padding: 0 18px 0 8px; + padding: 0 0px 0 8px; } .half-form-item:nth-child(even){ padding-left: 0; diff --git a/nezha-fronted/src/components/common/rightBox/moduleBox.vue b/nezha-fronted/src/components/common/rightBox/moduleBox.vue index 7ecc0868c..0d6db7cec 100644 --- a/nezha-fronted/src/components/common/rightBox/moduleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/moduleBox.vue @@ -787,7 +787,7 @@ export default { .half-form-item { width: calc(50% - 21px); display: inline-block; - padding: 0 18px 0 0px; + padding: 0 0px 0 0px; } .half-form-item:nth-child(even){ padding-left: 0; diff --git a/nezha-fronted/src/components/common/table/settings/endpointTable.vue b/nezha-fronted/src/components/common/table/settings/endpointTable.vue index b513ad983..e1209ab82 100644 --- a/nezha-fronted/src/components/common/table/settings/endpointTable.vue +++ b/nezha-fronted/src/components/common/table/settings/endpointTable.vue @@ -86,6 +86,10 @@
+ {{scope.row[item.prop] ? scope.row[item.prop] : ''}} @@ -176,6 +180,11 @@ export default { show: true, sortable: 'custom' } + // { + // label: this.$t('project.endpoint.status'), + // prop: 'enabled', + // show: false + // } ] } }, @@ -194,24 +203,24 @@ export default { suspendedStr (status) { // 10进制转为2进制 分别给对应的状态 if (!status || status === 1 || status == 0) { return '' } const arr = status.toString(2).split('') - while (arr.length < 5) { + while (arr.length < 4) { arr.unshift('0') } arr.pop() let str = '' arr.forEach((item, index) => { if (index === 0) { - str += `
DC
` + str += `
DC
` } if (index === 1) { - str += `
ASSET
` + str += `
ASSET
` } if (index === 2) { - str += `
ENDPOINT
` - } - if (index === 3) { - str += `
PROMETHEUS
` + str += `
ENDPOINT
` } + // if (index === 3) { + // str += `
PROMETHEUS
` + // } }) return str }