@artenx/dshb 0.1.42 → 0.1.43
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/lib/client.js +135 -103
- package/lib/client.js.map +1 -1
- package/lib/core/routes.d.ts +1 -1
- package/lib/core/sync/coordinator.d.ts +5 -5
- package/lib/core/sync/coordinator.js +7 -2
- package/lib/core/sync/coordinator.js.map +1 -1
- package/lib/core/sync/host-key.d.ts +1 -1
- package/lib/core/sync/internal-routes.d.ts +3 -3
- package/lib/core/sync/model.d.ts +1 -1
- package/lib/core/sync/model.js +3 -0
- package/lib/core/sync/model.js.map +1 -1
- package/lib/core/sync/node-sync.d.ts +1 -1
- package/lib/core/sync/offline-archive.d.ts +4 -4
- package/lib/core/sync/peer-manager.d.ts +2 -2
- package/lib/core/sync/peer-manager.js +1 -0
- package/lib/core/sync/peer-manager.js.map +1 -1
- package/lib/core/sync/routes.d.ts +1 -1
- package/lib/core/sync/session-journal.d.ts +1 -1
- package/lib/core/sync/session-routes.d.ts +1 -1
- package/lib/core/sync/session-sync.d.ts +1 -1
- package/lib/core/sync/ssh-transport.d.ts +1 -1
- package/lib/core/sync/stores.d.ts +1 -1
- package/lib/core/workspaces.d.ts +1 -1
- package/lib/{host-key-CjO13Ds4.d.ts → host-key-DeHqgO7s.d.ts} +2 -2
- package/lib/{model-CX2TlH2E.d.ts → model-qtM3rcyA.d.ts} +3 -1
- package/lib/{node-sync-qnJ7u0TU.d.ts → node-sync-CJZl2FCE.d.ts} +3 -3
- package/lib/{session-journal-ftjZuIxo.d.ts → session-journal-BwrCnkk4.d.ts} +2 -2
- package/lib/{session-sync-AlV-M72t.d.ts → session-sync-Celc4x_B.d.ts} +5 -5
- package/lib/{ssh-transport-a3qXoscG.d.ts → ssh-transport-DLXkPpxT.d.ts} +5 -5
- package/lib/{stores-BwQLabuJ.d.ts → stores-NzEbaGQ3.d.ts} +2 -2
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -2581,6 +2581,7 @@ window.__ModuleLoader__.load({
|
|
|
2581
2581
|
direction: "pull",
|
|
2582
2582
|
schedule: "manual",
|
|
2583
2583
|
mode: "full",
|
|
2584
|
+
syncNodes: true,
|
|
2584
2585
|
syncSessions: false,
|
|
2585
2586
|
selection: {
|
|
2586
2587
|
mode: "all",
|
|
@@ -2602,6 +2603,8 @@ window.__ModuleLoader__.load({
|
|
|
2602
2603
|
if (form.authKind === "key" && !form.privateKey && !savedSecrets?.hasKey) return "请填写 SSH 私钥内容";
|
|
2603
2604
|
}
|
|
2604
2605
|
function toSyncPeerForm(peer) {
|
|
2606
|
+
const syncSessions = peer.syncSessions;
|
|
2607
|
+
const mode = syncSessions ? peer.mode ?? "full" : "full";
|
|
2605
2608
|
return {
|
|
2606
2609
|
name: peer.name,
|
|
2607
2610
|
host: peer.host,
|
|
@@ -2616,18 +2619,29 @@ window.__ModuleLoader__.load({
|
|
|
2616
2619
|
remoteWebPort: peer.remoteWebPort == null ? "" : String(peer.remoteWebPort),
|
|
2617
2620
|
direction: peer.direction,
|
|
2618
2621
|
schedule: peer.schedule,
|
|
2619
|
-
mode
|
|
2620
|
-
|
|
2622
|
+
mode,
|
|
2623
|
+
syncNodes: mode === "metadata" ? peer.syncNodes ?? true : true,
|
|
2624
|
+
syncSessions,
|
|
2621
2625
|
selection: peer.selection ?? {
|
|
2622
2626
|
mode: "all",
|
|
2623
2627
|
nodes: [],
|
|
2624
2628
|
workspaces: [],
|
|
2625
2629
|
sessions: []
|
|
2626
2630
|
},
|
|
2627
|
-
enabled:
|
|
2631
|
+
enabled: true
|
|
2628
2632
|
};
|
|
2629
2633
|
}
|
|
2634
|
+
/**
|
|
2635
|
+
* 把表单归一化为保存请求:
|
|
2636
|
+
* - 「启用此同步节点」已移除,enabled 恒 true(停用语义由删除节点承担)。
|
|
2637
|
+
* - 元数据同步且不同步工作节点时没有任何调度内容,强制手动时机。
|
|
2638
|
+
* - 全量会话同步依赖工作节点配置,强制开启节点同步。
|
|
2639
|
+
*/
|
|
2630
2640
|
function buildSyncPeerFormRequest(form) {
|
|
2641
|
+
const syncSessions = form.syncSessions;
|
|
2642
|
+
const mode = syncSessions ? form.mode : "full";
|
|
2643
|
+
const syncNodes = mode === "metadata" ? form.syncNodes : true;
|
|
2644
|
+
const schedule = mode === "metadata" && !syncNodes ? "manual" : form.schedule;
|
|
2631
2645
|
const fields = {
|
|
2632
2646
|
name: form.name.trim(),
|
|
2633
2647
|
host: form.host.trim(),
|
|
@@ -2635,11 +2649,12 @@ window.__ModuleLoader__.load({
|
|
|
2635
2649
|
username: form.username.trim(),
|
|
2636
2650
|
authKind: form.authKind,
|
|
2637
2651
|
direction: form.direction,
|
|
2638
|
-
schedule
|
|
2639
|
-
mode
|
|
2640
|
-
|
|
2652
|
+
schedule,
|
|
2653
|
+
mode,
|
|
2654
|
+
syncNodes,
|
|
2655
|
+
syncSessions,
|
|
2641
2656
|
selection: form.selection,
|
|
2642
|
-
enabled:
|
|
2657
|
+
enabled: true,
|
|
2643
2658
|
...form.remoteDshHome.trim() ? { remoteDshHome: form.remoteDshHome.trim() } : {},
|
|
2644
2659
|
...form.remoteProfile.trim() ? { remoteProfile: form.remoteProfile.trim() } : {},
|
|
2645
2660
|
...form.remoteWebPort.trim() ? { remoteWebPort: Number(form.remoteWebPort) } : {}
|
|
@@ -3529,28 +3544,66 @@ window.__ModuleLoader__.load({
|
|
|
3529
3544
|
},
|
|
3530
3545
|
children: "同步策略"
|
|
3531
3546
|
}),
|
|
3532
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
3547
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3548
|
+
style: {
|
|
3549
|
+
...field,
|
|
3550
|
+
display: "flex",
|
|
3551
|
+
alignItems: "flex-start",
|
|
3552
|
+
gap: 8,
|
|
3553
|
+
cursor: "pointer"
|
|
3554
|
+
},
|
|
3555
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3556
|
+
type: "checkbox",
|
|
3557
|
+
checked: form.syncNodes,
|
|
3558
|
+
style: { marginTop: 2 },
|
|
3559
|
+
disabled: !(form.syncSessions && form.mode === "metadata"),
|
|
3560
|
+
onChange: (e) => setForm((c) => ({
|
|
3561
|
+
...c,
|
|
3562
|
+
syncNodes: e.target.checked,
|
|
3563
|
+
...e.target.checked || c.syncSessions && c.mode === "metadata" ? {} : { schedule: "manual" }
|
|
3564
|
+
}))
|
|
3565
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3566
|
+
style: { fontSize: 13 },
|
|
3567
|
+
children: "同步工作节点"
|
|
3568
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3569
|
+
style: {
|
|
3570
|
+
display: "block",
|
|
3571
|
+
fontSize: 11,
|
|
3572
|
+
opacity: .5,
|
|
3573
|
+
marginTop: 2
|
|
3574
|
+
},
|
|
3575
|
+
children: form.syncSessions && form.mode === "full" ? "全量会话同步依赖工作节点配置,始终开启" : "同步工作节点的 SSH 连接配置与远端目录"
|
|
3576
|
+
})] })]
|
|
3577
|
+
}),
|
|
3578
|
+
(form.syncNodes || form.syncSessions && form.mode === "full") && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3533
3579
|
className: "dshb-sync-two-col",
|
|
3534
3580
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3535
3581
|
style: field,
|
|
3536
|
-
children: [
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
children: "
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3582
|
+
children: [
|
|
3583
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3584
|
+
style: label,
|
|
3585
|
+
children: "同步方向"
|
|
3586
|
+
}),
|
|
3587
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
3588
|
+
style: inputStyle$1,
|
|
3589
|
+
value: form.direction,
|
|
3590
|
+
onChange: (e) => setForm((c) => ({
|
|
3591
|
+
...c,
|
|
3592
|
+
direction: e.target.value
|
|
3593
|
+
})),
|
|
3594
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3595
|
+
value: "pull",
|
|
3596
|
+
children: "单向拉取到本机"
|
|
3597
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3598
|
+
value: "bidirectional",
|
|
3599
|
+
children: "双向同步"
|
|
3600
|
+
})]
|
|
3601
|
+
}),
|
|
3602
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3603
|
+
style: hint,
|
|
3604
|
+
children: ["作用于工作节点配置", form.syncSessions && form.mode === "full" ? "与会话内容" : ""]
|
|
3605
|
+
})
|
|
3606
|
+
]
|
|
3554
3607
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3555
3608
|
style: field,
|
|
3556
3609
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -3580,87 +3633,66 @@ window.__ModuleLoader__.load({
|
|
|
3580
3633
|
flexDirection: "column",
|
|
3581
3634
|
gap: 10
|
|
3582
3635
|
},
|
|
3583
|
-
children: [
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3604
|
-
style: {
|
|
3605
|
-
display: "block",
|
|
3606
|
-
fontSize: 11,
|
|
3607
|
-
opacity: .5,
|
|
3608
|
-
marginTop: 2
|
|
3609
|
-
},
|
|
3610
|
-
children: form.mode === "metadata" ? "同步远端工作区与会话列表,通过加密通道实时访问会话内容" : "同步会话完整内容,导入后可在本机继续;保留冲突分支供恢复"
|
|
3611
|
-
})] })]
|
|
3612
|
-
}),
|
|
3613
|
-
form.syncSessions && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3614
|
-
style: {
|
|
3615
|
-
...field,
|
|
3616
|
-
margin: 0
|
|
3617
|
-
},
|
|
3618
|
-
children: [
|
|
3619
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3620
|
-
style: label,
|
|
3621
|
-
children: "同步模式"
|
|
3622
|
-
}),
|
|
3623
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
3624
|
-
style: inputStyle$1,
|
|
3625
|
-
value: form.mode,
|
|
3626
|
-
onChange: (e) => setForm((c) => ({
|
|
3627
|
-
...c,
|
|
3628
|
-
mode: e.target.value
|
|
3629
|
-
})),
|
|
3630
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3631
|
-
value: "full",
|
|
3632
|
-
children: "全量同步"
|
|
3633
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3634
|
-
value: "metadata",
|
|
3635
|
-
children: "元数据同步"
|
|
3636
|
-
})]
|
|
3637
|
-
}),
|
|
3638
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3639
|
-
style: hint,
|
|
3640
|
-
children: form.mode === "metadata" ? "仅同步工作节点与工作区会话列表,不传输会话内容;点击同步来的会话时,通过加密 SSH 通道读取远端内容;wss 实时事件流与发送消息将在后续版本接入。" : "将工作节点配置与工作区会话内容完整传输到对端;导入后可在本机离线继续会话,数据量大时耗时较长。"
|
|
3641
|
-
})
|
|
3642
|
-
]
|
|
3643
|
-
}),
|
|
3644
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3636
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3637
|
+
style: {
|
|
3638
|
+
display: "flex",
|
|
3639
|
+
alignItems: "flex-start",
|
|
3640
|
+
gap: 8,
|
|
3641
|
+
cursor: "pointer"
|
|
3642
|
+
},
|
|
3643
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3644
|
+
type: "checkbox",
|
|
3645
|
+
checked: form.syncSessions,
|
|
3646
|
+
style: { marginTop: 2 },
|
|
3647
|
+
onChange: (e) => setForm((c) => ({
|
|
3648
|
+
...c,
|
|
3649
|
+
syncSessions: e.target.checked,
|
|
3650
|
+
...e.target.checked ? { syncNodes: true } : { mode: "full" }
|
|
3651
|
+
}))
|
|
3652
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3653
|
+
style: { fontSize: 13 },
|
|
3654
|
+
children: "同步工作区会话"
|
|
3655
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3645
3656
|
style: {
|
|
3646
|
-
display: "
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3657
|
+
display: "block",
|
|
3658
|
+
fontSize: 11,
|
|
3659
|
+
opacity: .5,
|
|
3660
|
+
marginTop: 2
|
|
3650
3661
|
},
|
|
3651
|
-
children:
|
|
3652
|
-
|
|
3653
|
-
|
|
3662
|
+
children: form.mode === "metadata" ? "同步远端工作区与会话列表,通过加密通道实时访问会话内容" : "同步会话完整内容,导入后可在本机继续;保留冲突分支供恢复"
|
|
3663
|
+
})] })]
|
|
3664
|
+
}), form.syncSessions && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3665
|
+
style: {
|
|
3666
|
+
...field,
|
|
3667
|
+
margin: 0
|
|
3668
|
+
},
|
|
3669
|
+
children: [
|
|
3670
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3671
|
+
style: label,
|
|
3672
|
+
children: "同步模式"
|
|
3673
|
+
}),
|
|
3674
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
3675
|
+
style: inputStyle$1,
|
|
3676
|
+
value: form.mode,
|
|
3654
3677
|
onChange: (e) => setForm((c) => ({
|
|
3655
3678
|
...c,
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3679
|
+
mode: e.target.value,
|
|
3680
|
+
...e.target.value === "full" ? { syncNodes: true } : {}
|
|
3681
|
+
})),
|
|
3682
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3683
|
+
value: "full",
|
|
3684
|
+
children: "全量同步"
|
|
3685
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3686
|
+
value: "metadata",
|
|
3687
|
+
children: "元数据同步"
|
|
3688
|
+
})]
|
|
3689
|
+
}),
|
|
3690
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3691
|
+
style: hint,
|
|
3692
|
+
children: form.mode === "metadata" ? "仅同步工作区与会话列表,不传输会话内容;侧栏会话行的「打开远端会话」通过加密 SSH 通道实时读取远端内容并可直接继续对话与审批。" : "将工作节点配置与工作区会话内容完整传输到对端;导入后可在本机离线继续会话,数据量大时耗时较长。"
|
|
3693
|
+
})
|
|
3694
|
+
]
|
|
3695
|
+
})]
|
|
3664
3696
|
}),
|
|
3665
3697
|
selectedPeer && form.syncSessions && form.mode === "full" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3666
3698
|
style: {
|