diff --git a/README.md b/README.md index 6029bcb..7036953 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ GoNavi is designed for developers and DBAs who need a unified desktop experience | Document | MongoDB | Optional driver agent | Document query, collection browsing, connection management | | Time-series | TDengine | Optional driver agent | Time-series schema browsing and querying | | Columnar Analytics | ClickHouse | Optional driver agent | Analytical query, object browsing, SQL execution | +| Search | Elasticsearch | Optional driver agent | Index browsing, mapping inspection, JSON DSL / query_string search | | Extensibility | Custom Driver/DSN | Custom | Extend to more data sources via Driver + DSN |

📸 Screenshots

diff --git a/README.zh-CN.md b/README.zh-CN.md index 688f86e..8cc2f58 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -50,6 +50,7 @@ GoNavi 面向开发者与 DBA,核心目标是让数据库操作在桌面端做 | 文档型 | MongoDB | 可选驱动代理 | 文档查询、集合浏览、连接管理 | | 时序 | TDengine | 可选驱动代理 | 时序库表浏览、查询分析 | | 列式分析 | ClickHouse | 可选驱动代理 | 分析查询、对象浏览、SQL 执行 | +| 搜索 | Elasticsearch | 可选驱动代理 | 索引浏览、Mapping 检查、JSON DSL / query_string 查询 | | 扩展接入 | Custom Driver/DSN | 自定义 | 通过 Driver + DSN 接入更多数据源 |

📸 项目截图

diff --git a/build-driver-agents.sh b/build-driver-agents.sh index 854348d..9d1d7c2 100755 --- a/build-driver-agents.sh +++ b/build-driver-agents.sh @@ -5,7 +5,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$SCRIPT_DIR" -DEFAULT_DRIVERS=(mariadb oceanbase doris starrocks sphinx sqlserver sqlite duckdb dameng kingbase highgo vastbase opengauss iris mongodb tdengine clickhouse) +DEFAULT_DRIVERS=(mariadb oceanbase doris starrocks sphinx sqlserver sqlite duckdb dameng kingbase highgo vastbase opengauss iris mongodb tdengine clickhouse elasticsearch) DEFAULT_PLATFORMS=(darwin/amd64 darwin/arm64 windows/amd64 windows/arm64 linux/amd64 linux/arm64) DUCKDB_WINDOWS_LIBRARY_VERSION="v1.4.4" DUCKDB_WINDOWS_LIBRARY_URL="https://github.com/duckdb/duckdb/releases/download/${DUCKDB_WINDOWS_LIBRARY_VERSION}/libduckdb-windows-amd64.zip" @@ -42,6 +42,7 @@ normalize_driver() { case "$name" in doris|diros) echo "doris" ;; open_gauss|open-gauss) echo "opengauss" ;; + elasticsearch|elastic) echo "elasticsearch" ;; mariadb|oceanbase|starrocks|sphinx|sqlserver|sqlite|duckdb|dameng|kingbase|highgo|vastbase|opengauss|iris|mongodb|tdengine|clickhouse) echo "$name" ;; diff --git a/frontend/package.json.md5 b/frontend/package.json.md5 index 7396e24..bed8925 100755 --- a/frontend/package.json.md5 +++ b/frontend/package.json.md5 @@ -1 +1 @@ -d0464f9da25e9356e61652e638c99ffe \ No newline at end of file +0295a42fd931778d85157816d79d29e5 \ No newline at end of file diff --git a/frontend/public/db-icons/elasticsearch.svg b/frontend/public/db-icons/elasticsearch.svg new file mode 100644 index 0000000..bbac79d --- /dev/null +++ b/frontend/public/db-icons/elasticsearch.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/frontend/src/components/ConnectionModal.tsx b/frontend/src/components/ConnectionModal.tsx index 0baad1a..d3fce08 100644 --- a/frontend/src/components/ConnectionModal.tsx +++ b/frontend/src/components/ConnectionModal.tsx @@ -284,12 +284,12 @@ const singleHostUriSchemesByType: Record = { sqlserver: ["sqlserver"], iris: ["iris", "intersystems"], redis: ["redis"], - elasticsearch: ["http", "https"], tdengine: ["tdengine"], dameng: ["dameng", "dm"], kingbase: ["kingbase"], highgo: ["highgo"], vastbase: ["vastbase"], + elasticsearch: ["http", "https"], }; const sslSupportedTypes = new Set([ @@ -311,8 +311,8 @@ const sslSupportedTypes = new Set([ "opengauss", "mongodb", "redis", - "elasticsearch", "tdengine", + "elasticsearch", ]); const supportsSSLForType = (type: string) => @@ -357,7 +357,6 @@ const sslClientCertificateSupportedTypes = new Set([ "opengauss", "mongodb", "redis", - "elasticsearch", ]); const supportsSSLCAPathForType = (type: string) => @@ -411,9 +410,9 @@ const supportsConnectionParamsForType = (type: string) => type === "iris" || type === "clickhouse" || type === "mongodb" || - type === "elasticsearch" || type === "dameng" || - type === "tdengine"; + type === "tdengine" || + type === "elasticsearch"; type DriverStatusSnapshot = { type: string; @@ -431,6 +430,7 @@ const normalizeDriverType = (value: string): string => { .trim() .toLowerCase(); if (normalized === "postgresql") return "postgres"; + if (normalized === "elastic") return "elasticsearch"; if (normalized === "doris") return "diros"; if ( normalized === "intersystems" || @@ -1974,15 +1974,6 @@ const ConnectionModal: React.FC<{ parsedValues.useSSL = false; parsedValues.sslMode = "disable"; } - } else if (type === "elasticsearch") { - const isHTTPS = trimmedUri.toLowerCase().startsWith("https://"); - const skipVerify = normalizeBool(parsed.params.get("skip_verify")); - parsedValues.useSSL = isHTTPS; - parsedValues.sslMode = isHTTPS - ? skipVerify - ? "skip-verify" - : "required" - : "disable"; } } return parsedValues; @@ -2048,9 +2039,6 @@ const ConnectionModal: React.FC<{ if (dbType === "redis") { return "redis://:pass@127.0.0.1:6379,127.0.0.2:6379/0?topology=cluster"; } - if (dbType === "elasticsearch") { - return "http://elastic:pass@127.0.0.1:9200/logs-*"; - } if (dbType === "oracle") { return "oracle://user:pass@127.0.0.1:1521/ORCLPDB1"; } @@ -2270,10 +2258,6 @@ const ConnectionModal: React.FC<{ ? values.useSSL ? "https" : "http" - : type === "elasticsearch" - ? values.useSSL - ? "https" - : "http" : type; const dbPath = database ? `/${encodeURIComponent(database)}` : ""; const params = new URLSearchParams(); @@ -2320,11 +2304,6 @@ const ConnectionModal: React.FC<{ if (mode === "skip-verify" || mode === "preferred") { params.set("skip_verify", "true"); } - } else if (type === "elasticsearch") { - if (mode === "skip-verify" || mode === "preferred") { - params.set("skip_verify", "true"); - } - appendSSLPathParamsForUri(params, type, values); } } else if (supportsSSLForType(type)) { if (isPostgresCompatibleSSLType(type)) { @@ -3841,13 +3820,7 @@ const ConnectionModal: React.FC<{ }); } else if (type !== "custom") { const defaultUser = - type === "clickhouse" - ? "default" - : type === "redis" - ? "" - : type === "elasticsearch" - ? "elastic" - : "root"; + type === "clickhouse" ? "default" : (type === "redis" || type === "elasticsearch") ? "" : "root"; const sslCapableType = supportsSSLForType(type); setUseSSL(false); setUseHttpTunnel(false); @@ -4085,7 +4058,7 @@ const ConnectionModal: React.FC<{ case "mongodb": return "单机 / 副本集"; case "elasticsearch": - return "索引 / JSON DSL"; + return "支持索引浏览、Mapping 检查、JSON DSL 和 query_string 查询"; case "oceanbase": return "MySQL / Oracle 租户"; case "sqlite": @@ -5128,25 +5101,6 @@ const ConnectionModal: React.FC<{ ), })} - {dbType === "elasticsearch" && - renderConfigSectionCard({ - sectionKey: "service", - icon: , - children: ( - - - - ), - })} - {(dbType === "oracle" || isOceanBaseOracle) && renderConfigSectionCard({ sectionKey: "service", @@ -5677,13 +5631,13 @@ const ConnectionModal: React.FC<{ name="user" label="用户名" rules={ - dbType === "mongodb" + (dbType === "mongodb" || dbType === "elasticsearch") ? [] : [createUriAwareRequiredRule("请输入用户名")] } style={{ marginBottom: 0 }} > - +