nx-kv 0.32.0 → 0.34.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/CHANGELOG.md +67 -0
- package/package.json +1 -1
- package/src/core/db/migrations/index.js +2 -0
- package/src/core/db/migrations/v3.sql +20 -0
- package/src/core/db/version.js +4 -1
- package/src/modules/localtask/index.js +59 -0
- package/src/modules/localtask/repo/tasks.js +23 -0
- package/src/modules/localtask/task-ops.js +9 -0
- package/src/modules/localtask/task-remove.js +69 -0
- package/src/modules/localtask/task-view.js +4 -0
- package/src/modules/tasktool/plugins/timegoal-store.js +60 -0
- package/src/modules/templates/index.js +65 -9
- package/src/modules/templates/repo/templates.js +24 -2
- package/src/modules/templates/scope.js +107 -0
- package/src/modules/templates/service.js +83 -4
- package/src/runtime/spec.js +6 -1
- package/src/web/frontend/App.jsx +34 -2
- package/src/web/frontend/components/button/index.jsx +34 -7
- package/src/web/frontend/components/button/style.css +1 -1
- package/src/web/frontend/components/doc/doc-head.jsx +164 -48
- package/src/web/frontend/components/icons.jsx +17 -0
- package/src/web/frontend/components/layout/crumbs.js +4 -1
- package/src/web/frontend/components/md/attach-area.jsx +20 -11
- package/src/web/frontend/components/md/attach-modal.jsx +3 -2
- package/src/web/frontend/components/md/attach-picker.jsx +37 -7
- package/src/web/frontend/components/md/md-panes.jsx +102 -23
- package/src/web/frontend/components/md/sel-menu.jsx +11 -0
- package/src/web/frontend/components/md/tool-bar.jsx +153 -91
- package/src/web/frontend/components/sidebar/task-children.jsx +6 -11
- package/src/web/frontend/components/status-tag/index.jsx +30 -0
- package/src/web/frontend/components/status-tag/model.js +53 -0
- package/src/web/frontend/components/tool-acts/bar.jsx +156 -0
- package/src/web/frontend/components/tool-acts/dnd.js +59 -0
- package/src/web/frontend/components/tool-acts/layout-panel.jsx +289 -0
- package/src/web/frontend/components/tool-acts/modules.js +162 -0
- package/src/web/frontend/components/tool-acts/style.css +108 -0
- package/src/web/frontend/components/tool-acts/use-layout.js +27 -0
- package/src/web/frontend/modules/md/attach-mention.js +11 -0
- package/src/web/frontend/modules/md/md-edit-ops.js +10 -7
- package/src/web/frontend/modules/md/md-parse.js +8 -21
- package/src/web/frontend/modules/md/progress-search.js +96 -0
- package/src/web/frontend/modules/md/style.css +124 -14
- package/src/web/frontend/modules/md/use-templates.js +65 -2
- package/src/web/frontend/page/dir/index.jsx +73 -38
- package/src/web/frontend/page/dir/landing.jsx +73 -78
- package/src/web/frontend/page/dir/task.jsx +426 -111
- package/src/web/frontend/page/group/index.jsx +194 -88
- package/src/web/frontend/page/overview/index.jsx +168 -269
- package/src/web/frontend/page/progress/index.jsx +59 -9
- package/src/web/frontend/page/repos/index.jsx +95 -103
- package/src/web/frontend/page/settings/index.jsx +4 -3
- package/src/web/frontend/page/settings/style.css +59 -31
- package/src/web/frontend/page/settings/task-templates-section.jsx +94 -99
- package/src/web/frontend/page/templates/index.jsx +221 -203
- package/src/web/frontend/page/templates/scope-chips.jsx +211 -0
- package/src/web/frontend/panels.jsx +28 -4
- package/src/web/frontend/route-map.js +42 -2
- package/src/web/frontend/style-v2.css +33 -71
- package/src/web/frontend/style.css +127 -319
- package/src/web/frontend/workspace/areas.js +1 -1
- package/src/web/public/assets/Introduction-DU27b_b_.js +1 -0
- package/src/web/public/assets/bar-CNuQf706.js +1 -0
- package/src/web/public/assets/board-view-t8CKtq17.js +1 -0
- package/src/web/public/assets/button-BPYMY-zh.js +1 -0
- package/src/web/public/assets/button-DA4lNJeC.css +1 -0
- package/src/web/public/assets/cloud-DgNCxJsL.js +3 -0
- package/src/web/public/assets/{composer-launch-q1uPzWGo.js → composer-launch-BKeKTPp4.js} +1 -1
- package/src/web/public/assets/composer-panel-DP322mVs.js +1 -0
- package/src/web/public/assets/dag-C4702bOt.js +1 -0
- package/src/web/public/assets/dir-Cipgyv3a.js +5 -0
- package/src/web/public/assets/group-m61-WL4C.js +1 -0
- package/src/web/public/assets/index-BEkITE6q.css +1 -0
- package/src/web/public/assets/index-CeIJd4ee.js +30 -0
- package/src/web/public/assets/md-history-Uo6U7hYS.js +1 -0
- package/src/web/public/assets/md-panes-PS7K93Lg.js +28 -0
- package/src/web/public/assets/md-parse-DN9INgZn.js +25 -0
- package/src/web/public/assets/member-picker--32VkTmv.js +1 -0
- package/src/web/public/assets/overview-BmoTQJuu.js +1 -0
- package/src/web/public/assets/progress-CWy9bYKr.js +3 -0
- package/src/web/public/assets/refs-DAy1kYGf.js +1 -0
- package/src/web/public/assets/repos-D_NT51Dq.js +9 -0
- package/src/web/public/assets/route-crumb-lOriqwxP.js +1 -0
- package/src/web/public/assets/settings-CBrQ3Iz5.css +1 -0
- package/src/web/public/assets/settings-Vp3ZMC1M.js +7 -0
- package/src/web/public/assets/status-tag-DGlwjAg2.js +1 -0
- package/src/web/public/assets/task-CRpctHxx.js +9 -0
- package/src/web/public/assets/task-status-BP6y8MVu.js +1 -0
- package/src/web/public/assets/templates-D900RS5b.js +1 -0
- package/src/web/public/assets/tool-bar-1h2zairf.css +1 -0
- package/src/web/public/assets/tool-bar-C-rnP0vv.js +1 -0
- package/src/web/public/assets/upload-L1g-pfvZ.js +1 -0
- package/src/web/public/index.html +6 -5
- package/src/web/public/assets/Introduction-MAkTZvUX.js +0 -1
- package/src/web/public/assets/attach-Bw0necIf.js +0 -1
- package/src/web/public/assets/cloud-CG_hgVn9.js +0 -3
- package/src/web/public/assets/composer-panel-S2d6A3fG.js +0 -1
- package/src/web/public/assets/dag-CwY66RrZ.js +0 -1
- package/src/web/public/assets/dir-B_ySdQT1.js +0 -5
- package/src/web/public/assets/group-6sWouRDt.js +0 -1
- package/src/web/public/assets/index-DKncYqtS.js +0 -54
- package/src/web/public/assets/index-DO7b1M3E.css +0 -1
- package/src/web/public/assets/md-edit-ops-ZwnwtEax.js +0 -22
- package/src/web/public/assets/md-history-BxbOQtPI.js +0 -1
- package/src/web/public/assets/md-panes-Cso2NHbG.js +0 -7
- package/src/web/public/assets/member-picker-BpB9ZpWx.js +0 -1
- package/src/web/public/assets/overview-Bo8ivqRU.js +0 -1
- package/src/web/public/assets/progress-DPkGjn0P.js +0 -3
- package/src/web/public/assets/refs-CskU6rI7.js +0 -1
- package/src/web/public/assets/repos-B_tskNGw.js +0 -9
- package/src/web/public/assets/route-crumb-BZ6ffDRj.js +0 -1
- package/src/web/public/assets/settings-BMTd_p9Y.js +0 -7
- package/src/web/public/assets/settings-qCi-niJC.css +0 -1
- package/src/web/public/assets/task-Cs-9RNQn.js +0 -7
- package/src/web/public/assets/task-status-Bgo2Nfiw.js +0 -1
- package/src/web/public/assets/template-editor-CRxfV218.js +0 -1
- package/src/web/public/assets/templates-Apc3JKXa.js +0 -2
- package/src/web/public/assets/upload-C83Bwy06.js +0 -1
- /package/src/web/public/assets/{attach-BZrdOH46.css → task-status-BZrdOH46.css} +0 -0
|
@@ -11,6 +11,8 @@ import { Icon } from '../../components/icons.jsx';
|
|
|
11
11
|
import Introduction from '../../components/Introduction/index.jsx';
|
|
12
12
|
import Pager from '../../components/pager.jsx';
|
|
13
13
|
import { RowMenu } from '../../components/popup/index.jsx';
|
|
14
|
+
import ToolActsBar from '../../components/tool-acts/bar.jsx';
|
|
15
|
+
import { statusTone, statusShort } from '../../components/status-tag/model.js';
|
|
14
16
|
import { titleFromMd } from '../../modules/md/md-parse.js';
|
|
15
17
|
|
|
16
18
|
function shortTime(v) {
|
|
@@ -36,17 +38,19 @@ export default function Landing({
|
|
|
36
38
|
onDeleteTask,
|
|
37
39
|
onDeleteTasks, // (ids) 批量删除选中任务
|
|
38
40
|
onCancelTasks, // (ids) 批量取消选中待领取任务
|
|
41
|
+
onCompleteTasks, // (ids) 批量把选中待领取任务标为完成
|
|
39
42
|
onReopenTask,
|
|
40
43
|
onTplMenu,
|
|
41
44
|
onImport,
|
|
42
45
|
onProg,
|
|
43
46
|
onMoveTask, // (t, targetId, 'before'|'after') 拖动排序落盘
|
|
44
47
|
onOpenDag, // (t) 打开编排编辑器
|
|
45
|
-
onOpenFlow, // ()
|
|
48
|
+
onOpenFlow, // () 打开可视化编排面板
|
|
46
49
|
onToggleGate, // (t) 闸门快捷开关
|
|
47
50
|
downstreamOf, // { [gateTaskId]: number[] } 闸门挡住的后续任务 id
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
onDeleted, // () 打开已删除任务面板(#139 工具编排)
|
|
52
|
+
onRefs, // () 打开文档列表右侧栏
|
|
53
|
+
deletedCount = 0 // 已软删任务数(「更多」角标提示)
|
|
50
54
|
}) {
|
|
51
55
|
const name = isGlobal ? '全局池' : (topic?.name || '目录');
|
|
52
56
|
const path = isGlobal ? '共享池(无固定目录)' : (topic?.cwd || '—');
|
|
@@ -68,8 +72,8 @@ export default function Landing({
|
|
|
68
72
|
const pageIds = tasks.map((t) => Number(t.id));
|
|
69
73
|
const allPicked = pageIds.length > 0 && pageIds.every((id) => picked.has(id));
|
|
70
74
|
const pickedTasks = tasks.filter((t) => picked.has(Number(t.id)));
|
|
71
|
-
//
|
|
72
|
-
const
|
|
75
|
+
// 取消/标为完成只对待领取生效;已领取/已交付/已取消由后端跳过
|
|
76
|
+
const closableTasks = pickedTasks.filter(
|
|
73
77
|
(t) => t.status === 'pending' && !t.migratedTo && !t.deletedAt
|
|
74
78
|
);
|
|
75
79
|
const togglePick = (id) => {
|
|
@@ -91,7 +95,8 @@ export default function Landing({
|
|
|
91
95
|
};
|
|
92
96
|
const runBatch = async (kind) => {
|
|
93
97
|
const ids = [...picked];
|
|
94
|
-
const fn =
|
|
98
|
+
const fn =
|
|
99
|
+
kind === 'cancel' ? onCancelTasks : kind === 'complete' ? onCompleteTasks : onDeleteTasks;
|
|
95
100
|
if (!ids.length || !fn) return;
|
|
96
101
|
const ok = await fn(ids);
|
|
97
102
|
if (ok) setPicked(new Set());
|
|
@@ -152,79 +157,83 @@ export default function Landing({
|
|
|
152
157
|
{!isGlobal && repo ? <Introduction kind="repo" owner={repo} model={model} /> : null}
|
|
153
158
|
|
|
154
159
|
<div className="mdw-land-acts">
|
|
155
|
-
|
|
156
|
-
<
|
|
157
|
-
|
|
158
|
-
className="
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
160
|
+
{/* #139:工具区可编排(顺序 / 显隐;隐藏收入「更多」) */}
|
|
161
|
+
<ToolActsBar
|
|
162
|
+
kind="dir"
|
|
163
|
+
className="mdw-land-ta"
|
|
164
|
+
labels={{
|
|
165
|
+
more: deletedCount > 0 ? `更多 (${deletedCount})` : '更多',
|
|
166
|
+
deleted: deletedCount > 0 ? `已删除任务(${deletedCount})` : '已删除任务',
|
|
167
|
+
}}
|
|
168
|
+
titles={{
|
|
169
|
+
tpl: '按模板新建一页',
|
|
170
|
+
import: '把一个 .md 文件导入成任务',
|
|
171
|
+
progress: '打开这个目录的进程面板',
|
|
172
|
+
orch: '打开可视化编排面板',
|
|
173
|
+
more: deletedCount > 0 ? `更多操作(含 ${deletedCount} 条已删除任务)` : '更多操作',
|
|
174
|
+
deleted: '查看并恢复已删除任务',
|
|
175
|
+
refs: '查看文档 / reference 列表',
|
|
176
|
+
}}
|
|
177
|
+
renderers={{
|
|
178
|
+
tpl: () => (
|
|
179
|
+
<button
|
|
180
|
+
type="button"
|
|
181
|
+
className="btn small ghost"
|
|
182
|
+
title="按模板新建一页"
|
|
183
|
+
aria-haspopup="menu"
|
|
184
|
+
onClick={(e) => onTplMenu?.(e)}
|
|
185
|
+
>
|
|
186
|
+
模板 ▾
|
|
187
|
+
</button>
|
|
188
|
+
),
|
|
189
|
+
}}
|
|
190
|
+
actions={{
|
|
191
|
+
new: onNew,
|
|
192
|
+
import: onImport,
|
|
193
|
+
progress: onProg,
|
|
194
|
+
orch: onOpenFlow,
|
|
195
|
+
deleted: onDeleted,
|
|
196
|
+
refs: onRefs,
|
|
197
|
+
}}
|
|
198
|
+
/>
|
|
191
199
|
<span className="mdw-land-count">
|
|
192
200
|
{pendingCount > 0 && <b className="mdw-land-pending">{pendingCount} 待领取</b>}
|
|
193
201
|
{' '}
|
|
194
202
|
{taskCount} 个任务
|
|
195
203
|
</span>
|
|
196
|
-
{onOpenFlow && (
|
|
197
|
-
<span
|
|
198
|
-
className="dag-link mdw-land-orch"
|
|
199
|
-
role="button"
|
|
200
|
-
tabIndex={-1}
|
|
201
|
-
title="打开可视化编排面板:有向连线定顺序(未连线走默认序)、设闸门、加时间目标"
|
|
202
|
-
onClick={(e) => {
|
|
203
|
-
e.stopPropagation();
|
|
204
|
-
onOpenFlow();
|
|
205
|
-
}}
|
|
206
|
-
>
|
|
207
|
-
编排
|
|
208
|
-
</span>
|
|
209
|
-
)}
|
|
210
204
|
</div>
|
|
211
205
|
|
|
212
206
|
{pickedTasks.length > 0 && (
|
|
213
207
|
<div className="mdw-land-batch">
|
|
214
208
|
<span className="mdw-land-batch-count">已选 {pickedTasks.length} 条</span>
|
|
209
|
+
{onCompleteTasks && (
|
|
210
|
+
<button
|
|
211
|
+
type="button"
|
|
212
|
+
className="btn ghost sm"
|
|
213
|
+
disabled={!closableTasks.length}
|
|
214
|
+
title={
|
|
215
|
+
closableTasks.length
|
|
216
|
+
? '把选中的待领取任务标为已完成(补一条完成记录,原文留档)'
|
|
217
|
+
: '只有待领取任务可以直接标为完成'
|
|
218
|
+
}
|
|
219
|
+
onClick={() => runBatch('complete')}
|
|
220
|
+
>
|
|
221
|
+
标为完成选中{closableTasks.length ? ` (${closableTasks.length})` : ''}
|
|
222
|
+
</button>
|
|
223
|
+
)}
|
|
215
224
|
{onCancelTasks && (
|
|
216
225
|
<button
|
|
217
226
|
type="button"
|
|
218
227
|
className="btn ghost sm"
|
|
219
|
-
disabled={!
|
|
228
|
+
disabled={!closableTasks.length}
|
|
220
229
|
title={
|
|
221
|
-
|
|
230
|
+
closableTasks.length
|
|
222
231
|
? '把选中的待领取任务标为已取消(终态,原文留档)'
|
|
223
232
|
: '只有待领取任务可以取消'
|
|
224
233
|
}
|
|
225
234
|
onClick={() => runBatch('cancel')}
|
|
226
235
|
>
|
|
227
|
-
取消选中{
|
|
236
|
+
取消选中{closableTasks.length ? ` (${closableTasks.length})` : ''}
|
|
228
237
|
</button>
|
|
229
238
|
)}
|
|
230
239
|
{onDeleteTasks && (
|
|
@@ -327,17 +336,11 @@ export default function Landing({
|
|
|
327
336
|
</div>
|
|
328
337
|
</td>
|
|
329
338
|
<td>
|
|
339
|
+
{/* 状态徽标(#121 统一口径,components/status-tag/model.js):
|
|
340
|
+
等=浅灰 / 跑=进行中蓝 / 完=已完成绿 / 档=收口灰。
|
|
341
|
+
t.from 只是来源标记,不再当「在跑」。 */}
|
|
330
342
|
<span
|
|
331
|
-
className={
|
|
332
|
-
'st' +
|
|
333
|
-
(t.status === 'done' || t.status === 'claimed'
|
|
334
|
-
? ' done'
|
|
335
|
-
: t.status === 'cancelled'
|
|
336
|
-
? ' done'
|
|
337
|
-
: t.from
|
|
338
|
-
? ' run'
|
|
339
|
-
: '')
|
|
340
|
-
}
|
|
343
|
+
className={'st ' + statusTone(t)}
|
|
341
344
|
title={
|
|
342
345
|
t.status === 'cancelled'
|
|
343
346
|
? '已取消:被新任务取代或明确作废,原文留档'
|
|
@@ -346,15 +349,7 @@ export default function Landing({
|
|
|
346
349
|
: ''
|
|
347
350
|
}
|
|
348
351
|
>
|
|
349
|
-
{t
|
|
350
|
-
? '档'
|
|
351
|
-
: t.status === 'done'
|
|
352
|
-
? '完'
|
|
353
|
-
: t.status === 'claimed'
|
|
354
|
-
? '跑'
|
|
355
|
-
: t.from
|
|
356
|
-
? '跑'
|
|
357
|
-
: '等'}
|
|
352
|
+
{statusShort(t)}
|
|
358
353
|
</span>
|
|
359
354
|
</td>
|
|
360
355
|
<td className="mono faint">{shortTime(t.createdAt)}</td>
|