@pinkbanana/dsh-balance 0.10.0 → 0.10.2
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/README.md +6 -0
- package/README_EN.md +6 -0
- package/docs/dsh-usage-tabs.jpg +0 -0
- package/lib/client.js +426 -145
- package/lib/client.js.map +1 -1
- package/lib/index.js +26 -14
- package/lib/index.js.map +1 -1
- package/lib/types/billing.d.ts +5 -0
- package/lib/types/client/BillingDetails.d.ts +23 -0
- package/lib/types/client/locales.d.ts +19 -0
- package/lib/types/client/styles.d.ts +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -191,7 +191,7 @@ window.__ModuleLoader__.load({
|
|
|
191
191
|
const above = rect.top - 16;
|
|
192
192
|
const upwards = below < 160 && above > below;
|
|
193
193
|
const maxHeight = Math.max(80, Math.min(320, upwards ? above : below));
|
|
194
|
-
const height = Math.min(options.length * 36 + 12, maxHeight);
|
|
194
|
+
const height = Math.min(list.current?.scrollHeight ?? options.length * 36 + 12, maxHeight);
|
|
195
195
|
setPosition({
|
|
196
196
|
left: Math.max(12, Math.min(rect.left, window.innerWidth - width - 12)),
|
|
197
197
|
top: upwards ? rect.top - height - 6 : rect.bottom + 6,
|
|
@@ -264,7 +264,10 @@ window.__ModuleLoader__.load({
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
},
|
|
267
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
267
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
268
|
+
title: options[selected]?.label ?? value,
|
|
269
|
+
children: options[selected]?.label ?? value
|
|
270
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
268
271
|
width: "14",
|
|
269
272
|
height: "14",
|
|
270
273
|
viewBox: "0 0 16 16",
|
|
@@ -290,7 +293,10 @@ window.__ModuleLoader__.load({
|
|
|
290
293
|
onPointerMove: () => setActive(index),
|
|
291
294
|
onMouseDown: (event) => event.preventDefault(),
|
|
292
295
|
onClick: () => choose(index),
|
|
293
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
296
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
297
|
+
title: option.label,
|
|
298
|
+
children: option.label
|
|
299
|
+
}), option.value === value ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
294
300
|
width: "16",
|
|
295
301
|
height: "16",
|
|
296
302
|
viewBox: "0 0 16 16",
|
|
@@ -304,6 +310,143 @@ window.__ModuleLoader__.load({
|
|
|
304
310
|
}), document.body) : null] });
|
|
305
311
|
}
|
|
306
312
|
//#endregion
|
|
313
|
+
//#region src/client/BillingDetails.tsx
|
|
314
|
+
function DetailPanel({ label, tabs, value, onChange, toolbar, children }) {
|
|
315
|
+
const id = (0, react.useId)();
|
|
316
|
+
const buttons = (0, react.useRef)([]);
|
|
317
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
318
|
+
className: "dsh-billing-detail-panel",
|
|
319
|
+
"aria-label": label,
|
|
320
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
321
|
+
className: "dsh-billing-detail-header",
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
324
|
+
className: "dsh-billing-detail-tabs",
|
|
325
|
+
role: "tablist",
|
|
326
|
+
"aria-label": label,
|
|
327
|
+
children: tabs.map((tab, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
328
|
+
ref: (element) => {
|
|
329
|
+
buttons.current[index] = element;
|
|
330
|
+
},
|
|
331
|
+
type: "button",
|
|
332
|
+
role: "tab",
|
|
333
|
+
id: `${id}-${tab.value}`,
|
|
334
|
+
"aria-controls": `${id}-panel`,
|
|
335
|
+
"aria-selected": value === tab.value,
|
|
336
|
+
tabIndex: value === tab.value ? 0 : -1,
|
|
337
|
+
onClick: () => onChange(tab.value),
|
|
338
|
+
onKeyDown: (event) => {
|
|
339
|
+
const next = event.key === "ArrowRight" ? (index + 1) % tabs.length : event.key === "ArrowLeft" ? (index - 1 + tabs.length) % tabs.length : event.key === "Home" ? 0 : event.key === "End" ? tabs.length - 1 : void 0;
|
|
340
|
+
if (next === void 0) return;
|
|
341
|
+
event.preventDefault();
|
|
342
|
+
onChange(tabs[next].value);
|
|
343
|
+
buttons.current[next]?.focus();
|
|
344
|
+
},
|
|
345
|
+
children: [tab.label, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
346
|
+
className: "dsh-billing-tab-count",
|
|
347
|
+
children: tab.count
|
|
348
|
+
})]
|
|
349
|
+
}, tab.value))
|
|
350
|
+
}),
|
|
351
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
352
|
+
className: "dsh-billing-detail-mobile",
|
|
353
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dropdown, {
|
|
354
|
+
label,
|
|
355
|
+
value,
|
|
356
|
+
onChange,
|
|
357
|
+
options: tabs.map((tab) => ({
|
|
358
|
+
value: tab.value,
|
|
359
|
+
label: `${tab.label} · ${tab.count}`
|
|
360
|
+
}))
|
|
361
|
+
})
|
|
362
|
+
}),
|
|
363
|
+
toolbar ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
364
|
+
className: "dsh-billing-detail-tools",
|
|
365
|
+
children: toolbar
|
|
366
|
+
}) : null
|
|
367
|
+
]
|
|
368
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
369
|
+
className: "dsh-billing-detail-body",
|
|
370
|
+
role: "tabpanel",
|
|
371
|
+
id: `${id}-panel`,
|
|
372
|
+
"aria-labelledby": `${id}-${value}`,
|
|
373
|
+
tabIndex: 0,
|
|
374
|
+
children
|
|
375
|
+
})]
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
function PagedRows({ items, render, t }) {
|
|
379
|
+
const [page, setPage] = (0, react.useState)(0);
|
|
380
|
+
const [size, setSize] = (0, react.useState)("10");
|
|
381
|
+
const pageSize = Number(size);
|
|
382
|
+
const lastPage = Math.max(0, Math.ceil(items.length / pageSize) - 1);
|
|
383
|
+
const currentPage = Math.min(page, lastPage);
|
|
384
|
+
const start = currentPage * pageSize;
|
|
385
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [render(items.slice(start, start + pageSize)), items.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
386
|
+
className: "dsh-billing-pagination",
|
|
387
|
+
"aria-label": t("billing.pagination"),
|
|
388
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("billing.pageRange", {
|
|
389
|
+
from: start + 1,
|
|
390
|
+
to: Math.min(start + pageSize, items.length),
|
|
391
|
+
count: items.length
|
|
392
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
393
|
+
className: "dsh-billing-pagination-actions",
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dropdown, {
|
|
396
|
+
label: t("billing.pageSize"),
|
|
397
|
+
value: size,
|
|
398
|
+
onChange: (value) => {
|
|
399
|
+
setSize(value);
|
|
400
|
+
setPage(0);
|
|
401
|
+
},
|
|
402
|
+
options: [
|
|
403
|
+
"5",
|
|
404
|
+
"10",
|
|
405
|
+
"20"
|
|
406
|
+
].map((value) => ({
|
|
407
|
+
value,
|
|
408
|
+
label: t("billing.perPage", { count: value })
|
|
409
|
+
}))
|
|
410
|
+
}),
|
|
411
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
412
|
+
className: "dsh-billing-page-button",
|
|
413
|
+
type: "button",
|
|
414
|
+
disabled: currentPage === 0,
|
|
415
|
+
"aria-label": t("billing.previousPage"),
|
|
416
|
+
onClick: () => setPage(currentPage - 1),
|
|
417
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
418
|
+
width: "16",
|
|
419
|
+
height: "16",
|
|
420
|
+
viewBox: "0 0 16 16",
|
|
421
|
+
fill: "none",
|
|
422
|
+
stroke: "currentColor",
|
|
423
|
+
strokeWidth: "1.5",
|
|
424
|
+
"aria-hidden": "true",
|
|
425
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m10 4-4 4 4 4" })
|
|
426
|
+
})
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
429
|
+
className: "dsh-billing-page-button",
|
|
430
|
+
type: "button",
|
|
431
|
+
disabled: currentPage === lastPage,
|
|
432
|
+
"aria-label": t("billing.nextPage"),
|
|
433
|
+
onClick: () => setPage(currentPage + 1),
|
|
434
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
435
|
+
width: "16",
|
|
436
|
+
height: "16",
|
|
437
|
+
viewBox: "0 0 16 16",
|
|
438
|
+
fill: "none",
|
|
439
|
+
stroke: "currentColor",
|
|
440
|
+
strokeWidth: "1.5",
|
|
441
|
+
"aria-hidden": "true",
|
|
442
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m6 4 4 4-4 4" })
|
|
443
|
+
})
|
|
444
|
+
})
|
|
445
|
+
]
|
|
446
|
+
})]
|
|
447
|
+
}) : null] });
|
|
448
|
+
}
|
|
449
|
+
//#endregion
|
|
307
450
|
//#region src/client/format.ts
|
|
308
451
|
function formatClockTime(date, locale) {
|
|
309
452
|
return new Intl.DateTimeFormat(locale, {
|
|
@@ -448,32 +591,58 @@ window.__ModuleLoader__.load({
|
|
|
448
591
|
});
|
|
449
592
|
}
|
|
450
593
|
function TotalsCaption({ totals, t }) {
|
|
451
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
452
|
-
className: "dsh-billing-
|
|
453
|
-
children:
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
594
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
595
|
+
className: "dsh-billing-token-caption",
|
|
596
|
+
children: [
|
|
597
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
598
|
+
t("billing.inputShort"),
|
|
599
|
+
" ",
|
|
600
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: formatTokens(totals.inputTokens) })
|
|
601
|
+
] }),
|
|
602
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
603
|
+
t("billing.outputShort"),
|
|
604
|
+
" ",
|
|
605
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: formatTokens(totals.outputTokens) })
|
|
606
|
+
] }),
|
|
607
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
608
|
+
t("billing.cacheReadShort"),
|
|
609
|
+
" ",
|
|
610
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: formatTokens(totals.cacheReadTokens) })
|
|
611
|
+
] }),
|
|
612
|
+
totals.cacheWriteTokens > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
613
|
+
t("billing.cacheWriteShort"),
|
|
614
|
+
" ",
|
|
615
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: formatTokens(totals.cacheWriteTokens) })
|
|
616
|
+
] }) : null
|
|
617
|
+
]
|
|
459
618
|
});
|
|
460
619
|
}
|
|
461
|
-
function ModelRows({ summary, t }) {
|
|
620
|
+
function ModelRows({ summary, items = summary.byModel, t }) {
|
|
462
621
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
463
622
|
className: "dsh-billing-list",
|
|
464
|
-
children:
|
|
623
|
+
children: items.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
465
624
|
className: "dsh-balance-status",
|
|
466
625
|
children: t("billing.empty")
|
|
467
|
-
}) :
|
|
626
|
+
}) : items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
468
627
|
className: "dsh-billing-list-row",
|
|
469
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
470
|
-
|
|
471
|
-
"
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
628
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
629
|
+
className: "dsh-billing-row-main",
|
|
630
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
631
|
+
className: "dsh-billing-row-title",
|
|
632
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
633
|
+
className: "dsh-billing-name",
|
|
634
|
+
title: item.model,
|
|
635
|
+
children: item.model
|
|
636
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
637
|
+
className: "dsh-billing-provider-tag",
|
|
638
|
+
title: item.provider,
|
|
639
|
+
children: findBalanceProvider(item.provider)?.name ?? item.provider
|
|
640
|
+
})]
|
|
641
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TotalsCaption, {
|
|
642
|
+
totals: item,
|
|
643
|
+
t
|
|
644
|
+
})]
|
|
645
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
477
646
|
className: "dsh-billing-list-value",
|
|
478
647
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CostLabel, {
|
|
479
648
|
totals: item,
|
|
@@ -483,99 +652,141 @@ window.__ModuleLoader__.load({
|
|
|
483
652
|
}, JSON.stringify([item.provider, item.model])))
|
|
484
653
|
});
|
|
485
654
|
}
|
|
486
|
-
function
|
|
655
|
+
function AggregateRows({ items, t }) {
|
|
487
656
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
488
657
|
className: "dsh-billing-list",
|
|
489
|
-
children:
|
|
658
|
+
children: items.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
490
659
|
className: "dsh-balance-status",
|
|
491
660
|
children: t("billing.empty")
|
|
492
|
-
}) :
|
|
661
|
+
}) : items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
493
662
|
className: "dsh-billing-list-row",
|
|
494
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
495
|
-
className: "dsh-billing-
|
|
496
|
-
children:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
663
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
664
|
+
className: "dsh-billing-row-main",
|
|
665
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
666
|
+
className: "dsh-billing-session-title",
|
|
667
|
+
title: item.title,
|
|
668
|
+
children: item.title
|
|
669
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TotalsCaption, {
|
|
670
|
+
totals: item.totals,
|
|
671
|
+
t
|
|
672
|
+
})]
|
|
673
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
501
674
|
className: "dsh-billing-list-value",
|
|
502
675
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CostLabel, {
|
|
503
|
-
totals: item,
|
|
676
|
+
totals: item.totals,
|
|
504
677
|
t
|
|
505
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t("billing.requestCount", { count: item.requests }) })]
|
|
678
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t("billing.requestCount", { count: item.totals.requests }) })]
|
|
506
679
|
})]
|
|
507
|
-
}, item.
|
|
680
|
+
}, item.key))
|
|
508
681
|
});
|
|
509
682
|
}
|
|
510
683
|
function UsageTables({ summary, t }) {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
559
|
-
className: "dsh-billing-list",
|
|
560
|
-
children: summary.byDay.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
561
|
-
className: "dsh-billing-list-row",
|
|
562
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
563
|
-
className: "dsh-billing-session-title",
|
|
564
|
-
children: item.date
|
|
565
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TotalsCaption, {
|
|
566
|
-
totals: item,
|
|
567
|
-
t
|
|
568
|
-
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
569
|
-
className: "dsh-billing-list-value",
|
|
570
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CostLabel, {
|
|
571
|
-
totals: item,
|
|
572
|
-
t
|
|
573
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t("billing.requestCount", { count: item.requests }) })]
|
|
574
|
-
})]
|
|
575
|
-
}, item.date))
|
|
576
|
-
})]
|
|
684
|
+
const [category, setCategory] = (0, react.useState)("model");
|
|
685
|
+
const rows = category === "provider" ? summary.byProvider.map((item) => ({
|
|
686
|
+
key: item.provider,
|
|
687
|
+
title: findBalanceProvider(item.provider)?.name ?? item.provider,
|
|
688
|
+
totals: item
|
|
689
|
+
})) : category === "session" ? summary.bySession.map((item) => ({
|
|
690
|
+
key: item.sessionId,
|
|
691
|
+
title: item.title,
|
|
692
|
+
totals: item
|
|
693
|
+
})) : summary.byDay.map((item) => ({
|
|
694
|
+
key: item.date,
|
|
695
|
+
title: item.date,
|
|
696
|
+
totals: item
|
|
697
|
+
}));
|
|
698
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailPanel, {
|
|
699
|
+
label: t("billing.categories"),
|
|
700
|
+
value: category,
|
|
701
|
+
onChange: setCategory,
|
|
702
|
+
tabs: [
|
|
703
|
+
{
|
|
704
|
+
value: "model",
|
|
705
|
+
label: t("billing.modelsLabel"),
|
|
706
|
+
count: summary.byModel.length
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
value: "provider",
|
|
710
|
+
label: t("billing.providersLabel"),
|
|
711
|
+
count: summary.byProvider.length
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
value: "session",
|
|
715
|
+
label: t("billing.sessionsLabel"),
|
|
716
|
+
count: summary.bySession.length
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
value: "day",
|
|
720
|
+
label: t("billing.daysLabel"),
|
|
721
|
+
count: summary.byDay.length
|
|
722
|
+
}
|
|
723
|
+
],
|
|
724
|
+
children: category === "model" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PagedRows, {
|
|
725
|
+
items: summary.byModel,
|
|
726
|
+
t,
|
|
727
|
+
render: (items) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelRows, {
|
|
728
|
+
items,
|
|
729
|
+
summary,
|
|
730
|
+
t
|
|
577
731
|
})
|
|
578
|
-
|
|
732
|
+
}, "model") : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PagedRows, {
|
|
733
|
+
items: rows,
|
|
734
|
+
t,
|
|
735
|
+
render: (items) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AggregateRows, {
|
|
736
|
+
items,
|
|
737
|
+
t
|
|
738
|
+
})
|
|
739
|
+
}, category)
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
function SessionDetails({ result, t }) {
|
|
743
|
+
const [category, setCategory] = (0, react.useState)("model");
|
|
744
|
+
const [model, setModel] = (0, react.useState)("");
|
|
745
|
+
const modelKey = (request) => JSON.stringify([request.provider ?? "", request.model ?? ""]);
|
|
746
|
+
const models = [...new Map(result.requests.map((request) => [modelKey(request), `${request.provider ?? "?"} / ${request.model ?? t("billing.unknownModel")}`])).entries()];
|
|
747
|
+
const selectedModel = models.some(([key]) => key === model) ? model : "";
|
|
748
|
+
const requests = selectedModel === "" ? result.requests : result.requests.filter((request) => modelKey(request) === selectedModel);
|
|
749
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DetailPanel, {
|
|
750
|
+
label: t("billing.sessionDetails"),
|
|
751
|
+
value: category,
|
|
752
|
+
onChange: setCategory,
|
|
753
|
+
tabs: [{
|
|
754
|
+
value: "model",
|
|
755
|
+
label: t("billing.modelsLabel"),
|
|
756
|
+
count: result.summary.byModel.length
|
|
757
|
+
}, {
|
|
758
|
+
value: "request",
|
|
759
|
+
label: t("billing.requestDetails"),
|
|
760
|
+
count: result.requests.length
|
|
761
|
+
}],
|
|
762
|
+
toolbar: category === "request" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dropdown, {
|
|
763
|
+
label: t("billing.filterModel"),
|
|
764
|
+
value: selectedModel,
|
|
765
|
+
onChange: setModel,
|
|
766
|
+
options: [{
|
|
767
|
+
value: "",
|
|
768
|
+
label: t("billing.allModels")
|
|
769
|
+
}, ...models.map(([value, label]) => ({
|
|
770
|
+
value,
|
|
771
|
+
label
|
|
772
|
+
}))]
|
|
773
|
+
}) : void 0,
|
|
774
|
+
children: category === "model" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PagedRows, {
|
|
775
|
+
items: result.summary.byModel,
|
|
776
|
+
t,
|
|
777
|
+
render: (items) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelRows, {
|
|
778
|
+
items,
|
|
779
|
+
summary: result.summary,
|
|
780
|
+
t
|
|
781
|
+
})
|
|
782
|
+
}, "model") : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PagedRows, {
|
|
783
|
+
items: requests,
|
|
784
|
+
t,
|
|
785
|
+
render: (items) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RequestRows, {
|
|
786
|
+
requests: items,
|
|
787
|
+
t
|
|
788
|
+
})
|
|
789
|
+
}, `request:${selectedModel}`)
|
|
579
790
|
});
|
|
580
791
|
}
|
|
581
792
|
function RequestRows({ requests, t }) {
|
|
@@ -585,24 +796,25 @@ window.__ModuleLoader__.load({
|
|
|
585
796
|
children: requests.map((request) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
586
797
|
className: "dsh-billing-request-row",
|
|
587
798
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
588
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
589
|
-
|
|
590
|
-
request.
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
799
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
800
|
+
className: "dsh-billing-request-meta",
|
|
801
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: new Date(request.time).toLocaleString(locale) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
802
|
+
className: "dsh-billing-provider-tag",
|
|
803
|
+
children: request.provider ?? "?"
|
|
804
|
+
})]
|
|
805
|
+
}),
|
|
806
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
807
|
+
className: "dsh-billing-name",
|
|
808
|
+
title: `${request.provider ?? "?"} / ${request.model ?? t("billing.unknownModel")}`,
|
|
809
|
+
children: request.model ?? t("billing.unknownModel")
|
|
810
|
+
}),
|
|
594
811
|
request.unknownReason !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", {
|
|
595
812
|
className: "dsh-billing-secondary",
|
|
596
813
|
children: t(`billing.reason.${request.unknownReason}`)
|
|
597
814
|
}) : null
|
|
598
|
-
] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
input: formatTokens(request.inputTokens),
|
|
602
|
-
output: formatTokens(request.outputTokens),
|
|
603
|
-
cacheHit: formatTokens(request.cacheReadTokens),
|
|
604
|
-
cacheWrite: formatTokens(request.cacheWriteTokens)
|
|
605
|
-
})
|
|
815
|
+
] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TotalsCaption, {
|
|
816
|
+
totals: request,
|
|
817
|
+
t
|
|
606
818
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: request.costCny !== void 0 ? amount(request.costCny, "CNY", locale) : request.costUsd === null ? t("billing.notPriced") : amount(request.costUsd, "USD", locale) })] })]
|
|
607
819
|
}, request.seq))
|
|
608
820
|
});
|
|
@@ -774,6 +986,11 @@ window.__ModuleLoader__.load({
|
|
|
774
986
|
result,
|
|
775
987
|
t
|
|
776
988
|
}) : null,
|
|
989
|
+
result?.ok === true && result.scope === "all" && (result.coverage?.skippedSessions ?? 0) > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
990
|
+
className: "dsh-balance-status dsh-billing-coverage",
|
|
991
|
+
role: "status",
|
|
992
|
+
children: t("billing.skippedSessions", { count: result.coverage.skippedSessions })
|
|
993
|
+
}) : null,
|
|
777
994
|
result?.ok === true && result.scope === "all" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
778
995
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SummaryCards, {
|
|
779
996
|
summary: result.summary,
|
|
@@ -848,20 +1065,10 @@ window.__ModuleLoader__.load({
|
|
|
848
1065
|
className: "dsh-balance-meta",
|
|
849
1066
|
children: t("billing.estimate")
|
|
850
1067
|
}),
|
|
851
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
t
|
|
856
|
-
})]
|
|
857
|
-
}),
|
|
858
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
859
|
-
className: "dsh-billing-session-breakdown",
|
|
860
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: t("billing.requestDetails") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RequestRows, {
|
|
861
|
-
requests: sessionResult.requests,
|
|
862
|
-
t
|
|
863
|
-
})]
|
|
864
|
-
}),
|
|
1068
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionDetails, {
|
|
1069
|
+
result: sessionResult,
|
|
1070
|
+
t
|
|
1071
|
+
}, sessionId),
|
|
865
1072
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
866
1073
|
className: "dsh-balance-meta",
|
|
867
1074
|
children: [t("meta.updated", { time: new Date(sessionResult.fetchedAt).toLocaleString(t("locale.tag")) }), sessionResult.source === "cache" ? t("meta.cached") : ""]
|
|
@@ -1201,6 +1408,24 @@ window.__ModuleLoader__.load({
|
|
|
1201
1408
|
"billing.fixedRate": "固定汇率换算",
|
|
1202
1409
|
"billing.tokensBreakdown": "未缓存输入 {input} · 输出 {output} · 缓存读取 {cacheHit} · 缓存写入 {cacheWrite}",
|
|
1203
1410
|
"billing.byModel": "按模型",
|
|
1411
|
+
"billing.categories": "分类明细",
|
|
1412
|
+
"billing.sessionDetails": "会话明细",
|
|
1413
|
+
"billing.modelsLabel": "模型",
|
|
1414
|
+
"billing.providersLabel": "提供方",
|
|
1415
|
+
"billing.sessionsLabel": "会话",
|
|
1416
|
+
"billing.daysLabel": "日期",
|
|
1417
|
+
"billing.inputShort": "输入",
|
|
1418
|
+
"billing.outputShort": "输出",
|
|
1419
|
+
"billing.cacheReadShort": "缓存读取",
|
|
1420
|
+
"billing.cacheWriteShort": "缓存写入",
|
|
1421
|
+
"billing.filterModel": "筛选模型",
|
|
1422
|
+
"billing.allModels": "全部模型",
|
|
1423
|
+
"billing.pagination": "明细分页",
|
|
1424
|
+
"billing.pageSize": "每页条数",
|
|
1425
|
+
"billing.perPage": "每页 {count} 条",
|
|
1426
|
+
"billing.pageRange": "{from}–{to} / 共 {count} 条",
|
|
1427
|
+
"billing.previousPage": "上一页",
|
|
1428
|
+
"billing.nextPage": "下一页",
|
|
1204
1429
|
"billing.bySession": "按会话",
|
|
1205
1430
|
"billing.byDay": "按日期",
|
|
1206
1431
|
"billing.sessionTitle": "当前会话消费",
|
|
@@ -1212,6 +1437,7 @@ window.__ModuleLoader__.load({
|
|
|
1212
1437
|
"billing.partial": "仅包含已知价格的请求",
|
|
1213
1438
|
"billing.nativeCny": "人民币计价",
|
|
1214
1439
|
"billing.estimate": "费用按公开标准价估算,实际账单可能包含套餐、折扣或历史价格调整。",
|
|
1440
|
+
"billing.skippedSessions": "有 {count} 个会话暂无法读取,以下统计不包含这些会话。",
|
|
1215
1441
|
"billing.reason.missing-usage": "缺少 provider usage",
|
|
1216
1442
|
"billing.reason.unknown-provider": "未知 provider",
|
|
1217
1443
|
"billing.reason.unknown-model": "未知模型价格",
|
|
@@ -1316,6 +1542,24 @@ window.__ModuleLoader__.load({
|
|
|
1316
1542
|
"billing.fixedRate": "fixed-rate conversion",
|
|
1317
1543
|
"billing.tokensBreakdown": "Uncached input {input} · Output {output} · Cache read {cacheHit} · Cache write {cacheWrite}",
|
|
1318
1544
|
"billing.byModel": "By model",
|
|
1545
|
+
"billing.categories": "Usage breakdown",
|
|
1546
|
+
"billing.sessionDetails": "Session details",
|
|
1547
|
+
"billing.modelsLabel": "Models",
|
|
1548
|
+
"billing.providersLabel": "Providers",
|
|
1549
|
+
"billing.sessionsLabel": "Sessions",
|
|
1550
|
+
"billing.daysLabel": "Dates",
|
|
1551
|
+
"billing.inputShort": "Input",
|
|
1552
|
+
"billing.outputShort": "Output",
|
|
1553
|
+
"billing.cacheReadShort": "Cache read",
|
|
1554
|
+
"billing.cacheWriteShort": "Cache write",
|
|
1555
|
+
"billing.filterModel": "Filter models",
|
|
1556
|
+
"billing.allModels": "All models",
|
|
1557
|
+
"billing.pagination": "Detail pagination",
|
|
1558
|
+
"billing.pageSize": "Rows per page",
|
|
1559
|
+
"billing.perPage": "{count} per page",
|
|
1560
|
+
"billing.pageRange": "{from}–{to} of {count}",
|
|
1561
|
+
"billing.previousPage": "Previous page",
|
|
1562
|
+
"billing.nextPage": "Next page",
|
|
1319
1563
|
"billing.bySession": "By session",
|
|
1320
1564
|
"billing.byDay": "By day",
|
|
1321
1565
|
"billing.sessionTitle": "Current session usage",
|
|
@@ -1327,6 +1571,7 @@ window.__ModuleLoader__.load({
|
|
|
1327
1571
|
"billing.partial": "Requests with known pricing only",
|
|
1328
1572
|
"billing.nativeCny": "Billed in CNY",
|
|
1329
1573
|
"billing.estimate": "Costs use published standard rates; actual bills may include plans, discounts or historical price changes.",
|
|
1574
|
+
"billing.skippedSessions": "{count} sessions could not be read. The statistics below exclude these sessions.",
|
|
1330
1575
|
"billing.reason.missing-usage": "Provider usage is missing",
|
|
1331
1576
|
"billing.reason.unknown-provider": "Unknown provider",
|
|
1332
1577
|
"billing.reason.unknown-model": "Unknown model pricing",
|
|
@@ -1701,6 +1946,7 @@ window.__ModuleLoader__.load({
|
|
|
1701
1946
|
.dsh-balance-refresh:focus-visible, .dsh-provider-switch button:focus-visible, .dsh-usage-select:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary, #4d6bfe); outline-offset: 2px; }
|
|
1702
1947
|
.dsh-balance-status, .dsh-balance-error { margin: 0; border: 1px solid var(--ledger-line); border-radius: var(--dsw-radius-lg, 12px); padding: 20px; background: var(--ledger-paper); color: var(--ledger-muted); font-size: 13px; line-height: 1.6; }
|
|
1703
1948
|
.dsh-balance-error { border-left: 3px solid var(--dsw-alias-state-error-primary, #c33); }
|
|
1949
|
+
.dsh-billing-coverage { border-left: 3px solid var(--dsw-alias-state-warn-primary, #d99525); }
|
|
1704
1950
|
.dsh-balance-error strong { color: var(--dsw-alias-state-error-primary, #c33); }
|
|
1705
1951
|
.dsh-balance-error p { margin: 10px 0 0; }
|
|
1706
1952
|
.dsh-balance-availability { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ledger-muted); }
|
|
@@ -1720,23 +1966,25 @@ window.__ModuleLoader__.load({
|
|
|
1720
1966
|
.dsh-balance-skeleton { min-height: 180px; display: flex; flex-direction: column; gap: 24px; padding: 20px; border: 1px solid var(--ledger-line); border-radius: 12px; background: var(--ledger-paper); font-size: 12px; color: var(--ledger-muted); }
|
|
1721
1967
|
.dsh-balance-skeleton i { width: 60%; height: 32px; border-radius: 4px; background: var(--ledger-line); }
|
|
1722
1968
|
.dsh-balance-skeleton i:last-child { width: 35%; height: 16px; }
|
|
1723
|
-
@container (max-width: 700px) { .dsh-billing-card-grid
|
|
1969
|
+
@container (max-width: 700px) { .dsh-billing-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
|
|
1724
1970
|
@container (max-width: 480px) {
|
|
1725
1971
|
.dsh-billing-request-row { align-items: flex-start; flex-direction: column; }
|
|
1726
1972
|
.dsh-billing-request-row > div:last-child { align-items: flex-start; text-align: left; }
|
|
1727
|
-
.dsh-billing-card-grid, .dsh-
|
|
1973
|
+
.dsh-billing-card-grid, .dsh-model-grid { grid-template-columns: 1fr !important; }
|
|
1728
1974
|
.dsh-billing-list-row { flex-wrap: wrap; }
|
|
1729
1975
|
.dsh-billing-list-value { text-align: left; align-items: flex-start; }
|
|
1730
1976
|
}
|
|
1731
1977
|
.dsh-billing-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
|
|
1732
1978
|
.dsh-usage-select { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; padding: 6px 12px; border: 1px solid var(--dsw-alias-border-l2, #e3e4e7); border-radius: var(--dsw-radius-md, 8px); background: var(--dsw-alias-bg-layer-3, #fafafa); color: var(--dsw-alias-label-primary, #202124); font: inherit; font-size: 13px; cursor: pointer; }
|
|
1733
1979
|
.dsh-usage-select:hover, .dsh-usage-select[aria-expanded='true'] { background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 6%, transparent)); }
|
|
1980
|
+
.dsh-usage-select { min-width: 0; max-width: 100%; }
|
|
1981
|
+
.dsh-usage-select > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1734
1982
|
.dsh-usage-select svg { flex: none; color: var(--dsw-alias-label-tertiary, #8b8e94); transition: transform .15s ease; }
|
|
1735
1983
|
.dsh-usage-select[aria-expanded='true'] svg { transform: rotate(180deg); }
|
|
1736
1984
|
.dsh-usage-select:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary, #4d6bfe); outline-offset: 2px; }
|
|
1737
1985
|
.dsh-usage-select-menu { position: fixed; z-index: 1100; padding: 6px; box-sizing: border-box; border: 1px solid var(--dsw-alias-border-l2, #e3e4e7); border-radius: var(--dsw-radius-lg, 12px); background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-3, #fafafa)); color: var(--dsw-alias-label-primary, #202124); box-shadow: var(--dsw-elevation-prominent, 0 8px 32px #0002); backdrop-filter: var(--dsw-menu-backdrop-filter, none); overflow-y: auto; overscroll-behavior: contain; font-family: inherit; }
|
|
1738
1986
|
.dsh-usage-select-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; box-sizing: border-box; border-radius: var(--dsw-radius-md, 8px); padding: 6px 10px; font-size: 13px; line-height: 24px; cursor: pointer; }
|
|
1739
|
-
.dsh-usage-select-option > span { min-width: 0; overflow-wrap: anywhere; }
|
|
1987
|
+
.dsh-usage-select-option > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; overflow: hidden; overflow-wrap: anywhere; line-height: 20px; }
|
|
1740
1988
|
.dsh-usage-select-option svg { flex: none; }
|
|
1741
1989
|
.dsh-usage-select-option[data-active='true'] { background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 6%, transparent)); }
|
|
1742
1990
|
.dsh-usage-select-option[aria-selected='true'] { font-weight: 500; }
|
|
@@ -1778,17 +2026,6 @@ window.__ModuleLoader__.load({
|
|
|
1778
2026
|
.dsh-billing-cost-value { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
|
|
1779
2027
|
.dsh-billing-cost-value strong { font-size: 20px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
|
|
1780
2028
|
.dsh-billing-cost-value small, .dsh-billing-cost-value span { color: var(--dsw-alias-label-tertiary); font-size: 11px; line-height: 1.35; }
|
|
1781
|
-
.dsh-billing-table-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
|
|
1782
|
-
.dsh-billing-list-section {
|
|
1783
|
-
min-width: 0;
|
|
1784
|
-
border: 1px solid var(--dsw-alias-border-l2);
|
|
1785
|
-
border-radius: 12px;
|
|
1786
|
-
padding: 16px;
|
|
1787
|
-
background: var(--dsw-alias-bg-layer-3);
|
|
1788
|
-
}
|
|
1789
|
-
.dsh-billing-list-section h3,
|
|
1790
|
-
.dsh-billing-session-breakdown h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
|
|
1791
|
-
.dsh-billing-list-wide { grid-column: 1 / -1; }
|
|
1792
2029
|
.dsh-billing-list { display: flex; flex-direction: column; gap: 2px; }
|
|
1793
2030
|
.dsh-billing-list-row {
|
|
1794
2031
|
display: flex;
|
|
@@ -1807,7 +2044,6 @@ window.__ModuleLoader__.load({
|
|
|
1807
2044
|
.dsh-billing-list-value .dsh-billing-cost-value strong { font-size: 16px; overflow-wrap: anywhere; }
|
|
1808
2045
|
.dsh-billing-list-value > small { color: var(--dsw-alias-label-tertiary); font-size: 11px; }
|
|
1809
2046
|
.dsh-billing-session-title { overflow: hidden; color: var(--dsw-alias-label-primary); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
|
|
1810
|
-
.dsh-billing-session-breakdown { border: 1px solid var(--dsw-alias-border-l2); border-radius: 12px; padding: 16px; background: var(--dsw-alias-bg-layer-3); }
|
|
1811
2047
|
.dsh-billing-request-list { display: flex; flex-direction: column; }
|
|
1812
2048
|
.dsh-billing-request-row {
|
|
1813
2049
|
display: flex;
|
|
@@ -1824,6 +2060,51 @@ window.__ModuleLoader__.load({
|
|
|
1824
2060
|
.dsh-billing-request-row span { color: var(--dsw-alias-label-tertiary); }
|
|
1825
2061
|
.dsh-billing-request-row code { color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }
|
|
1826
2062
|
.dsh-billing-request-row strong { font-variant-numeric: tabular-nums; }
|
|
2063
|
+
.dsh-billing-detail-panel { min-width: 0; border: 1px solid var(--ledger-line); border-radius: var(--dsw-radius-lg, 12px); background: var(--ledger-paper); }
|
|
2064
|
+
.dsh-billing-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--ledger-line); }
|
|
2065
|
+
.dsh-billing-detail-tabs { display: flex; gap: 20px; min-width: 0; }
|
|
2066
|
+
.dsh-billing-detail-tabs > button { display: inline-flex; align-items: center; gap: 7px; min-height: 54px; margin-bottom: -1px; padding: 10px 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ledger-muted); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
|
|
2067
|
+
.dsh-billing-detail-tabs > button:hover { color: var(--ledger-ink); }
|
|
2068
|
+
.dsh-billing-detail-tabs > button[aria-selected='true'] { border-bottom-color: var(--dsw-alias-state-business-primary, #4d6bfe); color: var(--dsw-alias-state-business-primary, #4d6bfe); font-weight: 600; }
|
|
2069
|
+
.dsh-billing-tab-count { min-width: 19px; padding: 2px 5px; border-radius: 5px; background: var(--dsw-alias-interactive-bg-hover, #00000006); color: var(--ledger-muted); font-size: 10px; line-height: 1.4; font-variant-numeric: tabular-nums; }
|
|
2070
|
+
.dsh-billing-detail-tabs > button[aria-selected='true'] .dsh-billing-tab-count { color: inherit; background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #4d6bfe) 8%, transparent); }
|
|
2071
|
+
.dsh-billing-detail-mobile { display: none; min-width: 0; }
|
|
2072
|
+
.dsh-billing-detail-tools { display: flex; min-width: 0; max-width: 300px; }
|
|
2073
|
+
.dsh-billing-detail-body { min-width: 0; padding: 4px 16px 0; border-radius: 0 0 12px 12px; }
|
|
2074
|
+
.dsh-billing-detail-body:focus-visible, .dsh-billing-detail-tabs > button:focus-visible, .dsh-billing-page-button:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary, #4d6bfe); outline-offset: 2px; }
|
|
2075
|
+
.dsh-billing-detail-body .dsh-balance-status { border: 0; background: transparent; padding: 32px 12px; text-align: center; }
|
|
2076
|
+
.dsh-billing-list-row > div:first-child, .dsh-billing-request-row > div:first-child { flex: 1; min-width: 0; }
|
|
2077
|
+
.dsh-billing-row-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
2078
|
+
.dsh-billing-list-row .dsh-billing-name, .dsh-billing-request-row .dsh-billing-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2079
|
+
.dsh-billing-provider-tag { flex: none; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 6px; border-radius: 4px; background: var(--dsw-alias-interactive-bg-hover, #00000006); color: var(--ledger-muted); font-size: 10px; line-height: 1.4; }
|
|
2080
|
+
.dsh-billing-token-caption { display: flex; gap: 4px 14px; flex-wrap: wrap; color: var(--ledger-muted); font-size: 11px; line-height: 1.6; }
|
|
2081
|
+
.dsh-billing-token-caption > span { white-space: nowrap; }
|
|
2082
|
+
.dsh-billing-token-caption b { font-weight: 400; font-variant-numeric: tabular-nums; }
|
|
2083
|
+
.dsh-billing-request-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
2084
|
+
.dsh-billing-request-row > div:last-child { flex: 0 1 50%; }
|
|
2085
|
+
.dsh-billing-request-row > div:last-child .dsh-billing-token-caption { justify-content: flex-end; }
|
|
2086
|
+
.dsh-billing-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 12px 0; border-top: 1px solid var(--ledger-line); color: var(--ledger-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
|
|
2087
|
+
.dsh-billing-pagination-actions { display: flex; align-items: center; gap: 6px; }
|
|
2088
|
+
.dsh-billing-pagination-actions .dsh-usage-select { min-height: 30px; font-size: 11px; }
|
|
2089
|
+
.dsh-billing-page-button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid var(--ledger-line); border-radius: var(--dsw-radius-md, 8px); background: transparent; color: var(--ledger-ink); cursor: pointer; }
|
|
2090
|
+
.dsh-billing-page-button:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover, #00000006); }
|
|
2091
|
+
.dsh-billing-page-button:disabled { opacity: .35; cursor: default; }
|
|
2092
|
+
@container (max-width: 560px) {
|
|
2093
|
+
.dsh-billing-detail-tabs { display: none; }
|
|
2094
|
+
.dsh-billing-detail-mobile { display: block; flex: 1; }
|
|
2095
|
+
.dsh-billing-detail-mobile .dsh-usage-select { width: 100%; }
|
|
2096
|
+
.dsh-billing-detail-header { padding: 12px; flex-wrap: wrap; }
|
|
2097
|
+
.dsh-billing-detail-tools { flex: 1; max-width: 100%; }
|
|
2098
|
+
.dsh-billing-detail-tools .dsh-usage-select { width: 100%; }
|
|
2099
|
+
}
|
|
2100
|
+
@container (max-width: 480px) {
|
|
2101
|
+
.dsh-billing-list-row { gap: 8px; }
|
|
2102
|
+
.dsh-billing-list-row > div:first-child { flex-basis: 100%; }
|
|
2103
|
+
.dsh-billing-request-row > div:first-child, .dsh-billing-request-row > div:last-child { flex: none; width: 100%; }
|
|
2104
|
+
.dsh-billing-request-row > div:last-child .dsh-billing-token-caption { justify-content: flex-start; }
|
|
2105
|
+
.dsh-billing-detail-body { padding-inline: 12px; }
|
|
2106
|
+
.dsh-billing-pagination-actions { margin-left: auto; }
|
|
2107
|
+
}
|
|
1827
2108
|
.dsh-model-count { display: flex; align-items: center; gap: 8px; font-size: 13px; }
|
|
1828
2109
|
.dsh-model-count .dsh-balance-dot { background: var(--dsw-alias-state-success-primary); }
|
|
1829
2110
|
.dsh-model-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
|