Skip to content

Commit 2227969

Browse files
committed
Enhance audit logs and version management with new actions and improved terminology
- Added a new action for file uploads in the audit logs. - Updated action descriptions for modifying native and hot update package settings for clarity. - Adjusted rendering logic in the audit logs to differentiate between upload types. - Standardized terminology by changing '热更新包' to '热更包' across relevant components for consistency.
1 parent 9945ec9 commit 2227969

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

src/pages/audit-logs.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const actionMap: Record<string, string> = {
5050
'POST /app/create': '创建应用',
5151
// 订单相关
5252
'POST /orders': '创建订单',
53+
'POST /upload': '上传文件',
5354
};
5455

5556
// 路径模式匹配(用于动态路径,只包含写操作)
@@ -68,16 +69,17 @@ const pathPatterns: Array<{
6869
{
6970
pattern: /^\/app\/\d+\/package\/\d+$/,
7071
getAction: (method) => {
71-
if (method === 'PUT') return '更新原生包';
72+
if (method === 'PUT') return '修改原生包设置';
7273
if (method === 'DELETE') return '删除原生包';
7374
return '';
7475
},
7576
},
7677
{
7778
pattern: /^\/app\/\d+\/version\/\d+$/,
7879
getAction: (method) => {
79-
if (method === 'PUT') return '更新热更新包';
80-
if (method === 'DELETE') return '删除热更新包';
80+
if (method === 'PUT') return '修改热更包设置';
81+
if (method === 'DELETE') return '删除热更包';
82+
if (method === 'POST') return '创建热更包';
8183
return '';
8284
},
8385
},
@@ -165,19 +167,27 @@ const columns: ColumnType<AuditLog>[] = [
165167
},
166168
{
167169
title: '提交数据',
168-
dataIndex: 'data',
169170
width: 300,
170171
ellipsis: {
171172
showTitle: false,
172173
},
173-
render: (data?: Record<string, any>) =>
174-
data ? (
174+
render: (_, { path, data }: AuditLog) => {
175+
const isUpload = path.startsWith('/upload');
176+
if (isUpload) {
177+
if (data?.ext === '.ppk') {
178+
return <Text>热更包</Text>;
179+
} else {
180+
return <Text>原生包</Text>;
181+
}
182+
}
183+
return data ? (
175184
<Text ellipsis={{ tooltip: JSON.stringify(data, null, 2) }}>
176185
{JSON.stringify(data)}
177186
</Text>
178187
) : (
179188
<Text type="secondary">-</Text>
180-
),
189+
);
190+
},
181191
},
182192
{
183193
title: '设备信息',

src/pages/manage/components/version-table.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function removeSelectedVersions({
113113
}
114114
}
115115
Modal.confirm({
116-
title: '删除所选热更新包:',
116+
title: '删除所选热更包:',
117117
content: versionNames.join(','),
118118
maskClosable: true,
119119
okButtonProps: { danger: true },
@@ -275,7 +275,7 @@ export default function VersionTable() {
275275
<Table
276276
className="versions"
277277
rowKey="id"
278-
title={() => '热更新包'}
278+
title={() => '热更包'}
279279
columns={columns}
280280
dataSource={versions}
281281
pagination={{

src/utils/notice.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const notices = {
99
<>
1010
<p>
1111
<span style={{ color: '#f50' }}>2025年8月10日</span>起低于 v8
12-
版本的基准包和热更包将无法上传,请尽快升级到 v8
12+
版本的原生包和热更包将无法上传,请尽快升级到 v8
1313
及以上版本。已上传的版本不受影响。
1414
</p>
1515
<p>跨大版本更新时需要重新打原生包,并请充分测试。</p>

0 commit comments

Comments
 (0)