dsh-tokenbank 0.1.51 → 0.1.53
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/lib/client.js +19 -13
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -28,9 +28,11 @@ window.__ModuleLoader__.load({
|
|
|
28
28
|
openPortal: '打开完整门户',
|
|
29
29
|
openSite: '打开官网',
|
|
30
30
|
addFreeModels: '获取免费模型',
|
|
31
|
+
freeModelsTip: '免费接入 TokenBank GLM 模型:注册领 Key 送 $5 体验金,模型自动进列表,无需自建中转。',
|
|
31
32
|
modelLinked: '已接入 {n} 个模型,去切换',
|
|
32
33
|
reload: '刷新',
|
|
33
34
|
recharge: '充值',
|
|
35
|
+
rechargeTip: '余额不足时充值:支持 ¥10/50/100/300 档位,支付宝扫码即到账,到账后自动刷新余额。',
|
|
34
36
|
depositManage: '托管',
|
|
35
37
|
depositManageTip: '把你的 API Key 托管到 TokenBank,临时额度自动转移为永久额度保留使用。适用于周重置快到了还没用完等情况。',
|
|
36
38
|
checkin: '签到',
|
|
@@ -117,6 +119,8 @@ window.__ModuleLoader__.load({
|
|
|
117
119
|
openPortal: 'Open full portal',
|
|
118
120
|
openSite: 'Open website',
|
|
119
121
|
addFreeModels: 'Get free models',
|
|
122
|
+
freeModelsTip: 'Link free TokenBank GLM models — register for a key with a $5 credit; models are added automatically.',
|
|
123
|
+
rechargeTip: 'Recharge when balance runs low: CNY 10/50/100/300 packages via Alipay, credited instantly; balance refreshes on payment.',
|
|
120
124
|
modelLinked: '{n} models linked, tap to switch',
|
|
121
125
|
reload: 'Reload',
|
|
122
126
|
recharge: 'Recharge',
|
|
@@ -614,7 +618,7 @@ window.__ModuleLoader__.load({
|
|
|
614
618
|
var innerToast = React.useState(null)
|
|
615
619
|
var checkinFlash = React.useState(null) // 签到成功闪现文案(复用获取免费模型按钮样式,2s 回原样)
|
|
616
620
|
var checkin = React.useState({ busy: false, done: false })
|
|
617
|
-
var depTip = React.useState(
|
|
621
|
+
var depTip = React.useState(null) // 说明板块:hover 哪个按钮就显示哪段说明('deposit'|'recharge'|'models')
|
|
618
622
|
React.useEffect(function () {
|
|
619
623
|
if (!snap.authOpen) logoutArm[1](false)
|
|
620
624
|
}, [snap.authOpen])
|
|
@@ -690,12 +694,20 @@ window.__ModuleLoader__.load({
|
|
|
690
694
|
)) : null,
|
|
691
695
|
),
|
|
692
696
|
data && data.loggedIn
|
|
693
|
-
? h('div', { style: { display: 'flex', flexDirection: 'column', gap: 10 }, onMouseLeave: function () { depTip[1](
|
|
697
|
+
? h('div', { style: { display: 'flex', flexDirection: 'column', gap: 10 }, onMouseLeave: function () { depTip[1](null) } },
|
|
694
698
|
h('div', { style: { display: 'flex', alignItems: 'baseline', justifyContent: 'space-between', gap: 8 } },
|
|
695
699
|
h('span', { style: { fontSize: 13, fontWeight: 600 } },
|
|
696
700
|
(data.user && (data.user.display_name || data.user.name)) || data.email || ''),
|
|
697
701
|
h('span', { style: { fontSize: 12, color: 'var(--dsw-alias-label-secondary, #888)' } }, data.email || ''),
|
|
698
702
|
),
|
|
703
|
+
depTip[0] ? h('div', {
|
|
704
|
+
style: {
|
|
705
|
+
padding: '8px 10px', borderRadius: 8, fontSize: 12, lineHeight: 1.6,
|
|
706
|
+
background: 'var(--dsw-alias-bg-layer-1, #f7f7f8)',
|
|
707
|
+
color: 'var(--dsw-alias-label-secondary, #888)',
|
|
708
|
+
border: '1px solid var(--dsw-alias-border-l1)',
|
|
709
|
+
},
|
|
710
|
+
}, pageT(depTip[0] === 'recharge' ? 'rechargeTip' : depTip[0] === 'models' ? 'freeModelsTip' : 'depositManageTip')) : null,
|
|
699
711
|
h('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 } },
|
|
700
712
|
h('div', { style: { fontSize: 16, fontWeight: 700, fontVariantNumeric: 'tabular-nums' } },
|
|
701
713
|
data.account && typeof data.account.balance_nano_usd === 'number'
|
|
@@ -731,26 +743,19 @@ window.__ModuleLoader__.load({
|
|
|
731
743
|
data && data.loggedIn ? h('button', {
|
|
732
744
|
type: 'button', 'aria-label': pageT('depositManageTip'),
|
|
733
745
|
style: Object.assign({}, buttonStyle, { height: 26, padding: '0 12px', fontSize: 12, borderColor: 'var(--dsw-alias-border-l2, #c9ccd1)' }),
|
|
734
|
-
onMouseEnter: function () { depTip[1](
|
|
735
|
-
onClick: function () { depTip[1](
|
|
746
|
+
onMouseEnter: function () { depTip[1]('deposit') },
|
|
747
|
+
onClick: function () { depTip[1](null); tbStore.set({ authOpen: false }); openSettingsPage() },
|
|
736
748
|
}, pageT('depositManage')) : null,
|
|
737
749
|
(checkin[0].done || (data.account && typeof data.account.balance_nano_usd === 'number' && data.account.balance_nano_usd < 1e9))
|
|
738
750
|
? h('button', {
|
|
739
751
|
type: 'button',
|
|
740
752
|
style: Object.assign({}, primaryButtonStyle, { height: 26, padding: '0 12px', fontSize: 12 }),
|
|
741
|
-
|
|
753
|
+
onMouseEnter: function () { depTip[1]('recharge') },
|
|
754
|
+
onClick: function () { depTip[1](null); rechargeOpen[1](function (v) { return !v }) },
|
|
742
755
|
}, pageT('recharge'))
|
|
743
756
|
: null,
|
|
744
757
|
),
|
|
745
758
|
),
|
|
746
|
-
depTip[0] ? h('div', {
|
|
747
|
-
style: {
|
|
748
|
-
padding: '8px 10px', borderRadius: 8, fontSize: 12, lineHeight: 1.6,
|
|
749
|
-
background: 'var(--dsw-alias-bg-layer-1, #f7f7f8)',
|
|
750
|
-
color: 'var(--dsw-alias-label-secondary, #888)',
|
|
751
|
-
border: '1px solid var(--dsw-alias-border-l1)',
|
|
752
|
-
},
|
|
753
|
-
}, pageT('depositManageTip')) : null,
|
|
754
759
|
rechargeOpen[0] ? h(InlineRecharge, {
|
|
755
760
|
onPaid: async function () {
|
|
756
761
|
rechargeOpen[1](false)
|
|
@@ -797,6 +802,7 @@ window.__ModuleLoader__.load({
|
|
|
797
802
|
} : undefined,
|
|
798
803
|
}, checkinFlash[0].text) : h('button', {
|
|
799
804
|
type: 'button', style: Object.assign({}, primaryButtonStyle, { justifyContent: 'center' }),
|
|
805
|
+
onMouseEnter: function () { depTip[1]('models') },
|
|
800
806
|
onClick: async function () {
|
|
801
807
|
try {
|
|
802
808
|
var models = await api('gateway-models', { accessKey: data.accessKey })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-tokenbank",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.53",
|
|
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",
|