Skip to content

Commit

Permalink
Merge branch 'dev-4.3.2' into dev-4.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Dec 9, 2024
2 parents d69d8d7 + 5a5eec2 commit 670031f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
7 changes: 2 additions & 5 deletions src/common/network/sessionParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ export async function getDatabaseSessionList(sessionId: string): Promise<IDataba
}

export async function killSessions(
sessionIdAndsvrIps: {
sessionId: string;
svrIp: string;
}[],
sessionIds: string[],
datasourceId: number,
killType: 'session' | 'query',
): Promise<
Expand All @@ -79,7 +76,7 @@ export async function killSessions(
> {
const res = await request.post(`/api/v2/datasource/sessions/killSession`, {
data: {
sessionIds: sessionIdAndsvrIps,
sessionIds,
datasourceId,
killType,
},
Expand Down
1 change: 0 additions & 1 deletion src/d.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,6 @@ export interface IDatabaseSession {
sessionId: number;
sql: string;
srcIp: string;
svrIp: string;
status: string;
}

Expand Down
13 changes: 3 additions & 10 deletions src/page/Workspace/components/SessionManagementPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down Expand Up @@ -351,16 +346,14 @@ function SessionManagementPage(props: IProps) {
) : null}
<div className={styles.table}>
<MiniTable
rowKey={(row) => `${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);
},
Expand Down

0 comments on commit 670031f

Please sign in to comment.