diff --git a/chat2db-client/src/assets/font/demo_index.html b/chat2db-client/src/assets/font/demo_index.html index d48bca593..8fdd5f087 100644 --- a/chat2db-client/src/assets/font/demo_index.html +++ b/chat2db-client/src/assets/font/demo_index.html @@ -54,6 +54,12 @@
@font-face@font-face {
font-family: 'iconfont';
- src: url('iconfont.woff2?t=1697513439813') format('woff2'),
- url('iconfont.woff?t=1697513439813') format('woff'),
- url('iconfont.ttf?t=1697513439813') format('truetype');
+ src: url('iconfont.woff2?t=1697535832665') format('woff2'),
+ url('iconfont.woff?t=1697535832665') format('woff'),
+ url('iconfont.ttf?t=1697535832665') format('truetype');
}
第二步:定义使用 iconfont 的样式
@@ -1060,6 +1066,15 @@ 第三步:挑选相应图标并获取字体编码,应用于页面
+ -
+
+
+ 导入
+
+ .icon-daoru
+
+
+
-
@@ -2527,6 +2542,14 @@
第二步:挑选相应图标并获取类名,应用于页面:
+ -
+
+ 导入
+ #icon-daoru
+
+
-
diff --git a/chat2db-client/src/i18n/en-us/connection.ts b/chat2db-client/src/i18n/en-us/connection.ts
index 56bdceeeb..e886c58e4 100644
--- a/chat2db-client/src/i18n/en-us/connection.ts
+++ b/chat2db-client/src/i18n/en-us/connection.ts
@@ -2,6 +2,7 @@ export default {
'connection.title.connections': 'Connections',
'connection.title.createConnection': 'New Connection',
'connection.title.editConnection': 'Edit Connection',
+ 'connection.title.importConnection': 'Import Connection',
'connection.label.name': 'name',
'connection.label.host': 'host',
'connection.label.authentication': 'authentication',
diff --git a/chat2db-client/src/i18n/zh-cn/connection.ts b/chat2db-client/src/i18n/zh-cn/connection.ts
index 29e72b046..ec479ae2a 100644
--- a/chat2db-client/src/i18n/zh-cn/connection.ts
+++ b/chat2db-client/src/i18n/zh-cn/connection.ts
@@ -2,6 +2,7 @@ export default {
'connection.title.connections': '连接',
'connection.title.createConnection': '创建数据源',
'connection.title.editConnection': '修改数据源',
+ 'connection.title.importConnection': '导入数据源',
'connection.label.name': '名称',
'connection.label.host': '主机',
'connection.label.authentication': '身份验证',
@@ -29,4 +30,4 @@ export default {
'connection.label.shared': '共享',
'connection.button.createConnection': '创建连接',
'connection.tips.noConnection': '您当前还没有创建任何连接',
-}
+};
diff --git a/chat2db-client/src/pages/main/connection/index.tsx b/chat2db-client/src/pages/main/connection/index.tsx
index 02fc75cdd..7d7a62afc 100644
--- a/chat2db-client/src/pages/main/connection/index.tsx
+++ b/chat2db-client/src/pages/main/connection/index.tsx
@@ -297,7 +297,17 @@ function Connections(props: IProps) {
);
})}
)}
diff --git a/chat2db-server/chat2db-plugins/chat2db-mysql/src/main/java/ai/chat2db/plugin/mysql/MysqlMetaData.java b/chat2db-server/chat2db-plugins/chat2db-mysql/src/main/java/ai/chat2db/plugin/mysql/MysqlMetaData.java
index 398858f22..38d8b034e 100644
--- a/chat2db-server/chat2db-plugins/chat2db-mysql/src/main/java/ai/chat2db/plugin/mysql/MysqlMetaData.java
+++ b/chat2db-server/chat2db-plugins/chat2db-mysql/src/main/java/ai/chat2db/plugin/mysql/MysqlMetaData.java
@@ -253,7 +253,12 @@ private TableIndexColumn getTableIndexColumn(ResultSet resultSet) throws SQLExce
tableIndexColumn.setCollation(resultSet.getString("Collation"));
tableIndexColumn.setCardinality(resultSet.getLong("Cardinality"));
tableIndexColumn.setSubPart(resultSet.getLong("Sub_part"));
- tableIndexColumn.setAscOrDesc(resultSet.getString("Collation"));
+ String collation = resultSet.getString("Collation");
+ if ("a".equalsIgnoreCase(collation)) {
+ tableIndexColumn.setAscOrDesc("ASC");
+ } else if ("d".equalsIgnoreCase(collation)) {
+ tableIndexColumn.setAscOrDesc("DESC");
+ }
return tableIndexColumn;
}
diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-core/src/main/java/ai/chat2db/server/domain/core/impl/OperationLogServiceImpl.java b/chat2db-server/chat2db-server-domain/chat2db-server-domain-core/src/main/java/ai/chat2db/server/domain/core/impl/OperationLogServiceImpl.java
index f14c08575..2b4024f25 100644
--- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-core/src/main/java/ai/chat2db/server/domain/core/impl/OperationLogServiceImpl.java
+++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-core/src/main/java/ai/chat2db/server/domain/core/impl/OperationLogServiceImpl.java
@@ -1,6 +1,7 @@
package ai.chat2db.server.domain.core.impl;
import java.time.LocalDateTime;
+import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
@@ -22,7 +23,9 @@
import ai.chat2db.server.tools.common.util.ContextUtils;
import ai.chat2db.server.tools.common.util.EasySqlUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -67,6 +70,7 @@ public PageResult queryPage(OperationLogPageQueryParam param) {
Integer offset = param.getPageSize();
Page page = new Page<>(start, offset);
page.setOptimizeCountSql(false);
+ page.setOrders(Arrays.asList(OrderItem.desc("gmt_create")));
IPage executedDdlDOIPage = operationLogMapper.selectPage(page, queryWrapper);
List executedDdlDTOS = operationLogConverter.do2dto(executedDdlDOIPage.getRecords());
if (CollectionUtils.isEmpty(executedDdlDTOS)) {
diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/EmbeddingController.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/EmbeddingController.java
index 7e93c3680..a13489ad1 100644
--- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/EmbeddingController.java
+++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/EmbeddingController.java
@@ -65,6 +65,9 @@ public class EmbeddingController extends ChatController {
@GetMapping("/white/check")
public DataResult checkInWhite(WhiteListRequest request) {
request.setWhiteType(WhiteListTypeEnum.VECTOR.getCode());
+ if (StringUtils.isBlank(request.getApiKey())) {
+ return DataResult.of(false);
+ }
return gatewayClientService.checkInWhite(request);
}
diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/request/TableRequest.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/request/TableRequest.java
index 0e49878d6..3d38ab415 100644
--- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/request/TableRequest.java
+++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/request/TableRequest.java
@@ -4,6 +4,7 @@
import ai.chat2db.spi.model.TableColumn;
import ai.chat2db.spi.model.TableIndex;
+import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -40,6 +41,17 @@ public class TableRequest {
private List indexList;
+ /**
+ * 空间名
+ */
+ private String schemaName;
+
+ /**
+ * 数据库名
+ */
+ private String databaseName;
+
+
private String engine;
diff --git a/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/jdbc/DefaultDBManage.java b/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/jdbc/DefaultDBManage.java
index 3e14efe25..fee2c9246 100644
--- a/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/jdbc/DefaultDBManage.java
+++ b/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/jdbc/DefaultDBManage.java
@@ -67,7 +67,7 @@ public Connection getConnection(ConnectInfo connectInfo) {
}
connectInfo.setSession(session);
connectInfo.setConnection(connection);
- if (StringUtils.isNotBlank(connectInfo.getDatabaseName())) {
+ if (StringUtils.isNotBlank(connectInfo.getDatabaseName()) || StringUtils.isNotBlank(connectInfo.getSchemaName())) {
connectDatabase(connection, connectInfo.getDatabaseName());
}
return connection;