前言¶
When using DSH for development or deployment, it is common to start multiple background services (such as web servers, database proxies, etc.) through Agent sessions. As the number of services increases, managing the initiators, log locations, and health status of these processes becomes difficult. The dsh-service-board plugin provides a docked panel that intuitively displays services grouped by session and supports real-time log viewing and process control.
是什么¶
dsh-service-board is a DSH service panel plugin used to view in the Web GUI sidebar which services were started by which conversation (Agent session).
This plugin is developed as a fork based on the upstream dsh-process-board, fixing several known defects (such as log unavailability after restart, merging errors for processes with the same name, panel stealing input box focus, etc.), and adding features like a docked panel, runtime duration statistics, and filtering. It is licensed under the MIT license and has no runtime dependencies.
核心功能¶
- Grouping by Session: Automatically associates the conversation (Agent session) to which the process belongs.
- Health and Status: Provides tri-state health probing (Port/HTTP Code/PID).
- Process Information: Displays startup time and runtime duration.
- Control Capabilities: Supports graceful stop (SIGTERM) and in-place restart (replaying the original command line).
- Log Viewing: Real-time log tailing, supporting coloring by ERROR (red) / WARN (yellow).
- Docked Panel: The panel is docked on the right side, with adjustable width via dragging, and supports full-screen logs.
- Filtering: Supports filtering services by session scope, port whitelist, and hidden keywords.
安装与启用¶
Before installation, ensure that DSH is installed and available. Depending on the client used, the corresponding profile (such as web or desktop) must be selected.
# Web client installation example
dsh plugin --profile web add dsh-service-board
After installation is complete, restart the DSH host (the desktop application needs to be completely exited and reopened; dsh web needs to be restarted). An entry for the “Process Board” will appear in the sidebar.
Note: Installing this simultaneously with the upstream
dsh-process-boardwill insert two sidebar entries. Please install only one of them.
使用方法¶
Click “Process Board” in the sidebar, and the docked panel will expand on the right side.
基本操作¶
- View Logs: Click a service in the list. The panel below will expand to show a real-time log stream (ERROR is red, WARN is yellow, auto-refreshes every 4 seconds, supports full-screen).
- Restart Service: Click the “Restart” button. The panel will confirm the original command line, then stop the process tree and restart it in a detached manner using the original command line. After restart, it will wait for a scan (approx. 1–3 seconds) to refresh the status.
- Stop Service: Click the “Stop” button. It first performs a graceful termination (SIGTERM/taskkill), and after a 10-second grace period, forcefully kills the process tree. For services managed by Windows SCM, they will be displayed as “Windows Service” and cannot be stopped.
筛选与配置¶
The plugin supports configuration of filter rules. Write the configuration to ~/.dsh/gate/process-board/config.json, and it will take effect on the next scan. Filter conditions include:
* scope: Monitoring scope (All / Session-started only).
* ports: Port whitelist.
* hide: Hidden keywords.
让面板可见¶
By default, the panel only displays processes with specific markers. To be recognized and managed by the panel, environment variables must be set:
* DSH_SESSION_ID: Identifies the session ID to which the process belongs.
* DSH_PB_LOG: Specifies the log file path for the process (the /log interface is only allowed to read this path).
For example, starting a service in Windows PowerShell:
$env:DSH_PB_LOG = "$env:TEMP\my-service.log"
Start-Process java -ArgumentList '-jar','app.jar' -RedirectStandardOutput $env:DSH_PB_LOG -WindowStyle Hidden
权限与限制¶
This plugin requires the following system permissions to operate correctly:
* Read Process Information: Reads process lists, command lines, ports, and environment variables via WMI and PEB environment blocks on Windows.
* Terminate Processes: Possesses the ability to terminate process trees.
* Start Processes: Possesses the ability to start processes in a detached manner.
* Local HTTP: The plugin mounts /state, /config, /kill, /log, and /start routes on the DSH Web Server. It only listens on Loopback and validates Host/Origin to prevent cross-site requests.
Platform Limitations:
* Process Scanning and Session Attribution: Currently, this is only implemented on the Windows platform (using WMI/PEB). On macOS / Linux, the scanner returns an empty array directly; the panel UI is available, but the list is empty.
结尾¶
dsh-service-board is a tool designed for local developers, integrating process management capabilities into the DSH Web interface. Through session grouping and a docked panel, it makes debugging services in an Agent environment more intuitive.
- GitHub Repository: https://github.com/fanjinduo111/dsh-service-board
- Plugin Directory: https://www.skillhub.cn/plugins/fanjinduo111/dsh-service-board