From 390e7b8ed0332f9289c539d85fb9f8ab3b8251be Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Wed, 22 Dec 2021 19:54:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=BD=BF=E7=94=A8=20url=20path=20=E4=BC=A0?= =?UTF-8?q?=E9=80=92=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/css/components/common/login.scss | 10 +- nezha-fronted/src/components/common/login.vue | 2 +- .../src/components/common/mixin/dataList.js | 440 +++++++++++++++++- .../common/mixin/routerPathParams.js | 13 +- .../components/page/alert/alertMessage.vue | 90 +++- .../src/components/page/alert/alertRule.vue | 76 ++- .../components/page/alert/alertSilence.vue | 29 +- .../src/components/page/asset/asset.vue | 81 +++- .../src/components/page/config/assetMeta.vue | 63 ++- .../components/page/config/system/license.vue | 3 - .../page/config/template/chartTemp.vue | 20 - .../components/page/config/terminalLog.vue | 108 ++++- .../src/components/page/config/user.vue | 16 +- .../page/monitor/endpoint/endpointList.vue | 44 +- .../page/monitor/module/moduleList.vue | 46 +- .../page/monitor/project/projectList.vue | 32 +- 16 files changed, 978 insertions(+), 95 deletions(-) diff --git a/nezha-fronted/src/assets/css/components/common/login.scss b/nezha-fronted/src/assets/css/components/common/login.scss index ae952e05b..ba983f320 100644 --- a/nezha-fronted/src/assets/css/components/common/login.scss +++ b/nezha-fronted/src/assets/css/components/common/login.scss @@ -153,16 +153,18 @@ right: 8px; transform: translateY(-50%); } + .license-warn{ + color: #d92926; + margin-top: 22px; + text-align: center; + text-shadow: 1px 1px 3px #ddd; + } .login-license{ margin-top: 27px; text-align: center; line-height: 30px; display: flex; justify-content: space-around; - .license-warn{ - color: #d92926; - text-shadow: 1px 1px 3px #ddd; - } .license-info { margin-bottom: 10px; color: white; diff --git a/nezha-fronted/src/components/common/login.vue b/nezha-fronted/src/components/common/login.vue index 5ab2c50db..a00957eb3 100644 --- a/nezha-fronted/src/components/common/login.vue +++ b/nezha-fronted/src/components/common/login.vue @@ -26,8 +26,8 @@ +
{{license.warnInfo}}
-
{{license.warnInfo}}
diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js index d0e6a03a3..c47ef6142 100644 --- a/nezha-fronted/src/components/common/mixin/dataList.js +++ b/nezha-fronted/src/components/common/mixin/dataList.js @@ -296,20 +296,432 @@ export default { } }, created () { - const searchKeys = { - // key: path 键 - // value: vue set 参数 - pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, - pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, - orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - id: { target: this.searchLabel, propertyName: 'id', type: 'number' }, - severityIds: { target: this.searchLabel, propertyName: 'severityIds', type: 'string' }, - type: { target: this.searchLabel, propertyName: 'type', type: 'number' }, - name: { target: this.searchLabel, propertyName: 'name', type: 'string' }, - typeIds: { target: this.searchCheckBox, propertyName: 'typeIds', type: 'number' }, - ping: { target: this.searchCheckBox, propertyName: 'ping', type: 'string' }, - modelIds: { target: this.searchCheckBox, propertyName: 'modelIds', type: 'number' }, - fields: { target: this.searchCheckBox, propertyName: 'fields', type: 'json' } + // { + // // key: path 键 + // // value: vue set 参数 + // pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, + // pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, + // orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, + // ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' }, + // severityIds: { target: this.searchLabel, propertyName: 'severityIds', type: 'string' }, + // type: { target: this.searchLabel, propertyName: 'type', type: 'number' }, + // name: { target: this.searchLabel, propertyName: 'name', type: 'string' }, + // typeIds: { target: this.searchCheckBox, propertyName: 'typeIds', type: 'number' }, + // ping: { target: this.searchCheckBox, propertyName: 'ping', type: 'string' }, + // modelIds: { target: this.searchCheckBox, propertyName: 'modelIds', type: 'number' }, + // fields: { target: this.searchCheckBox, propertyName: 'fields', type: 'json' } + // } + const path = this.$route.fullPath.match(/\/(\S*)\?/)[1] + let searchKeys = {} + if (path === 'dc') { + searchKeys = { + // key: path 键 + // value: vue set 参数 + pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, + pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, + orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, + ids: { + target: this.searchLabel, + propertyName: 'ids', + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + name: { + target: this.searchLabel, + propertyName: 'name', + type: 'string', + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + location: { + target: this.searchLabel, + propertyName: 'location', + type: 'string', + defaultJson: { + disabled: false, + label: 'location', + name: 'Location', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + state: { + target: this.searchLabel, + propertyName: 'state', + type: 'string', + defaultJson: { + disabled: false, + label: 'dcState', + name: 'State', + readonly: true, + type: 'selectString', + val: '' + }, + jsonKey: 'val' + } + } + } else if (path === 'template') { + searchKeys = { + // key: path 键 + // value: vue set 参数 + pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, + pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, + orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, + ids: { + target: this.searchLabel, + propertyName: 'ids', + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + name: { + target: this.searchLabel, + propertyName: 'name', + type: 'string', + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + gname: { + target: this.searchLabel, + propertyName: 'gname', + type: 'string', + defaultJson: { + disabled: false, + label: 'gname', + name: 'Group', + type: 'input', + val: '' + }, + jsonKey: 'val' + } + } + } else if (path === 'i18n') { + searchKeys = { + // key: path 键 + // value: vue set 参数 + pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, + pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, + orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, + ids: { + target: this.searchLabel, + propertyName: 'ids', + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + code: { + target: this.searchLabel, + propertyName: 'code', + type: 'string', + defaultJson: { + disabled: false, + label: 'code', + name: 'Code', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + value: { + target: this.searchLabel, + propertyName: 'value', + type: 'string', + defaultJson: { + disabled: false, + label: 'value', + name: 'Value', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + lang: { + target: this.searchLabel, + propertyName: 'lang', + type: 'string', + defaultJson: { + disabled: false, + label: 'lang', + name: 'Lang', + type: 'input', + val: '' + }, + jsonKey: 'val' + } + } + } else if (path === 'model') { + searchKeys = { + // key: path 键 + // value: vue set 参数 + pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, + pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, + orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, + ids: { + target: this.searchLabel, + propertyName: 'ids', + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + name: { + target: this.searchLabel, + propertyName: 'name', + type: 'string', + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + brandIds: { + target: this.searchLabel, + propertyName: 'brandIds', + type: 'number', + defaultJson: { + disabled: false, + label: 'brandIds', + name: 'Brand', + readonly: true, + type: 'brand', + val: '' + }, + jsonKey: 'val' + } + } + } else if (path === 'operationLog' || path === 'profile') { + searchKeys = { + // key: path 键 + // value: vue set 参数 + pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, + pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, + orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, + type: { + target: this.searchLabel, + propertyName: 'type', + type: 'number', + defaultJson: { + disabled: false, + id: 11, + label: 'type', + name: 'Type', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + username: { + target: this.searchLabel, + propertyName: 'username', + type: 'string', + defaultJson: { + disabled: false, + id: 12, + label: 'username', + name: 'User', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + operation: { + target: this.searchLabel, + propertyName: 'operation', + type: 'string', + defaultJson: { + disabled: false, + id: 13, + label: 'operation', + name: 'Operation', + type: 'selectString', + val: '' + }, + jsonKey: 'val' + }, + state: { + target: this.searchLabel, + propertyName: 'state', + type: 'string', + defaultJson: { + disabled: false, + id: 16, + label: 'state', + name: 'State', + readonly: true, + type: 'selectString', + val: '' + }, + jsonKey: 'val' + }, + operaId: { + target: this.searchLabel, + propertyName: 'operaId', + type: 'string', + defaultJson: { + disabled: false, + id: 14, + label: 'operaId', + name: 'Resources', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + params: { + target: this.searchLabel, + propertyName: 'params', + type: 'string', + defaultJson: { + disabled: false, + id: 17, + label: 'params', + name: 'Params', + type: 'input', + val: '' + }, + jsonKey: 'val' + } + } + } else if (path === 'agent') { + searchKeys = { + // key: path 键 + // value: vue set 参数 + pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, + pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, + orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, + ids: { + target: this.searchLabel, + propertyName: 'ids', + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + state: { + target: this.searchLabel, + propertyName: 'state', + type: 'string', + defaultJson: { + disabled: false, + label: 'promState', + name: 'State', + readonly: true, + type: 'select', + val: '' + }, + jsonKey: 'val' + }, + dc: { + target: this.searchLabel, + propertyName: 'dc', + type: 'number', + defaultJson: { + name: 'Date center', + type: 'dc', + label: 'dcIds', + disabled: false, + val: '', + valnum: '', + valString: '' + }, + jsonKey: 'valnum', + strKey: 'val', + listStr: 'dcSelect' + }, + type: { + target: this.searchLabel, + propertyName: 'type', + type: 'number', + defaultJson: { + disabled: false, + label: 'promType', + name: 'Type', + readonly: true, + type: 'select', + val: '', + valnum: '', + valString: '' + }, + jsonKey: 'valnum', + strKey: 'val', + listStr: 'history_once' + } + } + } else if (path === 'roles') { + searchKeys = { + // key: path 键 + // value: vue set 参数 + pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, + pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, + orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, + name: { + target: this.searchLabel, + propertyName: 'name', + type: 'string', + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + } + } } this.initQueryFromPath(searchKeys) }, diff --git a/nezha-fronted/src/components/common/mixin/routerPathParams.js b/nezha-fronted/src/components/common/mixin/routerPathParams.js index 90ad054eb..980c2b271 100644 --- a/nezha-fronted/src/components/common/mixin/routerPathParams.js +++ b/nezha-fronted/src/components/common/mixin/routerPathParams.js @@ -6,19 +6,19 @@ export default { const q = this.$route.query lodash.forIn(searchKeys, (val, key) => { let qv = lodash.get(q, key) - console.log(qv, q, key, val) if (qv && val.type == 'number') { qv = lodash.toNumber(qv) } setTimeout(() => { this.setSearchInput(val, qv) }, 200) + console.log() qv && this.$set(val.target, val.propertyName, qv) }) }, // 更新path,包含请求参数 updatePath (param, path) { - // console.log(param) + console.log(param) this.$router.replace({ path: path, query: param }).catch(err => {}) }, setSearchInput (val, qv) { @@ -32,10 +32,17 @@ export default { setTimeout(() => { const obj = lodash.cloneDeep(val.defaultJson) obj[val.jsonKey] = qv + console.log(obj[val.jsonKey]) + if (val.strKey) { + this.$refs[dataList].$refs.searchInput[val.listStr].map((e) => { + console.log(e) + obj[val.strKey] = e.name + }) + } this.$refs[dataList].$refs.searchInput.select_list.push(obj) this.$refs[dataList].$refs.searchInput.sreach_num++ // this.$refs[dataList].$refs.searchInput.searchLabelList = this.$refs[dataList].$refs.searchInput.searchLabelList.filter(item => item.label !== 'projectIds') - }) + }, 500) } } } diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index 40247244c..b7368d9e9 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -401,12 +401,90 @@ export default { pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' }, - endpointName: { target: this.searchLabel, propertyName: 'endpointName', type: 'string' }, - summary: { target: this.searchLabel, propertyName: 'summary', type: 'number' }, - ruleName: { target: this.searchLabel, propertyName: 'ruleName', type: 'string' }, - assetName: { target: this.searchLabel, propertyName: 'assetName', type: 'string' }, - labels: { target: this.searchLabel, propertyName: 'labels', type: 'string' }, + ids: { + target: this.searchLabel, + propertyName: 'ids', + type: 'number', + + defaultJson: { + disabled: false, + id: 26, + label: 'ids', + name: 'ID', + type: 'id', + val: '' + }, + jsonKey: 'val' + }, + endpointName: { + target: this.searchLabel, + propertyName: 'endpointName', + type: 'string', + + defaultJson: { + disabled: false, + label: 'endpointName', + name: 'Endpoint', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + summary: { + target: this.searchLabel, + propertyName: 'summary', + type: 'number', + + defaultJson: { + disabled: false, + label: 'summary', + name: 'Summary', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + ruleName: { + target: this.searchLabel, + propertyName: 'ruleName', + type: 'string', + + defaultJson: { + disabled: false, + label: 'ruleName', + name: 'Alert rule', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + assetName: { + target: this.searchLabel, + propertyName: 'assetName', + type: 'string', + defaultJson: { + disabled: false, + label: 'assetName', + name: 'Asset ', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + labels: { + target: this.searchLabel, + propertyName: 'labels', + type: 'string', + + defaultJson: { + disabled: false, + label: 'labels', + name: 'Label', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, dcIds: { target: this.searchCheckBox, propertyName: 'dcIds', type: 'number' }, modelIds: { target: this.searchCheckBox, propertyName: 'modelIds', type: 'number' }, moduleIds: { target: this.searchCheckBox, propertyName: 'moduleIds', type: 'number' }, diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 43aa27f1d..52c9de29d 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -342,35 +342,75 @@ export default { pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' }, - severityIds: { target: this.searchLabel, propertyName: 'severityIds', type: 'string' }, + ids: { + target: this.searchLabel, + propertyName: 'ids', + + type: 'string', + defaultJson: { + disabled: false, + id: 1, + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + severityIds: { + target: this.searchLabel, + propertyName: 'severityIds', + type: 'string', + isSearchInput: true, + defaultJson: { + disabled: false, + id: 4, + label: 'severityIds', + name: 'Priority', + readonly: true, + type: 'severity', + val: '', + valnum: '', + valString: '' + }, + jsonKey: 'valnum', + strKey: 'val', + listStr: 'severitySelect' + }, type: { target: this.searchLabel, propertyName: 'type', type: 'number', isSearchInput: true, - defaultJson: - { - name: 'Type', - id: 5, - type: 'alertTypes', - label: 'type', - disabled: false, - readonly: true, - val: 'Metrics', - valnum: 1, - valString: '' - }, - jsonKey: 'valnum' + defaultJson: { + name: 'Type', + id: 5, + type: 'alertTypes', + label: 'type', + disabled: false, + readonly: true, + val: '', + valnum: '', + valString: '' + }, + jsonKey: 'valnum', + strKey: 'val', + listStr: 'alertTypesSelect' }, name: { target: this.searchLabel, propertyName: 'name', type: 'string', - isSearchInput: true, - defaultJson: { - } + defaultJson: { + disabled: false, + id: 2, + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' } } Object.keys(this.$route.query).forEach(key => { diff --git a/nezha-fronted/src/components/page/alert/alertSilence.vue b/nezha-fronted/src/components/page/alert/alertSilence.vue index 978a71853..af034cdd0 100644 --- a/nezha-fronted/src/components/page/alert/alertSilence.vue +++ b/nezha-fronted/src/components/page/alert/alertSilence.vue @@ -244,8 +244,33 @@ export default { pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' }, - matchers: { target: this.searchLabel, propertyName: 'matchers', type: 'string' } + ids: { + target: this.searchLabel, + propertyName: 'ids', + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + matchers: { + target: this.searchLabel, + propertyName: 'matchers', + type: 'string', + defaultJson: { + disabled: false, + label: 'matchers', + name: 'Matcher', + type: 'input', + val: '' + }, + jsonKey: 'val' + } } this.initQueryFromPath(searchKeys) } diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 1c39b8c52..62c81731b 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -764,11 +764,82 @@ export default { pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' }, - sn: { target: this.searchLabel, propertyName: 'sn', type: 'number' }, - name: { target: this.searchLabel, propertyName: 'name', type: 'string' }, - manageIp: { target: this.searchLabel, propertyName: 'manageIp', type: 'number' }, - statistics: { target: this.searchLabel, propertyName: 'statistics', type: 'number' } + ids: { + target: this.searchLabel, + propertyName: 'ids', + + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + name: { + target: this.searchLabel, + propertyName: 'name', + type: 'string', + + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + sn: { + target: this.searchLabel, + propertyName: 'sn', + type: 'number', + + defaultJson: { + disabled: false, + id: 'sn', + label: 'sn', + name: 'SN', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + manageIp: { + target: this.searchLabel, + propertyName: 'manageIp', + type: 'number', + + defaultJson: { + disabled: false, + id: 'manageIp', + label: 'manageIp', + name: 'IP', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + statistics: { + target: this.searchLabel, + propertyName: 'statistics', + type: 'number', + + defaultJson: { + disabled: false, + id: 'stateIds', + label: 'stateIds', + name: 'State', + readonly: true, + type: 'assetState', + val: '' + }, + jsonKey: 'val' + } } this.initQueryFromPath(searchKeys) }, diff --git a/nezha-fronted/src/components/page/config/assetMeta.vue b/nezha-fronted/src/components/page/config/assetMeta.vue index 846dacc2c..81f1f840b 100644 --- a/nezha-fronted/src/components/page/config/assetMeta.vue +++ b/nezha-fronted/src/components/page/config/assetMeta.vue @@ -294,9 +294,66 @@ export default { pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' }, - name: { target: this.searchLabel, propertyName: 'name', type: 'string' }, - brandIds: { target: this.searchLabel, propertyName: 'brandIds', type: 'number' } + ids: { + target: this.searchLabel, + propertyName: 'ids', + + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + name: { + target: this.searchLabel, + propertyName: 'name', + type: 'string', + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + key: { + target: this.searchLabel, + propertyName: 'key', + type: 'string', + defaultJson: { + disabled: false, + label: 'key', + name: 'Key', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + groupIds: { + target: this.searchLabel, + propertyName: 'groupIds', + type: 'number', + isSearchInput: true, + defaultJson: { + disabled: false, + label: 'group', + name: 'Group', + readonly: true, + type: 'group', + val: '', + searchType: '' + }, + jsonKey: 'searchType', + strKey: 'val', + listStr: 'groupSelect' + } } this.initQueryFromPath(searchKeys) } diff --git a/nezha-fronted/src/components/page/config/system/license.vue b/nezha-fronted/src/components/page/config/system/license.vue index 0f8f0a851..2f2bec608 100644 --- a/nezha-fronted/src/components/page/config/system/license.vue +++ b/nezha-fronted/src/components/page/config/system/license.vue @@ -163,9 +163,6 @@ export default { } }) this.$get('/sys/license/status', { scope: 'all' }).then(res => { - res = statusDate - this.loading = false - return this.tableData = res.data.list if (res.code === 200) { this.tableData = res.data.list this.loading = false diff --git a/nezha-fronted/src/components/page/config/template/chartTemp.vue b/nezha-fronted/src/components/page/config/template/chartTemp.vue index 81b6481f1..0ddfdf2f1 100644 --- a/nezha-fronted/src/components/page/config/template/chartTemp.vue +++ b/nezha-fronted/src/components/page/config/template/chartTemp.vue @@ -218,12 +218,6 @@ export default { this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.tools.loading = true - const chartTempParam = { - ...this.searchLabel, - ...this.searchCheckBox - } - const path = this.fromRoute.chartTemp - this.updatePath(chartTempParam, path) this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox, panelId: 0, returnChildren: 0, groupId: 0 }).then(response => { this.tools.loading = false if (response.code === 200) { @@ -262,20 +256,6 @@ export default { }, panelReload () {}, panelReloadOnlyPanel () {} - }, - created () { - const searchKeys = { - // key: path 键 - // value: vue set 参数 - pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, - pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, - orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' }, - type: { target: this.searchLabel, propertyName: 'type', type: 'string' }, - name: { target: this.searchLabel, propertyName: 'name', type: 'string' }, - varType: { target: this.searchLabel, propertyName: 'varType', type: 'number' } - } - this.initQueryFromPath(searchKeys) } } diff --git a/nezha-fronted/src/components/page/config/terminalLog.vue b/nezha-fronted/src/components/page/config/terminalLog.vue index 6ef5dc675..ed4fcc550 100644 --- a/nezha-fronted/src/components/page/config/terminalLog.vue +++ b/nezha-fronted/src/components/page/config/terminalLog.vue @@ -221,13 +221,107 @@ export default { pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - host: { target: this.searchLabel, propertyName: 'host', type: 'string' }, - username: { target: this.searchLabel, propertyName: 'username', type: 'string' }, - loginUser: { target: this.searchLabel, propertyName: 'loginUser', type: 'string' }, - remoteAddr: { target: this.searchLabel, propertyName: 'remoteAddr', type: 'string' }, - uuid: { target: this.searchLabel, propertyName: 'uuid', type: 'string' }, - protocol: { target: this.searchLabel, propertyName: 'protocol', type: 'string' }, - state: { target: this.searchLabel, propertyName: 'state', type: 'number' } + host: { + target: this.searchLabel, + propertyName: 'host', + type: 'string', + defaultJson: { + disabled: false, + id: 11, + label: 'host', + name: 'Login host', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + username: { + target: this.searchLabel, + propertyName: 'username', + type: 'string', + defaultJson: { + disabled: false, + id: 14, + label: 'username', + name: 'Source user', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + loginUser: { + target: this.searchLabel, + propertyName: 'loginUser', + type: 'string', + defaultJson: { + disabled: false, + id: 12, + label: 'loginUser', + name: 'Login user', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + remoteAddr: { + target: this.searchLabel, + propertyName: 'remoteAddr', + type: 'string', + defaultJson: { + disabled: false, + id: 13, + label: 'remoteAddr', + name: 'Source IP', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + uuid: { + target: this.searchLabel, + propertyName: 'uuid', + type: 'string', + defaultJson: { + disabled: false, + id: 15, + label: 'uuid', + name: 'UUID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + protocol: { + target: this.searchLabel, + propertyName: 'protocol', + type: 'string', + defaultJson: { + disabled: false, + id: 16, + label: 'protocol', + name: 'Protocol', + readonly: true, + type: 'selectString', + + val: '' + }, + jsonKey: 'val' + }, + state: { + target: this.searchLabel, + propertyName: 'state', + type: 'number', + defaultJson: { + disabled: false, + id: 17, + label: 'state', + name: 'State', + readonly: true, + type: 'terminalStatus', + val: '' + }, + jsonKey: 'val' + } } this.initQueryFromPath(searchKeys) } diff --git a/nezha-fronted/src/components/page/config/user.vue b/nezha-fronted/src/components/page/config/user.vue index a8f965eae..cbf21dd00 100644 --- a/nezha-fronted/src/components/page/config/user.vue +++ b/nezha-fronted/src/components/page/config/user.vue @@ -208,7 +208,21 @@ export default { pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - name: { target: this.searchLabel, propertyName: 'name', type: 'string' } + name: { + target: this.searchLabel, + propertyName: 'name', + type: 'string', + + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + } } this.initQueryFromPath(searchKeys) } diff --git a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue index ecf1d16d0..73770e5ed 100644 --- a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue +++ b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue @@ -807,9 +807,47 @@ export default { pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' }, - name: { target: this.searchLabel, propertyName: 'name', type: 'string' }, - assetName: { target: this.searchLabel, propertyName: 'assetName', type: 'string' }, + ids: { + target: this.searchLabel, + propertyName: 'ids', + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + name: { + target: this.searchLabel, + propertyName: 'name', + type: 'string', + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + assetName: { + target: this.searchLabel, + propertyName: 'assetName', + type: 'string', + defaultJson: { + disabled: false, + label: 'assetName', + name: 'Asset', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, projectIds: { target: this.searchCheckBox, propertyName: 'projectIds', type: 'string' }, logsStates: { target: this.searchCheckBox, propertyName: 'logsStates', type: 'string' }, moduleIds: { target: this.searchCheckBox, propertyName: 'moduleIds', type: 'string' } diff --git a/nezha-fronted/src/components/page/monitor/module/moduleList.vue b/nezha-fronted/src/components/page/monitor/module/moduleList.vue index e3951e1bd..c444a5417 100644 --- a/nezha-fronted/src/components/page/monitor/module/moduleList.vue +++ b/nezha-fronted/src/components/page/monitor/module/moduleList.vue @@ -462,9 +462,49 @@ export default { pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' }, - projectIds: { target: this.searchLabel, propertyName: 'projectIds', type: 'number' }, - name: { target: this.searchLabel, propertyName: 'name', type: 'string' } + ids: { + target: this.searchLabel, + propertyName: 'ids', + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + name: { + target: this.searchLabel, + propertyName: 'name', + type: 'string', + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + projectIds: { + target: this.searchLabel, + propertyName: 'projectIds', + type: 'number', + defaultJson: { + disabled: false, + id: 11, + label: 'projectIds', + name: 'Project name', + readonly: true, + type: 'project', + val: '' + }, + jsonKey: 'val' + } } this.initQueryFromPath(searchKeys) }, diff --git a/nezha-fronted/src/components/page/monitor/project/projectList.vue b/nezha-fronted/src/components/page/monitor/project/projectList.vue index 3983773e0..04761999c 100644 --- a/nezha-fronted/src/components/page/monitor/project/projectList.vue +++ b/nezha-fronted/src/components/page/monitor/project/projectList.vue @@ -166,8 +166,36 @@ export default { pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, - ids: { target: this.searchLabel, propertyName: 'ids', type: 'number' }, - name: { target: this.searchLabel, propertyName: 'name', type: 'string' } + ids: { + target: this.searchLabel, + propertyName: 'ids', + + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + name: { + target: this.searchLabel, + propertyName: 'name', + type: 'string', + + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + } } this.initQueryFromPath(searchKeys) },