@chenpu17/cc-gw 0.4.3 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/server/dist/index.js +140 -37
- package/src/web/dist/assets/{About-BWcLLdLY.js → About-R4GuiAOC.js} +2 -2
- package/src/web/dist/assets/{ApiKeys-DsYmx21U.js → ApiKeys-CNNwIRTy.js} +1 -1
- package/src/web/dist/assets/{Button-CZXniSHM.js → Button-CgdNhVeu.js} +1 -1
- package/src/web/dist/assets/{Dashboard-H7fcVgwO.js → Dashboard-U1EC6qmF.js} +2 -2
- package/src/web/dist/assets/{FormField-SZpxR702.js → FormField-DJjnoGU0.js} +1 -1
- package/src/web/dist/assets/{Help-CgWIUFIO.js → Help-COAfsR6K.js} +1 -1
- package/src/web/dist/assets/{Input-BdyQWPOU.js → Input-CkTJl-fF.js} +1 -1
- package/src/web/dist/assets/{Login-0_Y4Go8x.js → Login-BbRStE3M.js} +1 -1
- package/src/web/dist/assets/Logs-C-7diPqf.js +1 -0
- package/src/web/dist/assets/{ModelManagement-DBVBITho.js → ModelManagement-BWX0w6Wu.js} +1 -1
- package/src/web/dist/assets/{PageSection-B08EcVAN.js → PageSection-BT-depe5.js} +1 -1
- package/src/web/dist/assets/{Settings-DEloCGp7.js → Settings-CLM0Srx1.js} +1 -1
- package/src/web/dist/assets/{StatusBadge-8KAMZvYW.js → StatusBadge-CgBAXD_S.js} +1 -1
- package/src/web/dist/assets/{copy-BdNskWTP.js → copy-OD9YQ85H.js} +1 -1
- package/src/web/dist/assets/{index-BK1UNVMz.js → index-3UByifOG.js} +4 -4
- package/src/web/dist/assets/{index-CyrAg0Ev.js → index-DVBy-Kka.js} +1 -1
- package/src/web/dist/assets/{info-BTcWJb9B.js → info-DAG4KwRm.js} +1 -1
- package/src/web/dist/assets/{useApiQuery-BNTE55UK.js → useApiQuery-7KXAW9hB.js} +1 -1
- package/src/web/dist/index.html +1 -1
- package/src/web/dist/assets/Logs-MTopPD6L.js +0 -1
package/package.json
CHANGED
package/src/server/dist/index.js
CHANGED
|
@@ -11227,6 +11227,8 @@ async function ensureSchema(db) {
|
|
|
11227
11227
|
);
|
|
11228
11228
|
await maybeAddColumn(db, "request_logs", "client_model", "TEXT");
|
|
11229
11229
|
await maybeAddColumn(db, "request_logs", "cached_tokens", "INTEGER");
|
|
11230
|
+
await maybeAddColumn(db, "request_logs", "cache_read_tokens", "INTEGER DEFAULT 0");
|
|
11231
|
+
await maybeAddColumn(db, "request_logs", "cache_creation_tokens", "INTEGER DEFAULT 0");
|
|
11230
11232
|
await maybeAddColumn(db, "request_logs", "ttft_ms", "INTEGER");
|
|
11231
11233
|
await maybeAddColumn(db, "request_logs", "tpot_ms", "REAL");
|
|
11232
11234
|
await maybeAddColumn(db, "request_logs", "stream", "INTEGER");
|
|
@@ -11416,6 +11418,14 @@ async function updateLogTokens(requestId, values) {
|
|
|
11416
11418
|
values.outputTokens,
|
|
11417
11419
|
values.cachedTokens ?? null
|
|
11418
11420
|
];
|
|
11421
|
+
if (values.cacheReadTokens !== void 0) {
|
|
11422
|
+
setters.push("cache_read_tokens = ?");
|
|
11423
|
+
params.push(values.cacheReadTokens ?? null);
|
|
11424
|
+
}
|
|
11425
|
+
if (values.cacheCreationTokens !== void 0) {
|
|
11426
|
+
setters.push("cache_creation_tokens = ?");
|
|
11427
|
+
params.push(values.cacheCreationTokens ?? null);
|
|
11428
|
+
}
|
|
11419
11429
|
if (values.ttftMs !== void 0) {
|
|
11420
11430
|
setters.push("ttft_ms = ?");
|
|
11421
11431
|
params.push(values.ttftMs ?? null);
|
|
@@ -12262,6 +12272,8 @@ async function registerMessagesRoute(app) {
|
|
|
12262
12272
|
inputTokens: inputTokens2,
|
|
12263
12273
|
outputTokens: outputTokens2,
|
|
12264
12274
|
cachedTokens: cachedTokens3,
|
|
12275
|
+
cacheReadTokens: cached3.read,
|
|
12276
|
+
cacheCreationTokens: cached3.creation,
|
|
12265
12277
|
ttftMs: latencyMs2,
|
|
12266
12278
|
tpotMs: computeTpot(latencyMs2, outputTokens2, { streaming: false })
|
|
12267
12279
|
});
|
|
@@ -12312,6 +12324,8 @@ async function registerMessagesRoute(app) {
|
|
|
12312
12324
|
inputTokens,
|
|
12313
12325
|
outputTokens,
|
|
12314
12326
|
cachedTokens: cachedTokens2,
|
|
12327
|
+
cacheReadTokens: cached2.read,
|
|
12328
|
+
cacheCreationTokens: cached2.creation,
|
|
12315
12329
|
ttftMs: latencyMs,
|
|
12316
12330
|
tpotMs: computeTpot(latencyMs, outputTokens, { streaming: false })
|
|
12317
12331
|
});
|
|
@@ -12359,6 +12373,8 @@ async function registerMessagesRoute(app) {
|
|
|
12359
12373
|
let usagePrompt2 = 0;
|
|
12360
12374
|
let usageCompletion2 = 0;
|
|
12361
12375
|
let usageCached2 = null;
|
|
12376
|
+
let usageCacheRead2 = 0;
|
|
12377
|
+
let usageCacheCreation2 = 0;
|
|
12362
12378
|
let accumulatedContent2 = "";
|
|
12363
12379
|
let firstTokenAt2 = null;
|
|
12364
12380
|
let lastUsagePayload = null;
|
|
@@ -12494,6 +12510,8 @@ async function registerMessagesRoute(app) {
|
|
|
12494
12510
|
usagePrompt2 = payload2.usage.input_tokens ?? usagePrompt2;
|
|
12495
12511
|
usageCompletion2 = payload2.usage.output_tokens ?? usageCompletion2;
|
|
12496
12512
|
const maybeCached = resolveCachedTokens(payload2.usage);
|
|
12513
|
+
usageCacheRead2 = maybeCached.read;
|
|
12514
|
+
usageCacheCreation2 = maybeCached.creation;
|
|
12497
12515
|
usageCached2 = maybeCached.read + maybeCached.creation;
|
|
12498
12516
|
lastUsagePayload = payload2.usage;
|
|
12499
12517
|
}
|
|
@@ -12521,6 +12539,8 @@ async function registerMessagesRoute(app) {
|
|
|
12521
12539
|
usagePrompt2 = payload2.usage.input_tokens ?? usagePrompt2;
|
|
12522
12540
|
usageCompletion2 = payload2.usage.output_tokens ?? usageCompletion2;
|
|
12523
12541
|
const maybeCached = resolveCachedTokens(payload2.usage);
|
|
12542
|
+
usageCacheRead2 = maybeCached.read;
|
|
12543
|
+
usageCacheCreation2 = maybeCached.creation;
|
|
12524
12544
|
usageCached2 = maybeCached.read + maybeCached.creation;
|
|
12525
12545
|
lastUsagePayload = payload2.usage;
|
|
12526
12546
|
}
|
|
@@ -12573,8 +12593,10 @@ async function registerMessagesRoute(app) {
|
|
|
12573
12593
|
}
|
|
12574
12594
|
const totalLatencyMs = Date.now() - requestStart;
|
|
12575
12595
|
const ttftMs = firstTokenAt2 ? firstTokenAt2 - requestStart : null;
|
|
12576
|
-
const cached2 = resolveCachedTokens(lastUsagePayload);
|
|
12577
12596
|
if (usageCached2 === null) {
|
|
12597
|
+
const cached2 = resolveCachedTokens(lastUsagePayload);
|
|
12598
|
+
usageCacheRead2 = cached2.read;
|
|
12599
|
+
usageCacheCreation2 = cached2.creation;
|
|
12578
12600
|
usageCached2 = cached2.read + cached2.creation;
|
|
12579
12601
|
}
|
|
12580
12602
|
logUsage("stream.anthropic.final", {
|
|
@@ -12586,6 +12608,8 @@ async function registerMessagesRoute(app) {
|
|
|
12586
12608
|
inputTokens: usagePrompt2,
|
|
12587
12609
|
outputTokens: usageCompletion2,
|
|
12588
12610
|
cachedTokens: usageCached2,
|
|
12611
|
+
cacheReadTokens: usageCacheRead2,
|
|
12612
|
+
cacheCreationTokens: usageCacheCreation2,
|
|
12589
12613
|
ttftMs,
|
|
12590
12614
|
tpotMs: computeTpot(totalLatencyMs, usageCompletion2, {
|
|
12591
12615
|
streaming: true,
|
|
@@ -12598,8 +12622,8 @@ async function registerMessagesRoute(app) {
|
|
|
12598
12622
|
inputTokens: usagePrompt2,
|
|
12599
12623
|
outputTokens: usageCompletion2,
|
|
12600
12624
|
cachedTokens: usageCached2,
|
|
12601
|
-
cacheReadTokens:
|
|
12602
|
-
cacheCreationTokens:
|
|
12625
|
+
cacheReadTokens: usageCacheRead2,
|
|
12626
|
+
cacheCreationTokens: usageCacheCreation2,
|
|
12603
12627
|
latencyMs: totalLatencyMs
|
|
12604
12628
|
});
|
|
12605
12629
|
if (storeResponsePayloads) {
|
|
@@ -12676,6 +12700,8 @@ async function registerMessagesRoute(app) {
|
|
|
12676
12700
|
let usagePrompt = 0;
|
|
12677
12701
|
let usageCompletion = 0;
|
|
12678
12702
|
let usageCached = null;
|
|
12703
|
+
let usageCacheRead = 0;
|
|
12704
|
+
let usageCacheCreation = 0;
|
|
12679
12705
|
let accumulatedContent = "";
|
|
12680
12706
|
let completed = false;
|
|
12681
12707
|
let firstTokenAt = null;
|
|
@@ -12759,6 +12785,8 @@ data: ${JSON.stringify(data)}
|
|
|
12759
12785
|
inputTokens: finalPromptTokens,
|
|
12760
12786
|
outputTokens: finalCompletionTokens,
|
|
12761
12787
|
cachedTokens: usageCached,
|
|
12788
|
+
cacheReadTokens: 0,
|
|
12789
|
+
cacheCreationTokens: 0,
|
|
12762
12790
|
ttftMs,
|
|
12763
12791
|
tpotMs: computeTpot(totalLatencyMs, finalCompletionTokens, {
|
|
12764
12792
|
streaming: true,
|
|
@@ -12814,9 +12842,10 @@ data: ${JSON.stringify(data)}
|
|
|
12814
12842
|
if (usagePayload) {
|
|
12815
12843
|
usagePrompt = usagePayload.prompt_tokens ?? usagePrompt;
|
|
12816
12844
|
usageCompletion = usagePayload.completion_tokens ?? usageCompletion;
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12845
|
+
const maybeCached = resolveCachedTokens(usagePayload);
|
|
12846
|
+
usageCacheRead = maybeCached.read;
|
|
12847
|
+
usageCacheCreation = maybeCached.creation;
|
|
12848
|
+
usageCached = maybeCached.read + maybeCached.creation;
|
|
12820
12849
|
}
|
|
12821
12850
|
if (choice.delta?.tool_calls) {
|
|
12822
12851
|
request.log.debug({ event: "debug.tool_call_delta", delta: choice.delta?.tool_calls }, "tool call delta received");
|
|
@@ -12923,6 +12952,8 @@ data: ${JSON.stringify(data)}
|
|
|
12923
12952
|
inputTokens: fallbackPrompt,
|
|
12924
12953
|
outputTokens: fallbackCompletion,
|
|
12925
12954
|
cachedTokens: usageCached,
|
|
12955
|
+
cacheReadTokens: usageCacheRead,
|
|
12956
|
+
cacheCreationTokens: usageCacheCreation,
|
|
12926
12957
|
ttftMs,
|
|
12927
12958
|
tpotMs: computeTpot(totalLatencyMs, fallbackCompletion, {
|
|
12928
12959
|
streaming: true,
|
|
@@ -12935,8 +12966,8 @@ data: ${JSON.stringify(data)}
|
|
|
12935
12966
|
inputTokens: fallbackPrompt,
|
|
12936
12967
|
outputTokens: fallbackCompletion,
|
|
12937
12968
|
cachedTokens: usageCached ?? 0,
|
|
12938
|
-
cacheReadTokens:
|
|
12939
|
-
cacheCreationTokens:
|
|
12969
|
+
cacheReadTokens: usageCacheRead,
|
|
12970
|
+
cacheCreationTokens: usageCacheCreation,
|
|
12940
12971
|
latencyMs: totalLatencyMs
|
|
12941
12972
|
});
|
|
12942
12973
|
if (storeResponsePayloads) {
|
|
@@ -13892,6 +13923,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
13892
13923
|
inputTokens: inputTokens3,
|
|
13893
13924
|
outputTokens: outputTokens3,
|
|
13894
13925
|
cachedTokens: cachedTokens3,
|
|
13926
|
+
cacheReadTokens: cached3.read,
|
|
13927
|
+
cacheCreationTokens: cached3.creation,
|
|
13895
13928
|
ttftMs: latencyMs3,
|
|
13896
13929
|
tpotMs: computeTpot2(latencyMs3, outputTokens3, { streaming: false })
|
|
13897
13930
|
});
|
|
@@ -13901,6 +13934,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
13901
13934
|
inputTokens: inputTokens3,
|
|
13902
13935
|
outputTokens: outputTokens3,
|
|
13903
13936
|
cachedTokens: cachedTokens3,
|
|
13937
|
+
cacheReadTokens: cached3.read,
|
|
13938
|
+
cacheCreationTokens: cached3.creation,
|
|
13904
13939
|
latencyMs: latencyMs3
|
|
13905
13940
|
});
|
|
13906
13941
|
if (storeResponsePayloads) {
|
|
@@ -13942,6 +13977,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
13942
13977
|
inputTokens: inputTokens2,
|
|
13943
13978
|
outputTokens: outputTokens2,
|
|
13944
13979
|
cachedTokens: cachedTokens2,
|
|
13980
|
+
cacheReadTokens: cached2.read,
|
|
13981
|
+
cacheCreationTokens: cached2.creation,
|
|
13945
13982
|
ttftMs: usagePayload?.first_token_latency_ms ?? latencyMs2,
|
|
13946
13983
|
tpotMs: usagePayload?.tokens_per_second ? computeTpot2(latencyMs2, outputTokens2, { streaming: false, reasoningTokens: reasoningTokens2 }) : null
|
|
13947
13984
|
});
|
|
@@ -13950,6 +13987,9 @@ async function registerOpenAiRoutes(app) {
|
|
|
13950
13987
|
requests: 1,
|
|
13951
13988
|
inputTokens: inputTokens2,
|
|
13952
13989
|
outputTokens: outputTokens2,
|
|
13990
|
+
cachedTokens: cachedTokens2,
|
|
13991
|
+
cacheReadTokens: cached2.read,
|
|
13992
|
+
cacheCreationTokens: cached2.creation,
|
|
13953
13993
|
latencyMs: latencyMs2
|
|
13954
13994
|
});
|
|
13955
13995
|
await finalize(200, null);
|
|
@@ -13983,6 +14023,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
13983
14023
|
let usagePrompt2 = null;
|
|
13984
14024
|
let usageCompletion2 = null;
|
|
13985
14025
|
let usageCached2 = null;
|
|
14026
|
+
let usageCacheRead2 = 0;
|
|
14027
|
+
let usageCacheCreation2 = 0;
|
|
13986
14028
|
let lastUsagePayload = null;
|
|
13987
14029
|
let firstTokenAt2 = null;
|
|
13988
14030
|
let claudeMessageId = null;
|
|
@@ -14024,9 +14066,9 @@ async function registerOpenAiRoutes(app) {
|
|
|
14024
14066
|
);
|
|
14025
14067
|
if (usageCached2 == null) {
|
|
14026
14068
|
const candidate = resolveCachedTokens2(usagePayload);
|
|
14027
|
-
|
|
14028
|
-
|
|
14029
|
-
|
|
14069
|
+
usageCacheRead2 = candidate.read;
|
|
14070
|
+
usageCacheCreation2 = candidate.creation;
|
|
14071
|
+
usageCached2 = candidate.read + candidate.creation;
|
|
14030
14072
|
}
|
|
14031
14073
|
lastUsagePayload = usagePayload;
|
|
14032
14074
|
};
|
|
@@ -14297,7 +14339,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
14297
14339
|
ensureCreatedSent();
|
|
14298
14340
|
let finalPromptTokens = typeof usagePrompt2 === "number" && usagePrompt2 > 0 ? usagePrompt2 : target.tokenEstimate ?? estimateTokens(normalized, target.modelId);
|
|
14299
14341
|
let finalCompletionTokens = typeof usageCompletion2 === "number" && usageCompletion2 > 0 ? usageCompletion2 : aggregatedText ? estimateTextTokens(aggregatedText, target.modelId) : 0;
|
|
14300
|
-
const
|
|
14342
|
+
const finalCachedResult = usageCached2 != null ? { read: usageCacheRead2, creation: usageCacheCreation2 } : resolveCachedTokens2(lastUsagePayload);
|
|
14343
|
+
const finalCachedTokens = finalCachedResult.read + finalCachedResult.creation;
|
|
14301
14344
|
const totalLatencyMs = Date.now() - requestStart;
|
|
14302
14345
|
const ttftMs = firstTokenAt2 ? firstTokenAt2 - requestStart : null;
|
|
14303
14346
|
const openAIResponse = buildOpenAIResponseFromClaude(claudeMessage, target.modelId, converted, {
|
|
@@ -14328,6 +14371,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
14328
14371
|
inputTokens: finalPromptTokens,
|
|
14329
14372
|
outputTokens: finalCompletionTokens,
|
|
14330
14373
|
cachedTokens: finalCachedTokens ?? null,
|
|
14374
|
+
cacheReadTokens: 0,
|
|
14375
|
+
cacheCreationTokens: 0,
|
|
14331
14376
|
ttftMs,
|
|
14332
14377
|
tpotMs: computeTpot2(totalLatencyMs, finalCompletionTokens, {
|
|
14333
14378
|
streaming: true,
|
|
@@ -14339,9 +14384,9 @@ async function registerOpenAiRoutes(app) {
|
|
|
14339
14384
|
requests: 1,
|
|
14340
14385
|
inputTokens: finalPromptTokens,
|
|
14341
14386
|
outputTokens: finalCompletionTokens,
|
|
14342
|
-
cachedTokens:
|
|
14343
|
-
cacheReadTokens:
|
|
14344
|
-
cacheCreationTokens:
|
|
14387
|
+
cachedTokens: finalCachedTokens,
|
|
14388
|
+
cacheReadTokens: finalCachedResult.read,
|
|
14389
|
+
cacheCreationTokens: finalCachedResult.creation,
|
|
14345
14390
|
latencyMs: totalLatencyMs
|
|
14346
14391
|
});
|
|
14347
14392
|
if (storeResponsePayloads && capturedResponseChunks2) {
|
|
@@ -14361,6 +14406,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
14361
14406
|
let usageCompletion = null;
|
|
14362
14407
|
let usageReasoning = null;
|
|
14363
14408
|
let usageCached = null;
|
|
14409
|
+
let usageCacheRead = 0;
|
|
14410
|
+
let usageCacheCreation = 0;
|
|
14364
14411
|
let firstTokenAt = null;
|
|
14365
14412
|
let chunkCount = 0;
|
|
14366
14413
|
const capturedResponseChunks = storeResponsePayloads ? [] : null;
|
|
@@ -14400,7 +14447,10 @@ async function registerOpenAiRoutes(app) {
|
|
|
14400
14447
|
usageReasoning
|
|
14401
14448
|
);
|
|
14402
14449
|
if (usageCached == null) {
|
|
14403
|
-
|
|
14450
|
+
const cachedResult = resolveCachedTokens2(usagePayload);
|
|
14451
|
+
usageCacheRead = cachedResult.read;
|
|
14452
|
+
usageCacheCreation = cachedResult.creation;
|
|
14453
|
+
usageCached = cachedResult.read + cachedResult.creation;
|
|
14404
14454
|
}
|
|
14405
14455
|
if (OPENAI_DEBUG) {
|
|
14406
14456
|
debugLog("usage payload received", usagePayload);
|
|
@@ -14492,6 +14542,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
14492
14542
|
inputTokens,
|
|
14493
14543
|
outputTokens,
|
|
14494
14544
|
cachedTokens: usageCached,
|
|
14545
|
+
cacheReadTokens: 0,
|
|
14546
|
+
cacheCreationTokens: 0,
|
|
14495
14547
|
ttftMs: firstTokenAt ? firstTokenAt - requestStart : null,
|
|
14496
14548
|
tpotMs: computeTpot2(latencyMs, outputTokens, {
|
|
14497
14549
|
streaming: true,
|
|
@@ -14755,7 +14807,9 @@ async function registerOpenAiRoutes(app) {
|
|
|
14755
14807
|
await updateLogTokens(logId, {
|
|
14756
14808
|
inputTokens: inputTokens3,
|
|
14757
14809
|
outputTokens: outputTokens3,
|
|
14758
|
-
cachedTokens:
|
|
14810
|
+
cachedTokens: usageCached,
|
|
14811
|
+
cacheReadTokens: cached3.read,
|
|
14812
|
+
cacheCreationTokens: cached3.creation,
|
|
14759
14813
|
ttftMs: latencyMs3,
|
|
14760
14814
|
tpotMs: computeTpot2(latencyMs3, outputTokens3, { streaming: false })
|
|
14761
14815
|
});
|
|
@@ -14764,7 +14818,9 @@ async function registerOpenAiRoutes(app) {
|
|
|
14764
14818
|
requests: 1,
|
|
14765
14819
|
inputTokens: inputTokens3,
|
|
14766
14820
|
outputTokens: outputTokens3,
|
|
14767
|
-
cachedTokens:
|
|
14821
|
+
cachedTokens: usageCached,
|
|
14822
|
+
cacheReadTokens: usageCacheRead,
|
|
14823
|
+
cacheCreationTokens: usageCacheCreation,
|
|
14768
14824
|
latencyMs: latencyMs3
|
|
14769
14825
|
});
|
|
14770
14826
|
if (storeResponsePayloads) {
|
|
@@ -14800,7 +14856,9 @@ async function registerOpenAiRoutes(app) {
|
|
|
14800
14856
|
await updateLogTokens(logId, {
|
|
14801
14857
|
inputTokens: inputTokens2,
|
|
14802
14858
|
outputTokens: outputTokens2,
|
|
14803
|
-
cachedTokens:
|
|
14859
|
+
cachedTokens: usageCached,
|
|
14860
|
+
cacheReadTokens: cached2.read,
|
|
14861
|
+
cacheCreationTokens: cached2.creation,
|
|
14804
14862
|
ttftMs: usagePayload?.first_token_latency_ms ?? latencyMs2,
|
|
14805
14863
|
tpotMs: usagePayload?.tokens_per_second ? computeTpot2(latencyMs2, outputTokens2, { streaming: false }) : null
|
|
14806
14864
|
});
|
|
@@ -14809,6 +14867,9 @@ async function registerOpenAiRoutes(app) {
|
|
|
14809
14867
|
requests: 1,
|
|
14810
14868
|
inputTokens: inputTokens2,
|
|
14811
14869
|
outputTokens: outputTokens2,
|
|
14870
|
+
cachedTokens: cachedTokens2,
|
|
14871
|
+
cacheReadTokens: cached2.read,
|
|
14872
|
+
cacheCreationTokens: cached2.creation,
|
|
14812
14873
|
latencyMs: latencyMs2
|
|
14813
14874
|
});
|
|
14814
14875
|
await finalize(200, null);
|
|
@@ -14842,6 +14903,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
14842
14903
|
let usagePrompt2 = null;
|
|
14843
14904
|
let usageCompletion2 = null;
|
|
14844
14905
|
let usageCached2 = null;
|
|
14906
|
+
let usageCacheRead2 = 0;
|
|
14907
|
+
let usageCacheCreation2 = 0;
|
|
14845
14908
|
let lastUsagePayload = null;
|
|
14846
14909
|
let firstTokenAt2 = null;
|
|
14847
14910
|
let claudeStopReason = null;
|
|
@@ -14884,9 +14947,9 @@ async function registerOpenAiRoutes(app) {
|
|
|
14884
14947
|
);
|
|
14885
14948
|
if (usageCached2 == null) {
|
|
14886
14949
|
const candidate = resolveCachedTokens2(usagePayload);
|
|
14887
|
-
|
|
14888
|
-
|
|
14889
|
-
|
|
14950
|
+
usageCacheRead2 = candidate.read;
|
|
14951
|
+
usageCacheCreation2 = candidate.creation;
|
|
14952
|
+
usageCached2 = candidate.read + candidate.creation;
|
|
14890
14953
|
}
|
|
14891
14954
|
lastUsagePayload = usagePayload;
|
|
14892
14955
|
};
|
|
@@ -15197,7 +15260,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
15197
15260
|
}
|
|
15198
15261
|
const finalPromptTokens = typeof usagePrompt2 === "number" && usagePrompt2 > 0 ? usagePrompt2 : target.tokenEstimate ?? estimateTokens(normalized, target.modelId);
|
|
15199
15262
|
const finalCompletionTokens = typeof usageCompletion2 === "number" && usageCompletion2 > 0 ? usageCompletion2 : aggregatedText ? estimateTextTokens(aggregatedText, target.modelId) : 0;
|
|
15200
|
-
const
|
|
15263
|
+
const finalCachedResult = usageCached2 != null ? { read: usageCacheRead2, creation: usageCacheCreation2 } : resolveCachedTokens2(lastUsagePayload);
|
|
15264
|
+
const finalCachedTokens = finalCachedResult.read + finalCachedResult.creation;
|
|
15201
15265
|
const totalLatencyMs = Date.now() - requestStart;
|
|
15202
15266
|
const ttftMs = firstTokenAt2 ? firstTokenAt2 - requestStart : null;
|
|
15203
15267
|
const finishReason = mapClaudeStopReasonToChatFinish(claudeStopReason) ?? "stop";
|
|
@@ -15230,6 +15294,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
15230
15294
|
inputTokens: finalPromptTokens,
|
|
15231
15295
|
outputTokens: finalCompletionTokens,
|
|
15232
15296
|
cachedTokens: finalCachedTokens ?? null,
|
|
15297
|
+
cacheReadTokens: 0,
|
|
15298
|
+
cacheCreationTokens: 0,
|
|
15233
15299
|
ttftMs,
|
|
15234
15300
|
tpotMs: computeTpot2(totalLatencyMs, finalCompletionTokens, {
|
|
15235
15301
|
streaming: true,
|
|
@@ -15241,9 +15307,9 @@ async function registerOpenAiRoutes(app) {
|
|
|
15241
15307
|
requests: 1,
|
|
15242
15308
|
inputTokens: finalPromptTokens,
|
|
15243
15309
|
outputTokens: finalCompletionTokens,
|
|
15244
|
-
cachedTokens:
|
|
15245
|
-
cacheReadTokens:
|
|
15246
|
-
cacheCreationTokens:
|
|
15310
|
+
cachedTokens: finalCachedTokens,
|
|
15311
|
+
cacheReadTokens: finalCachedResult.read,
|
|
15312
|
+
cacheCreationTokens: finalCachedResult.creation,
|
|
15247
15313
|
latencyMs: totalLatencyMs
|
|
15248
15314
|
});
|
|
15249
15315
|
if (storeResponsePayloads && capturedResponseChunks2) {
|
|
@@ -15262,6 +15328,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
15262
15328
|
let usagePrompt = null;
|
|
15263
15329
|
let usageCompletion = null;
|
|
15264
15330
|
let usageCached = null;
|
|
15331
|
+
let usageCacheRead = 0;
|
|
15332
|
+
let usageCacheCreation = 0;
|
|
15265
15333
|
let firstTokenAt = null;
|
|
15266
15334
|
const capturedResponseChunks = storeResponsePayloads ? [] : null;
|
|
15267
15335
|
const replyClosed = () => {
|
|
@@ -15294,7 +15362,10 @@ async function registerOpenAiRoutes(app) {
|
|
|
15294
15362
|
usageCompletion
|
|
15295
15363
|
);
|
|
15296
15364
|
if (usageCached == null) {
|
|
15297
|
-
|
|
15365
|
+
const cachedResult = resolveCachedTokens2(usagePayload);
|
|
15366
|
+
usageCacheRead = cachedResult.read;
|
|
15367
|
+
usageCacheCreation = cachedResult.creation;
|
|
15368
|
+
usageCached = cachedResult.read + cachedResult.creation;
|
|
15298
15369
|
}
|
|
15299
15370
|
};
|
|
15300
15371
|
while (true) {
|
|
@@ -15369,6 +15440,8 @@ async function registerOpenAiRoutes(app) {
|
|
|
15369
15440
|
inputTokens,
|
|
15370
15441
|
outputTokens,
|
|
15371
15442
|
cachedTokens: usageCached,
|
|
15443
|
+
cacheReadTokens: 0,
|
|
15444
|
+
cacheCreationTokens: 0,
|
|
15372
15445
|
ttftMs: firstTokenAt ? firstTokenAt - requestStart : null,
|
|
15373
15446
|
tpotMs: computeTpot2(latencyMs, outputTokens, {
|
|
15374
15447
|
streaming: true,
|
|
@@ -15545,7 +15618,7 @@ async function queryLogs(options = {}) {
|
|
|
15545
15618
|
const items = await getAll(
|
|
15546
15619
|
`SELECT id, timestamp, session_id, endpoint, provider, model, client_model,
|
|
15547
15620
|
stream, latency_ms, status_code, input_tokens, output_tokens,
|
|
15548
|
-
cached_tokens, ttft_ms, tpot_ms, error, api_key_id, api_key_name, api_key_value
|
|
15621
|
+
cached_tokens, cache_read_tokens, cache_creation_tokens, ttft_ms, tpot_ms, error, api_key_id, api_key_name, api_key_value
|
|
15549
15622
|
FROM request_logs
|
|
15550
15623
|
${whereClause}
|
|
15551
15624
|
ORDER BY timestamp DESC
|
|
@@ -15561,7 +15634,7 @@ async function getLogDetail(id) {
|
|
|
15561
15634
|
const record = await getOne(
|
|
15562
15635
|
`SELECT id, timestamp, session_id, endpoint, provider, model, client_model,
|
|
15563
15636
|
stream, latency_ms, status_code, input_tokens, output_tokens,
|
|
15564
|
-
cached_tokens, ttft_ms, tpot_ms, error, api_key_id, api_key_name, api_key_value
|
|
15637
|
+
cached_tokens, cache_read_tokens, cache_creation_tokens, ttft_ms, tpot_ms, error, api_key_id, api_key_name, api_key_value
|
|
15565
15638
|
FROM request_logs
|
|
15566
15639
|
WHERE id = ?`,
|
|
15567
15640
|
[id]
|
|
@@ -15611,6 +15684,8 @@ async function exportLogs(options = {}) {
|
|
|
15611
15684
|
l.input_tokens,
|
|
15612
15685
|
l.output_tokens,
|
|
15613
15686
|
l.cached_tokens,
|
|
15687
|
+
l.cache_read_tokens,
|
|
15688
|
+
l.cache_creation_tokens,
|
|
15614
15689
|
l.ttft_ms,
|
|
15615
15690
|
l.tpot_ms,
|
|
15616
15691
|
l.error,
|
|
@@ -17530,6 +17605,8 @@ async function handleAnthropicProtocol(request, reply, endpoint, endpointId, app
|
|
|
17530
17605
|
inputTokens,
|
|
17531
17606
|
outputTokens,
|
|
17532
17607
|
cachedTokens: cachedTokens2,
|
|
17608
|
+
cacheReadTokens: cached2.read,
|
|
17609
|
+
cacheCreationTokens: cached2.creation,
|
|
17533
17610
|
ttftMs: latencyMs,
|
|
17534
17611
|
tpotMs: computeTpot3(latencyMs, outputTokens, { streaming: false })
|
|
17535
17612
|
});
|
|
@@ -17539,6 +17616,8 @@ async function handleAnthropicProtocol(request, reply, endpoint, endpointId, app
|
|
|
17539
17616
|
inputTokens,
|
|
17540
17617
|
outputTokens,
|
|
17541
17618
|
cachedTokens: cachedTokens2,
|
|
17619
|
+
cacheReadTokens: cached2.read,
|
|
17620
|
+
cacheCreationTokens: cached2.creation,
|
|
17542
17621
|
latencyMs
|
|
17543
17622
|
});
|
|
17544
17623
|
if (storeResponsePayloads) {
|
|
@@ -17566,6 +17645,8 @@ async function handleAnthropicProtocol(request, reply, endpoint, endpointId, app
|
|
|
17566
17645
|
let usagePrompt = 0;
|
|
17567
17646
|
let usageCompletion = 0;
|
|
17568
17647
|
let usageCached = null;
|
|
17648
|
+
let usageCacheRead = 0;
|
|
17649
|
+
let usageCacheCreation = 0;
|
|
17569
17650
|
let firstTokenAt = null;
|
|
17570
17651
|
const capturedChunks = storeResponsePayloads ? [] : null;
|
|
17571
17652
|
try {
|
|
@@ -17595,9 +17676,9 @@ async function handleAnthropicProtocol(request, reply, endpoint, endpointId, app
|
|
|
17595
17676
|
usagePrompt = parsed.usage.input_tokens ?? usagePrompt;
|
|
17596
17677
|
usageCompletion = parsed.usage.output_tokens ?? usageCompletion;
|
|
17597
17678
|
const cached2 = resolveCachedTokens3(parsed.usage);
|
|
17598
|
-
|
|
17599
|
-
|
|
17600
|
-
|
|
17679
|
+
usageCacheRead = cached2.read;
|
|
17680
|
+
usageCacheCreation = cached2.creation;
|
|
17681
|
+
usageCached = cached2.read + cached2.creation;
|
|
17601
17682
|
}
|
|
17602
17683
|
if (!firstTokenAt && (parsed?.type === "content_block_delta" || parsed?.delta?.text)) {
|
|
17603
17684
|
firstTokenAt = Date.now();
|
|
@@ -17624,6 +17705,8 @@ async function handleAnthropicProtocol(request, reply, endpoint, endpointId, app
|
|
|
17624
17705
|
inputTokens: usagePrompt,
|
|
17625
17706
|
outputTokens: usageCompletion,
|
|
17626
17707
|
cachedTokens: usageCached,
|
|
17708
|
+
cacheReadTokens: usageCacheRead,
|
|
17709
|
+
cacheCreationTokens: usageCacheCreation,
|
|
17627
17710
|
ttftMs,
|
|
17628
17711
|
tpotMs: computeTpot3(totalLatencyMs, usageCompletion, {
|
|
17629
17712
|
streaming: true,
|
|
@@ -17636,8 +17719,6 @@ async function handleAnthropicProtocol(request, reply, endpoint, endpointId, app
|
|
|
17636
17719
|
inputTokens: usagePrompt,
|
|
17637
17720
|
outputTokens: usageCompletion,
|
|
17638
17721
|
cachedTokens: usageCached,
|
|
17639
|
-
cacheReadTokens: cached.read,
|
|
17640
|
-
cacheCreationTokens: cached.creation,
|
|
17641
17722
|
latencyMs: totalLatencyMs
|
|
17642
17723
|
});
|
|
17643
17724
|
if (storeResponsePayloads && capturedChunks) {
|
|
@@ -17824,6 +17905,8 @@ async function handleOpenAIChatProtocol(request, reply, endpoint, endpointId, ap
|
|
|
17824
17905
|
inputTokens: inputTokens2,
|
|
17825
17906
|
outputTokens: outputTokens2,
|
|
17826
17907
|
cachedTokens: cachedTokens2,
|
|
17908
|
+
cacheReadTokens: cached2.read,
|
|
17909
|
+
cacheCreationTokens: cached2.creation,
|
|
17827
17910
|
ttftMs: latencyMs2,
|
|
17828
17911
|
tpotMs: computeTpot3(latencyMs2, outputTokens2, { streaming: false })
|
|
17829
17912
|
});
|
|
@@ -17833,6 +17916,8 @@ async function handleOpenAIChatProtocol(request, reply, endpoint, endpointId, ap
|
|
|
17833
17916
|
inputTokens: inputTokens2,
|
|
17834
17917
|
outputTokens: outputTokens2,
|
|
17835
17918
|
cachedTokens: cachedTokens2,
|
|
17919
|
+
cacheReadTokens: cached2.read,
|
|
17920
|
+
cacheCreationTokens: cached2.creation,
|
|
17836
17921
|
latencyMs: latencyMs2
|
|
17837
17922
|
});
|
|
17838
17923
|
if (storeResponsePayloads) {
|
|
@@ -17857,6 +17942,8 @@ async function handleOpenAIChatProtocol(request, reply, endpoint, endpointId, ap
|
|
|
17857
17942
|
let usagePrompt = null;
|
|
17858
17943
|
let usageCompletion = null;
|
|
17859
17944
|
let usageCached = null;
|
|
17945
|
+
let usageCacheRead = 0;
|
|
17946
|
+
let usageCacheCreation = 0;
|
|
17860
17947
|
let firstTokenAt = null;
|
|
17861
17948
|
const capturedChunks = storeResponsePayloads ? [] : null;
|
|
17862
17949
|
try {
|
|
@@ -17886,7 +17973,10 @@ async function handleOpenAIChatProtocol(request, reply, endpoint, endpointId, ap
|
|
|
17886
17973
|
if (usage) {
|
|
17887
17974
|
usagePrompt = usage.prompt_tokens ?? usage.input_tokens ?? usagePrompt;
|
|
17888
17975
|
usageCompletion = usage.completion_tokens ?? usage.output_tokens ?? usageCompletion;
|
|
17889
|
-
|
|
17976
|
+
const cachedResult = resolveCachedTokens3(usage);
|
|
17977
|
+
usageCacheRead = cachedResult.read;
|
|
17978
|
+
usageCacheCreation = cachedResult.creation;
|
|
17979
|
+
usageCached = cachedResult.read + cachedResult.creation;
|
|
17890
17980
|
}
|
|
17891
17981
|
} catch {
|
|
17892
17982
|
}
|
|
@@ -17908,6 +17998,8 @@ async function handleOpenAIChatProtocol(request, reply, endpoint, endpointId, ap
|
|
|
17908
17998
|
inputTokens,
|
|
17909
17999
|
outputTokens,
|
|
17910
18000
|
cachedTokens: usageCached,
|
|
18001
|
+
cacheReadTokens: usageCacheRead,
|
|
18002
|
+
cacheCreationTokens: usageCacheCreation,
|
|
17911
18003
|
ttftMs: firstTokenAt ? firstTokenAt - requestStart : null,
|
|
17912
18004
|
tpotMs: computeTpot3(latencyMs, outputTokens, {
|
|
17913
18005
|
streaming: true,
|
|
@@ -18104,7 +18196,9 @@ async function handleOpenAIResponsesProtocol(request, reply, endpoint, endpointI
|
|
|
18104
18196
|
await updateLogTokens(logId, {
|
|
18105
18197
|
inputTokens: inputTokens2,
|
|
18106
18198
|
outputTokens: outputTokens2,
|
|
18107
|
-
cachedTokens:
|
|
18199
|
+
cachedTokens: usageCached,
|
|
18200
|
+
cacheReadTokens: cached2.read,
|
|
18201
|
+
cacheCreationTokens: cached2.creation,
|
|
18108
18202
|
ttftMs: latencyMs2,
|
|
18109
18203
|
tpotMs: computeTpot3(latencyMs2, outputTokens2, { streaming: false })
|
|
18110
18204
|
});
|
|
@@ -18114,6 +18208,8 @@ async function handleOpenAIResponsesProtocol(request, reply, endpoint, endpointI
|
|
|
18114
18208
|
inputTokens: inputTokens2,
|
|
18115
18209
|
outputTokens: outputTokens2,
|
|
18116
18210
|
cachedTokens: cachedTokens2,
|
|
18211
|
+
cacheReadTokens: cached2.read,
|
|
18212
|
+
cacheCreationTokens: cached2.creation,
|
|
18117
18213
|
latencyMs: latencyMs2
|
|
18118
18214
|
});
|
|
18119
18215
|
if (storeResponsePayloads) {
|
|
@@ -18138,6 +18234,8 @@ async function handleOpenAIResponsesProtocol(request, reply, endpoint, endpointI
|
|
|
18138
18234
|
let usagePrompt = null;
|
|
18139
18235
|
let usageCompletion = null;
|
|
18140
18236
|
let usageCached = null;
|
|
18237
|
+
let usageCacheRead = 0;
|
|
18238
|
+
let usageCacheCreation = 0;
|
|
18141
18239
|
let firstTokenAt = null;
|
|
18142
18240
|
const capturedChunks = storeResponsePayloads ? [] : null;
|
|
18143
18241
|
try {
|
|
@@ -18167,7 +18265,10 @@ async function handleOpenAIResponsesProtocol(request, reply, endpoint, endpointI
|
|
|
18167
18265
|
if (usage) {
|
|
18168
18266
|
usagePrompt = usage.prompt_tokens ?? usage.input_tokens ?? usagePrompt;
|
|
18169
18267
|
usageCompletion = usage.completion_tokens ?? usage.output_tokens ?? usageCompletion;
|
|
18170
|
-
|
|
18268
|
+
const cachedResult = resolveCachedTokens3(usage);
|
|
18269
|
+
usageCacheRead = cachedResult.read;
|
|
18270
|
+
usageCacheCreation = cachedResult.creation;
|
|
18271
|
+
usageCached = cachedResult.read + cachedResult.creation;
|
|
18171
18272
|
}
|
|
18172
18273
|
} catch {
|
|
18173
18274
|
}
|
|
@@ -18189,6 +18290,8 @@ async function handleOpenAIResponsesProtocol(request, reply, endpoint, endpointI
|
|
|
18189
18290
|
inputTokens,
|
|
18190
18291
|
outputTokens,
|
|
18191
18292
|
cachedTokens: usageCached,
|
|
18293
|
+
cacheReadTokens: usageCacheRead,
|
|
18294
|
+
cacheCreationTokens: usageCacheCreation,
|
|
18192
18295
|
ttftMs: firstTokenAt ? firstTokenAt - requestStart : null,
|
|
18193
18296
|
tpotMs: computeTpot3(latencyMs, outputTokens, {
|
|
18194
18297
|
streaming: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as p,u as v,a as k,r,j as e,d as o,U as j,m as i}from"./index-
|
|
1
|
+
import{c as p,u as v,a as k,r,j as e,d as o,U as j,m as i}from"./index-3UByifOG.js";import{u as N}from"./useApiQuery-7KXAW9hB.js";import{P as w,a as d}from"./PageSection-BT-depe5.js";import"./Input-CkTJl-fF.js";import{B as b}from"./Button-CgdNhVeu.js";import{I as y}from"./info-DAG4KwRm.js";/**
|
|
2
2
|
* @license lucide-react v0.344.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -8,4 +8,4 @@ import{c as p,u as v,a as k,r,j as e,d as o,U as j,m as i}from"./index-BK1UNVMz.
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const E=p("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]),I="0.
|
|
11
|
+
*/const E=p("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]),I="0.5.1",_={version:I},L={VITE_BUILD_TIME:"2025-10-31T08:47:42.611Z",VITE_NODE_VERSION:"v22.14.0"};function m({items:t}){return t.length===0?null:e.jsx("dl",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-2",children:t.map(s=>e.jsxs("div",{className:"rounded-2xl border border-slate-200/50 bg-white p-4 shadow-sm shadow-slate-200/30 transition-all duration-200 hover:-translate-y-0.5 hover:border-slate-200/70 hover:shadow-md hover:shadow-slate-200/40 dark:border-slate-700/50 dark:bg-slate-900/80 dark:shadow-lg dark:shadow-slate-900/30 dark:hover:border-slate-600/70",children:[e.jsx("dt",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-slate-500 dark:text-slate-400",children:s.label}),e.jsx("dd",{className:"mt-2 text-base font-semibold text-slate-900 dark:text-slate-100",children:s.value}),s.hint?e.jsx("p",{className:o(i,"mt-2 text-xs leading-relaxed"),children:s.hint}):null]},s.label))})}function P(){const{t}=v(),{pushToast:s}=k(),a=N(["status","gateway"],{url:"/api/status",method:"GET"},{staleTime:6e4});r.useEffect(()=>{a.isError&&a.error&&s({title:t("about.toast.statusError.title"),description:a.error.message,variant:"error"})},[a.isError,a.error,s,t]);const n=_.version,l=r.useMemo(()=>{const u=L,f=u.VITE_BUILD_TIME,g=u.VITE_NODE_VERSION;return{buildTime:f,nodeVersion:g}},[]),h=r.useMemo(()=>[{label:t("about.app.labels.name"),value:e.jsx("span",{className:"font-mono text-sm font-semibold text-slate-900 dark:text-slate-100",children:"cc-gw"})},{label:t("about.app.labels.version"),value:e.jsxs("span",{className:"font-mono text-sm font-semibold text-blue-700 dark:text-blue-200",children:["v",n]})},{label:t("about.app.labels.buildTime"),value:l.buildTime,hint:t("about.app.hint.buildTime")},{label:t("about.app.labels.node"),value:e.jsx("span",{className:"font-mono text-sm text-slate-800 dark:text-slate-200",children:l.nodeVersion})}],[n,l.buildTime,l.nodeVersion,t]),c=r.useMemo(()=>a.data?[{label:t("about.status.labels.host"),value:a.data.host??"127.0.0.1"},{label:t("about.status.labels.port"),value:a.data.port.toLocaleString()},{label:t("about.status.labels.providers"),value:a.data.providers.toLocaleString()},{label:t("about.status.labels.active"),value:(a.data.activeRequests??0).toLocaleString(),hint:t("about.status.hint.active")}]:[],[a.data,t]),x=()=>{s({title:t("about.toast.updatesPlanned"),variant:"info"})};return e.jsxs("div",{className:"space-y-8",children:[e.jsx(w,{icon:e.jsx(y,{className:"h-6 w-6","aria-hidden":"true"}),title:t("about.title"),description:t("about.description"),badge:`v${n}`,actions:e.jsx(b,{variant:"primary",icon:e.jsx(E,{className:"h-4 w-4","aria-hidden":"true"}),onClick:x,children:t("about.support.actions.checkUpdates")})}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(d,{title:t("about.app.title"),description:t("about.app.subtitle"),className:"h-full",contentClassName:"gap-4",children:e.jsx(m,{items:h})}),e.jsx(d,{title:t("about.status.title"),description:t("about.status.subtitle"),className:"h-full",contentClassName:"gap-4",actions:e.jsx(b,{variant:"subtle",size:"sm",icon:e.jsx(T,{className:"h-4 w-4","aria-hidden":"true"}),onClick:()=>a.refetch(),loading:a.isFetching,children:a.isFetching?t("common.actions.refreshing"):t("common.actions.refresh")}),children:a.isLoading?e.jsxs("div",{className:"flex h-36 flex-col items-center justify-center gap-3 text-center",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-[3px] border-blue-500/30 border-t-blue-600 dark:border-blue-400/20 dark:border-t-blue-300"}),e.jsx("p",{className:o(i,"text-sm"),children:t("about.status.loading")})]}):c.length>0?e.jsx(m,{items:c}):e.jsxs("div",{className:"flex h-36 flex-col items-center justify-center gap-2 rounded-2xl border border-dashed border-slate-200/60 bg-white p-6 text-center shadow-inner dark:border-slate-700/60 dark:bg-slate-900/60",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-700 dark:text-slate-200",children:t("about.status.empty")}),e.jsx("p",{className:o(i,"text-xs"),children:t("common.actions.refresh")})]})})]}),e.jsx(d,{title:t("about.support.title"),description:e.jsxs("span",{className:"space-y-1",children:[e.jsx("span",{className:"block text-sm font-semibold text-blue-600 dark:text-blue-300",children:t("about.support.subtitle")}),e.jsx("span",{children:t("about.support.description")})]}),className:"relative overflow-hidden",contentClassName:"gap-6",children:e.jsxs("div",{className:"flex flex-col gap-4 rounded-3xl border border-slate-200/50 bg-white p-6 shadow-lg shadow-slate-200/30 backdrop-blur-md dark:border-slate-700/50 dark:bg-slate-900/80 dark:shadow-slate-900/40",children:[e.jsxs("div",{className:"flex flex-wrap items-start gap-4",children:[e.jsx("div",{className:"grid h-12 w-12 place-items-center rounded-2xl bg-gradient-to-br from-blue-500/20 to-indigo-500/20 text-blue-600 shadow-inner dark:text-blue-200",children:e.jsx(j,{className:"h-6 w-6","aria-hidden":"true"})}),e.jsx("p",{className:o(i,"text-sm leading-6"),children:t("about.support.tip")})]}),e.jsx("code",{className:"inline-flex items-center gap-2 self-start rounded-full border border-blue-200/50 bg-blue-50/80 px-4 py-2 text-xs font-semibold tracking-wide text-blue-700 shadow-sm dark:border-blue-500/30 dark:bg-blue-900/30 dark:text-blue-200",children:"~/.cc-gw/config.json"})]})})]})}export{P as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as T,u as W,a as J,r as d,j as e,L as X,N as Y,d as t,b as K,m as r,H as m,E as Z,k as ee,l as ae,f as se,h as te}from"./index-
|
|
1
|
+
import{c as T,u as W,a as J,r as d,j as e,L as X,N as Y,d as t,b as K,m as r,H as m,E as Z,k as ee,l as ae,f as se,h as te}from"./index-3UByifOG.js";import{E as le}from"./index-DVBy-Kka.js";import{u as w}from"./useApiQuery-7KXAW9hB.js";import{P as ie,a as q}from"./PageSection-BT-depe5.js";import{F as I}from"./FormField-DJjnoGU0.js";import{I as re}from"./Input-CkTJl-fF.js";import{B as C}from"./Button-CgdNhVeu.js";import{S as ne}from"./StatusBadge-CgBAXD_S.js";import{C as ce}from"./copy-OD9YQ85H.js";/**
|
|
2
2
|
* @license lucide-react v0.344.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,d as c,J as i,E as p,k as b}from"./index-
|
|
1
|
+
import{j as s,d as c,J as i,E as p,k as b}from"./index-3UByifOG.js";function h({variant:n="subtle",size:o="md",children:a,loading:t,icon:e,className:l,disabled:r,...u}){const m={subtle:b,primary:p,danger:i}[n],x={sm:"h-8 px-3 text-xs",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"}[o];return s.jsx("button",{className:c(m,x,t&&"cursor-wait opacity-70",r&&"cursor-not-allowed opacity-50",l),disabled:r||t,...u,children:t?s.jsx("div",{className:"inline-block animate-spin rounded-full h-4 w-4 border-b-2 border-current"}):e?s.jsxs(s.Fragment,{children:[e,a]}):a})}export{h as B};
|