From 91dfba95f184d909e8088132c8d076e15196258a Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 11 Jun 2022 07:24:36 +0800 Subject: [PATCH] [manager]support monitor params name i18n (#184) * [manager]support monitor params name i18n * [manager]support monitor params name i18n --- .../common/entity/manager/ParamDefine.java | 10 ++- home/blog/2022-06-01-hertzbeat-v1.0.md | 85 +++++++++++++++++++ .../manager/service/impl/AppServiceImpl.java | 19 ++++- .../main/resources/define/param/A-example.yml | 36 +++++--- .../src/main/resources/define/param/api.yml | 78 ++++++++++------- .../main/resources/define/param/centos.yml | 22 +++-- .../resources/define/param/elasticsearch.yml | 33 ++++--- .../main/resources/define/param/fullsite.yml | 18 ++-- .../src/main/resources/define/param/linux.yml | 22 +++-- .../main/resources/define/param/mariadb.yml | 30 +++++-- .../src/main/resources/define/param/mysql.yml | 30 +++++-- .../main/resources/define/param/oracle.yml | 30 +++++-- .../src/main/resources/define/param/ping.yml | 16 ++-- .../src/main/resources/define/param/port.yml | 21 ++--- .../resources/define/param/postgresql.yml | 30 +++++-- .../src/main/resources/define/param/redis.yml | 29 ++++--- .../main/resources/define/param/sqlserver.yml | 30 +++++-- .../main/resources/define/param/ubuntu.yml | 22 +++-- .../main/resources/define/param/website.yml | 45 +++++----- .../main/resources/define/param/zookeeper.yml | 23 +++-- .../monitor-edit/monitor-edit.component.ts | 1 + .../monitor-new/monitor-new.component.ts | 1 + 22 files changed, 436 insertions(+), 195 deletions(-) create mode 100644 home/blog/2022-06-01-hertzbeat-v1.0.md diff --git a/common/src/main/java/com/usthe/common/entity/manager/ParamDefine.java b/common/src/main/java/com/usthe/common/entity/manager/ParamDefine.java index ea7fe24f767..21f27b7a9a0 100644 --- a/common/src/main/java/com/usthe/common/entity/manager/ParamDefine.java +++ b/common/src/main/java/com/usthe/common/entity/manager/ParamDefine.java @@ -1,5 +1,6 @@ package com.usthe.common.entity.manager; +import com.usthe.common.entity.alerter.JsonMapAttributeConverter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -16,6 +17,7 @@ import javax.persistence.Table; import java.time.LocalDateTime; import java.util.List; +import java.util.Map; import static io.swagger.annotations.ApiModelProperty.AccessMode.READ_ONLY; import static io.swagger.annotations.ApiModelProperty.AccessMode.READ_WRITE; @@ -54,10 +56,14 @@ public class ParamDefine { /** * Parameter field external display name + * zh-CN: 端口 + * en-US: Port * 参数字段对外显示名称 */ - @ApiModelProperty(value = "参数字段显示名称", example = "端口", accessMode = READ_WRITE, position = 2) - private String name; + @ApiModelProperty(value = "参数字段显示国际化名称", example = "{zh-CN: '端口'}", accessMode = READ_WRITE, position = 2) + @Convert(converter = JsonMapAttributeConverter.class) + @SuppressWarnings("JpaAttributeTypeInspection") + private Map name; /** * Parameter Field Identifier diff --git a/home/blog/2022-06-01-hertzbeat-v1.0.md b/home/blog/2022-06-01-hertzbeat-v1.0.md new file mode 100644 index 00000000000..92a738bcf66 --- /dev/null +++ b/home/blog/2022-06-01-hertzbeat-v1.0.md @@ -0,0 +1,85 @@ +--- +title: 云监控系统 HertzBeat v1.0 正式发布啦 +author: tom +author_title: tom +author_url: https://github.com/tomsun28 +author_image_url: https://avatars.githubusercontent.com/u/24788200?s=400&v=4 +tags: [opensource] +--- + +[HertzBeat 赫兹跳动](https://github.com/dromara/hertzbeat) 是由 [Dromara](https://dromara.org) 孵化,[TanCloud](https://tancloud.cn) 开源的一个支持网站,API,PING,端口,数据库,全站,操作系统,中间件等监控类型,支持阈值告警,告警通知 (邮箱,webhook,钉钉,企业微信,飞书机器人),拥有易用友好的可视化操作界面的开源监控告警项目。 + +**官网: [hertzbeat.com](https://hertzbeat.com) | [tancloud.cn](https://tancloud.cn)** + +从v1.0-beta.1到v1.0-beat.8,经过多个版本的迭代完善,我们很高兴宣布hertzbeat v1.0正式发布。 + +感谢从beat.1版本以来 HertzBeat Contributors 的贡献,社区同学和用户们的支持。 此版本更新支持了Redis的监控( @gcdd1993 贡献),覆盖Redis的内存CPU等各个性能指标,全方面监控Redis。修复了多个bug进一步增强稳定性。 + + + + + + + + + + + + + + + + + + +

tomsun28

💻 📖 🎨

会编程的王学长

💻 📖 🎨

MaxKey

💻 🎨 🤔

观沧海

💻 🎨 🐛

yuye

💻 📖

jx10086

💻 🐛

winnerTimer

💻 🐛

goo-kits

💻 🐛

brave4Time

💻 🐛

WalkerLee

💻 🐛

jianghang

💻 🐛

ChineseTony

💻
+ +特性: + +1. [[monitor] feature:支持redis监控协议 #142](https://github.com/dromara/hertzbeat/pull/142). contribute by @gcdd1993 +2. Copyright & NOTICE contribute by @shimingxy +3. [[alerter]bugfix: 支持系统告警设置触发次数 #144](https://github.com/dromara/hertzbeat/pull/144). +4. [[collector]feature: redis复用单连接 #146](https://github.com/dromara/hertzbeat/pull/146). +5. [[collector]隐藏日志中IP、账号与密码等敏感信息 #159](https://github.com/dromara/hertzbeat/pull/159) idea from @goo-kits +6. [支持 zookeeper 监控帮助文档 #137](https://github.com/dromara/hertzbeat/pull/137) contributr by @wang1027-wqh + +Bug修复. + +1. [[monitor]bugfix: 修复resource bundle在en.HK加载资源错误问题 #131](https://github.com/dromara/hertzbeat/pull/131). +2. [[web-app]bugfix:修复当主题为dark时部分菜单不可见 #132](https://github.com/dromara/hertzbeat/pull/132). +3. [[monitor]bugfix: 修复通知策略过滤标签时只能选择一个 #140](https://github.com/dromara/hertzbeat/pull/140). issue by @daqianxiaoyao +4. [[td-engine store]bugfix: 修复tdengine入库指标数据时无table报错日志#150](https://github.com/dromara/hertzbeat/pull/150). contribute by @ChineseTony +5. [[collector]bugfix: 修复 warehouse data queue 未消费异常 #153](https://github.com/dromara/hertzbeat/pull/153). issue by @daqianxiaoyao +7. [[web-app]bugfix: 修复黑暗主题时页面输入框校验出错时不可见 #157](https://github.com/dromara/hertzbeat/pull/157). issue by @ConradWen + +**Full Changelog**: https://github.com/dromara/hertzbeat/compare/v1.0-beta.8...v1.0 + +Online https://console.tancloud.cn. + +----------------------- +Redis监控来啦: + +2022-05-29 20 23 58 + +2022-05-29 20 24 21 + + +> [HertzBeat赫兹跳动](https://github.com/dromara/hertzbeat) 是由[Dromara](https://dromara.org)孵化,[TanCloud](https://tancloud.cn)开源的一个支持网站,API,PING,端口,数据库,操作系统等监控类型,拥有易用友好的可视化操作界面的开源监控告警项目。 +> 当然,我们也提供了对应的[SAAS云监控版本](https://console.tancloud.cn),中小团队和个人无需再为了监控自己的网站资源,而去部署一套繁琐的监控系统,[登录即可免费开始](https://console.tancloud.cn)监控之旅。 +> HertzBeat 支持自定义监控,只用通过配置YML文件我们就可以自定义需要的监控类型和指标,来满足常见的个性化需求。 +> HertzBeat 模块化,`manager, collector, scheduler, warehouse, alerter` 各个模块解耦合,方便理解与定制开发。 +> HertzBeat 支持更自由化的告警配置(计算表达式),支持告警通知,告警模版,邮件钉钉微信飞书等及时通知送达 +> 欢迎登录 HertzBeat 的 [云环境TanCloud](https://console.tancloud.cn) 试用发现更多。 +> 我们正在快速迭代中,欢迎参与加入共建项目开源生态。 + +> `HertzBeat` 的多类型支持,易扩展,低耦合,希望能帮助开发者和中小团队快速搭建自有监控系统。 + +老铁们可以通过演示视频来直观了解功能: [https://www.bilibili.com/video/BV1DY4y1i7ts](https://www.bilibili.com/video/BV1DY4y1i7ts) + + +**仓库地址** + +[Github](https://github.com/dromara/hertzbeat) [https://github.com/dromara/hertzbeat](https://github.com/dromara/hertzbeat) + +[Gitee](https://gitee.com/dromara/hertzbeat) [https://gitee.com/dromara/hertzbeat](https://gitee.com/dromara/hertzbeat) + diff --git a/manager/src/main/java/com/usthe/manager/service/impl/AppServiceImpl.java b/manager/src/main/java/com/usthe/manager/service/impl/AppServiceImpl.java index 0773bbdfc59..70b5abf1cab 100644 --- a/manager/src/main/java/com/usthe/manager/service/impl/AppServiceImpl.java +++ b/manager/src/main/java/com/usthe/manager/service/impl/AppServiceImpl.java @@ -71,10 +71,10 @@ public Job getAppDefine(String app) throws IllegalArgumentException { @Override public Map getI18nResources(String lang) { - Map i18nMap = new HashMap<>(32); + Map i18nMap = new HashMap<>(128); for (Job job : appDefines.values()) { - // todo Todo temporarily only internationalizes the monitoring type name, after which it needs to support the indicator name - // 暂时只国际化监控类型名称 后面需要支持指标名称 + // todo needs to support the indicator name + // 后面需要支持指标名称 Map name = job.getName(); if (name != null && !name.isEmpty()) { String i18nName = name.get(lang); @@ -84,6 +84,19 @@ public Map getI18nResources(String lang) { i18nMap.put("monitor.app." + job.getApp(), i18nName); } } + for (Map.Entry> entry : paramDefines.entrySet()) { + String app = entry.getKey(); + for (ParamDefine paramDefine : entry.getValue()) { + Map name = paramDefine.getName(); + if (name != null && !name.isEmpty()) { + String i18nName = name.get(lang); + if (i18nName == null) { + i18nName = name.values().stream().findFirst().get(); + } + i18nMap.put("monitor.app." + app + ".param." + paramDefine.getField(), i18nName); + } + } + } return i18nMap; } diff --git a/manager/src/main/resources/define/param/A-example.yml b/manager/src/main/resources/define/param/A-example.yml index c09b05e62fe..06ad16790fe 100644 --- a/manager/src/main/resources/define/param/A-example.yml +++ b/manager/src/main/resources/define/param/A-example.yml @@ -5,13 +5,17 @@ param: # field-字段名称标识符 - field: host # name-参数字段显示名称 - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host # type-字段类型,样式(大部分映射input标签type属性) type: host # 是否是必输项 true-必填 false-可选 required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number # 当type为number时,用range表示范围 range: '[0,65535]' @@ -21,38 +25,48 @@ param: # 参数输入框提示信息 placeholder: '请输入端口' - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text # 当type为text时,用limit表示字符串限制大小 limit: 20 required: false hide: true - field: password - name: 密码 + name: + zh-CN: 用户密码 + en-US: Password type: password required: false hide: true - field: ssl - name: 启动SSL + name: + zh-CN: 启动SSL + en-US: SSL # 当type为boolean时,前端用switch展示开关 type: boolean required: false - field: method - name: 请求方式 + name: + zh-CN: 请求方式 + en-US: Method type: radio required: true # 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2} options: - - label: GET请求 + - label: GET value: GET - - label: POST请求 + - label: POST value: POST - - label: PUT请求 + - label: PUT value: PUT - - label: DELETE请求 + - label: DELETE value: DELETE - field: headers - name: 请求Headers + name: + zh-CN: 请求Headers + en-US: Headers type: key-value required: false keyAlias: Header Name diff --git a/manager/src/main/resources/define/param/api.yml b/manager/src/main/resources/define/param/api.yml index 95af32ef90e..7a8594149e6 100644 --- a/manager/src/main/resources/define/param/api.yml +++ b/manager/src/main/resources/define/param/api.yml @@ -1,97 +1,111 @@ -# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws... app: api -# 强制固定必须参数 - host(ipv4,ipv6,域名) param: - # field-字段名称标识符 - field: host - # name-参数字段显示名称 - name: 主机Host - # type-字段类型,样式(大部分映射input标签type属性) + name: + zh-CN: 主机Host + en-US: Host type: host - # 是否是必输项 true-必填 false-可选 required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number - # 当type为number时,用range表示范围 range: '[0,65535]' required: true defaultValue: 80 - field: method - name: 请求方式 + name: + zh-CN: 请求方式 + en-US: Method type: radio required: true - # 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2} options: - - label: GET请求 + - label: GET value: GET - - label: POST请求 + - label: POST value: POST - - label: PUT请求 + - label: PUT value: PUT - - label: DELETE请求 + - label: DELETE value: DELETE - field: uri - name: 相对路径 + name: + zh-CN: 相对路径 + en-US: URI type: text - # 当type为text时,用limit表示字符串限制大小 limit: 200 required: false - placeholder: 'API地址除IP端口外的路径 例如:/v2/book/bar' + placeholder: 'Website uri path(no ip port) EG:/v2/book/bar' - field: ssl - name: 启用HTTPS - # 当type为boolean时,前端用switch展示开关 + name: + zh-CN: 启用HTTPS + en-US: HTTPS type: boolean required: true - field: headers - name: 请求Headers + name: + zh-CN: 请求Headers + en-US: Headers type: key-value required: false keyAlias: Header Name valueAlias: Header Value - field: params - name: 查询Params + name: + zh-CN: 查询Params + en-US: Params type: key-value required: false keyAlias: Param Key valueAlias: Param Value - field: contentType - name: Content-Type + name: + zh-CN: Content-Type + en-US: Content-Type type: text - placeholder: '请求BODY资源类型' + placeholder: 'Request Body Type' required: false hide: true - field: payload - name: 请求BODY + name: + zh-CN: 请求BODY + en-US: BODY type: textarea - placeholder: 'POST PUT请求时有效' + placeholder: 'Available When POST PUT' required: false hide: true - field: authType - name: 认证方式 + name: + zh-CN: 认证方式 + en-US: Auth Type type: radio required: false hide: true - # 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2} options: - label: Basic Auth value: Basic Auth - label: Digest Auth value: Digest Auth - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text - # 当type为text时,用limit表示字符串限制大小 limit: 20 required: false hide: true - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false hide: true - field: keyword - name: 关键字 + name: + zh-CN: 关键字 + en-US: Keyword type: text required: false hide: true diff --git a/manager/src/main/resources/define/param/centos.yml b/manager/src/main/resources/define/param/centos.yml index 6e2760fe6ad..50c8d62f799 100644 --- a/manager/src/main/resources/define/param/centos.yml +++ b/manager/src/main/resources/define/param/centos.yml @@ -1,28 +1,36 @@ app: centos param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 22 - placeholder: '请输入端口' - field: timeout - name: 超时时间 + name: + zh-CN: 超时时间 + en-US: Timeout type: number required: false defaultValue: 6000 - placeholder: '超时时间' - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: true - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false \ No newline at end of file diff --git a/manager/src/main/resources/define/param/elasticsearch.yml b/manager/src/main/resources/define/param/elasticsearch.yml index 1dcf98833cb..0b396c777e1 100644 --- a/manager/src/main/resources/define/param/elasticsearch.yml +++ b/manager/src/main/resources/define/param/elasticsearch.yml @@ -1,46 +1,55 @@ -# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws middleware ... app: elasticsearch -# 强制固定必须参数 - host(ipv4,ipv6,域名) param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 9200 - placeholder: '请输入端口' - field: timeout - name: 查询超时时间 + name: + zh-CN: 查询超时时间 + en-US: Query Timeout type: number required: false hide: true defaultValue: 6000 - placeholder: '查询超时时间' - field: authType - name: 认证方式 + name: + zh-CN: 认证方式 + en-US: Auth Type type: radio required: false - # 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2} options: - label: Basic Auth value: Basic Auth - label: Digest Auth value: Digest Auth - field: index - name: 索引名称 + name: + zh-CN: 索引名称 + en-US: Index Name type: text hide: true required: false - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: false - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false diff --git a/manager/src/main/resources/define/param/fullsite.yml b/manager/src/main/resources/define/param/fullsite.yml index 71ef6024c37..6de05fa04f8 100644 --- a/manager/src/main/resources/define/param/fullsite.yml +++ b/manager/src/main/resources/define/param/fullsite.yml @@ -1,22 +1,30 @@ app: fullsite param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 80 - field: sitemap - name: 网站地图 + name: + zh-CN: 网站地图 + en-US: Site Map type: text limit: 200 required: true - placeholder: '网站SITEMAP地图地址 例如:/sitemap.xml' + placeholder: 'Web SITEMAP EG:/sitemap.xml' - field: ssl - name: 启用HTTPS + name: + zh-CN: 启用HTTPS + en-US: HTTPS type: boolean required: true \ No newline at end of file diff --git a/manager/src/main/resources/define/param/linux.yml b/manager/src/main/resources/define/param/linux.yml index bb4fe307b11..1efe69f8c5a 100644 --- a/manager/src/main/resources/define/param/linux.yml +++ b/manager/src/main/resources/define/param/linux.yml @@ -1,28 +1,36 @@ app: linux param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 22 - placeholder: '请输入端口' - field: timeout - name: 超时时间 + name: + zh-CN: 超时时间 + en-US: Timeout type: number required: false defaultValue: 6000 - placeholder: '超时时间' - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: true - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false \ No newline at end of file diff --git a/manager/src/main/resources/define/param/mariadb.yml b/manager/src/main/resources/define/param/mariadb.yml index 3d953593a7f..ed4ce01bed8 100644 --- a/manager/src/main/resources/define/param/mariadb.yml +++ b/manager/src/main/resources/define/param/mariadb.yml @@ -1,38 +1,50 @@ app: mariadb param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 3306 - placeholder: '请输入端口' - field: timeout - name: 查询超时时间 + name: + zh-CN: 查询超时时间 + en-US: Query Timeout type: number required: false defaultValue: 6000 - placeholder: '查询超时时间' hide: true - field: database - name: 数据库名称 + name: + zh-CN: 数据库名称 + en-US: Database Name type: text required: false - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: false - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false - field: url - name: URL + name: + zh-CN: URL + en-US: URL type: text required: false hide: true \ No newline at end of file diff --git a/manager/src/main/resources/define/param/mysql.yml b/manager/src/main/resources/define/param/mysql.yml index d68f521721b..cee9b9b42a6 100644 --- a/manager/src/main/resources/define/param/mysql.yml +++ b/manager/src/main/resources/define/param/mysql.yml @@ -1,38 +1,50 @@ app: mysql param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 3306 - placeholder: '请输入端口' - field: timeout - name: 查询超时时间 + name: + zh-CN: 查询超时时间 + en-US: Query Timeout type: number required: false hide: true defaultValue: 6000 - placeholder: '查询超时时间' - field: database - name: 数据库名称 + name: + zh-CN: 数据库名称 + en-US: Database Name type: text required: false - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: false - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false - field: url - name: URL + name: + zh-CN: URL + en-US: URL type: text required: false hide: true \ No newline at end of file diff --git a/manager/src/main/resources/define/param/oracle.yml b/manager/src/main/resources/define/param/oracle.yml index 8be90625a7b..bf714a4fdd3 100644 --- a/manager/src/main/resources/define/param/oracle.yml +++ b/manager/src/main/resources/define/param/oracle.yml @@ -1,38 +1,50 @@ app: oracle param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 1521 - placeholder: '请输入端口' - field: timeout - name: 查询超时时间 + name: + zh-CN: 查询超时时间 + en-US: Query Timeout type: number required: false hide: true defaultValue: 6000 - placeholder: '查询超时时间' - field: database - name: 服务名 + name: + zh-CN: 服务名 + en-US: Service Name type: text required: false - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: false - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false - field: url - name: URL + name: + zh-CN: URL + en-US: URL type: text required: false hide: true \ No newline at end of file diff --git a/manager/src/main/resources/define/param/ping.yml b/manager/src/main/resources/define/param/ping.yml index 3ff5cbe1a51..e2562dca5a8 100644 --- a/manager/src/main/resources/define/param/ping.yml +++ b/manager/src/main/resources/define/param/ping.yml @@ -1,20 +1,16 @@ -# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws... app: ping -# 强制固定必须参数 - host(ipv4,ipv6,域名) param: - # field-字段名称标识符 - field: host - # name-参数字段显示名称 - name: 主机Host - # type-字段类型,样式(大部分映射input标签type属性) + name: + zh-CN: 主机Host + en-US: Host type: host - # 是否是必输项 true-必填 false-可选 required: true - field: timeout - name: Ping超时时间 + name: + zh-CN: Ping超时时间 + en-US: Ping Timeout type: number - # 当type为number时,用range表示范围 range: '[0,100000]' required: true - placeholder: '请输入超时时间,单位毫秒' defaultValue: 6000 \ No newline at end of file diff --git a/manager/src/main/resources/define/param/port.yml b/manager/src/main/resources/define/param/port.yml index 3f905eeea08..7bf0e97c27d 100644 --- a/manager/src/main/resources/define/param/port.yml +++ b/manager/src/main/resources/define/param/port.yml @@ -1,27 +1,24 @@ -# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws... app: port -# 强制固定必须参数 - host(ipv4,ipv6,域名) param: - # field-字段名称标识符 - field: host - # name-参数字段显示名称 - name: 主机Host - # type-字段类型,样式(大部分映射input标签type属性) + name: + zh-CN: 主机Host + en-US: Host type: host - # 是否是必输项 true-必填 false-可选 required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number - # 当type为number时,用range表示范围 range: '[0,65535]' required: true defaultValue: 80 - field: timeout - name: 连接超时时间 + name: + zh-CN: 连接超时时间 + en-US: Connect Timeout type: number - # 当type为number时,用range表示范围 range: '[0,100000]' required: true - placeholder: '请输入超时时间,单位毫秒' defaultValue: 6000 \ No newline at end of file diff --git a/manager/src/main/resources/define/param/postgresql.yml b/manager/src/main/resources/define/param/postgresql.yml index 220110ed97a..08bf11e745b 100644 --- a/manager/src/main/resources/define/param/postgresql.yml +++ b/manager/src/main/resources/define/param/postgresql.yml @@ -1,38 +1,50 @@ app: postgresql param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 5432 - placeholder: '请输入端口' - field: timeout - name: 查询超时时间 + name: + zh-CN: 查询超时时间 + en-US: Query Timeout type: number required: false hide: true defaultValue: 6000 - placeholder: '查询超时时间' - field: database - name: 数据库名称 + name: + zh-CN: 数据库名称 + en-US: Database Name type: text required: false - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: false - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false - field: url - name: URL + name: + zh-CN: URL + en-US: URL type: text required: false hide: true \ No newline at end of file diff --git a/manager/src/main/resources/define/param/redis.yml b/manager/src/main/resources/define/param/redis.yml index f1673af97ce..01e22ab0dea 100644 --- a/manager/src/main/resources/define/param/redis.yml +++ b/manager/src/main/resources/define/param/redis.yml @@ -1,36 +1,37 @@ -# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws... app: redis -# 强制固定必须参数 - host(ipv4,ipv6,域名) param: - # field-字段名称标识符 - field: host - # name-参数字段显示名称 - name: 主机Host - # type-字段类型,样式(大部分映射input标签type属性) + name: + zh-CN: 主机Host + en-US: Host type: host - # 是否是必输项 true-必填 false-可选 required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number - # 当type为number时,用range表示范围 range: '[0,65535]' required: true defaultValue: 6379 - field: timeout - name: Redis超时时间 + name: + zh-CN: 超时时间 + en-US: Timeout type: number - # 当type为number时,用range表示范围 range: '[0,100000]' required: true - placeholder: '请输入超时时间,单位毫秒' defaultValue: 3000 - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: false - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false \ No newline at end of file diff --git a/manager/src/main/resources/define/param/sqlserver.yml b/manager/src/main/resources/define/param/sqlserver.yml index 7d07469c358..71e792766d2 100644 --- a/manager/src/main/resources/define/param/sqlserver.yml +++ b/manager/src/main/resources/define/param/sqlserver.yml @@ -1,38 +1,50 @@ app: sqlserver param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 1433 - placeholder: '请输入端口' - field: timeout - name: 查询超时时间 + name: + zh-CN: 查询超时时间 + en-US: Query Timeout type: number required: false hide: true defaultValue: 6000 - placeholder: '查询超时时间' - field: database - name: 数据库名称 + name: + zh-CN: 数据库名称 + en-US: Database Name type: text required: false - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: false - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false - field: url - name: URL + name: + zh-CN: URL + en-US: URL type: text required: false hide: true \ No newline at end of file diff --git a/manager/src/main/resources/define/param/ubuntu.yml b/manager/src/main/resources/define/param/ubuntu.yml index d2b91a061f3..6d8ddfec4d3 100644 --- a/manager/src/main/resources/define/param/ubuntu.yml +++ b/manager/src/main/resources/define/param/ubuntu.yml @@ -1,28 +1,36 @@ app: ubuntu param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 22 - placeholder: '请输入端口' - field: timeout - name: 超时时间 + name: + zh-CN: 超时时间 + en-US: Timeout type: number required: false defaultValue: 6000 - placeholder: '超时时间' - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: true - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false \ No newline at end of file diff --git a/manager/src/main/resources/define/param/website.yml b/manager/src/main/resources/define/param/website.yml index e16caedfc31..5696280d04c 100644 --- a/manager/src/main/resources/define/param/website.yml +++ b/manager/src/main/resources/define/param/website.yml @@ -1,59 +1,64 @@ -# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws... app: website -# 强制固定必须参数 - host(ipv4,ipv6,域名) param: - # field-字段名称标识符 - field: host - # name-参数字段显示名称 - name: 主机Host - # type-字段类型,样式(大部分映射input标签type属性) + name: + zh-CN: 主机Host + en-US: Host type: host - # 是否是必输项 true-必填 false-可选 required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number - # 当type为number时,用range表示范围 range: '[0,65535]' required: true defaultValue: 80 - field: uri - name: 相对路径 + name: + zh-CN: 相对路径 + en-US: URI type: text - # 当type为text时,用limit表示字符串限制大小 limit: 200 required: false - placeholder: '网站地址除IP端口外的路径 例如:/console' + placeholder: 'Website uri path(no ip port) EG:/console' - field: ssl - name: 启用HTTPS - # 当type为boolean时,前端用switch展示开关 + name: + zh-CN: 启用HTTPS + en-US: HTTPS type: boolean required: true - field: authType - name: 认证方式 + name: + zh-CN: 认证方式 + en-US: Auth Type type: radio required: false hide: true - # 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2} options: - label: Basic Auth value: Basic Auth - label: Digest Auth value: Digest Auth - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text - # 当type为text时,用limit表示字符串限制大小 limit: 20 required: false hide: true - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false hide: true - field: keyword - name: 关键字 + name: + zh-CN: 关键字 + en-US: Keyword type: text required: false hide: true \ No newline at end of file diff --git a/manager/src/main/resources/define/param/zookeeper.yml b/manager/src/main/resources/define/param/zookeeper.yml index d7cd73edee1..5c9fb6d8696 100644 --- a/manager/src/main/resources/define/param/zookeeper.yml +++ b/manager/src/main/resources/define/param/zookeeper.yml @@ -1,30 +1,37 @@ app: zookeeper -# 强制固定必须参数 - host(ipv4,ipv6,域名) param: - field: host - name: 主机Host + name: + zh-CN: 主机Host + en-US: Host type: host required: true - field: port - name: 端口 + name: + zh-CN: 端口 + en-US: Port type: number range: '[0,65535]' required: true defaultValue: 2181 - placeholder: '请输入端口' - field: timeout - name: 查询超时时间 + name: + zh-CN: 查询超时时间 + en-US: Query Timeout type: number required: false hide: true defaultValue: 6000 - placeholder: '查询超时时间' - field: username - name: 用户名 + name: + zh-CN: 用户名 + en-US: Username type: text limit: 20 required: true - field: password - name: 密码 + name: + zh-CN: 密码 + en-US: Password type: password required: false \ No newline at end of file diff --git a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts index 0a9c31c2510..a9d8a45e5df 100644 --- a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts +++ b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts @@ -111,6 +111,7 @@ export class MonitorEditComponent implements OnInit { } } } + define.name = this.i18nSvc.fanyi(`monitor.app.${this.monitor.app}.param.${define.field}`); if (define.hide) { this.advancedParams.push(param); this.advancedParamDefines.push(define); diff --git a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts index c1ad014777c..b6310a67751 100644 --- a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts +++ b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts @@ -85,6 +85,7 @@ export class MonitorNewComponent implements OnInit { param.value = define.defaultValue; } } + define.name = this.i18nSvc.fanyi(`monitor.app.${this.monitor.app}.param.${define.field}`); if (define.hide) { this.advancedParams.push(param); this.advancedParamDefines.push(define);