dsh-download-indicator: Add a floating download progress indicator to DSH Web UI

Preface

DSH’s Web UI is responsible for displaying sessions and files, but does not itself monitor the download directory on the disk. If you manually download large models, datasets, or training materials from the site, you can only open a resource monitor or repeatedly refresh the folder to confirm whether a download is still progressing and roughly what speed it is. This kind of information is most needed the moment a download ends and files stop growing, yet system-level resource monitors are disconnected from the Web UI.

dsh-download-indicator is a small plugin designed to fill this gap. It is maintained by falleneve-ctrl and uses a plugin form to bring files that are “still growing” in your specified directory into the Web UI, providing a semi-transparent, draggable progress floating window in the top-right corner. When idle, it automatically fades out, not occupying the interface.

Below, I will introduce it sequentially by positioning, features, installation, usage, and notes.

What is it

One-sentence positioning: This is a download progress indicator plugin for the DSH Web UI. It only appears when files are actually growing, displaying a progress bar, downloaded size, and real-time speed.

The problems it solves are specific:

  1. When manually downloading large models or datasets, there is a lack of a progress view that goes along with the Web UI; you can only open a separate system tool to confirm.
  2. Percentages are often uncalculable (the remote side doesn’t provide the total size), and many tools show fake percentages. This plugin chooses not to display fake data.
  3. Before a download completes, the interface position is often occupied by other windows, so a floating window that can be dragged away easily without obstructing work is needed.

It is aimed at developers who have a local download directory mounted and use the DSH Web UI for daily operations.

Core Features

Each point below comes from the plugin README description.

1. On-demand appearance

The plugin polls the watched directory every 2 seconds. If it does not find any growing files for two consecutive times, the floating window fades out and stops displaying. When idle, it does not occupy the interface.

2. Draggable, position is remembered

The floating window can be dragged arbitrarily. The position is saved in localStorage, so it won’t be lost when refreshing the page or restarting the client. It cannot be dragged off-screen; if the position goes out of bounds when the window size changes, it is automatically pulled back into the visible area.

3. Real-time speed is measured

The server measures speed by comparing file size changes between consecutive polls, rather than guessing a number on the client. To keep readings steady, the average of the three most recent sampling points is taken.

4. Automatic download discovery, no need to declare one by one

The plugin scans the watched directory (recursion depth not exceeding 3 layers), retaining files larger than 20 MB and with extensions belonging to known archive or model formats, and finds those that are still growing. You only need to provide the directory; you don’t need to list each download task in the configuration.

5. Total speed

The header of the floating window displays the total speed of all currently active downloads.

6. No fake percentages when total size is unknown

When the final size is unknown, the plugin displays a striped uncertain progress bar along with the downloaded amount, rather than fabricating a percentage. Known total sizes are maintained in KNOWN_TOTALS inside lib/index.js, indexed by lowercase filenames; unregistered files only show progress without a percentage.

Installation and Enablement

The official installation command is as follows, using the desktop profile:

dsh plugin --profile desktop add dsh-download-indicator

After installation, you need to restart the client once, because the desktop shell collects the index-injection table at startup. If you have a page open at that time, refresh it once more.

Uninstall command:

dsh plugin --profile desktop remove dsh-download-indicator

Typical Usage

It works out of the box by default. The plugin monitors two directories by default:

F:\ComfyUI\models
F:\training\downloads

That is to say, if downloads land in these two locations, the floating window will automatically appear after installation and restart, without needing to change any configuration. The common scenario is dragging models or datasets from the site to F:\ComfyUI\models, and then viewing the progress and speed directly in the top-right corner of the Web UI.

If the download directory is not one of the two above, specify one or more directories via environment variables, separated by semicolons:

DSH_DOWNLOAD_WATCH=D:\downloads;E:\datasets

This is the only configuration item in the README, and the default value is the two Windows paths mentioned earlier. To control scanning behavior more finely, you can modify the three constants at the top of lib/index.js:

const MIN_SIZE = 20 * 1024 * 1024   // ignore files smaller than this
const MAX_DEPTH = 3                 // folder scan depth
const MIN_GROWTH = 128 * 1024       // growth needed to count as "downloading"

MIN_SIZE determines how large a file is ignored, MAX_DEPTH determines the directory scan depth, and MIN_GROWTH determines how much a file must grow at least to be judged as “downloading”.

How it Works

The plugin is divided into a server-side and a client-side part, because the desktop client only accepts one injection method. This is worth mentioning because it explains why the plugin is layered this way.

Server-side (lib/index.js) registers two routes on the DSH Web service: /dsh-download/status returns JSON (active downloads, size, speed), and /dsh-download/widget.js returns the client script. At the same time, it pushes a structured index-injection record to load the script.

Client-side (assets/widget.js) is responsible for building the floating window elements, polling the status route, and rendering.

Injection deliberately uses an inline script row instead of a script-src row. The reason is that a failed script-src load will directly reject client startup; once a route is missing, the entire UI will fail to start. Inline rows create <script> tags themselves and swallow onerror, so this plugin will never prevent the client from starting. For a plugin that only displays progress, this fault tolerance is necessary.

Suitable Scenarios and Notes

Suitable scenarios:

  1. Using the DSH Web UI locally and downloading models, datasets, or training materials in fixed directories, needing to watch and wait.
  2. Wanting to confirm if a download is still alive, rather than just checking if the file size has changed.
  3. Total download size is unknown, unwilling to see a potentially inaccurate percentage, preferring to see actual measured speed and downloaded amount.

Points to note:

  1. The plugin directly reads the directories you specify and runs with the permissions of the current DSH process. Before installation, you should open lib/index.js and assets/widget.js to check the source code and confirm that the monitored directory scope and scanning behavior meet expectations.
  2. The license is marked as MIT in the repository, but it is still recommended to confirm the license terms yourself before installation.
  3. It is a UI helper plugin and does not participate in the management of the download itself, nor does it change download behavior, only displaying it.
  4. The default paths are in Windows style; Linux or macOS users need to change them to their own directories in the environment variables.

Conclusion

The value of this plugin lies in putting the “download in progress” status into the DSH Web UI itself, using actual measured speed and progress to replace guessing, and automatically disappearing when idle. One command to install, all configuration options are optional, and the code volume is small, making it suitable as a permanent small tool in your own download process.

Plugin directory page: https://www.skillhub.cn/plugins/falleneve-ctrl/dsh-download-indicator

GitHub: https://github.com/falleneve-ctrl/dsh-download-indicator

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

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

Xiaoye