dsh-tokenbank 0.1.55 → 0.1.57
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 +4 -8
- package/lib/index.js +7 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -526,11 +526,7 @@ window.__ModuleLoader__.load({
|
|
|
526
526
|
busy[1](false)
|
|
527
527
|
}
|
|
528
528
|
return h('div', {
|
|
529
|
-
style: {
|
|
530
|
-
display: 'flex', flexDirection: 'column', gap: 8, padding: 10,
|
|
531
|
-
borderRadius: 8, border: '1px solid var(--dsw-alias-border-l1)',
|
|
532
|
-
background: 'var(--dsw-alias-bg-layer-1, #f7f7f8)',
|
|
533
|
-
},
|
|
529
|
+
style: { display: 'flex', flexDirection: 'column', gap: 8, padding: 0 },
|
|
534
530
|
},
|
|
535
531
|
h('div', { style: { display: 'flex', gap: 6, flexWrap: 'wrap' } },
|
|
536
532
|
(packs[0] || [
|
|
@@ -743,14 +739,14 @@ window.__ModuleLoader__.load({
|
|
|
743
739
|
data && data.loggedIn ? h('button', {
|
|
744
740
|
type: 'button', 'aria-label': pageT('depositManageTip'),
|
|
745
741
|
style: Object.assign({}, buttonStyle, { height: 26, padding: '0 12px', fontSize: 12, borderColor: 'var(--dsw-alias-border-l2, #c9ccd1)' }),
|
|
746
|
-
onMouseEnter: function () { depTip[1]('deposit') },
|
|
742
|
+
onMouseEnter: function () { if (!rechargeOpen[0]) depTip[1]('deposit') },
|
|
747
743
|
onClick: function () { depTip[1](null); tbStore.set({ authOpen: false }); openSettingsPage() },
|
|
748
744
|
}, pageT('depositManage')) : null,
|
|
749
745
|
(checkin[0].done || (data.account && typeof data.account.balance_nano_usd === 'number' && data.account.balance_nano_usd < 1e9))
|
|
750
746
|
? h('button', {
|
|
751
747
|
type: 'button',
|
|
752
748
|
style: Object.assign({}, primaryButtonStyle, { height: 26, padding: '0 12px', fontSize: 12 }),
|
|
753
|
-
onMouseEnter: function () { depTip[1]('recharge') },
|
|
749
|
+
onMouseEnter: function () { if (!rechargeOpen[0]) depTip[1]('recharge') },
|
|
754
750
|
onClick: function () { depTip[1](null); rechargeOpen[1](function (v) { return !v }) },
|
|
755
751
|
}, pageT('recharge'))
|
|
756
752
|
: null,
|
|
@@ -802,7 +798,7 @@ window.__ModuleLoader__.load({
|
|
|
802
798
|
} : undefined,
|
|
803
799
|
}, checkinFlash[0].text) : h('button', {
|
|
804
800
|
type: 'button', style: Object.assign({}, primaryButtonStyle, { justifyContent: 'center' }),
|
|
805
|
-
onMouseEnter: function () { depTip[1]('models') },
|
|
801
|
+
onMouseEnter: function () { if (!rechargeOpen[0]) depTip[1]('models') },
|
|
806
802
|
onClick: async function () {
|
|
807
803
|
try {
|
|
808
804
|
var models = await api('gateway-models', { accessKey: data.accessKey })
|
package/lib/index.js
CHANGED
|
@@ -403,6 +403,13 @@ async function dispatch(ctx, state, cfg, body) {
|
|
|
403
403
|
} catch {
|
|
404
404
|
list = await tb.listGatewayModels(baseUrl, key)
|
|
405
405
|
}
|
|
406
|
+
// 只保留网关实际可调的模型:/v1/models 由有可用上游凭证的分组聚合而来,
|
|
407
|
+
// 门户目录会把无凭证分组的模型也列出来,直接加进模型列表只会调用报错。
|
|
408
|
+
let callable = new Set()
|
|
409
|
+
try {
|
|
410
|
+
for (const m of await tb.listGatewayModels(baseUrl, key)) callable.add(m.id)
|
|
411
|
+
} catch { /* 网关失败时不过滤,退回门户目录 */ }
|
|
412
|
+
if (callable.size > 0) list = list.filter((m) => callable.has(m.id))
|
|
406
413
|
return { ok: true, models: list, protocol: groupProtocol || undefined, accessKey: key }
|
|
407
414
|
}
|
|
408
415
|
case 'low-balance':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-tokenbank",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.57",
|
|
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",
|