From ce18288599574ac6777c81841ae0c75317d9f0a5 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 11 Nov 2021 11:34:34 +0800 Subject: [PATCH 01/22] =?UTF-8?q?NEZ-1221=20fix=EF=BC=9A=20=20diagram=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=9B=BE=20=E5=9B=A0=E4=B8=BA=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E6=BB=9A=E8=BD=AE=E6=94=BE=E5=A4=A7=E7=BC=A9=E5=B0=8F?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=82=AC=E6=B5=AE=E5=B1=95=E7=A4=BA=E6=9C=89?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/charts/chart-list.vue | 5 ++++- nezha-fronted/src/components/common/ChartDiagram/diagram.vue | 5 +++++ nezha-fronted/src/components/common/project/topologyL5.vue | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index dd232d8f0..fd5dc134e 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -1515,7 +1515,10 @@ export default { const arr = [] arr.push(this.$get(`/asset/asset/${assetId}`)) arr.push(this.$get(`/asset/asset/feature/${assetId}`)) - this.$refs['editChart' + chartInfo.id][0].showLoad() + console.log(this.$refs['editChart' + chartInfo.id][0]) + if (this.$refs['editChart' + chartInfo.id][0]) { + this.$refs['editChart' + chartInfo.id][0].showLoad() + } // this.$get('/asset/info?id=' + assetId).then(response => { // if (response.code == 200) { diff --git a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue index 5f58f3ecf..4c2aa7d96 100644 --- a/nezha-fronted/src/components/common/ChartDiagram/diagram.vue +++ b/nezha-fronted/src/components/common/ChartDiagram/diagram.vue @@ -1408,6 +1408,10 @@ export default { if (this.$refs.topTool) { this.$refs.topTool.scaleNum = parseInt(data * 100) } + const domRect = document.getElementById('topology-canvas' + this.topologyIndexF).getBoundingClientRect() + if (getTopology(this.topologyIndex)) { + getTopology(this.topologyIndex).canvasPos = domRect + } break } case 'locked': { @@ -1924,6 +1928,7 @@ export default { } const domRect = document.getElementById('topology-canvas' + this.topologyIndexF).getBoundingClientRect() getTopology(this.topologyIndex).canvasPos = domRect + getTopology(this.topologyIndex).resize() }, 100) }, diff --git a/nezha-fronted/src/components/common/project/topologyL5.vue b/nezha-fronted/src/components/common/project/topologyL5.vue index ec2b16e96..d4a9c3662 100644 --- a/nezha-fronted/src/components/common/project/topologyL5.vue +++ b/nezha-fronted/src/components/common/project/topologyL5.vue @@ -1448,6 +1448,10 @@ export default { if (this.$refs.topTool) { this.$refs.topTool.scaleNum = parseInt(data * 100) } + const domRect = document.getElementById('topology-canvas' + this.topologyIndexF).getBoundingClientRect() + if (getTopology(this.topologyIndex)) { + getTopology(this.topologyIndex).canvasPos = domRect + } break } case 'locked': { From d4dd85ee8eb2338c83f6d3d0af0a0764e6f88ba9 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Thu, 11 Nov 2021 13:55:04 +0800 Subject: [PATCH 02/22] =?UTF-8?q?NEZ-1218=20fix:=20alert=20message=20?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=8C=89=E9=92=AE=20=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=9D=A1=E4=BB=B6=20=E5=BD=93=20rule=5Ftype?= =?UTF-8?q?=20=E6=9C=AAlogs=E6=97=B6=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/pagination.vue | 2 +- .../src/components/common/table/alert/alertMessageTable.vue | 4 ++-- nezha-fronted/src/components/page/alert/alertMessage.vue | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/common/pagination.vue b/nezha-fronted/src/components/common/pagination.vue index 406ed1055..f854cbe1a 100644 --- a/nezha-fronted/src/components/common/pagination.vue +++ b/nezha-fronted/src/components/common/pagination.vue @@ -15,7 +15,6 @@ - @@ -102,6 +101,7 @@ export default { wraps.forEach(wrap => { if (wrap) { wrap.scrollTop = 0 + wrap.scrollLeft = 0 } }) }) diff --git a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue index 06a46ae03..4026cca33 100644 --- a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue @@ -113,8 +113,8 @@ fixed="right">
{{$t('overall.option')}}
- - + +
diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index 3e546c15d..d24572f7f 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -453,7 +453,11 @@ export default { } this.$get('/alert/rule/' + row.alertRule.id).then(res => { this.currentMsg = { ...row, alertRule: { ...res.data } } - this.graphShow = true + if (row.alertRule.type !== 1) { + this.graphShow = false + } else { + this.graphShow = true + } this.$nextTick(() => { this.searchTimeDialog = [bus.computeTimezoneTime(new Date().getTime() - 1 * 60 * 60 * 1000), bus.computeTimezoneTime(new Date().getTime())] this.queryDate() From 22c5120bf75bfa15d0073fce682d1e9e9506cc2a Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Thu, 11 Nov 2021 15:01:48 +0800 Subject: [PATCH 03/22] =?UTF-8?q?style:=20endpoint=20config=20=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/table/settings/endpointTable.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/common/table/settings/endpointTable.vue b/nezha-fronted/src/components/common/table/settings/endpointTable.vue index d83c9fffa..e888cbc3d 100644 --- a/nezha-fronted/src/components/common/table/settings/endpointTable.vue +++ b/nezha-fronted/src/components/common/table/settings/endpointTable.vue @@ -110,7 +110,7 @@ - + [{{scope.row.configs[0].enable ? 'Metrics':''}}{{scope.row.configs[0].enable&&scope.row.configs[1].enable?',':''}}{{scope.row.configs[1].enable ? 'logs' : ''}}]
@@ -409,8 +409,8 @@ export default { } .copy-value-content{ position: absolute; - right: 6px; - top: 6px; + right: 12px; + top: 8px; } .data-column__endpoint { background: #FFFFFF; From 70e3945dc4631a6af0dadfeab9d543e0a2514b69 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 11 Nov 2021 15:05:16 +0800 Subject: [PATCH 04/22] =?UTF-8?q?NEZ-1220=20fix=EF=BC=9Asetup=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/i18n.js | 6 +- .../src/components/common/language/index.js | 8 +- .../src/components/common/language/newcn.js | 70 ++++++++++++++++ .../src/components/common/language/newen.js | 79 +++++++++++++++++++ 4 files changed, 156 insertions(+), 7 deletions(-) create mode 100644 nezha-fronted/src/components/common/language/newcn.js create mode 100644 nezha-fronted/src/components/common/language/newen.js diff --git a/nezha-fronted/src/components/common/i18n.js b/nezha-fronted/src/components/common/i18n.js index 55d153552..1165394f8 100644 --- a/nezha-fronted/src/components/common/i18n.js +++ b/nezha-fronted/src/components/common/i18n.js @@ -2,12 +2,12 @@ import Vue from 'vue' import locale from 'element-ui/lib/locale' import VueI18n from 'vue-i18n' import { get } from '@/http' -// import messages from './language' +import messages from './language' Vue.use(VueI18n) // 从localStorage获取语言选择。 const i18n = new VueI18n({ - locale: localStorage.getItem('nz-language') || 'en' // 初始未选择默认 en 英文 - // messages + locale: localStorage.getItem('nz-language') || 'en', // 初始未选择默认 en 英文 + messages }) locale.i18n((key, value) => i18n.t(key, value)) // 兼容element diff --git a/nezha-fronted/src/components/common/language/index.js b/nezha-fronted/src/components/common/language/index.js index dfbf6e068..d367c582e 100644 --- a/nezha-fronted/src/components/common/language/index.js +++ b/nezha-fronted/src/components/common/language/index.js @@ -1,6 +1,6 @@ -import en from './en' -import cn from './cn' +import newen from './newen' +import newcn from './newcn' export default { - en: en, - cn: cn + en: newen, + cn: newcn } diff --git a/nezha-fronted/src/components/common/language/newcn.js b/nezha-fronted/src/components/common/language/newcn.js new file mode 100644 index 000000000..05751a780 --- /dev/null +++ b/nezha-fronted/src/components/common/language/newcn.js @@ -0,0 +1,70 @@ +import zhLocale from 'element-ui/lib/locale/lang/zh-CN' // 引入element语言包 +const newcn = { + setup: { + step0: '欢迎', + step1: '数据库', + step2: 'Redis', + step3: '系统', + host: 'Host', + port: '端口', + language: '语言', + welcome: { + header: '欢迎使用哪吒安装向导!', + guid: '向导将为您做什么?', + guid_1: '创建基本的配置', + guid_2: '尝试在数据库和Redis设置中查找问题', + toContinue: '继续', + creatFile: '出于安全原因,您需要通过创建文件来验证安装', + createFileTip: '这可以通过执行以下命令来完成', + next: '完成后单击“下一步”按钮.' + }, + database: { + configTitle: '配置数据库连接', + configTip: '请手动创建数据库,并设置连接到此数据库的配置参数,完成后按“下一步”按钮' + }, + redis: { + configTitle: '配置Redis连接', + configTip: '请设置连接到此redis的配置参数,完成后按“下一步”按钮' + }, + system: { + configTitle: '系统配置', + configTip: '请输入管理员的用户名和密码,并设置Nezha WEB模块的安装信息,如IP:port', + federation: '联邦', + federationEnable: '可用', + federationDisable: '不可用' + }, + name: '数据库名称', + username: '用户名', + pin: '密码', + alertPath: '网站URL', + alertPrefix: '警报前缀', + haMode: 'HA 模式', + haVip: '虚拟的 IP', + next: '下一步', + back: '返回', + finish: '完成', + invalidDb: '数据库配置可能存在一些错误', + invalidRedis: 'Redis的配置可能有一些错误', + invalidPin: 'Redis的密码可能错误', + requirePin: 'Redis可能需要密码', + wait: '配置已保存,请耐心等待生效', + reloadTimeout: '重新启动服务器花了太多时间,安装可能有一些问题', + hadConfig: '已经有人开始配置系统', + invalidCode: '身份验证无效,请按照{page}中的描述继续', + welcomePage: '欢迎页面', + inited: '系统已经被初始化' + }, + login: { + username: '登录名', + pin: '密码', + login: '登录', + verify: '验证', + verifyDialogTitle: '双因子认证设置', + verifyTitle: '双因子认证', + verifyContent: '在您的移动设备上输入来自双因子应用程序的代码。 如果您丢失了设备,您可以输入您的恢复代码之一。', + verifyPlaceholder: '验证码', + bindFail: '绑定失败' + }, + ...zhLocale +} +export default newcn diff --git a/nezha-fronted/src/components/common/language/newen.js b/nezha-fronted/src/components/common/language/newen.js new file mode 100644 index 000000000..ee37c67d4 --- /dev/null +++ b/nezha-fronted/src/components/common/language/newen.js @@ -0,0 +1,79 @@ +import enLocale from 'element-ui/lib/locale/lang/en' // 引入element语言包 +const newen = { +// 命名原则 +// 创建使用New +// 表示创建状态用Created,如创建时间Created Time +// 告警使用Alert,而不是Alarm +// 账号用Account,username、password等都属于account的一部分 +// A user is the person who uses the account, the account is an inanimate object that is merely registered to an e-mail address. + setup: { + step0: 'Welcome', + step1: 'Database', + step2: 'Redis', + step3: 'System', + host: 'Host', + port: 'Port', + language: 'Language', + welcome: { + header: 'Welcome to Nezha setup wizard!', + guid: 'What will the wizard do for you?', + guid_1: 'Create a basic configuration', + guid_2: 'Tries to find problems within your Database and Redis setup', + toContinue: 'To continue', + creatFile: 'For security reasons you need to authenticate for the installation by creating the file', + createFileTip: 'This can be done by executing the following command', + next: "Click the 'Next' button when you've finished." + }, + database: { + configTitle: 'Configure DB connection', + configTip: "Please create database manually,and set the configuration parameters for connection to this database,Press 'Next' button when done" + }, + redis: { + configTitle: 'Configure Redis connection', + configTip: "Please set the configuration parameters for connection to this redis,Press 'Next' button when done" + }, + system: { + configTitle: 'System configuration', + configTip: 'Please enter username and password for administrator ,and set the Nezha WEB module install information,like IP:port', + federation: 'Federation', + federationEnable: 'Enable', + federationDisable: 'Disable' + + }, + name: 'Database name', + username: 'Username', + pin: 'Password', + alertPath: 'Site URL', + alertPrefix: 'Alert prefix', + haMode: 'HA mode', + haVip: 'Virtual IP', + next: 'Next', + back: 'Back', + finish: 'Finish', + invalidDb: 'There may be some errors in the configuration of the database', + invalidRedis: 'There may be some errors in the configuration of the Redis', + invalidPin: "Redis's password may be wrong", + requirePin: 'The password may be required by the Redis', + wait: 'The configuration has been saved, please wait patiently for it to take effect', + reloadTimeout: 'It took too much time to restart the server, there may be some problems when you install', + hadConfig: 'Someone has started to configure the system', + invalidCode: "The authentication is invalid ,please follow the description in {page} 'To continue'", + welcomePage: 'Welcome page', + inited: 'The system has been initialized' + }, + login: { + username: 'Username', + pin: 'Password', + login: 'Login', + upload: 'Upload license', + verify: 'Verify code', + verifyDialogTitle: 'Two Factor Authentication Set Up', + verifyTitle: 'Two-Factor Authentication', + verifyContent: 'Enter the code from the two -factor app on your mobile device. If you\' ve lost your device, you may enter one of your recovery codes.', + verifyPlaceholder: 'verify code', + bindFail: 'Binding failure' + }, + ...enLocale +} + +export default newen From 6e002ffd14bf469d6f152fdbdb8808f0701d6d0a Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Thu, 11 Nov 2021 15:34:33 +0800 Subject: [PATCH 05/22] =?UTF-8?q?style:=20endpoint=20=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/table/settings/endpointTable.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nezha-fronted/src/components/common/table/settings/endpointTable.vue b/nezha-fronted/src/components/common/table/settings/endpointTable.vue index e888cbc3d..ce2773636 100644 --- a/nezha-fronted/src/components/common/table/settings/endpointTable.vue +++ b/nezha-fronted/src/components/common/table/settings/endpointTable.vue @@ -113,8 +113,8 @@ [{{scope.row.configs[0].enable ? 'Metrics':''}}{{scope.row.configs[0].enable&&scope.row.configs[1].enable?',':''}}{{scope.row.configs[1].enable ? 'logs' : ''}}]
- -
{{JSON.stringify(clConfigs(scope.row),null,2)}}
+ +
{{JSON.stringify(clConfigs(scope.row),null,2)}}
@@ -401,13 +401,11 @@ export default { /*width: 70px;*/ margin-right: 5px; } - - diff --git a/nezha-fronted/src/components/common/table/settings/endpointTable.vue b/nezha-fronted/src/components/common/table/settings/endpointTable.vue index e888cbc3d..5172916d8 100644 --- a/nezha-fronted/src/components/common/table/settings/endpointTable.vue +++ b/nezha-fronted/src/components/common/table/settings/endpointTable.vue @@ -95,64 +95,61 @@ +