From bcbf719a04c654a0fca80f57bee8b2c2152ac17b Mon Sep 17 00:00:00 2001 From: kl7sn Date: Tue, 10 Jan 2023 13:11:01 +0800 Subject: [PATCH 1/3] refactor: Optimize document and update docker-compose --- api/pkg/utils/clickhouse.go | 7 - .../all-in-one/clickvisual/config/docker.toml | 2 +- docker-compose.devops.m1.yml | 181 -------------- docker-compose.devops.yml | 39 ++-- docker-compose.m1.yml | 221 ------------------ docs/docs/en/clickvisual/06join/env.md | 8 +- ...erience-clickvisual-with-docker-compose.md | 8 +- docs/docs/zh/clickvisual/06join/env.md | 8 +- 8 files changed, 33 insertions(+), 441 deletions(-) delete mode 100644 docker-compose.devops.m1.yml delete mode 100644 docker-compose.m1.yml diff --git a/api/pkg/utils/clickhouse.go b/api/pkg/utils/clickhouse.go index 1d4c70c27..ceb9f35ab 100644 --- a/api/pkg/utils/clickhouse.go +++ b/api/pkg/utils/clickhouse.go @@ -15,7 +15,6 @@ func ClickhouseDsnConvert(req string) (res string) { elog.Error("clickhouseDsnConvert", elog.Any("error", err)) return req } - query := u.Query() query.Del("write_timeout") if strings.HasPrefix(req, "clickhouse://") || @@ -24,28 +23,22 @@ func ClickhouseDsnConvert(req string) (res string) { u.RawQuery = query.Encode() return u.String() } - database := query.Get("database") if database == "" { database = "default" } - password := query.Get("password") if password != "" { password = url.QueryEscape(query.Get("password")) // 处理特殊字符 } - res = fmt.Sprintf("clickhouse://%s:%s@%s/%s", query.Get("username"), password, u.Host, database) query.Del("password") query.Del("username") query.Del("database") - queryValAssembly(query, "read_timeout", "ms") - if len(query) != 0 { res = fmt.Sprintf("%s?%s", res, query.Encode()) } - return } diff --git a/data/all-in-one/clickvisual/config/docker.toml b/data/all-in-one/clickvisual/config/docker.toml index 9501346d0..2dce83582 100644 --- a/data/all-in-one/clickvisual/config/docker.toml +++ b/data/all-in-one/clickvisual/config/docker.toml @@ -81,4 +81,4 @@ teamIds = [] allowedOrganizations = [] [defaultCh] -dsn="tcp://clickhouse:9000?username=root&password=shimo&read_timeout=10&write_timeout=10&debug=true" +dsn="clickhouse://root:shimo@clickhouse:9000/default?max_execution_time=60" diff --git a/docker-compose.devops.m1.yml b/docker-compose.devops.m1.yml deleted file mode 100644 index 70f18cdec..000000000 --- a/docker-compose.devops.m1.yml +++ /dev/null @@ -1,181 +0,0 @@ -version: '3' -networks: - cv-devops-net: - driver: bridge -services: - nginx: - image: nginx - networks: - - cv-devops-net - ports: - - "19003:80" - volumes: - - ./data/all-in-one/nginx/html:/usr/share/nginx/html - - ./data/all-in-one/nginx/conf/nginx.conf:/etc/nginx/nginx.conf - - ./data/all-in-one/nginx/conf.d:/etc/nginx/conf.d - - ./data/all-in-one/nginx/logs:/var/log/nginx - restart: always - fluent-bit: - image: fluent/fluent-bit:1.8.12 - networks: - - cv-devops-net - environment: - KAFKA_BROKERS: kafka:9092 - ports: - - 2020:2020 - volumes: - - ./data/all-in-one/fluent-bit/conf:/fluent-bit/etc/ - - ./data/all-in-one/nginx/logs:/var/log/containers - depends_on: - - nginx - - kafka - links: - - kafka - restart: always - zookeeper: - image: zookeeper - networks: - - cv-devops-net - environment: - - ALLOW_ANONYMOUS_LOGIN=yes - expose: - - 2181 - volumes: - - ./data/all-in-one/zookeeper/data:/data - - ./data/all-in-one/zookeeper/datalog:/datalog - kafka: - image: bitnami/kafka:2.8.1 - user: root - networks: - - cv-devops-net - environment: - - KAFKA_BROKER_ID=1 - - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 - - ALLOW_PLAINTEXT_LISTENER=yes - expose: - - 9092 - depends_on: - - zookeeper - restart: always - volumes: - - ./data/all-in-one/kafka:/bitnami/kafka - kowl: - image: rsmnarts/kowl - networks: - - cv-devops-net - environment: - KAFKA_BROKERS: kafka:9092 - ports: - - "19002:8080" - depends_on: - - kafka - links: - - zookeeper - - kafka - restart: always - mysql: - platform: linux/x86_64 - image: mysql:5.7 - networks: - - cv-devops-net - environment: - MYSQL_ROOT_PASSWORD: root - MYSQL_ROOT_HOST: '%' - command: [ - '--character-set-server=utf8mb4', - '--collation-server=utf8mb4_general_ci', - '--port=13306', - '--init-file=/data/all-in-one/migration/database.sql', - ] - ports: - - "13306:13306" - volumes: - - ./scripts/migration:/data/all-in-one/migration - restart: always - redis: - image: redis:5.0.14-alpine - networks: - - cv-devops-net - expose: - - 6380 - restart: always - command: [ '--port 6380' ] - clickhouse: - image: lunalabsltd/clickhouse-server:21.7.2.7-arm - networks: - - cv-devops-net - environment: - CLICKHOUSE_USER: root - CLICKHOUSE_PASSWORD: root - expose: - - 9000 - - 8123 - ports: - - "8123:8123" - - "9000:9000" - volumes: - - ./data/all-in-one/clickhouse/database:/var/lib/clickhouse - - ./data/all-in-one/clickhouse/logs:/var/log - # - ./data/all-in-one/clickhouse/conf/users.xml:/etc/clickhouse-server/users.xml - - ./data/all-in-one/clickhouse/conf/conf.d:/etc/clickhouse-server/conf.d - restart: always - links: - - kafka - depends_on: - - kafka - alertmanager: - networks: - - cv-devops-net - image: prom/alertmanager:latest - volumes: - - ./data/all-in-one/alertmanager/alertmanager.yaml:/etc/alertmanager/config/alertmanager.yaml - command: [ - "--config.file=/etc/alertmanager/config/alertmanager.yaml", - "--cluster.listen-address=localhost:6783", - "--storage.path=/alertmanager", - "--data.retention=120h", - "--web.listen-address=:9093", - "--web.route-prefix=/" - ] - expose: - - 9093 - ports: - - "19005:9093" - prom2click: - networks: - - cv-devops-net - image: fhalim/prom2click:latest - command: - - '-ch.dsn=tcp://clickhouse:9000?username=root&password=root&read_timeout=10&write_timeout=10&debug=true' - - '-ch.db=metrics' - - '-ch.table=samples' - expose: - - 9201 - ports: - - 19006:9201 - depends_on: - - clickhouse - links: - - clickhouse - prometheus: - networks: - - cv-devops-net - image: prom/prometheus:latest - command: - - '--web.enable-lifecycle' - - '--storage.tsdb.retention=6h' - - '--storage.tsdb.path=/prometheus' - - '--config.file=/etc/prometheus/prometheus.yaml' - volumes: - - ./data/all-in-one/prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml - - ./data/all-in-one/prometheus/rules:/etc/prometheus/rules - expose: - - 9090 - depends_on: - - alertmanager - - prom2click - links: - - alertmanager - - prom2click - ports: - - 19004:9090 diff --git a/docker-compose.devops.yml b/docker-compose.devops.yml index d92bd0493..68e7fce52 100644 --- a/docker-compose.devops.yml +++ b/docker-compose.devops.yml @@ -1,12 +1,12 @@ version: '3' networks: - cv-devops-net: + clickvisual-net: driver: bridge services: nginx: image: nginx networks: - - cv-devops-net + - clickvisual-net ports: - "19003:80" volumes: @@ -18,7 +18,7 @@ services: fluent-bit: image: fluent/fluent-bit:1.8.12 networks: - - cv-devops-net + - clickvisual-net environment: KAFKA_BROKERS: kafka:9092 ports: @@ -35,7 +35,7 @@ services: zookeeper: image: zookeeper networks: - - cv-devops-net + - clickvisual-net environment: - ALLOW_ANONYMOUS_LOGIN=yes expose: @@ -47,7 +47,7 @@ services: image: bitnami/kafka:2.8.1 user: root networks: - - cv-devops-net + - clickvisual-net environment: - KAFKA_BROKER_ID=1 - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 @@ -62,11 +62,11 @@ services: kowl: image: rsmnarts/kowl networks: - - cv-devops-net + - clickvisual-net environment: KAFKA_BROKERS: kafka:9092 ports: - - "19002:8080" + - 19002:8080 depends_on: - kafka links: @@ -75,10 +75,11 @@ services: restart: always mysql: image: mysql:5.7.37 + platform: linux/amd64 networks: - - cv-devops-net + - clickvisual-net environment: - MYSQL_ROOT_PASSWORD: root + MYSQL_ROOT_PASSWORD: shimo MYSQL_ROOT_HOST: '%' command: [ '--character-set-server=utf8mb4', @@ -87,14 +88,14 @@ services: '--init-file=/data/all-in-one/migration/database.sql', ] ports: - - "13306:13306" + - 13306:13306 volumes: - ./scripts/migration:/data/all-in-one/migration restart: always redis: image: redis:5.0.14-alpine networks: - - cv-devops-net + - clickvisual-net expose: - 6380 restart: always @@ -102,16 +103,14 @@ services: clickhouse: image: clickhouse/clickhouse-server:latest networks: - - cv-devops-net + - clickvisual-net environment: CLICKHOUSE_USER: root - CLICKHOUSE_PASSWORD: root + CLICKHOUSE_PASSWORD: shimo expose: - 9000 - - 8123 ports: - "8123:8123" - - "9000:9000" volumes: - ./data/all-in-one/clickhouse/database:/var/lib/clickhouse - ./data/all-in-one/clickhouse/logs:/var/log @@ -124,7 +123,7 @@ services: - kafka alertmanager: networks: - - cv-devops-net + - clickvisual-net image: prom/alertmanager:latest volumes: - ./data/all-in-one/alertmanager/alertmanager.yaml:/etc/alertmanager/config/alertmanager.yaml @@ -139,13 +138,13 @@ services: expose: - 9093 ports: - - "19005:9093" + - 19005:9093 prom2click: networks: - - cv-devops-net + - clickvisual-net image: fhalim/prom2click:latest command: - - '-ch.dsn=tcp://clickhouse:9000?username=root&password=root&read_timeout=10&write_timeout=10&debug=true' + - '-ch.dsn=tcp://clickhouse:9000?username=root&password=shimo&read_timeout=10&write_timeout=10&debug=true' - '-ch.db=metrics' - '-ch.table=samples' expose: @@ -158,7 +157,7 @@ services: - clickhouse prometheus: networks: - - cv-devops-net + - clickvisual-net image: prom/prometheus:latest command: - '--web.enable-lifecycle' diff --git a/docker-compose.m1.yml b/docker-compose.m1.yml deleted file mode 100644 index 7d384100d..000000000 --- a/docker-compose.m1.yml +++ /dev/null @@ -1,221 +0,0 @@ -version: '3' -networks: - clickvisual-net: - driver: bridge -services: - nginx: - image: nginx - networks: - - clickvisual-net - ports: - - "19003:80" - volumes: - - ./data/all-in-one/nginx/html:/usr/share/nginx/html - - ./data/all-in-one/nginx/conf/nginx.conf:/etc/nginx/nginx.conf - - ./data/all-in-one/nginx/conf.d:/etc/nginx/conf.d - - ./data/all-in-one/nginx/logs:/var/log/nginx - restart: always - fluent-bit: - image: fluent/fluent-bit:1.8.12 - networks: - - clickvisual-net - environment: - KAFKA_BROKERS: kafka:9092 - ports: - - 2020:2020 - volumes: - - ./data/all-in-one/fluent-bit/conf:/fluent-bit/etc/ - - ./data/all-in-one/nginx/logs:/var/log/containers - depends_on: - - nginx - - kafka - links: - - kafka - restart: always - zookeeper: - image: zookeeper - networks: - - clickvisual-net - environment: - - ALLOW_ANONYMOUS_LOGIN=yes - expose: - - 2181 - volumes: - - ./data/all-in-one/zookeeper/data:/data - - ./data/all-in-one/zookeeper/datalog:/datalog - kafka: - image: bitnami/kafka:2.8.1 - user: root - networks: - - clickvisual-net - environment: - - KAFKA_BROKER_ID=1 - - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 - - ALLOW_PLAINTEXT_LISTENER=yes - expose: - - 9092 - depends_on: - - zookeeper - restart: always - volumes: - - ./data/all-in-one/kafka:/bitnami/kafka - kowl: - image: rsmnarts/kowl - networks: - - clickvisual-net - environment: - KAFKA_BROKERS: kafka:9092 - ports: - - 19002:8080 - depends_on: - - kafka - links: - - zookeeper - - kafka - restart: always - mysql: - platform: linux/x86_64 - image: mysql:5.7 - networks: - - clickvisual-net - environment: - MYSQL_ROOT_PASSWORD: shimo - MYSQL_ROOT_HOST: '%' - command: [ - '--character-set-server=utf8mb4', - '--collation-server=utf8mb4_general_ci', - '--port=13306', - '--init-file=/data/all-in-one/migration/database.sql', - ] - ports: - - 13306:13306 - volumes: - - ./scripts/migration:/data/all-in-one/migration - restart: always - redis: - image: redis:5.0.14-alpine - networks: - - clickvisual-net - expose: - - 6380 - restart: always - command: [ '--port 6380' ] - clickhouse: - image: lunalabsltd/clickhouse-server:21.7.2.7-arm - networks: - - clickvisual-net - environment: - CLICKHOUSE_USER: root - CLICKHOUSE_PASSWORD: shimo - expose: - - 9000 - ports: - - "8123:8123" - volumes: - - ./data/all-in-one/clickhouse/database:/var/lib/clickhouse - - ./data/all-in-one/clickhouse/logs:/var/log -# - ./data/all-in-one/clickhouse/conf/users.xml:/etc/clickhouse-server/users.xml - - ./data/all-in-one/clickhouse/conf/conf.d:/etc/clickhouse-server/conf.d - restart: always - links: - - kafka - depends_on: - - kafka - alertmanager: - networks: - - clickvisual-net - image: prom/alertmanager:latest - volumes: - - ./data/all-in-one/alertmanager/alertmanager.yaml:/etc/alertmanager/config/alertmanager.yaml - command: [ - "--config.file=/etc/alertmanager/config/alertmanager.yaml", - "--cluster.listen-address=localhost:6783", - "--storage.path=/alertmanager", - "--data.retention=120h", - "--web.listen-address=:9093", - "--web.route-prefix=/" - ] - expose: - - 9093 - ports: - - 19005:9093 - prom2click: - networks: - - clickvisual-net - image: fhalim/prom2click:latest - command: - - '-ch.dsn=tcp://clickhouse:9000?username=root&password=shimo&read_timeout=10&write_timeout=10&debug=true' - - '-ch.db=metrics' - - '-ch.table=samples' - expose: - - 9201 - ports: - - 19006:9201 - depends_on: - - clickhouse - links: - - clickhouse - prometheus: - networks: - - clickvisual-net - image: prom/prometheus:latest - command: - - '--web.enable-lifecycle' - - '--storage.tsdb.retention=6h' - - '--storage.tsdb.path=/prometheus' - - '--config.file=/etc/prometheus/prometheus.yaml' - volumes: - - ./data/all-in-one/prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml - - ./data/all-in-one/prometheus/rules:/etc/prometheus/rules - expose: - - 9090 - depends_on: - - alertmanager - - prom2click - links: - - alertmanager - - prom2click - ports: - - 19004:9090 - api: - image: clickvisual/clickvisual:master - networks: - - clickvisual-net - environment: - EGO_CONFIG_PATH: /clickvisual/config/docker.toml - EGO_LOG_WRITER: stderr - ports: - - 19001:19001 - depends_on: - - mysql - - redis - - clickhouse - - fluent-bit - - kafka - - prometheus - links: - - mysql - - redis - - clickhouse - - kafka - - prometheus - restart: always - volumes: - - ./data/all-in-one/clickvisual/config:/clickvisual/config - - ./data/all-in-one/prometheus/rules:/clickvisual/rules - command: [ '/bin/sh', '-c', './bin/clickvisual' ] - mock: - image: clickvisual/clickvisual:master - networks: - - clickvisual-net - environment: - EGO_CONFIG_PATH: /clickvisual/config/docker.toml - EGO_LOG_WRITER: stderr - depends_on: - - mysql - links: - - mysql - restart: 'no' - volumes: - - ./data/all-in-one/clickvisual/config:/clickvisual/config - command: [ '/bin/sh', '-c', './bin/clickvisual -job install' ] \ No newline at end of file diff --git a/docs/docs/en/clickvisual/06join/env.md b/docs/docs/en/clickvisual/06join/env.md index ab241d043..c487b4e72 100644 --- a/docs/docs/en/clickvisual/06join/env.md +++ b/docs/docs/en/clickvisual/06join/env.md @@ -2,12 +2,10 @@ 快速搭建本地开发环境 ## 启动 -fork 代码后,在项目根目录可以看到,以下两个文件,根据自己的硬件情况选择启动 -- docker-compose.devops.yml -- docker-compose.devops.m1.yml +fork 代码后,在项目根目录可以看到 `docker-compose.devops.yml` -例如 mac m1 机器可以执行 -> docker-compose -f docker-compose.devops.m1.yml up +执行 +> docker-compose -f docker-compose.devops.yml up 成功启动 diff --git a/docs/docs/zh/clickvisual/01quickstart/experience-clickvisual-with-docker-compose.md b/docs/docs/zh/clickvisual/01quickstart/experience-clickvisual-with-docker-compose.md index 9799c1e16..a1ada7a83 100644 --- a/docs/docs/zh/clickvisual/01quickstart/experience-clickvisual-with-docker-compose.md +++ b/docs/docs/zh/clickvisual/01quickstart/experience-clickvisual-with-docker-compose.md @@ -21,7 +21,13 @@ ### 2.2. 创建数据库 -创建实例,填写 DSN 参数 clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms&max_execution_time=60 +创建实例,填写 DSN 参数 + +> clickhouse://username:password@host1:9000,host2:9000/database?max_execution_time=60 + +docker-compose demo 填写 + +> clickhouse://root:shimo@clickhouse:9000/default?max_execution_time=60 ![img.png](../../../images/create-database.png) diff --git a/docs/docs/zh/clickvisual/06join/env.md b/docs/docs/zh/clickvisual/06join/env.md index ab241d043..c487b4e72 100644 --- a/docs/docs/zh/clickvisual/06join/env.md +++ b/docs/docs/zh/clickvisual/06join/env.md @@ -2,12 +2,10 @@ 快速搭建本地开发环境 ## 启动 -fork 代码后,在项目根目录可以看到,以下两个文件,根据自己的硬件情况选择启动 -- docker-compose.devops.yml -- docker-compose.devops.m1.yml +fork 代码后,在项目根目录可以看到 `docker-compose.devops.yml` -例如 mac m1 机器可以执行 -> docker-compose -f docker-compose.devops.m1.yml up +执行 +> docker-compose -f docker-compose.devops.yml up 成功启动 From 2a265738f7807f6de5f3834f4b930254935fd466 Mon Sep 17 00:00:00 2001 From: kl7sn Date: Wed, 11 Jan 2023 17:51:32 +0800 Subject: [PATCH 2/3] fix: Table mode supports null value display --- api/internal/service/inquiry/clickhouse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/internal/service/inquiry/clickhouse.go b/api/internal/service/inquiry/clickhouse.go index 56b582c23..5d365feae 100644 --- a/api/internal/service/inquiry/clickhouse.go +++ b/api/internal/service/inquiry/clickhouse.go @@ -1837,7 +1837,7 @@ func (c *ClickHouse) doQuery(sql string) (res []map[string]interface{}, err erro } for k := range fields { if isEmpty(values[k]) { - line[fields[k]] = "" + line[fields[k]] = "[NULL]" } else { line[fields[k]] = values[k] } From a68c13f761b4c89c3d368eac50205ce66e9bf720 Mon Sep 17 00:00:00 2001 From: kl7sn Date: Wed, 11 Jan 2023 18:20:18 +0800 Subject: [PATCH 3/3] fix: Fix instance availability test exceptions #871 --- api/internal/api/apiv1/base/instance.go | 4 +- api/pkg/model/view/sysop.go | 2 +- .../CreatedOrUpdatedInstanceModal/index.tsx | 37 ++++++------------- ui/src/services/systemSetting.ts | 4 +- 4 files changed, 18 insertions(+), 29 deletions(-) diff --git a/api/internal/api/apiv1/base/instance.go b/api/internal/api/apiv1/base/instance.go index 05ed7472a..12c4eb07f 100644 --- a/api/internal/api/apiv1/base/instance.go +++ b/api/internal/api/apiv1/base/instance.go @@ -204,12 +204,14 @@ func InstanceTest(c *core.Context) { c.JSONE(1, err.Error(), err) return } - switch req.Datasource { case db.DatasourceClickHouse: _, err = service.ClickHouseLink(req.Dsn) case db.DatasourceDatabend: _, err = service.DatabendLink(req.Dsn) + default: + c.JSONE(1, "data source type error", nil) + return } if err != nil { c.JSONE(1, "connection failure: "+err.Error(), err) diff --git a/api/pkg/model/view/sysop.go b/api/pkg/model/view/sysop.go index 80b47bfa1..7601d8c57 100644 --- a/api/pkg/model/view/sysop.go +++ b/api/pkg/model/view/sysop.go @@ -14,7 +14,7 @@ type RespConfigmap struct { } type ReqTestInstance struct { - Datasource string `json:"datasource" default:"ch"` + Datasource string `json:"datasource" binding:"required"` Dsn string `json:"dsn" binding:"required"` } diff --git a/ui/src/pages/SystemSetting/InstancePanel/components/CreatedOrUpdatedInstanceModal/index.tsx b/ui/src/pages/SystemSetting/InstancePanel/components/CreatedOrUpdatedInstanceModal/index.tsx index 91973f793..9900b738f 100644 --- a/ui/src/pages/SystemSetting/InstancePanel/components/CreatedOrUpdatedInstanceModal/index.tsx +++ b/ui/src/pages/SystemSetting/InstancePanel/components/CreatedOrUpdatedInstanceModal/index.tsx @@ -1,28 +1,12 @@ -import { - Button, - Checkbox, - Form, - FormInstance, - Input, - message, - Modal, - Select, - Space, - Switch, - Tooltip, -} from "antd"; -import { useDebounceFn } from "ahooks"; -import type { InstanceType } from "@/services/systemSetting"; -import { useModel } from "@@/plugin-model/useModel"; -import { useEffect, useRef, useState } from "react"; -import { DEBOUNCE_WAIT } from "@/config/config"; -import { useIntl } from "umi"; -import { - MinusCircleOutlined, - PlusOutlined, - SaveOutlined, -} from "@ant-design/icons"; -import { cloneDeep } from "lodash"; +import {Button, Checkbox, Form, FormInstance, Input, message, Modal, Select, Space, Switch, Tooltip,} from "antd"; +import {useDebounceFn} from "ahooks"; +import type {InstanceType} from "@/services/systemSetting"; +import {useModel} from "@@/plugin-model/useModel"; +import {useEffect, useRef, useState} from "react"; +import {DEBOUNCE_WAIT} from "@/config/config"; +import {useIntl} from "umi"; +import {MinusCircleOutlined, PlusOutlined, SaveOutlined,} from "@ant-design/icons"; +import {cloneDeep} from "lodash"; import IconFont from "@/components/IconFont"; type CreatedOrUpdatedInstanceModalProps = { @@ -78,13 +62,14 @@ const CreatedOrUpdatedInstanceModal = ( const handleTest = useDebounceFn( () => { const dsn = instanceFormRef.current?.getFieldValue("dsn"); + const datasource = instanceFormRef.current?.getFieldValue("datasource"); if (!dsn) { message.warning( i18n.formatMessage({ id: "instance.form.test.warning" }) ); return; } - doTestInstance.run({ dsn }).then((res) => { + doTestInstance.run({ dsn, datasource }).then((res) => { if (res?.code === 0) { message.success( i18n.formatMessage({ id: "instance.form.test.success" }) diff --git a/ui/src/services/systemSetting.ts b/ui/src/services/systemSetting.ts index 095de2c83..8451d9c9c 100644 --- a/ui/src/services/systemSetting.ts +++ b/ui/src/services/systemSetting.ts @@ -1,4 +1,5 @@ -import { request } from "umi"; +import {request} from "umi"; + export interface TimeBaseType { utime?: number; ctime?: number; @@ -20,6 +21,7 @@ export interface InstanceType extends TimeBaseType { export interface TestInstanceRequest { dsn: string; + datasource: string; } export interface ClustersRequest {