fix: filter pricing variables based on cache token availability in tiered model price rendering
Some checks failed
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (amd64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (arm64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Create multi-arch manifests (Docker Hub) (push) Has been cancelled
Some checks failed
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (amd64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Build & push (arm64) [native] (push) Has been cancelled
Publish Docker image (Multi Registries, native amd64+arm64) / Create multi-arch manifests (Docker Hub) (push) Has been cancelled
This commit is contained in:
parent
bee339d279
commit
9f8a4ec050
13
web/src/helpers/render.jsx
vendored
13
web/src/helpers/render.jsx
vendored
@ -2293,7 +2293,12 @@ export function renderTieredModelPrice(opts) {
|
|||||||
const { symbol, rate } = getCurrencyConfig();
|
const { symbol, rate } = getCurrencyConfig();
|
||||||
const gr = groupRatio || 1;
|
const gr = groupRatio || 1;
|
||||||
|
|
||||||
const priceLines = BILLING_PRICING_VARS.map((v) => [v.field, v.label]);
|
const hasAnyCacheTokens = cacheTokens > 0 || cacheCreationTokens > 0
|
||||||
|
|| cacheCreationTokens5m > 0 || cacheCreationTokens1h > 0;
|
||||||
|
|
||||||
|
const priceLines = BILLING_PRICING_VARS
|
||||||
|
.filter((v) => v.group !== 'cache' || hasAnyCacheTokens)
|
||||||
|
.map((v) => [v.field, v.label]);
|
||||||
|
|
||||||
const lines = [
|
const lines = [
|
||||||
buildBillingText('命中档位:{{tier}}', { tier: matchedTier || tier.label }),
|
buildBillingText('命中档位:{{tier}}', { tier: matchedTier || tier.label }),
|
||||||
@ -2334,7 +2339,11 @@ export function renderTieredModelPriceSimple(opts) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
if (tier && isPriceDisplayMode(displayMode)) {
|
if (tier && isPriceDisplayMode(displayMode)) {
|
||||||
const priceSegments = BILLING_PRICING_VARS.map((v) => [v.field, v.shortLabel]);
|
const hasAnyCacheTokens = cacheTokens > 0 || cacheCreationTokens > 0
|
||||||
|
|| cacheCreationTokens5m > 0 || cacheCreationTokens1h > 0;
|
||||||
|
const priceSegments = BILLING_PRICING_VARS
|
||||||
|
.filter((v) => v.group !== 'cache' || hasAnyCacheTokens)
|
||||||
|
.map((v) => [v.field, v.shortLabel]);
|
||||||
for (const [field, label] of priceSegments) {
|
for (const [field, label] of priceSegments) {
|
||||||
if (tier[field] > 0) {
|
if (tier[field] > 0) {
|
||||||
segments.push({
|
segments.push({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user