feat: add billing display mode selection and update pricing rendering

Introduce a billing display mode feature allowing users to toggle between price and ratio views. Update relevant components and hooks to support this new functionality, ensuring consistent pricing information is displayed across the application.
This commit is contained in:
CaIon
2026-03-06 23:35:17 +08:00
parent 8d7d880db5
commit aa89ea2db5
12 changed files with 1014 additions and 47 deletions

View File

@@ -337,6 +337,7 @@ export const getLogsColumns = ({
showUserInfoFunc,
openChannelAffinityUsageCacheModal,
isAdminUser,
billingDisplayMode = 'price',
}) => {
return [
{
@@ -761,11 +762,10 @@ export const getLogsColumns = ({
Boolean(other?.violation_fee_marker)
) {
const feeQuota = other?.fee_quota ?? record?.quota;
const ratioText = formatRatio(other?.group_ratio);
const summary = [
t('违规扣费'),
`${t('分组倍率')}${ratioText}`,
`${t('扣费')}${renderQuota(feeQuota, 6)}`,
`${t('分组倍率')}${formatRatio(other?.group_ratio)}`,
text ? `${t('详情')}${text}` : null,
]
.filter(Boolean)
@@ -808,6 +808,7 @@ export const getLogsColumns = ({
1.0,
other?.is_system_prompt_overwritten,
'claude',
billingDisplayMode,
)
: renderModelPriceSimple(
other.model_ratio,
@@ -826,6 +827,7 @@ export const getLogsColumns = ({
1.0,
other?.is_system_prompt_overwritten,
'openai',
billingDisplayMode,
);
return (
<Typography.Paragraph