Explorar o código

[manager,webapp]优化监控类型参数,告警处理提示

tomsun28 %!s(int64=4) %!d(string=hai) anos
pai
achega
6a9fe9912f

+ 1 - 1
manager/src/main/resources/define/app/A-example.yml

@@ -1,5 +1,5 @@
 # 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
-app: exapmle
+app: example
 name:
   zh-CN: 模拟应用类型
   en-US: EXAMPLE APP

+ 67 - 0
manager/src/main/resources/define/app/mysql.yml

@@ -0,0 +1,67 @@
+app: mysql
+name:
+  zh-CN: MYSQL数据库
+  en-US: MYSQL DB
+# 参数映射map. type是参数类型: 0-number数字, 1-string明文字符串, 2-secret加密字符串
+# 强制固定必须参数 - host
+configmap:
+  - key: host
+    type: 1
+  - key: port
+    type: 0
+  - key: username
+    type: 1
+  - key: password
+    type: 2
+  - key: database
+    type: 1
+  - key: url
+    type: 1
+# 指标组列表
+metrics:
+  - name: basic
+    # 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
+    # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
+    priority: 0
+    # 指标组中的具体监控指标
+    fields:
+      # 指标信息 包括 field名称   type字段类型:0-number数字,1-string字符串   instance是否为实例主键   unit:指标单位
+      - field: version
+        type: 1
+        instance: true
+      - field: port
+        type: 1
+      - field: datadir
+        type: 1
+      - field: max_connections
+        type: 0
+# (非必须)监控指标别名,与上面的指标名映射。用于采集接口数据字段不直接是最终指标名称,需要此别名做映射转换
+    aliasFields:
+      - version
+      - version_compile_os
+      - version_compile_machine
+      - port
+      - datadir
+      - max_connections
+# (非必须)指标计算表达式,与上面的别名一起作用,计算出最终需要的指标值
+# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
+    calculates:
+      - port=port
+      - datadir=datadir
+      - max_connections=max_connections
+      - version=version+"_"+version_compile_os+"_"+version_compile_machine
+    protocol: jdbc
+    jdbc:
+      # 主机host: ipv4 ipv6 域名
+      host: ^_^host^_^
+      # 端口
+      port: ^_^port^_^
+      platform: mysql
+      username: ^_^username^_^
+      password: ^_^password^_^
+      database: ^_^database^_^
+      # SQL查询方式: oneRow, multiRow, columns
+      queryType: columns
+      # sql
+      sql: show global variables where Variable_name like 'version%' or Variable_name = 'max_connections' or Variable_name = 'datadir' or Variable_name = 'port';
+      url: ^_^url^_^

+ 24 - 0
manager/src/main/resources/define/app/port.yml

@@ -0,0 +1,24 @@
+app: port
+name:
+  zh-CN: 端口可用性
+  en-US: PORT TELNET
+configmap:
+  - key: host
+    type: 1
+  - key: port
+    type: 0
+  - key: timeout
+    type: 0
+metrics:
+  - name: summary
+    priority: 0
+    fields:
+      - field: responseTime
+        type: 0
+        unit: ms
+    protocol: telnet
+# 当protocol为telnet协议时具体的采集配置
+    telnet:
+      host: ^_^host^_^
+      port: ^_^port^_^
+      timeout: ^_^timeout^_^

+ 1 - 13
manager/src/main/resources/define/app/website.yml

@@ -9,14 +9,8 @@ configmap:
     type: 0
   - key: uri
     type: 1
-  - key: method
-    type: 1
   - key: ssl
     type: 1
-  - key: username
-    type: 1
-  - key: password
-    type: 2
 # 指标组列表
 metrics:
   # 第一个监控指标组 cpu
@@ -42,15 +36,9 @@ metrics:
       # url请求接口路径
       url: ^_^uri^_^
       # 请求方式 GET POST PUT DELETE PATCH
-      method: ^_^method^_^
+      method: GET
       # 是否启用ssl/tls,即是http还是https,默认false
       ssl: ^_^ssl^_^
-      # 认证
-      authorization:
-        # 认证方式: Basic Auth, Digest Auth, Bearer Token
-        type: Basic Auth
-        basicAuthUsername: ^_^username^_^
-        basicAuthPassword: ^_^password^_^
       # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控
       # todo xmlPath-xmlPath脚本,prometheus-Prometheus数据规则
       parseType: website

+ 1 - 1
manager/src/main/resources/define/param/A-example.yml

@@ -1,5 +1,5 @@
 # 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws...
-app: exapmle
+app: example
 # 强制固定必须参数 - host(ipv4,ipv6,域名)
 param:
     # field-字段名称标识符

+ 1 - 1
manager/src/main/resources/define/param/api.yml

@@ -47,7 +47,7 @@ param:
     type: password
     required: false
   - field: ssl
-    name: 使用SSL
+    name: 开启SSL
     # 当type为boolean时,前端用switch展示开关
     type: boolean
     required: true

+ 30 - 0
manager/src/main/resources/define/param/mysql.yml

@@ -0,0 +1,30 @@
+app: mysql
+param:
+  - field: host
+    name: 主机Host
+    type: host
+    required: true
+  - field: port
+    name: 端口
+    type: number
+    range: '[0,65535]'
+    required: true
+    defaultValue: 80
+    placeholder: '请输入端口'
+  - field: database
+    name: 数据库名称
+    type: text
+    required: false
+  - field: username
+    name: 用户名
+    type: text
+    limit: 20
+    required: false
+  - field: password
+    name: 密码
+    type: password
+    required: false
+  - field: url
+    name: URL
+    type: text
+    required: false

+ 27 - 0
manager/src/main/resources/define/param/port.yml

@@ -0,0 +1,27 @@
+# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws...
+app: port
+# 强制固定必须参数 - host(ipv4,ipv6,域名)
+param:
+    # field-字段名称标识符
+  - field: host
+    # name-参数字段显示名称
+    name: 主机Host
+    # type-字段类型,样式(大部分映射input标签type属性)
+    type: host
+    # 是否是必输项 true-必填 false-可选
+    required: true
+  - field: port
+    name: 端口
+    type: number
+    # 当type为number时,用range表示范围
+    range: '[0,65535]'
+    required: true
+    defaultValue: 80
+  - field: timeout
+    name: 连接超时时间
+    type: number
+    # 当type为number时,用range表示范围
+    range: '[0,100000]'
+    required: true
+    placeholder: '请输入超时时间,单位毫秒'
+    defaultValue: 3000

+ 3 - 28
manager/src/main/resources/define/param/website.yml

@@ -18,39 +18,14 @@ param:
     required: true
     defaultValue: 80
   - field: uri
-    name: URI路径
+    name: 网站路径
     type: text
     # 当type为text时,用limit表示字符串限制大小
     limit: 100
     required: true
-    placeholder: '请输入网站的URI,例如:/index.html'
-  - field: method
-    name: 请求方式
-    type: radio
-    required: true
-    # 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2}
-    options:
-      - label: GET请求
-        value: GET
-      - label: POST请求
-        value: POST
-      - label: PUT请求
-        value: PUT
-      - label: DELETE请求
-        value: DELETE
-
-  - field: username
-    name: 用户名
-    type: text
-    # 当type为text时,用limit表示字符串限制大小
-    limit: 20
-    required: false
-  - field: password
-    name: 密码
-    type: password
-    required: false
+    placeholder: '请输入网站地址,例如:/index.html'
   - field: ssl
-    name: 使用SSL
+    name: 开启SSL
     # 当type为boolean时,前端用switch展示开关
     type: boolean
     required: true

+ 4 - 4
web-app/src/app/routes/alert/alert-center/alert-center.component.ts

@@ -106,7 +106,7 @@ export class AlertCenterComponent implements OnInit {
       return;
     }
     this.modal.confirm({
-      nzTitle: '请确认是否批量标记已!',
+      nzTitle: '请确认是否批量标记已处理!',
       nzOkText: '确定',
       nzCancelText: '取消',
       nzOkDanger: true,
@@ -120,7 +120,7 @@ export class AlertCenterComponent implements OnInit {
       return;
     }
     this.modal.confirm({
-      nzTitle: '请确认是否批量标记未!',
+      nzTitle: '请确认是否批量标记未处理!',
       nzOkText: '确定',
       nzCancelText: '取消',
       nzOkDanger: true,
@@ -146,7 +146,7 @@ export class AlertCenterComponent implements OnInit {
     let alerts = new Set<number>();
     alerts.add(alertId);
     this.modal.confirm({
-      nzTitle: '请确认是否标记已!',
+      nzTitle: '请确认是否标记已处理!',
       nzOkText: '确定',
       nzCancelText: '取消',
       nzOkDanger: true,
@@ -159,7 +159,7 @@ export class AlertCenterComponent implements OnInit {
     let alerts = new Set<number>();
     alerts.add(alertId);
     this.modal.confirm({
-      nzTitle: '请确认是否标记未!',
+      nzTitle: '请确认是否标记未处理!',
       nzOkText: '确定',
       nzCancelText: '取消',
       nzOkDanger: true,

+ 19 - 5
web-app/src/assets/app-data.json

@@ -1,6 +1,6 @@
 {
   "app": {
-    "name": "探云",
+    "name": "TANCLOUD",
     "description": "易用友好的高性能监控云"
   },
   "user": {
@@ -50,9 +50,9 @@
               "i18n": "monitor.app.ping"
             },
             {
-              "text": "telnet",
-              "link": "/monitors?app=telnet",
-              "i18n": "monitor.app.telnet"
+              "text": "port",
+              "link": "/monitors?app=port",
+              "i18n": "monitor.app.port"
             }
           ]
         },
@@ -63,7 +63,7 @@
           "children": [
             {
               "text": "Mysql",
-              "link": "/monitors",
+              "link": "/monitors?app=mysql",
               "i18n": "monitor.app.mysql"
             },
             {
@@ -105,6 +105,20 @@
           "link": "/alert/notice"
         }
       ]
+    },
+    {
+      "text": "More",
+      "i18n": "menu.extras",
+      "group": true,
+      "hideInBreadcrumb": true,
+      "children": [
+        {
+          "text": "Settings",
+          "link": "/account/settings",
+          "i18n": "menu.extras.setting",
+          "icon": "anticon-setting"
+        }
+      ]
     }
   ]
 }

+ 16 - 5
web-app/src/assets/i18n/zh-CN.json

@@ -17,7 +17,9 @@
     "account": {
       "": "个人页",
       "center": "个人中心",
-      "settings": "个人设置",
+      "settings": "账户设置",
+      "security": "安全设置",
+      "binding": "账号绑定",
       "trigger": "触发错误",
       "logout": "退出登录"
     },
@@ -49,7 +51,7 @@
       "api": "HTTP API",
       "http": "HTTP API",
       "ping": "PING连通性",
-      "telnet": "Telnet端口可用性",
+      "port": "端口可用性",
       "mysql": "Mysql",
       "oracle": "Oracle",
       "redis": "Redis"
@@ -71,7 +73,9 @@
     }
   },
   "app.lock": "锁屏",
-  "app.login.message-invalid-credentials": "账户或密码错误(admin/ant.design)",
+  "app.login.message-need-identifier": "请输入邮箱或手机号",
+  "app.login.message-need-credential": "请输入密码",
+  "app.login.message-invalid-credentials": "账户或密码错误",
   "app.login.message-invalid-verification-code": "验证码错误",
   "app.login.tab-login-credentials": "账户密码登录",
   "app.login.tab-login-mobile": "手机号登录",
@@ -80,16 +84,22 @@
   "app.login.sign-in-with": "其他登录方式",
   "app.login.signup": "注册账户",
   "app.login.login": "登录",
+  "app.password.forgot": "忘记密码",
+  "app.password.reset": "重置密码",
   "app.register.register": "注册",
   "app.register.get-verification-code": "获取验证码",
   "app.register.sign-in": "使用已有账户登录",
   "app.register-result.msg": "你的账户:{{email}} 注册成功",
   "app.register-result.activation-email":
-    "激活邮件已发送到你的邮箱中,邮件有效期为24小时。请及时登录邮箱,点击邮件中的链接激活帐户。",
+    "额外赠送监控额度邮件已发送到你的邮箱中。请及时登录邮箱,点击邮件中的链接领取。",
+  "app.register-result.login": "开始登陆",
   "app.register-result.back-home": "返回首页",
   "app.register-result.view-mailbox": "查看邮箱",
   "validation.email.required": "请输入邮箱地址!",
   "validation.email.wrong-format": "邮箱地址格式错误!",
+  "validation.email.invalid": "无效的邮箱地址!",
+  "validation.phone.invalid": "无效的手机号!",
+  "validation.verification-code.invalid": "无效的验证码,应是6位数字!",
   "validation.password.required": "请输入密码!",
   "validation.password.twice": "两次输入的密码不匹配!",
   "validation.password.strength.msg": "请至少输入 6 个字符。请不要使用容易被猜到的密码。",
@@ -103,5 +113,6 @@
   "validation.title.required": "请输入标题",
   "validation.date.required": "请选择起止日期",
   "validation.goal.required": "请输入目标描述",
-  "validation.standard.required": "请输入衡量标准"
+  "validation.standard.required": "请输入衡量标准",
+  "validation.required": "请填充必填项! "
 }