Skip to content

Commit 948a284

Browse files
committed
Refactor API tokens page for improved readability and functionality
- Rearranged import statements for better organization. - Enhanced API token description with a link to the Pushy API documentation. - Improved formatting of the createdAt date rendering for consistency.
1 parent f3b99ff commit 948a284

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/pages/api-tokens.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { KeyOutlined, CopyOutlined, DeleteOutlined } from '@ant-design/icons';
1+
import { CopyOutlined, DeleteOutlined, KeyOutlined } from '@ant-design/icons';
2+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
23
import {
34
Button,
45
Card,
56
Checkbox,
67
Form,
78
Input,
8-
message,
99
Modal,
10+
message,
1011
Popconfirm,
1112
Select,
1213
Space,
@@ -17,8 +18,8 @@ import {
1718
import type { ColumnsType } from 'antd/es/table';
1819
import dayjs from 'dayjs';
1920
import { useState } from 'react';
20-
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
2121
import { api } from '@/services/api';
22+
import type { ApiToken } from '@/types';
2223

2324
const { Paragraph } = Typography;
2425

@@ -140,7 +141,8 @@ function ApiTokensPage() {
140141
title: '创建时间',
141142
dataIndex: 'createdAt',
142143
key: 'createdAt',
143-
render: (createdAt: string) => dayjs(createdAt).format('YYYY-MM-DD HH:mm'),
144+
render: (createdAt: string) =>
145+
dayjs(createdAt).format('YYYY-MM-DD HH:mm'),
144146
},
145147
{
146148
title: '操作',
@@ -182,8 +184,15 @@ function ApiTokensPage() {
182184
}
183185
>
184186
<Paragraph type="secondary" className="mb-4">
185-
API Token 可用于 CI/CD 流程或自动化脚本中调用 Pushy API。每个用户最多可创建
186-
10 个 Token。
187+
API Token 可用于 CI/CD 流程或自动化脚本中调用{' '}
188+
<a
189+
target="_blank"
190+
href="https://update.reactnative.cn/api/openapi"
191+
rel="noopener"
192+
>
193+
Pushy API
194+
</a>
195+
。每个用户最多可创建 10 个 Token。
187196
</Paragraph>
188197
<Table
189198
columns={columns}

0 commit comments

Comments
 (0)