dsh-ustc-quota 1.1.38 → 1.1.39

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 CHANGED
@@ -108,6 +108,7 @@ key-c 8.7/30 29% 8.7/70 12% 11.1/100 11%
108
108
  ## 面板位置
109
109
 
110
110
  - 卡片默认在左侧边栏底部。**鼠标移到卡片上时,标题左边的品牌图标会变成方向图标**(布局图示,标出卡片将要去的那一侧),点一下即可换边;移开鼠标图标复原。选择会记住,重启后保持。
111
+ - 排版自适应:每个窗口一行显示「数值 · 进度条 · 百分比」,三段各自固定宽度对齐,跨行不参差;刷新时间并入「3h / 12h / 24h」表头行右侧。用宽度换高度,卡片更矮更紧凑。
111
112
  - 右侧位置会在对话区右侧**预留一条槽**:插件给对话列加右侧内边距(约列宽的 26%,封顶 34%),正文与轮次导航条整体左移,卡片占住这条槽——因此不遮挡正文、不遮挡轮次导航条、也不遮挡右侧原生按钮。上沿从「对话 / 轨迹 / 看板」选项卡下的分隔线以下 6px 开始。
112
113
  - 窄窗口或打开侧栏时槽宽自动收窄(下限 140px),卡片始终可见;如果连正文最小宽度都不够,则允许卡片比常规更窄,而不是消失。
113
114
  - 换边不重新加载:两处卡片共用同一份已取到的数据。底色用左侧边栏的底色(`--dsw-specific-sidebar-fill`),阴影与左侧一致。
package/client.js CHANGED
@@ -11,7 +11,7 @@ window.__ModuleLoader__.load({
11
11
  const UPDATE_ENDPOINT = 'plugins/dsh-ustc-quota/update';
12
12
  const UPDATE_APPLY_ENDPOINT = 'plugins/dsh-ustc-quota/update/apply';
13
13
  const WINDOW_IDS = ['3h', '12h', '24h'];
14
- const CLIENT_VERSION = '1.1.38';
14
+ const CLIENT_VERSION = '1.1.39';
15
15
  const UPDATE_INTERVAL_MS = 24 * 60 * 60 * 1000;
16
16
  const CLIENT_VERSION_KEY = `${NS}:client-version`;
17
17
  const CLIENT_RELOAD_KEY = `${NS}:client-reload`;
@@ -477,7 +477,7 @@ window.__ModuleLoader__.load({
477
477
  legendRow: {
478
478
  display: 'grid',
479
479
  gridTemplateColumns: 'var(--ustc-key-col, 36px) repeat(3, minmax(0, 1fr)) auto',
480
- columnGap: 4,
480
+ columnGap: 8,
481
481
  alignItems: 'center',
482
482
  minWidth: 0,
483
483
  paddingBottom: 4,
@@ -486,7 +486,7 @@ window.__ModuleLoader__.load({
486
486
  keyRow: {
487
487
  display: 'grid',
488
488
  gridTemplateColumns: 'var(--ustc-key-col, 36px) repeat(3, minmax(0, 1fr))',
489
- columnGap: 4,
489
+ columnGap: 8,
490
490
  alignItems: 'center',
491
491
  minWidth: 0,
492
492
  paddingTop: 6,
@@ -568,8 +568,8 @@ window.__ModuleLoader__.load({
568
568
  gap: 3,
569
569
  },
570
570
  inlineBar: {
571
- flex: '1 1 14px',
572
- minWidth: 10,
571
+ flex: '1 1 0',
572
+ minWidth: 8,
573
573
  height: 5,
574
574
  position: 'relative',
575
575
  borderRadius: 999,
@@ -584,8 +584,9 @@ window.__ModuleLoader__.load({
584
584
  minWidth: 0,
585
585
  },
586
586
  value: {
587
- minWidth: 0,
588
- fontSize: 10.5,
587
+ flex: '0 0 auto',
588
+ textAlign: 'right',
589
+ fontSize: 10,
589
590
  fontWeight: 650,
590
591
  color: 'var(--dsw-alias-label-primary)',
591
592
  whiteSpace: 'nowrap',
@@ -594,6 +595,8 @@ window.__ModuleLoader__.load({
594
595
  },
595
596
  percent: {
596
597
  flex: '0 0 auto',
598
+ width: 24,
599
+ textAlign: 'right',
597
600
  fontSize: 8.5,
598
601
  color: 'var(--dsw-alias-label-secondary)',
599
602
  whiteSpace: 'nowrap',
@@ -811,7 +814,9 @@ window.__ModuleLoader__.load({
811
814
  function formatPercent(ratio) {
812
815
  if (typeof ratio !== 'number' || !Number.isFinite(ratio)) return null;
813
816
  const percent = ratio * 100;
814
- if (percent > 0 && percent < 10) return `${percent.toFixed(1)}%`;
817
+ const tenths = Math.round(percent * 10) / 10;
818
+ if (tenths === 0) return '0%';
819
+ if (tenths < 10) return `${tenths.toFixed(1)}%`;
815
820
  return `${Math.round(percent)}%`;
816
821
  }
817
822
 
@@ -1799,10 +1804,7 @@ window.__ModuleLoader__.load({
1799
1804
  if (isStale) titleParts.push(t('stale'));
1800
1805
 
1801
1806
  return h('div', { style: STYLE.cell, title: titleParts.join(' · ') },
1802
- h('div', { style: STYLE.valueLine },
1803
- h('span', { style: STYLE.value }, `${isStale ? '≈ ' : ''}${valueText}`),
1804
- percent ? h('span', { style: { ...STYLE.percent, color: percentColor } }, percent) : null
1805
- ),
1807
+ h('span', { style: STYLE.value }, `${isStale ? '≈ ' : ''}${valueText}`),
1806
1808
  h('div', {
1807
1809
  style: { ...STYLE.inlineBar, opacity: isStale ? 0.55 : 1 },
1808
1810
  role: 'progressbar',
@@ -1823,7 +1825,8 @@ window.__ModuleLoader__.load({
1823
1825
  transition: 'width 200ms ease',
1824
1826
  },
1825
1827
  })
1826
- )
1828
+ ),
1829
+ percent ? h('span', { style: { ...STYLE.percent, color: percentColor } }, percent) : null
1827
1830
  );
1828
1831
  }
1829
1832
 
package/index.js CHANGED
@@ -22,7 +22,7 @@ const ROUTE_PATH = '/plugins/dsh-ustc-quota/snapshot';
22
22
  const UPDATE_PATH = '/plugins/dsh-ustc-quota/update';
23
23
  const UPDATE_APPLY_PATH = '/plugins/dsh-ustc-quota/update/apply';
24
24
  const UPDATE_TOKEN_TTL_MS = 30 * 60 * 1000;
25
- const PLUGIN_VERSION = '1.1.38';
25
+ const PLUGIN_VERSION = '1.1.39';
26
26
  const KEY_INFO_PATH = 'key/info';
27
27
  const USER_INFO_PATH = 'user/info';
28
28
  const DISCOVERY_TTL_MS = 30000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ustc-quota",
3
- "version": "1.1.38",
3
+ "version": "1.1.39",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Live 3h/12h/24h USTC token quota card in the DSH sidebar (works with the USTC TokenWorks distribution).",