Skip to content

Commit efab87f

Browse files
committed
feat(fe): remove RMB symbols from cost displays and simplify price formatting
Remove ¥ prefix from pricing displays across admin/model, chat info, and settings views Keep numeric formatting unchanged (e.g. 0.00/0.02) Simplify ChatModelInfo price string construction by removing unnecessary template literal
1 parent 0cc47f1 commit efab87f

8 files changed

Lines changed: 29 additions & 30 deletions

File tree

src/FE/components/Chat/ChatModelInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const ChatModelInfo = (props: { modelId: number }) => {
3939
toFixed(modelUsage.inputFreshTokenPrice1M),
4040
toFixed(modelUsage.outputTokenPrice1M),
4141
];
42-
const priceDisplay = `¥${priceParts.join('/')}`;
42+
const priceDisplay = priceParts.join('/');
4343

4444
return (
4545
<div className="flex flex-col text-gray-600 text-sm h-5">

src/FE/components/ChatMessage/GenerateInfoPopoverContent.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,30 +137,30 @@ export const GenerateInfoPopoverContent = ({
137137
{showInputTotalCost && (
138138
<GenerateInfoItem
139139
name={'Input cost'}
140-
value={info ? '¥' + formatNumberAsMoney(+totalInputPrice, 6) : '-'}
140+
value={info ? formatNumberAsMoney(+totalInputPrice, 6) : '-'}
141141
icon="💰"
142142
loading={loading}
143143
/>
144144
)}
145145
{showInputCachedCost && (
146146
<GenerateInfoItem
147147
name={'Input cost (cached)'}
148-
value={info ? '¥' + formatNumberAsMoney(+inputCachedPrice, 6) : '-'}
148+
value={info ? formatNumberAsMoney(+inputCachedPrice, 6) : '-'}
149149
icon="♻️"
150150
loading={loading}
151151
/>
152152
)}
153153
{showOutputCost && (
154154
<GenerateInfoItem
155155
name={'Response cost'}
156-
value={info ? '¥' + formatNumberAsMoney(+outputPrice, 6) : '-'}
156+
value={info ? formatNumberAsMoney(+outputPrice, 6) : '-'}
157157
icon="💵"
158158
loading={loading}
159159
/>
160160
)}
161161
<GenerateInfoItem
162162
name={'total cost'}
163-
value={info ? '¥' + formatNumberAsMoney(totalCost, 6) : '-'}
163+
value={info ? formatNumberAsMoney(totalCost, 6) : '-'}
164164
icon="💳"
165165
loading={loading}
166166
/>

src/FE/components/admin/model/ModelItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export default function ModelItem({ model, onEditClick, onDeleteClick, onGoToUsa
118118
const priceBreakdown = cachedPrice > 0
119119
? [freshPrice, cachedPrice, model.outputTokenPrice1M]
120120
: [freshPrice, model.outputTokenPrice1M];
121-
const formattedPrice = '¥' + priceBreakdown.map((value) => formatNumberAsMoney(value)).join('/');
121+
const formattedPrice = priceBreakdown.map((value) => formatNumberAsMoney(value)).join('/');
122122

123123
return (
124124
<div>

src/FE/components/settings/tabs/GeneralTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const GeneralTab = () => {
146146
{t('Account balance')}
147147
</span>
148148
<span className="text-base font-semibold tabular-nums">
149-
{toFixed(+(userBalance || 0))}
149+
{toFixed(+(userBalance || 0))}
150150
</span>
151151
</div>
152152

src/FE/components/settings/tabs/UsageRecordsTab.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -556,15 +556,15 @@ const UsageRecordsTab = ({ fixedSource, basePath }: UsageRecordsTabProps = {}) =
556556
</div>
557557
</div>
558558
<div className="flex items-center justify-between text-xs">
559-
<div className="font-medium">{t('Input/Output Cost(¥)')}</div>
559+
<div className="font-medium">{t('Input/Output Cost')}</div>
560560
<div>
561-
{toFixed(usageStat?.sumInputCost)}/
561+
{toFixed(usageStat?.sumInputCost)}/
562562
{toFixed(usageStat?.sumOutputCost)}
563563
</div>
564564
</div>
565565
<div className="flex items-center justify-between text-xs">
566566
<div className="font-medium">{t('Total Cost')}</div>
567-
<div>{toFixed(usageStat?.sumTotalCost)}</div>
567+
<div>{toFixed(usageStat?.sumTotalCost)}</div>
568568
</div>
569569
</Card>
570570
{usageLogs.map((log, index) => (
@@ -588,15 +588,15 @@ const UsageRecordsTab = ({ fixedSource, basePath }: UsageRecordsTabProps = {}) =
588588
</div>
589589
<div className="flex items-center justify-between text-xs mt-1">
590590
<div className="font-medium">
591-
{t('Input/Output Cost(¥)')}
591+
{t('Input/Output Cost')}
592592
</div>
593593
<div>
594-
{toFixed(log.inputCost)}/{toFixed(log.outputCost)}
594+
{toFixed(log.inputCost)}/{toFixed(log.outputCost)}
595595
</div>
596596
</div>
597597
<div className="flex items-center justify-between text-xs mt-1">
598598
<div className="font-medium">{t('Total Cost')}</div>
599-
<div>{toFixed(log.inputCost + log.outputCost)}</div>
599+
<div>{toFixed(log.inputCost + log.outputCost)}</div>
600600
</div>
601601
<div className="flex items-center justify-between text-xs mt-1">
602602
<div className="font-medium">{t('IP')}</div>
@@ -624,8 +624,8 @@ const UsageRecordsTab = ({ fixedSource, basePath }: UsageRecordsTabProps = {}) =
624624
<TableHead>{t('Date')}</TableHead>
625625
<TableHead>{t('Model')}</TableHead>
626626
<TableHead>{t('Input/Output Tokens')}</TableHead>
627-
<TableHead>{t('Input/Output Cost(¥)')}</TableHead>
628-
<TableHead>{t('Total Cost(¥)')}</TableHead>
627+
<TableHead>{t('Input/Output Cost')}</TableHead>
628+
<TableHead>{t('Total Cost')}</TableHead>
629629
<TableHead>{t('IP')}</TableHead>
630630
<TableHead>{t('Finish Reason')}</TableHead>
631631
<TableHead>{t('Total Duration(ms)')}</TableHead>
@@ -645,10 +645,10 @@ const UsageRecordsTab = ({ fixedSource, basePath }: UsageRecordsTabProps = {}) =
645645
{log.inputTokens}/{log.outputTokens}
646646
</TableCell>
647647
<TableCell>
648-
{toFixed(log.inputCost)}/{toFixed(log.outputCost)}
648+
{toFixed(log.inputCost)}/{toFixed(log.outputCost)}
649649
</TableCell>
650650
<TableCell>
651-
{toFixed(log.inputCost + log.outputCost)}
651+
{toFixed(log.inputCost + log.outputCost)}
652652
</TableCell>
653653
<TableCell>{log.ip}</TableCell>
654654
<TableCell>{log.finishReason}</TableCell>
@@ -667,10 +667,10 @@ const UsageRecordsTab = ({ fixedSource, basePath }: UsageRecordsTabProps = {}) =
667667
{formatNumberAsMoney(usageStat?.sumOutputTokens)}
668668
</TableCell>
669669
<TableCell>
670-
{toFixed(usageStat?.sumInputCost)}/
670+
{toFixed(usageStat?.sumInputCost)}/
671671
{toFixed(usageStat?.sumOutputCost)}
672672
</TableCell>
673-
<TableCell>{toFixed(usageStat?.sumTotalCost)}</TableCell>
673+
<TableCell>{toFixed(usageStat?.sumTotalCost)}</TableCell>
674674
<TableCell colSpan={3}></TableCell>
675675
</TableRow>
676676
</TableFooter>

src/FE/locales/zh-CN.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@
121121
"prompt cost": "请求消费",
122122
"Input cost": "输入费用",
123123
"Input cost (cached)": "输入费用(缓存)",
124+
"Input/Output Cost": "输入/输出费用",
125+
"Total Cost": "总费用",
124126
"Response cost": "响应费用",
125127
"Dark": "深色模式",
126128
"Light": "浅色模式",
@@ -525,15 +527,12 @@
525527
"Failure Reason": "失败原因",
526528
"Total Duration(ms)": "总时长(ms)",
527529
"Input/Output Tokens": "输入/输出Tokens",
528-
"Input/Output Cost(¥)": "输入/输出费用(¥)",
529-
"Total Cost(¥)": "总费用(¥)",
530530
"Input Tokens": "输入Tokens",
531531
"Output Tokens": "输出Tokens",
532532
"Reasoning Tokens": "推理Tokens",
533533
"Total Tokens": "总Tokens",
534534
"Input Cost": "输入费用",
535535
"Output Cost": "输出费用",
536-
"Total Cost": "总费用",
537536
"Total Usage": "总消费",
538537
"Search": "搜索",
539538
"Search by username": "按用户名搜索",

src/FE/pages/admin/model/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ export default function ModelManager() {
688688
const overlayPriceParts = (m.inputCachedTokenPrice1M > 0
689689
? [m.inputFreshTokenPrice1M, m.inputCachedTokenPrice1M, m.outputTokenPrice1M]
690690
: [m.inputFreshTokenPrice1M, m.outputTokenPrice1M]);
691-
const overlayPrice = '¥' + overlayPriceParts.map(value => formatNumberAsMoney(value)).join('/');
691+
const overlayPrice = overlayPriceParts.map(value => formatNumberAsMoney(value)).join('/');
692692
return (
693693
<div className="rounded border bg-background/90 shadow-md px-2 py-1">
694694
<div className="flex items-center gap-2">

src/FE/pages/admin/usage/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -552,15 +552,15 @@ const UsageRecords = () => {
552552
</div>
553553
<div className="flex items-center justify-between text-xs mt-1">
554554
<div className="font-medium">
555-
{t('Input/Output Cost(¥)')}
555+
{t('Input/Output Cost')}
556556
</div>
557557
<div>
558-
{toFixed(log.inputCost)}/{toFixed(log.outputCost)}
558+
{toFixed(log.inputCost)}/{toFixed(log.outputCost)}
559559
</div>
560560
</div>
561561
<div className="flex items-center justify-between text-xs mt-1">
562562
<div className="font-medium">{t('Total Cost')}</div>
563-
<div>{toFixed(log.inputCost + log.outputCost)}</div>
563+
<div>{toFixed(log.inputCost + log.outputCost)}</div>
564564
</div>
565565
<div className="flex items-center justify-between text-xs mt-1">
566566
<div className="font-medium">{t('IP')}</div>
@@ -589,8 +589,8 @@ const UsageRecords = () => {
589589
<TableHead>{t('Account')}</TableHead>
590590
<TableHead>{t('Model')}</TableHead>
591591
<TableHead>{t('Input/Output Tokens')}</TableHead>
592-
<TableHead>{t('Input/Output Cost(¥)')}</TableHead>
593-
<TableHead>{t('Total Cost(¥)')}</TableHead>
592+
<TableHead>{t('Input/Output Cost')}</TableHead>
593+
<TableHead>{t('Total Cost')}</TableHead>
594594
<TableHead>{t('IP')}</TableHead>
595595
<TableHead>{t('Finish Reason')}</TableHead>
596596
<TableHead>{t('Total Duration(ms)')}</TableHead>
@@ -611,10 +611,10 @@ const UsageRecords = () => {
611611
{log.inputTokens}/{log.outputTokens}
612612
</TableCell>
613613
<TableCell>
614-
{toFixed(log.inputCost)}/{toFixed(log.outputCost)}
614+
{toFixed(log.inputCost)}/{toFixed(log.outputCost)}
615615
</TableCell>
616616
<TableCell>
617-
{toFixed(log.inputCost + log.outputCost)}
617+
{toFixed(log.inputCost + log.outputCost)}
618618
</TableCell>
619619
<TableCell>{log.ip}</TableCell>
620620
<TableCell>{log.finishReason}</TableCell>

0 commit comments

Comments
 (0)