@wrongstack/webui 0.68.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-Df1jRLwk.css +1 -0
- package/dist/assets/index-H4ofeiKr.js +94 -0
- package/dist/assets/{vendor-CzdG0ns2.js → vendor-DBuK7aZd.js} +74 -79
- package/dist/index.css +23 -0
- package/dist/index.css.map +1 -1
- package/dist/index.html +3 -3
- package/dist/index.js +165 -88
- package/dist/index.js.map +1 -1
- package/dist/server/entry.js +27 -0
- package/dist/server/entry.js.map +1 -1
- package/dist/server/index.js +27 -0
- package/dist/server/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/assets/index-BeXRAkSS.js +0 -94
- package/dist/assets/index-C_0-qbQ-.css +0 -1
package/dist/server/index.js
CHANGED
|
@@ -2923,6 +2923,33 @@ async function startWebUI(opts = {}) {
|
|
|
2923
2923
|
broadcast(clients, { type: "todos.updated", payload: { todos: [] } });
|
|
2924
2924
|
break;
|
|
2925
2925
|
}
|
|
2926
|
+
case "todos.remove": {
|
|
2927
|
+
const payload = msg.payload;
|
|
2928
|
+
if (!payload) {
|
|
2929
|
+
sendResult(ws, false, "Missing id or index");
|
|
2930
|
+
break;
|
|
2931
|
+
}
|
|
2932
|
+
const { id, index } = payload;
|
|
2933
|
+
let targetIdx = -1;
|
|
2934
|
+
if (typeof id === "string") {
|
|
2935
|
+
targetIdx = context.todos.findIndex((t) => t.id === id);
|
|
2936
|
+
} else if (typeof index === "number" && index > 0) {
|
|
2937
|
+
targetIdx = index - 1;
|
|
2938
|
+
}
|
|
2939
|
+
if (targetIdx < 0 || !context.todos[targetIdx]) {
|
|
2940
|
+
sendResult(ws, false, "Todo not found");
|
|
2941
|
+
break;
|
|
2942
|
+
}
|
|
2943
|
+
const removed = context.todos[targetIdx];
|
|
2944
|
+
const next = [
|
|
2945
|
+
...context.todos.slice(0, targetIdx),
|
|
2946
|
+
...context.todos.slice(targetIdx + 1)
|
|
2947
|
+
];
|
|
2948
|
+
context.state.replaceTodos(next);
|
|
2949
|
+
sendResult(ws, true, `Removed: ${removed.content}`);
|
|
2950
|
+
broadcast(clients, { type: "todos.updated", payload: { todos: next } });
|
|
2951
|
+
break;
|
|
2952
|
+
}
|
|
2926
2953
|
case "plan.get": {
|
|
2927
2954
|
const planPath = context.meta["plan.path"];
|
|
2928
2955
|
if (typeof planPath === "string" && planPath) {
|