fix: 将模板失败概览操作类别改为中文
This commit is contained in:
1 parent
5a93d38437
commit
e6d843b4a7
1 file changed
+14
-5
@@ -12,6 +12,17 @@ import { TemplatePackagePreviewModal } from "./TemplatePackagePreviewModal.js";
|
||||
|
||||
const client = createApiClient();
|
||||
|
||||
const failureActionLabels: Record<string, string> = {
|
||||
import: "模板导入失败",
|
||||
preview: "模板预览失败",
|
||||
install: "模板安装失败",
|
||||
upgrade: "模板升级失败",
|
||||
rollback: "模板回滚失败",
|
||||
install_conflict: "模板操作冲突",
|
||||
build: "小程序构建失败",
|
||||
upload: "小程序上传失败",
|
||||
};
|
||||
|
||||
function formatBytes(value: unknown): string {
|
||||
const bytes = typeof value === "number" ? value : 0;
|
||||
if (bytes < 1024) return `${bytes} B`;
|
||||
@@ -112,10 +123,7 @@ export function TemplateManagementPage() {
|
||||
/>
|
||||
) : null}
|
||||
{lifecycle.isError ? <ErrorNote error={lifecycle.error} /> : null}
|
||||
<AdminSection
|
||||
title="近 30 天失败概览"
|
||||
description="只显示按操作类别聚合的数量,不包含 requestId、错误正文或品牌内容。"
|
||||
>
|
||||
<AdminSection title="近 30 天失败概览" description="按操作类别统计失败次数。">
|
||||
<QueryState
|
||||
loading={metrics.isLoading}
|
||||
error={metrics.error}
|
||||
@@ -128,7 +136,8 @@ export function TemplateManagementPage() {
|
||||
renderItem={(item) => (
|
||||
<List.Item>
|
||||
<Typography.Text>
|
||||
{item.action}:<Typography.Text strong>{item.count}</Typography.Text>
|
||||
{failureActionLabels[item.action] ?? "其他操作失败"}:
|
||||
<Typography.Text strong>{item.count}</Typography.Text>
|
||||
</Typography.Text>
|
||||
</List.Item>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user