opencode-supertask 0.1.11 → 0.1.12
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/cli/index.js +28 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/gateway/index.js +28 -0
- package/dist/gateway/index.js.map +1 -1
- package/dist/web/index.js +28 -0
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -22127,6 +22127,17 @@ async function deleteTmpl(id){if(!confirm('\u786E\u5B9A\u5220\u9664\u6B64\u6A21\
|
|
|
22127
22127
|
async function triggerTmpl(id){if(!confirm('\u7ACB\u5373\u89E6\u53D1\u4E00\u6B21?'))return;const r=await fetch('/api/templates/'+id+'/trigger',{method:'POST'});const d=await r.json();if(d.success){alert('\u5DF2\u521B\u5EFA\u4EFB\u52A1 #'+d.taskId);location.reload();}else{alert('\u89E6\u53D1\u5931\u8D25');}}
|
|
22128
22128
|
function toggleLog(id){const el=document.getElementById('log-'+id);el.style.display=el.style.display==='none'?'block':'none';}
|
|
22129
22129
|
|
|
22130
|
+
async function clearDatabase(){
|
|
22131
|
+
if(!confirm('\u786E\u5B9A\u6E05\u7A7A\u6240\u6709\u4EFB\u52A1\u6570\u636E\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\uFF01'))return;
|
|
22132
|
+
if(!confirm('\u518D\u6B21\u786E\u8BA4\uFF1A\u5C06\u5220\u9664\u6240\u6709\u4EFB\u52A1\u3001\u6267\u884C\u8BB0\u5F55\u548C\u8C03\u5EA6\u6A21\u677F\u3002'))return;
|
|
22133
|
+
try{
|
|
22134
|
+
const r=await fetch('/api/database/clear',{method:'POST'});
|
|
22135
|
+
const d=await r.json();
|
|
22136
|
+
if(d.success){alert('\u6570\u636E\u5E93\u5DF2\u6E05\u7A7A');location.reload();}
|
|
22137
|
+
else{alert('\u6E05\u7A7A\u5931\u8D25: '+d.error);}
|
|
22138
|
+
}catch(e){alert('\u6E05\u7A7A\u5931\u8D25: '+e.message);}
|
|
22139
|
+
}
|
|
22140
|
+
|
|
22130
22141
|
async function saveConfig(){
|
|
22131
22142
|
const form=document.getElementById('config-form');
|
|
22132
22143
|
const data={
|
|
@@ -22528,6 +22539,12 @@ var init_web = __esm({
|
|
|
22528
22539
|
<h3 style="margin:0 0 12px;font-size:14px">\u914D\u7F6E\u6587\u4EF6</h3>
|
|
22529
22540
|
<div class="ir"><span class="ik">\u8DEF\u5F84</span><span class="iv m sm">${CONFIG_PATH}</span></div>
|
|
22530
22541
|
<div class="ir"><span class="ik">\u6587\u4EF6\u5B58\u5728</span><span class="iv">${configFileStatus}</span></div>
|
|
22542
|
+
</div>
|
|
22543
|
+
|
|
22544
|
+
<div class="card mt16" style="border-color:var(--red)">
|
|
22545
|
+
<h3 style="margin:0 0 12px;font-size:14px;color:var(--red)">\u5371\u9669\u64CD\u4F5C</h3>
|
|
22546
|
+
<p class="sm mu" style="margin:0 0 12px">\u6E05\u7A7A\u6240\u6709\u4EFB\u52A1\u6570\u636E\uFF08tasks + task_runs + task_templates\uFF09\uFF0C\u4E0D\u53EF\u6062\u590D\u3002</p>
|
|
22547
|
+
<button class="btn btn-danger" style="border-color:var(--red);color:var(--red);padding:6px 16px" onclick="clearDatabase()">\u6E05\u7A7A\u6570\u636E\u5E93</button>
|
|
22531
22548
|
</div>`;
|
|
22532
22549
|
return c.html(renderLayout("\u7CFB\u7EDF\u72B6\u6001", "system", body));
|
|
22533
22550
|
});
|
|
@@ -22599,6 +22616,17 @@ var init_web = __esm({
|
|
|
22599
22616
|
return c.json({ success: false, error: err instanceof Error ? err.message : String(err) });
|
|
22600
22617
|
}
|
|
22601
22618
|
});
|
|
22619
|
+
app.post("/api/database/clear", async (c) => {
|
|
22620
|
+
try {
|
|
22621
|
+
const { tasks: tasks3, taskRuns: taskRuns3, taskTemplates: taskTemplates4 } = schema_exports;
|
|
22622
|
+
await db.delete(taskRuns3);
|
|
22623
|
+
await db.delete(taskTemplates4);
|
|
22624
|
+
await db.delete(tasks3);
|
|
22625
|
+
return c.json({ success: true });
|
|
22626
|
+
} catch (err) {
|
|
22627
|
+
return c.json({ success: false, error: err instanceof Error ? err.message : String(err) });
|
|
22628
|
+
}
|
|
22629
|
+
});
|
|
22602
22630
|
dashboardApp = app;
|
|
22603
22631
|
web_default = {
|
|
22604
22632
|
port: 4680,
|