dshiq04/dsh-deepseek-balance ↗★ 0

dsh-deepseek-balance

DeepSeek API balance widget for the dsh web UI: total balance with currency shown above Settings, hover details (currency / total / granted / topped-up), developer-configurable color, and a manual refresh button with transition animations. 适合想查看余额明细的用户,需配置 API 密钥并重启。

パッケージ
dsh-deepseek-balance
互換性
未検証
Harness ピア範囲
^0.1.0-rc.6
Cordis ピア範囲
^4.0.1
バージョン
0.1.0
ライセンス
MIT
最終更新
2026/08/14

同名パッケージの別リポジトリ

インストール

検証済み bundle がないか、互換性チェックに失敗しています。先にリポジトリの説明を読んでください。 README 全文を読む ↗

ドキュメント

README 全文を読む ↗

快速使用 Quick start

  1. 安装插件到 web profile(见下方「Installation」)并重启 dsh web。
  2. 打开 Settings → 余额 (Balance),填入你的 DeepSeek API Key(或在环境变量 DEEPSEEK_API_KEY / Models 页面里配置,见「API key resolution」)。
  3. 点 检查余额 (Check balance) —— 显示 Connection OK: 即成功。
  4. 侧边栏底部(设置按钮上方)随即出现余额小部件:悬停查看货币 / 总余额 / 赠金 / 充值详情,点刷新按钮手动刷新,也可在设置页开启自动刷新间隔与主题色。

Configuration

All settings live under the dsh-deepseek-balance: section in $DSH_HOME/settings.yaml, or in the Settings → 余额 (Balance) page:

FieldDefaultMeaning
apiKey(empty)Your DeepSeek API key (write-only; never read back to the browser).
apiKeyEnvDEEPSEEK_API_KEYEnvironment variable / credential reference holding the key.
baseURLhttps://api.deepseek.comAPI endpoint; GET /user/balance is used.
color#4d6bfeBalance text / popover accent color.
refreshIntervalMs0Auto-refresh interval in ms (0 = manual refresh only).

限制:远程浏览器无法使用

  • 余额 API 路由做了 loopback 防护(见 lib/index.js):拒绝非 127.0.0.1 / localhost / [::1] 的 Host 头与跨域 Origin。
  • 因此从另一台设备的浏览器访问同一 web UI 时,余额请求会返回 403,小部件只显示「请求被拒绝」。
  • 设置页同样仅本机浏览器可写(远程浏览器会提示「远程浏览器无法持久化设置」)。