Skip to content

Commit a1405a0

Browse files
sunnylqmclaude
andcommitted
feat: show fingerprint-keyed packages in the native-package panel
packageVersion_bundleHash entries (new clients reporting their content fingerprint) render in the same panel as the buildTime composites, with the 64-hex tail truncated for the legend. Drops the short-lived standalone content-verdict attribute. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 66f5d03 commit a1405a0

3 files changed

Lines changed: 13 additions & 25 deletions

File tree

src/i18n/locales/en.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,7 @@
383383
"no_data": "No data available",
384384
"tooltip_count": "{{count}} checks",
385385
"tooltip_count_percent": "{{count}} checks ({{percent}}%)",
386-
"current_dimension_label": "Current dimension: {{dimension}}",
387-
"bundle_status": "Content verdict",
388-
"bundle_status_matched": "Matched",
389-
"bundle_status_rebuiltSameJs": "Rebuilt, same JS",
390-
"bundle_status_unknownBundle": "Unknown bundle"
386+
"current_dimension_label": "Current dimension: {{dimension}}"
391387
},
392388
"admin_metrics": {
393389
"mode_requests": "Requests",

src/i18n/locales/zh-CN.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,7 @@
383383
"no_data": "暂无数据",
384384
"tooltip_count": "{{count}} 次",
385385
"tooltip_count_percent": "{{count}} 次({{percent}}%)",
386-
"current_dimension_label": "当前维度:{{dimension}}",
387-
"bundle_status": "内容判定",
388-
"bundle_status_matched": "内容一致 (matched)",
389-
"bundle_status_rebuiltSameJs": "重打包但 JS 未变 (rebuiltSameJs)",
390-
"bundle_status_unknownBundle": "未注册二进制 (unknownBundle)"
386+
"current_dimension_label": "当前维度:{{dimension}}"
391387
},
392388
"admin_metrics": {
393389
"mode_requests": "请求数",

src/pages/realtime-metrics.tsx

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface ChartDataPoint {
2626
sharePercent?: number;
2727
}
2828

29-
type MetricAttribute = 'hash' | 'packageVersion_buildTime' | 'bundleStatus';
29+
type MetricAttribute = 'hash' | 'packageVersion_buildTime';
3030

3131
interface FormattedCategory {
3232
label: string;
@@ -73,13 +73,15 @@ const formatCategory = (
7373
isTotal: false,
7474
};
7575
}
76-
if (key === 'bundleStatus') {
77-
// 内容判定结论(bundleHashJudge 开启后才有数据),三个取值直接翻译
76+
if (key === 'packageVersion_bundleHash') {
77+
// 内容指纹复合键与 buildTime 复合键同属"原生包"面板(新客户端上报
78+
// 指纹后取代 buildTime);截断 64 位 hex 便于图例阅读
7879
return {
79-
label: t(`realtime_metrics.bundle_status_${value}`, {
80-
defaultValue: value,
81-
}),
82-
attribute: 'bundleStatus',
80+
label: `${t('realtime_metrics.package_prefix')} ${value.replace(
81+
/([0-9a-f]{64})$/,
82+
(h) => `${h.slice(0, 8)}…`,
83+
)}`,
84+
attribute: 'packageVersion_buildTime',
8385
isTotal: false,
8486
};
8587
}
@@ -108,10 +110,6 @@ const getAttributeOptions = (t: (key: string) => string) => [
108110
label: t('realtime_metrics.package'),
109111
value: 'packageVersion_buildTime' as const,
110112
},
111-
{
112-
label: t('realtime_metrics.bundle_status'),
113-
value: 'bundleStatus' as const,
114-
},
115113
];
116114

117115
const formatTooltipItem = (
@@ -157,11 +155,9 @@ export const Component = () => {
157155
isLoading: isLoadingApps,
158156
} = useAppWorkspaceList();
159157
const urlAppKey = searchParams.get('appKey') || undefined;
160-
const attributeParam = searchParams.get('attribute');
161158
const selectedAttribute: MetricAttribute =
162-
attributeParam === 'packageVersion_buildTime' ||
163-
attributeParam === 'bundleStatus'
164-
? attributeParam
159+
searchParams.get('attribute') === 'packageVersion_buildTime'
160+
? 'packageVersion_buildTime'
165161
: 'hash';
166162

167163
const attributeOptions = getAttributeOptions(t);

0 commit comments

Comments
 (0)