From be9dbfd6d5c207ce9fe68126305b70a3811cea2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BA=E5=96=9C?= <86969353+shanhexi@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:53:49 +0800 Subject: [PATCH] fix:console title --- chat2db-client/src/pages/demo/index.tsx | 31 +++++++++++++------ .../src/pages/main/workspace/store/console.ts | 2 +- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/chat2db-client/src/pages/demo/index.tsx b/chat2db-client/src/pages/demo/index.tsx index aceb18934..c341aac46 100644 --- a/chat2db-client/src/pages/demo/index.tsx +++ b/chat2db-client/src/pages/demo/index.tsx @@ -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 ; + 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; diff --git a/chat2db-client/src/pages/main/workspace/store/console.ts b/chat2db-client/src/pages/main/workspace/store/console.ts index aea5a82cd..f82e3b90b 100644 --- a/chat2db-client/src/pages/main/workspace/store/console.ts +++ b/chat2db-client/src/pages/main/workspace/store/console.ts @@ -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,