dsh-tokenbank 0.1.64 → 0.1.65

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.
Files changed (2) hide show
  1. package/lib/client.js +26 -12
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -637,6 +637,14 @@ window.__ModuleLoader__.load({
637
637
  var openPanel = function (mode, extra) {
638
638
  tbStore.set(Object.assign({ authOpen: true, authMode: mode || snap.authMode || 'login', anchor: null }, extra || {}))
639
639
  }
640
+ // 余额行右侧的低调图标按钮(悬停有 title 提示)
641
+ var iconBtn = function (label, paths, onClick) {
642
+ return h('button', { type: 'button', title: label, 'aria-label': label,
643
+ style: { border: 'none', background: 'transparent', cursor: 'pointer', padding: 3, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', color: 'var(--dsw-alias-label-secondary, #666)' },
644
+ onClick: onClick },
645
+ h('svg', { viewBox: '0 0 24 24', width: 14, height: 14, fill: 'none', stroke: 'currentColor', 'stroke-width': 2, 'stroke-linecap': 'round', 'stroke-linejoin': 'round' },
646
+ paths.map(function (d) { return h('path', { d: d }) })))
647
+ }
640
648
  // 找到宿主模型选择器触发按钮并点开(带重试:刚接入的 provider 需要等一拍渲染)
641
649
  var openModelSwitcher = function (tries) {
642
650
  var triggers = document.querySelectorAll('button[aria-haspopup="menu"]')
@@ -718,22 +726,28 @@ window.__ModuleLoader__.load({
718
726
  h('span', { style: { fontSize: 11, color: 'var(--dsw-alias-label-secondary, #888)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, data.email || ''),
719
727
  ) : null,
720
728
  loggedIn
721
- ? h('div', { style: { display: 'flex', alignItems: 'center', gap: 6 } },
729
+ ? h('div', { style: { display: 'flex', alignItems: 'center', gap: 2 } },
722
730
  h('span', { style: { fontSize: 14, fontWeight: 700, fontVariantNumeric: 'tabular-nums', flex: 1 } },
723
731
  data && data.account && typeof data.account.balance_nano_usd === 'number'
724
732
  ? '$' + (data.account.balance_nano_usd / 1e9).toFixed(2) : '—'),
725
- h('button', { type: 'button', style: Object.assign({}, smallBtn, { borderColor: 'var(--dsw-alias-border-l2, #c9ccd1)' }),
726
- onClick: function () { openSettingsPage() } }, pageT('depositManage')),
727
- h('button', { type: 'button', style: Object.assign({}, primaryButtonStyle, { height: 24, padding: '0 8px', fontSize: 12 }),
728
- onClick: function () { openPanel('login', { startRecharge: true }) } }, pageT('recharge')))
733
+ iconBtn(pageT('addFreeModels'), [
734
+ 'M20 12v9H4v-9',
735
+ 'M2 7h20v5H2z',
736
+ 'M12 22V7',
737
+ 'M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z',
738
+ 'M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z',
739
+ ], addModels),
740
+ iconBtn(pageT('depositManage'), [
741
+ 'M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z',
742
+ ], function () { openSettingsPage() }),
743
+ iconBtn(pageT('recharge'), [
744
+ 'M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z',
745
+ 'M12 8v8',
746
+ 'M8 12h8',
747
+ ], function () { openPanel('login', { startRecharge: true }) }))
729
748
  : null,
730
- loggedIn
731
- ? flash[0]
732
- ? h('button', { type: 'button', tabIndex: -1, disabled: true,
733
- style: Object.assign({}, primaryButtonStyle, { height: 28, justifyContent: 'center', width: '100%', cursor: 'default', opacity: 0.9 }),
734
- }, flash[0].text)
735
- : h('button', { type: 'button', style: Object.assign({}, primaryButtonStyle, { height: 28, justifyContent: 'center', width: '100%' }),
736
- onClick: addModels }, pageT('addFreeModels'))
749
+ loggedIn && flash[0]
750
+ ? h('div', { style: { fontSize: 11, color: 'var(--dsw-alias-label-secondary, #888)', textAlign: 'center' } }, flash[0].text)
737
751
  : null,
738
752
  )
739
753
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tokenbank",
3
- "version": "0.1.64",
3
+ "version": "0.1.65",
4
4
  "description": "DSH 免费模型:一键注册 TokenBank 领免费 APIKey 送 $5 体验金,免费 GLM 模型直接进模型列表;自带余额查询、API Key 密钥托管(临时额度转永久)、每日签到、充值入口(支付宝),获取免费模型无需自建中转。致敬 dsh-our-free-model。官网 https://bank.skillpie.cn",
5
5
  "type": "module",
6
6
  "license": "MIT",