Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 92cdc64654 | |||
| 4cd9c19e4d |
@@ -46,6 +46,41 @@ const fmtTok = (inTok: number | null, outTok: number | null) =>
|
|||||||
inTok == null && outTok == null ? '-' : `${inTok ?? 0}/${outTok ?? 0}`;
|
inTok == null && outTok == null ? '-' : `${inTok ?? 0}/${outTok ?? 0}`;
|
||||||
const fmtRate = (value: number | null) => (value == null ? '-' : `${(value * 100).toFixed(1)}%`);
|
const fmtRate = (value: number | null) => (value == null ? '-' : `${(value * 100).toFixed(1)}%`);
|
||||||
|
|
||||||
|
function deviceName(record: ComparisonRecordListItem): string {
|
||||||
|
return record.device_model_name || record.device_model || '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
function romName(record: ComparisonRecordListItem): string {
|
||||||
|
return [
|
||||||
|
record.rom_vendor,
|
||||||
|
record.rom_name,
|
||||||
|
record.rom_version != null ? String(record.rom_version) : null,
|
||||||
|
]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(' ') || '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderDevice(record: ComparisonRecordListItem): ReactNode {
|
||||||
|
const readableName = deviceName(record);
|
||||||
|
const showRawModel =
|
||||||
|
record.device_model_name
|
||||||
|
&& record.device_model
|
||||||
|
&& record.device_model_name !== record.device_model;
|
||||||
|
return (
|
||||||
|
<Space direction="vertical" size={0}>
|
||||||
|
<span>{readableName}</span>
|
||||||
|
{showRawModel ? (
|
||||||
|
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||||
|
{record.device_model}
|
||||||
|
</Typography.Text>
|
||||||
|
) : null}
|
||||||
|
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||||
|
{romName(record)}
|
||||||
|
</Typography.Text>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// LLM 价格快照只展示 prices 里各模型的单价(元/每百万 token),忽略 mode/_source 等元字段。
|
// LLM 价格快照只展示 prices 里各模型的单价(元/每百万 token),忽略 mode/_source 等元字段。
|
||||||
function llmPriceRows(snapshot: Record<string, unknown> | null): string[] {
|
function llmPriceRows(snapshot: Record<string, unknown> | null): string[] {
|
||||||
const prices = snapshot?.prices;
|
const prices = snapshot?.prices;
|
||||||
@@ -308,9 +343,9 @@ export default function ComparisonRecordsPage() {
|
|||||||
{
|
{
|
||||||
title: '机型/ROM',
|
title: '机型/ROM',
|
||||||
key: 'device',
|
key: 'device',
|
||||||
width: 150,
|
width: 180,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (_, r) => [r.device_model, r.rom_name].filter(Boolean).join(' / ') || '-',
|
render: (_, r) => renderDevice(r),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'traceid',
|
title: 'traceid',
|
||||||
@@ -499,8 +534,15 @@ export default function ComparisonRecordsPage() {
|
|||||||
|
|
||||||
<Card size="small" title="设备环境">
|
<Card size="small" title="设备环境">
|
||||||
<Descriptions size="small" column={2}>
|
<Descriptions size="small" column={2}>
|
||||||
<Descriptions.Item label="机型">{detail.device_model || '-'}({detail.device_manufacturer || '-'})</Descriptions.Item>
|
<Descriptions.Item label="机型">
|
||||||
<Descriptions.Item label="ROM">{[detail.rom_vendor, detail.rom_name, detail.rom_version].filter(Boolean).join(' ') || '-'}</Descriptions.Item>
|
{deviceName(detail)}
|
||||||
|
{detail.device_model_name && detail.device_model_name !== detail.device_model
|
||||||
|
? `(${[detail.device_manufacturer, detail.device_model].filter(Boolean).join(' · ')})`
|
||||||
|
: detail.device_manufacturer
|
||||||
|
? `(${detail.device_manufacturer})`
|
||||||
|
: ''}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="ROM">{romName(detail)}</Descriptions.Item>
|
||||||
<Descriptions.Item label="Android">{detail.android_version || '-'}(SDK {detail.android_sdk ?? '-'})</Descriptions.Item>
|
<Descriptions.Item label="Android">{detail.android_version || '-'}(SDK {detail.android_sdk ?? '-'})</Descriptions.Item>
|
||||||
<Descriptions.Item label="App 版本">{detail.app_version || '-'}({detail.app_version_code ?? '-'})</Descriptions.Item>
|
<Descriptions.Item label="App 版本">{detail.app_version || '-'}({detail.app_version_code ?? '-'})</Descriptions.Item>
|
||||||
<Descriptions.Item label="源 App 版本" span={2}>{detail.source_app_version || '-'}</Descriptions.Item>
|
<Descriptions.Item label="源 App 版本" span={2}>{detail.source_app_version || '-'}</Descriptions.Item>
|
||||||
|
|||||||
+2
-1
@@ -465,8 +465,10 @@ export interface ComparisonRecordListItem {
|
|||||||
output_tokens: number | null;
|
output_tokens: number | null;
|
||||||
llm_cost_yuan: number | null; // 后端按「当时价」冻结的实际成本(元);旧记录 null → 「成本」列回退估算
|
llm_cost_yuan: number | null; // 后端按「当时价」冻结的实际成本(元);旧记录 null → 「成本」列回退估算
|
||||||
device_model: string | null;
|
device_model: string | null;
|
||||||
|
device_model_name: string | null;
|
||||||
rom_vendor: string | null;
|
rom_vendor: string | null;
|
||||||
rom_name: string | null;
|
rom_name: string | null;
|
||||||
|
rom_version: number | null;
|
||||||
android_version: string | null;
|
android_version: string | null;
|
||||||
app_version: string | null;
|
app_version: string | null;
|
||||||
ad_revenue_yuan: number; // 本次比价看的信息流广告预估收益(元)
|
ad_revenue_yuan: number; // 本次比价看的信息流广告预估收益(元)
|
||||||
@@ -517,7 +519,6 @@ export interface ComparisonRecordDetail extends ComparisonRecordListItem {
|
|||||||
comparison_results: Record<string, unknown>[];
|
comparison_results: Record<string, unknown>[];
|
||||||
skipped_dish_names: string[];
|
skipped_dish_names: string[];
|
||||||
device_manufacturer: string | null;
|
device_manufacturer: string | null;
|
||||||
rom_version: number | null;
|
|
||||||
android_sdk: number | null;
|
android_sdk: number | null;
|
||||||
app_version_code: number | null;
|
app_version_code: number | null;
|
||||||
source_app_version: string | null;
|
source_app_version: string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user