feat(react-web-next): 新增.editorconfig和.prettierrc配置文件,添加public/.gitkeep占位文件
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import React, { useRef, useState } from 'react';
|
||||
import { PageContainer, ProFormSelect, ProFormText, ProTable } from '@ant-design/pro-components';
|
||||
import type { ProColumns, ActionType } from '@ant-design/pro-components';
|
||||
import { GlassCard, SearchBarPlus } from '@/components/ui';
|
||||
import { searchApi } from '@/services/search';
|
||||
|
||||
const SlowSqlLogPage: React.FC = () => {
|
||||
const [params, setParams] = useState<Record<string, any>>({});
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const columns: ProColumns<any>[] = [
|
||||
{ dataIndex: 'index', valueType: 'indexBorder', width: 48 },
|
||||
{ title: '日志时间', key: 'timestamp', width: 140, render: (_, r) => r.timestamp },
|
||||
{ title: '查询语句', dataIndex: 'query_str', width: 400, ellipsis: true },
|
||||
{ title: '查询时间(ms)', dataIndex: 'query_time', width: 120 },
|
||||
{ title: '锁等待(ms)', dataIndex: 'lock_time', width: 120 },
|
||||
{ title: '返回行数', dataIndex: 'rows_sent', width: 120 },
|
||||
{ title: '扫描行数', dataIndex: 'rows_examined', width: 160 },
|
||||
];
|
||||
|
||||
return (
|
||||
<PageContainer header={{ title: '慢查询日志' }}>
|
||||
<SearchBarPlus
|
||||
defaultCollapsed
|
||||
split
|
||||
span={8}
|
||||
onTenantChanged={() => actionRef.current?.reload?.()}
|
||||
onFinish={async (values) => {
|
||||
const { searchKey, searchValue } = values as any;
|
||||
let queryStr = '';
|
||||
if (searchKey && searchValue) queryStr = searchKey === 'none' ? searchValue : `${searchKey}:${searchValue}`;
|
||||
setParams({ ...params, queryStr });
|
||||
}}
|
||||
>
|
||||
<ProFormSelect name="searchKey" label="检索" valueEnum={{ none: '全文检索', query_str: '查询语句' }} />
|
||||
<ProFormText name="searchValue" placeholder="请输入关键字" />
|
||||
</SearchBarPlus>
|
||||
|
||||
<GlassCard>
|
||||
<ProTable<any>
|
||||
actionRef={actionRef}
|
||||
rowKey="id"
|
||||
headerTitle="慢查询日志"
|
||||
request={(p) => searchApi.slowQueryLog({ ...p, ...params })}
|
||||
columns={columns}
|
||||
search={false}
|
||||
size="small"
|
||||
pagination={{ showSizeChanger: true, showQuickJumper: true }}
|
||||
/>
|
||||
</GlassCard>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
export default SlowSqlLogPage;
|
||||
|
||||
Reference in New Issue
Block a user