1. 合并拆分的API类型定义到统一的api/interface.ts文件 2. 删除旧的api/client.ts与api/types.ts文件 3. 重构所有页面与组件的API调用方式,统一使用api/index.ts导出的接口 4. 调整组件文件结构,将分散的组件按模块整理 5. 统一类型导入路径,移除冗余的类型重复定义
22 lines
982 B
TypeScript
22 lines
982 B
TypeScript
import { Table, Tag } from "@arco-design/web-react";
|
|
import type { RequestLogTableProps } from "./interface";
|
|
|
|
export function RequestLogTable({ data, loading }: RequestLogTableProps) {
|
|
return (
|
|
<Table
|
|
rowKey="requestId"
|
|
loading={loading}
|
|
data={data}
|
|
pagination={false}
|
|
columns={[
|
|
{ title: "请求 ID", dataIndex: "requestId", ellipsis: true },
|
|
{ title: "方法", dataIndex: "method", width: 100, render: (value) => <Tag>{value}</Tag> },
|
|
{ title: "路径", dataIndex: "path", ellipsis: true },
|
|
{ title: "状态", dataIndex: "statusCode", width: 100, render: (value) => <Tag color={value < 400 ? "green" : "red"}>{value}</Tag> },
|
|
{ title: "耗时", dataIndex: "costMs", width: 100, render: (value) => String(value) + "ms" },
|
|
{ title: "消息", dataIndex: "message", width: 180 },
|
|
]}
|
|
/>
|
|
);
|
|
}
|