Passer au contenu principal
I

dsh-task-board

ixxgal/dsh-task-board

Lists the Windows scheduled tasks DSH created and DSH's own schedules on one page; from there you can run, disable, enable, delete and create them. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

Installer

dsh plugin --profile web add github:ixxgal/dsh-task-board

README

dsh-task-board(定时任务面板)

这个仓库已并入 ixxgal/dsh-plugins:全部插件和唯一索引都在那边,索引源 https://ixxgal.github.io/dsh-plugins/index.json。本仓库只保留历史提交,代码以总仓库的 packages/dsh-task-board 为准。

DSH 窗口最底下那行状态栏里多一枚「定时任务」胶囊(在余额那几枚胶囊旁边),点开是一整块面板,把这台机器上会自己跑起来的东西放在一起。入口只有这一处:侧栏不再放第二个入口,避免同一个面板在界面上出现两回。

区块数据来源为什么需要它
Windows 计划任务Get-ScheduledTask,只留名字 / 路径 / 动作里带 dsh deepseek harness 的官方「自动化任务」页只看 DSH 内部的 schedule。11 月 20 日那次瓦罗兰特闪退,就是旧会话注册的 dsh-restart-* 计划任务在 23:55/23:56/23:58 弹出可见 PowerShell 窗口抢了前台 —— 那些任务在 GUI 里原本一个都看不见
DSH 内部定时任务ctx.schedule.list()(和「自动化任务」页同一份数据)在这里能一次看到全部,不用来回切页

两边都支持:立即运行 / 停用 / 启用 / 删除。新建有两种:

  • Windows 计划任务:一次性、每天、每隔 N 分钟。脚本写到 $DSH_HOME/task-board/scripts/<名字>.ps1,任务动作固定为 powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File "<脚本>",并默认把任务本身也标成 Hidden。 「隐藏窗口」这个勾选框就是上次闪退的解药。
  • DSH 内部任务:每天 HH:mm / 每隔 N 秒 / 五字段 cron,走 ctx.schedule.create()。

布局

index.js            宿主半:注册 /dsh-task-board/* 路由,调 ps/board.ps1 与 ctx.schedule
client.js           浏览器半:状态栏胶囊(DOM 注入)+ 浮层面板,不占任何侧栏槽位
ps/board.ps1        Windows 计划任务的全部真实操作(list / windows-op / windows-create)
cordis.patch.yml    bundle 补丁:insert 一个 id=task-board

ps/board.ps1 必须存成 UTF-8 with BOM:Windows PowerShell 5.1 读无 BOM 的 .ps1 会按 GBK 解码,中文全变乱码并直接语法报错。

接口

方法路径说明
GET/dsh-task-board/state.json{ ok, windows: [...], native: { ok, items, total } }
POST/dsh-task-board/windows.json{ op: run|enable|disable|delete|harden, path, name }
POST/dsh-task-board/windows-create.json{ name, kind: once|daily|every, at|time|everyMinutes, script, hidden }
POST/dsh-task-board/native.json{ op: run|pause|resume|delete, id }
POST/dsh-task-board/native-create.json{ title, prompt, kind: daily|every|cron, time|everySeconds|expression }

所有写操作只接受回环 Host(127.0.0.1 / localhost / ::1),别的机器连上端口也改不了计划任务。

安装

profile 的 package.json 里加依赖并挂进 bundles。直接从 GitHub 装:

"@local/dsh-task-board": "github:ixxgal/dsh-task-board"
"bundles": [ "...", "@local/dsh-task-board" ]

不想手改 profile 文件,也可以把本仓库的插件索引加进宿主的发现页(插件 → 发现 → 添加索引源):

https://ixxgal.github.io/dsh-task-board/index.json

索引是 format 1 的 JSON,位于 docs/index.json;每个版本钉死一个 commit,安装走的仍是上面的 GitHub 源。

改源码调试时换成目录链接(路径换成你自己的克隆位置):

"@local/dsh-task-board": "link:./plugins/dsh-task-board"

再建 node_modules/@local/dsh-task-board 的目录链接指向该路径,然后重启应用。

自检

# 列表(应返回一行 JSON 数组)
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ps\board.ps1 list

# 建一个隐藏窗口的每日任务再删掉
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ps\board.ps1 windows-create < body.json
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ps\board.ps1 windows-op < body.json

已实测:list / windows-create(daily + hidden,落在 \dsh-board\)/ windows-op delete 三条路径都返回 {"ok":true}。

更新记录

  • 0.1.1 — 只保留底部状态栏那一枚「定时任务」胶囊。以前底部胶囊 2.5 秒内没挂上就会顺手往侧栏底部注册一个文字入口,而状态栏稍后渲染出来时胶囊又挂上了,于是侧栏和状态栏各有一个入口。现在侧栏入口整段删掉(连同 sidebar.footer.action 的注册与对应的 CSS),挂不上就只是不显示,不再补第二个。

Plugins associés