dsh-quick-restart
装完新插件/新技能,点一下「刷新 DSH」就生效 —— 不用手动重启。 New plugin or skill installed? One click on "Refresh DSH" and it's live — no manual restart.
English | 中文
中文
✨ 卖点:一键生效,告别手动重启
装完新插件(dsh-market 里安装的、或 dsh plugin add 装的)或新技能(放进 ~/.dsh/skills 的)之后,不用在终端里手动重启 dsh——点一下侧边栏的「刷新 DSH」按钮:
- 服务自动重启(后台完成,页面提示「请等待约 20 秒」)
- 新插件 / 新技能全部加载生效
- 服务恢复后页面自动刷新,无需任何手动操作
比命令行手动重启更省事:一个按钮完成全部,页面还会自己恢复。
功能
- 侧边栏底部「刷新 DSH」按钮,带在线状态灯(绿=在线 / 红=离线)
- 单击直接触发,无需二次确认;点击后弹出等待提示
- 服务恢复后页面自动重载,无需手动刷新
- 重启命令带
--no-open,不会额外打开浏览器页面 - 通过
/dsh-health每 5 秒探测服务健康状态
安装
# 本地目录安装
dsh plugin --profile web add link:/path/to/dsh-quick-restart
# 或从 GitHub
dsh plugin --profile web add github:Xyz10088/dsh-quick-restart#main
# 或使用预构建包(推荐)
dsh plugin --profile web add https://github.com/Xyz10088/dsh-quick-restart/releases/download/v0.1.0/dsh-quick-restart-0.1.0.tgz
重启 dsh web,侧边栏底部即出现「刷新 DSH」按钮。
工作原理
- host 半区(
lib/index.js):注册POST /restart-dsh与GET /dsh-health路由;重启处理器以分离进程拉起重启脚本,脚本杀掉 3080 端口监听进程后重新启动dsh web(--no-open)。 - client 半区(
lib/client.js):注册sidebar.footer.action槽位按钮;点击后POST /restart-dsh,随后轮询/dsh-health,观察到服务离线→恢复后自动location.reload()。
注意:
lib/index.js中RESTART_SCRIPT常量默认指向C:\Users\Administrator\.dsh\desktop-launcher\restart-dsh-web.ps1,不同机器请按需修改为你自己的重启/启动命令。
卸载
dsh plugin --profile web remove dsh-quick-restart
License
MIT
English
✨ Selling point: one click to activate, no manual restart
Installed a new plugin (from dsh-market or dsh plugin add) or a new skill (dropped into ~/.dsh/skills)? No need to manually restart dsh from the terminal — just click the "Refresh DSH" button in the sidebar:
- The service restarts in the background (a toast says "please wait ~20s")
- New plugins / skills are all loaded and live
- The page auto-reloads once the service is back — zero manual steps
Easier than a manual command-line restart: one button does it all, and the page recovers by itself.
Features
- "Refresh DSH" button in the sidebar footer with a live status dot (green = online / red = offline)
- Single click triggers the refresh, no confirmation step; a toast appears on click
- Page auto-reloads once the service is back — no manual refresh needed
- Restart command uses
--no-openso no extra browser tab is opened - Probes service health via
/dsh-healthevery 5 seconds
Install
# from a local directory
dsh plugin --profile web add link:/path/to/dsh-quick-restart
# or from GitHub
dsh plugin --profile web add github:Xyz10088/dsh-quick-restart#main
# or use the prebuilt package (recommended)
dsh plugin --profile web add https://github.com/Xyz10088/dsh-quick-restart/releases/download/v0.1.0/dsh-quick-restart-0.1.0.tgz
Restart dsh web, and the "Refresh DSH" button appears at the sidebar footer.
How it works
- Host half (
lib/index.js): registersPOST /restart-dshandGET /dsh-healthroutes; the handler launches a detached restart script that kills the process listening on port 3080 and startsdsh webagain (--no-open). - Client half (
lib/client.js): registers a button in thesidebar.footer.actionslot; on click it POSTs/restart-dsh, then polls/dsh-health— once the service is observed down and then back up, it callslocation.reload().
Note: the
RESTART_SCRIPTconstant inlib/index.jsdefaults toC:\Users\Administrator\.dsh\desktop-launcher\restart-dsh-web.ps1— adjust it to your own restart/launch command on other machines.
Uninstall
dsh plugin --profile web remove dsh-quick-restart
License
MIT
No comments yet. Be the first to write one.