dshiq04/dsh-deepseek-balance ↗★ 0
dsh-deepseek-balance
网页界面 DeepSeek 余额小部件,含悬停详情与刷新 适合想查看余额明细的用户,需配置 API 密钥并重启。
同名包的其他仓库
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗快速使用 Quick start
- 安装插件到 web profile(见下方「Installation」)并重启
dsh web。 - 打开 Settings → 余额 (Balance),填入你的 DeepSeek API Key(或在环境变量
DEEPSEEK_API_KEY/ Models 页面里配置,见「API key resolution」)。 - 点 检查余额 (Check balance) —— 显示
Connection OK:即成功。 - 侧边栏底部(设置按钮上方)随即出现余额小部件:悬停查看货币 / 总余额 / 赠金 / 充值详情,点刷新按钮手动刷新,也可在设置页开启自动刷新间隔与主题色。
Configuration
All settings live under the dsh-deepseek-balance: section in $DSH_HOME/settings.yaml, or in the Settings → 余额 (Balance) page:
| Field | Default | Meaning |
|---|---|---|
apiKey | (empty) | Your DeepSeek API key (write-only; never read back to the browser). |
apiKeyEnv | DEEPSEEK_API_KEY | Environment variable / credential reference holding the key. |
baseURL | https://api.deepseek.com | API endpoint; GET /user/balance is used. |
color | #4d6bfe | Balance text / popover accent color. |
refreshIntervalMs | 0 | Auto-refresh interval in ms (0 = manual refresh only). |
限制:远程浏览器无法使用
- 余额 API 路由做了 loopback 防护(见
lib/index.js):拒绝非127.0.0.1/localhost/[::1]的Host头与跨域Origin。 - 因此从另一台设备的浏览器访问同一 web UI 时,余额请求会返回 403,小部件只显示「请求被拒绝」。
- 设置页同样仅本机浏览器可写(远程浏览器会提示「远程浏览器无法持久化设置」)。