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 peer 범위
^0.1.0-rc.6
Cordis peer 범위
^4.0.1
버전
0.1.0
라이선스
MIT
최근 업데이트
2026. 8. 14.

같은 패키지 이름의 다른 저장소

설치

검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 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,小部件只显示「请求被拒绝」。
  • 设置页同样仅本机浏览器可写(远程浏览器会提示「远程浏览器无法持久化设置」)。