From fc62145a996bffb8caed47d916f0bacdf29054c2 Mon Sep 17 00:00:00 2001 From: xiaokang Date: Mon, 9 Dec 2024 17:47:33 +0800 Subject: [PATCH 1/2] Revert "feat: support svrIp in kill api" This reverts commit f9aacd6a0d9e415a76504ad3c1a0f599ba1e77a9. --- src/common/network/sessionParams.ts | 7 ++----- src/d.ts/index.ts | 1 - .../Workspace/components/SessionManagementPage/index.tsx | 7 +------ 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/common/network/sessionParams.ts b/src/common/network/sessionParams.ts index 7e08c243b..d3771c49f 100644 --- a/src/common/network/sessionParams.ts +++ b/src/common/network/sessionParams.ts @@ -64,10 +64,7 @@ export async function getDatabaseSessionList(sessionId: string): Promise { const res = await request.post(`/api/v2/datasource/sessions/killSession`, { data: { - sessionIds: sessionIdAndsvrIps, + sessionIds, datasourceId, killType, }, diff --git a/src/d.ts/index.ts b/src/d.ts/index.ts index 7e5a91447..a6583abc2 100644 --- a/src/d.ts/index.ts +++ b/src/d.ts/index.ts @@ -1744,7 +1744,6 @@ export interface IDatabaseSession { sessionId: number; sql: string; srcIp: string; - svrIp: string; status: string; } diff --git a/src/page/Workspace/components/SessionManagementPage/index.tsx b/src/page/Workspace/components/SessionManagementPage/index.tsx index 0e293d335..5d7b51320 100644 --- a/src/page/Workspace/components/SessionManagementPage/index.tsx +++ b/src/page/Workspace/components/SessionManagementPage/index.tsx @@ -232,12 +232,7 @@ function SessionManagementPage(props: IProps) { */ const kill = async (type: 'session' | 'query') => { const data = await killSessions( - selectedRows?.map((i) => { - return { - sessionId: i.sessionId?.toString(), - svrIp: i.svrIp, - }; - }), + selectedRows?.map((i) => i.sessionId?.toString()), context.datasourceId, type, ); From 5a5eec2877e926edbe5aa3d0daa9d13b53ada869 Mon Sep 17 00:00:00 2001 From: xiaokang Date: Mon, 9 Dec 2024 17:48:13 +0800 Subject: [PATCH 2/2] Revert "fix: set unique session id" This reverts commit b4820fced85bc60b7026f7613d1f70b751c57d45. --- .../Workspace/components/SessionManagementPage/index.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/page/Workspace/components/SessionManagementPage/index.tsx b/src/page/Workspace/components/SessionManagementPage/index.tsx index 5d7b51320..ba3ecfca0 100644 --- a/src/page/Workspace/components/SessionManagementPage/index.tsx +++ b/src/page/Workspace/components/SessionManagementPage/index.tsx @@ -346,16 +346,14 @@ function SessionManagementPage(props: IProps) { ) : null}
`${row.sessionId}-${row.svrIp}`} + rowKey={'sessionId'} bordered={true} loading={listLoading} columns={columns} dataSource={filteredRows} loadData={(page) => {}} rowSelection={{ - selectedRowKeys: selectedRows.map( - (r: IDatabaseSession) => `${r.sessionId}-${r.svrIp}`, - ), + selectedRowKeys: selectedRows.map((r: IDatabaseSession) => r.sessionId), onChange: (selectedRowKeys: string[], rows: IDatabaseSession[]) => { setSelectedRows(rows); },