From 3feb3b2e778b5c41526d829f22a9001755fd776e Mon Sep 17 00:00:00 2001
From: Duyet Le <5009534+duyet@users.noreply.github.com>
Date: Sun, 3 Dec 2023 05:59:41 +0700
Subject: [PATCH] chore(frontend): better UX for running queries page (#59)
* chore(frontend): change the way render of reloading running queries
* chore: format reable row count for running queries table
---
.../pages/RunningQueries/RunningQueries.tsx | 20 ++++++++++++++-----
housewatch/clickhouse/queries/sql.py | 11 +++++++++-
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/frontend/src/pages/RunningQueries/RunningQueries.tsx b/frontend/src/pages/RunningQueries/RunningQueries.tsx
index ef42a3a..f60ae87 100644
--- a/frontend/src/pages/RunningQueries/RunningQueries.tsx
+++ b/frontend/src/pages/RunningQueries/RunningQueries.tsx
@@ -1,4 +1,4 @@
-import { Table, Button, notification, Typography } from 'antd'
+import { Table, Button, notification, Typography, Tooltip, Spin } from 'antd'
import { usePollingEffect } from '../../utils/usePollingEffect'
import React, { useState } from 'react'
import { ColumnType } from 'antd/es/table'
@@ -8,8 +8,10 @@ const { Paragraph } = Typography
interface RunningQueryData {
query: string
read_rows: number
+ read_rows_readable: string
query_id: string
total_rows_approx: number
+ total_rows_approx_readable: string
elapsed: number
memory_usage: string
}
@@ -80,11 +82,16 @@ export default function RunningQueries() {
)
},
},
+ { title: 'User', dataIndex: 'user' },
{ title: 'Elapsed time', dataIndex: 'elapsed' },
{
title: 'Rows read',
dataIndex: 'read_rows',
- render: (_: any, item) => `~${item.read_rows}/${item.total_rows_approx}`,
+ render: (_: any, item) => (
+