Skip to content

Commit

Permalink
fix:console title
Browse files Browse the repository at this point in the history
  • Loading branch information
shanhexi committed Jan 31, 2024
1 parent 3d53af5 commit be9dbfd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
31 changes: 21 additions & 10 deletions chat2db-client/src/pages/demo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
import React, { useEffect } from 'react';
import OpenScreenAnimation from '@/components/OpenScreenAnimation';
import sqlService from '@/service/sql';

function Test() {
// const token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOjIsImRldmljZSI6ImRlZmF1bHQtZGV2aWNlIiwiZWZmIjoxNzA2ODU0NTMwMDI3LCJyblN0ciI6Ik1RcHRPOUVBVlJlbGRQa1RFN01MZUpLeG5KTGVwRFpaIn0.knOw08E6mwWF_GpkeQ8KflQlfQuNu4jd-_Bgh7EnCj4'
// useEffect(() => {
// const socket = new WebSocket(`ws://127.0.0.1:10821/api/ws/${token}`);
// socket.onopen = () => {
// console.log('open');
// socket.send('hello');
// };
// }, []);
return <OpenScreenAnimation />;
const sql = "INSERT INTO `big_data_table` (`name1`,`name2`,`name3`,`name4`,`name5`,`name6`,`name7`,`name8`,`name9`,`name10`,`name11`,`name21`,`name31`,`name41`,`name51`,`name61`,`name71`,`name81`,`name91`,`name12`,`name22`,`name32`,`name42`,`name52`,`name62`,`name72`,`name82`,`name92`,`name13`,`name223`,`name323`,`name423`,`name523`,`name623`,`name723`,`name823`,`name923`) VALUES ('牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛','牛牛牛牛牛牛牛牛牛牛牛牛');";
const sqls:any = [];
for (let i = 30; i < 1030; i++) {
sqls.push(sql)
}
const a = () =>{
const executeSQLParams = {
sql: sqls.join(''),
dataSourceId:2,
databaseName: "e-commerc",
};
// 获取当前SQL的查询结果
return sqlService.executeSql(executeSQLParams).finally(()=>{
a()
});
}
useEffect(() => {
a()
},[])
return 11111;
}

export default Test;
2 changes: 1 addition & 1 deletion chat2db-client/src/pages/main/workspace/store/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const createConsole = (params: ICreateConsoleParams) => {
const currentConnectionDetails = useWorkspaceStore.getState().currentConnectionDetails;
const newConsole = {
...params,
name: params.name || `untitled-${params.databaseName || params.schemaName} (@${params.dataSourceName})`,
name: params.name || `untitled-${params.databaseName || params.schemaName} (${params.dataSourceName})`,
ddl: params.ddl || '',
status: ConsoleStatus.DRAFT,
operationType: params.operationType || WorkspaceTabType.CONSOLE,
Expand Down

0 comments on commit be9dbfd

Please sign in to comment.