dsh-usage-overview 1.1.2 → 1.1.4

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.en.md CHANGED
@@ -27,10 +27,6 @@ cache-hit-rate trends, and a per-model breakdown with a stacked day/week chart.
27
27
  - **Light and dark themes** — colours come from DSH theme tokens, including the
28
28
  tooltip's own dark-surface label token.
29
29
 
30
- | Desktop | Phone (390px) |
31
- |---|---|
32
- | ![Desktop](docs/dashboard.png) | ![Phone](docs/dashboard-mobile.png) |
33
-
34
30
  ## Install
35
31
 
36
32
  The plugin is a DSH bundle. It needs a harness build that provides the
package/README.md CHANGED
@@ -21,10 +21,6 @@
21
21
  和图表都会随可用空间连续调整。
22
22
  - **浅色/深色主题**:颜色来自 DSH 主题 Token;提示气泡使用自身深色表面的专用前景色。
23
23
 
24
- | 桌面 | 手机(390px) |
25
- |---|---|
26
- | ![桌面](docs/dashboard.png) | ![手机](docs/dashboard-mobile.png) |
27
-
28
24
  ## 安装
29
25
 
30
26
  本插件是一个 DSH Bundle,需要宿主提供 `webServer` 服务。
package/lib/client.js CHANGED
@@ -410,7 +410,6 @@ window.__ModuleLoader__.load({
410
410
  h(
411
411
  'div',
412
412
  { className: 'dus-heat-legend' },
413
- scrollable ? h('span', { className: 'dus-heat-hint' }, '← 左右滑动 →') : null,
414
413
  h('span', null, '少'),
415
414
  ...[0, 1, 2, 3, 4].map((level) =>
416
415
  h('div', { key: `l-${String(level)}`, className: 'dus-heat-cell', 'data-level': String(level), style: { width: '10px', height: '10px' } }),
@@ -1170,7 +1169,6 @@ window.__ModuleLoader__.load({
1170
1169
  'div',
1171
1170
  { className: 'dus-bars-heading' },
1172
1171
  h('h3', { className: 'dus-bars-title' }, '各模型用量趋势'),
1173
- h('span', { className: 'dus-bars-note' }, '堆叠高度 = Token 总量 · 颜色对应上方模型'),
1174
1172
  ),
1175
1173
  h(
1176
1174
  'div',
@@ -1331,6 +1329,14 @@ window.__ModuleLoader__.load({
1331
1329
 
1332
1330
  const POLL_INTERVAL_MS = 30000;
1333
1331
 
1332
+ // Headline stat cards show two decimal places (e.g. 53.80亿).
1333
+ function formatStatTokens(value) {
1334
+ if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) return '—';
1335
+ if (value < 10000) return String(Math.round(value));
1336
+ if (value < 100000000) return `${(value / 10000).toFixed(2)}万`;
1337
+ return `${(value / 100000000).toFixed(2)}亿`;
1338
+ }
1339
+
1334
1340
  async function fetchUsage({ range, signal }) {
1335
1341
  const query = range === null ? 'all' : range;
1336
1342
  const response = await fetch(`${USAGE_STATS_PATH}?range=${encodeURIComponent(query)}`, {
@@ -1578,9 +1584,9 @@ window.__ModuleLoader__.load({
1578
1584
  h(
1579
1585
  'div',
1580
1586
  { className: 'dus-cards', key: 'cards' },
1581
- h(StatCard, { value: formatTokensZh(document_?.totals.total ?? 0), label: '累计 Token 数' }),
1587
+ h(StatCard, { value: formatStatTokens(document_?.totals.total ?? 0), label: '累计 Token 数' }),
1582
1588
  h(StatCard, {
1583
- value: formatTokensZh(document_?.totals.peakDayTokens ?? 0),
1589
+ value: formatStatTokens(document_?.totals.peakDayTokens ?? 0),
1584
1590
  label: '单日峰值 Token 数',
1585
1591
  title:
1586
1592
  document_?.totals.peakDay == null
@@ -1588,7 +1594,7 @@ window.__ModuleLoader__.load({
1588
1594
  : `用量最高的一天:${document_.totals.peakDay}`,
1589
1595
  }),
1590
1596
  h(StatCard, {
1591
- value: formatTokensZh(document_?.totals.averageTokensPerActiveDay ?? 0),
1597
+ value: formatStatTokens(document_?.totals.averageTokensPerActiveDay ?? 0),
1592
1598
  label: '日均 Token 数',
1593
1599
  title:
1594
1600
  (document_?.totals.activeDays ?? 0) > 0
@@ -1668,8 +1674,6 @@ window.__ModuleLoader__.load({
1668
1674
  'div',
1669
1675
  { className: 'dus-panel-head' },
1670
1676
  h('h2', { className: 'dus-panel-title' }, '每日平均缓存命中率'),
1671
- h('div', { className: 'dus-head-spacer' }),
1672
- h('span', { className: 'dus-panel-sub' }, `${rangeLabel(rangeId)} · 按输入 token 加权`),
1673
1677
  ),
1674
1678
  h(TokenCacheRate, { days, rangeDays: range }),
1675
1679
  ),
@@ -1681,8 +1685,6 @@ window.__ModuleLoader__.load({
1681
1685
  'div',
1682
1686
  { className: 'dus-panel-head' },
1683
1687
  h('h2', { className: 'dus-panel-title' }, '模型用量'),
1684
- h('div', { className: 'dus-head-spacer' }),
1685
- h('span', { className: 'dus-panel-sub' }, '来源 = 模型接入的提供方'),
1686
1688
  ),
1687
1689
  h(ModelDonut, { models: modelsWithUsage }),
1688
1690
  h(ModelUsageChart, { days, models: modelsWithUsage, rangeDays: range }),
@@ -1890,7 +1892,6 @@ window.__ModuleLoader__.load({
1890
1892
  margin-top: 10px; font-size: 11px; color: var(--dsw-alias-label-secondary);
1891
1893
  }
1892
1894
  .dus-heat-legend .dus-heat-cell { width: 10px; height: 10px; }
1893
- .dus-heat-hint { margin-right: auto; color: var(--dsw-alias-label-secondary); }
1894
1895
 
1895
1896
  .dus-tip {
1896
1897
  position: fixed; z-index: 60; pointer-events: none;
@@ -2027,7 +2028,6 @@ window.__ModuleLoader__.load({
2027
2028
  gap: 4px 10px; min-width: 0; flex: 1 1 200px;
2028
2029
  }
2029
2030
  .dus-bars-title { font-size: 13.5px; font-weight: 600; margin: 0; line-height: 1.3; }
2030
- .dus-bars-note { font-size: 11px; color: var(--dsw-alias-label-secondary); }
2031
2031
  .dus-trend-toggle { margin-left: auto; flex: none; }
2032
2032
  .dus-seg-sm .dus-seg-btn { padding: 3px 10px; font-size: 11px; }
2033
2033
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-usage-overview",
3
3
  "displayName": "DSH Usage Overview",
4
4
  "description": "A usage overview for DeepSeek Harness: token totals, activity heatmap, daily token and cache trends, and per-model attribution.",
5
- "version": "1.1.2",
5
+ "version": "1.1.4",
6
6
  "icon": "icon.svg",
7
7
  "author": "w-callan-w",
8
8
  "repository": {