knlght/DSH-shutdown

One-click shutdown of DeepSeek Harness service: Settings shutdown page + secondary confirmation + graceful exit, no background processes left behind when closing the browser.

项目介绍Project Overview

DSH 关机插件为 DSH 设置侧栏新增「关机」页签,提供一键关闭后台服务的能力。核心功能包括:调用 /_dsh/shutdown 端点优雅退出进程、内置二次确认防误触、显示关闭成功反馈面板,并自动适配明暗主题。适用于调试后或长时间使用后需要释放端口与内存的场景。注意:脚本只能关闭自身打开的标签页,手动打开的标签页会保留成功提示。

The dsh-shutdown plugin adds a Shutdown tab to the DSH settings sidebar for ending background services with a single click. Core capabilities: calls the /_dsh/shutdown endpoint to gracefully exit the process, includes a two-step confirmation to prevent accidental triggers, displays a success panel, and adapts to light and dark themes. Use it after debugging or long sessions to free ports and memory. Note: browser security policies only allow closing tabs the script itself opened; manually opened tabs will retain the success panel.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add github:knlght/DSH-shutdown

knlght/DSH-shutdown 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-shutdown

一键结束 DSH 服务

Settings「关机」页 · 二次确认 · 优雅退出

关掉浏览器不再留下后台进程
🌏 中文 · English

✨ 为什么需要

关闭浏览器不会结束 dsh 的后台服务进程——服务继续占用端口与内存。本插件在页面内提供一键关机入口,无需命令行。

✨ 功能一览

  • 🖥️ Settings「关机」页:侧栏最底部新增「关机」页签
  • 🛡️ 二次确认:点「关闭 DSH 服务」→ 出现「确认关闭 / 取消」双按钮,防误触
  • ✅ 成功反馈:确认后页面立即显示绿色「关闭成功」面板(并尝试自动关闭标签页)
  • 🎨 原生风格:按钮与配色全部引用 DSH 主题 token(--dsw-alias-*),明暗自适应

📦 安装

dsh plugin --profile web add <本仓库 / npm 包名>
# 重启 dsh web 生效

🧠 设计要点

  • 关机端点:/_dsh/shutdown(仅 POST)——服务先返回「正在关闭」响应,500ms 后 process.exit(0) 优雅退出
  • 会话日志为逐事件落盘,空闲时退出安全;正在进行的对话请等待其完成后再关闭
  • 浏览器安全策略下脚本只能关闭自己打开的窗口——手动打开的标签页会保留「关闭成功」面板,两种情况下你都能确认结果

🧩 生态

打上 dsh-shutdown topic 的插件可接入同一生态。欢迎通过 PR 改进本插件。

📄 许可

MIT

上一个 Prev dsh-llm-inspector 下一个 Next dsh-better-sidebar-svn