dsh-account-glance: DSH Web GUI Sidebar Account Balance and Billing Overview

In the DeepSeek Harness (DSH) Web GUI, account balances and billing cycles are typically hidden within the account row in the settings menu. Developers need to switch contexts frequently to monitor consumption and remaining quotas. dsh-account-glance provides a compact preview card above the account row in the sidebar, centralizing key information to reduce navigation overhead.

This is a DSH client plugin maintained by faith372. It is a self-contained component that displays the DeepSeek account balance, the current peak/off-peak billing countdown, and today’s token consumption and call counts directly in the Web interface’s sidebar. The plugin has no dependencies and requires no build step.

Core Features

  1. Account Balance Display: Probes the DeepSeek /user/balance API directly to retrieve the balance and displays the source on hover.
  2. Peak/Off-Peak Countdown: Displays the current billing cycle based on Beijing Time, switching to seconds for the final minute. Off-peak hours enjoy a 50% discount.
  3. Today’s Usage Statistics: Shows today’s cost, tokens consumed, and number of calls, with a manual refresh button.
  4. Smart Interoperability: Interoperates with @linxin666/dsh-usage. If that plugin is installed, this card prioritizes reading its routes and automatically hides the native preview card of dsh-usage, while both retain their own ledger records.
  5. React Platform Injection: Injects components based on the React platform, compatible with Web GUI rendering.

Installation & Enablement

Installing this plugin requires DSH version 0.2.0-rc.1 or higher.

  1. Clone the repository:
    git clone https://github.com/faith372/dsh-account-glance.git
  1. Add the plugin via CLI:
    dsh plugin --profile desktop add link:./dsh-account-glance
  1. Enable in Web GUI: Click the Plugins icon in the sidebar, switch to the Installed tab, find dsh-account-glance, and toggle it on.

Typical Usage

  • Billing Cycle Logic:
    • Peak Hours: Monday to Friday, 09:00-12:00 and 14:00-18:00 (standard price).
    • Off-Peak Hours: All other times (including weekends), with a 50% discount.
  • Coexistence with dsh-usage:
    • If @linxin666/dsh-usage is installed, this plugin reads its route configuration and utilizes specific DOM attributes (data-dsh-plugin and data-dsh-part) to automatically hide the native card of dsh-usage, preventing UI duplication.
    • Both maintain independent ledgers, so there may be slight differences in total amounts.
  • Data Refresh:
    • Clicking the refresh button on the card forces a re-probe of the balance and today’s data.

Scenarios & Notes

  • Data Scope: Balance amounts are displayed only for official DeepSeek routes. For other routes (such as third-party providers compatible with DashScope), only tokens and call counts are displayed, without monetary amounts.
  • Security: API keys are transmitted only through loopback-only routes and are not exposed to the browser.
  • UI Adaptation: When the sidebar collapses to the 56px rail, the card automatically hides to match the Shell’s collapsed state.
  • License: Some files are under the MIT License, while some files (lib/host/* and lib/index.js) are adapted from @linxin666/dsh-usage v0.4.4 and are under the Apache-2.0 License.

By providing a real-time balance and billing overview in the sidebar, this plugin reduces the interaction steps required to check account status. All code is self-contained and follows the MIT and Apache-2.0 licenses. For more information, visit GitHub.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye