@artenx/dshb 0.1.41 → 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 +251 -103
- package/lib/client.js.map +1 -1
- package/lib/core/index.js +343 -7
- package/lib/core/index.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-journal.js +10 -0
- package/lib/core/sync/session-journal.js.map +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-lum5L2ip.d.ts → session-journal-BwrCnkk4.d.ts} +4 -2
- package/lib/{session-sync-Be5wuYHJ.d.ts → session-sync-Celc4x_B.d.ts} +5 -5
- package/lib/{ssh-transport-Cevwfre9.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
|
@@ -2189,6 +2189,121 @@ window.__ModuleLoader__.load({
|
|
|
2189
2189
|
scan();
|
|
2190
2190
|
}
|
|
2191
2191
|
//#endregion
|
|
2192
|
+
//#region src/client/remote-session.tsx
|
|
2193
|
+
/** 会话行悬停按钮:该会话来自某个同步 peer 时显示「打开远端会话」。 */
|
|
2194
|
+
function RemoteSessionRowAction({ sessionId }) {
|
|
2195
|
+
const [origin, setOrigin] = (0, react.useState)(void 0);
|
|
2196
|
+
const [checked, setChecked] = (0, react.useState)(false);
|
|
2197
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
2198
|
+
const id = String(sessionId ?? "");
|
|
2199
|
+
(0, react.useEffect)(() => {
|
|
2200
|
+
let cancelled = false;
|
|
2201
|
+
setChecked(false);
|
|
2202
|
+
setOrigin(void 0);
|
|
2203
|
+
if (!id) {
|
|
2204
|
+
setChecked(true);
|
|
2205
|
+
return;
|
|
2206
|
+
}
|
|
2207
|
+
fetch(`/api/dshb/sync/session-origin?sessionId=${encodeURIComponent(id)}`, { cache: "no-store" }).then(async (res) => res.ok ? await res.json() : void 0).then((body) => {
|
|
2208
|
+
if (cancelled) return;
|
|
2209
|
+
if (body?.peerId && body.remoteSessionId) setOrigin({
|
|
2210
|
+
peerId: body.peerId,
|
|
2211
|
+
remoteSessionId: body.remoteSessionId
|
|
2212
|
+
});
|
|
2213
|
+
setChecked(true);
|
|
2214
|
+
}).catch(() => {
|
|
2215
|
+
if (!cancelled) setChecked(true);
|
|
2216
|
+
});
|
|
2217
|
+
return () => {
|
|
2218
|
+
cancelled = true;
|
|
2219
|
+
};
|
|
2220
|
+
}, [id]);
|
|
2221
|
+
if (!checked || !origin) return null;
|
|
2222
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2223
|
+
type: "button",
|
|
2224
|
+
"data-dshb-remote-session": "open",
|
|
2225
|
+
"aria-label": "打开远端会话",
|
|
2226
|
+
title: "打开远端会话(实时操作远端 DSH)",
|
|
2227
|
+
onClick: (event) => {
|
|
2228
|
+
event.stopPropagation();
|
|
2229
|
+
setOpen(true);
|
|
2230
|
+
},
|
|
2231
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
2232
|
+
width: "14",
|
|
2233
|
+
height: "14",
|
|
2234
|
+
viewBox: "0 0 16 16",
|
|
2235
|
+
fill: "none",
|
|
2236
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2237
|
+
"aria-hidden": "true",
|
|
2238
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
2239
|
+
cx: "8",
|
|
2240
|
+
cy: "8",
|
|
2241
|
+
r: "2",
|
|
2242
|
+
stroke: "currentColor",
|
|
2243
|
+
"stroke-width": "1.5"
|
|
2244
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
2245
|
+
d: "M8 3.5a4.5 4.5 0 0 1 4.5 4.5M8 3.5A4.5 4.5 0 0 0 3.5 8M8 12.5a4.5 4.5 0 0 0 3.2-1.3M8 12.5a4.5 4.5 0 0 1-3.2-1.3",
|
|
2246
|
+
stroke: "currentColor",
|
|
2247
|
+
"stroke-width": "1.5",
|
|
2248
|
+
"stroke-linecap": "round"
|
|
2249
|
+
})]
|
|
2250
|
+
})
|
|
2251
|
+
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RemoteSessionOverlay, {
|
|
2252
|
+
peerId: origin.peerId,
|
|
2253
|
+
onClose: () => setOpen(false)
|
|
2254
|
+
}) : null] });
|
|
2255
|
+
}
|
|
2256
|
+
const OVERLAY_STYLE = `
|
|
2257
|
+
[data-dshb-remote-overlay] { position: fixed; inset: 0; z-index: 2147483000; background: var(--dsh-bg, #0b0d10); display: flex; flex-direction: column; }
|
|
2258
|
+
[data-dshb-remote-overlay] > header { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); font-size: 12px; opacity: .85; }
|
|
2259
|
+
[data-dshb-remote-overlay] > header button { cursor: pointer; }
|
|
2260
|
+
[data-dshb-remote-overlay] > iframe { flex: 1; width: 100%; border: 0; background: transparent; }
|
|
2261
|
+
`;
|
|
2262
|
+
function RemoteSessionOverlay({ peerId, onClose }) {
|
|
2263
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2264
|
+
"data-dshb-remote-overlay": true,
|
|
2265
|
+
role: "dialog",
|
|
2266
|
+
"aria-label": "远端会话",
|
|
2267
|
+
children: [
|
|
2268
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: OVERLAY_STYLE }),
|
|
2269
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2270
|
+
type: "button",
|
|
2271
|
+
"aria-label": "返回本地会话",
|
|
2272
|
+
title: "返回本地会话",
|
|
2273
|
+
onClick: onClose,
|
|
2274
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
2275
|
+
width: "14",
|
|
2276
|
+
height: "14",
|
|
2277
|
+
viewBox: "0 0 16 16",
|
|
2278
|
+
fill: "none",
|
|
2279
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2280
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
2281
|
+
d: "M10 3L5 8L10 13",
|
|
2282
|
+
stroke: "currentColor",
|
|
2283
|
+
"stroke-width": "1.5",
|
|
2284
|
+
"stroke-linecap": "round",
|
|
2285
|
+
"stroke-linejoin": "round"
|
|
2286
|
+
})
|
|
2287
|
+
})
|
|
2288
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "远端会话视图 · 实时操作远端 DSH" })] }),
|
|
2289
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
|
|
2290
|
+
src: `/api/dshb/sync/relay/${encodeURIComponent(peerId)}/app/`,
|
|
2291
|
+
title: "远端会话"
|
|
2292
|
+
})
|
|
2293
|
+
]
|
|
2294
|
+
});
|
|
2295
|
+
}
|
|
2296
|
+
/** 注册远端会话入口(侧栏会话行悬停按钮带,位于 pin 之后)。 */
|
|
2297
|
+
function installRemoteSessionEntry(ctx) {
|
|
2298
|
+
const slots = ctx.slots;
|
|
2299
|
+
if (!slots) return;
|
|
2300
|
+
slots.inject("sidebar.workspaces.session.row.action", () => slots.register({
|
|
2301
|
+
name: "sidebar.workspaces.session.row.action",
|
|
2302
|
+
id: "dshb-remote-session",
|
|
2303
|
+
order: 300
|
|
2304
|
+
}, RemoteSessionRowAction));
|
|
2305
|
+
}
|
|
2306
|
+
//#endregion
|
|
2192
2307
|
//#region src/client/sync-selection-picker.tsx
|
|
2193
2308
|
function originKey(origin) {
|
|
2194
2309
|
return JSON.stringify([origin.originInstanceId, origin.originEntityId]);
|
|
@@ -2466,6 +2581,7 @@ window.__ModuleLoader__.load({
|
|
|
2466
2581
|
direction: "pull",
|
|
2467
2582
|
schedule: "manual",
|
|
2468
2583
|
mode: "full",
|
|
2584
|
+
syncNodes: true,
|
|
2469
2585
|
syncSessions: false,
|
|
2470
2586
|
selection: {
|
|
2471
2587
|
mode: "all",
|
|
@@ -2487,6 +2603,8 @@ window.__ModuleLoader__.load({
|
|
|
2487
2603
|
if (form.authKind === "key" && !form.privateKey && !savedSecrets?.hasKey) return "请填写 SSH 私钥内容";
|
|
2488
2604
|
}
|
|
2489
2605
|
function toSyncPeerForm(peer) {
|
|
2606
|
+
const syncSessions = peer.syncSessions;
|
|
2607
|
+
const mode = syncSessions ? peer.mode ?? "full" : "full";
|
|
2490
2608
|
return {
|
|
2491
2609
|
name: peer.name,
|
|
2492
2610
|
host: peer.host,
|
|
@@ -2501,18 +2619,29 @@ window.__ModuleLoader__.load({
|
|
|
2501
2619
|
remoteWebPort: peer.remoteWebPort == null ? "" : String(peer.remoteWebPort),
|
|
2502
2620
|
direction: peer.direction,
|
|
2503
2621
|
schedule: peer.schedule,
|
|
2504
|
-
mode
|
|
2505
|
-
|
|
2622
|
+
mode,
|
|
2623
|
+
syncNodes: mode === "metadata" ? peer.syncNodes ?? true : true,
|
|
2624
|
+
syncSessions,
|
|
2506
2625
|
selection: peer.selection ?? {
|
|
2507
2626
|
mode: "all",
|
|
2508
2627
|
nodes: [],
|
|
2509
2628
|
workspaces: [],
|
|
2510
2629
|
sessions: []
|
|
2511
2630
|
},
|
|
2512
|
-
enabled:
|
|
2631
|
+
enabled: true
|
|
2513
2632
|
};
|
|
2514
2633
|
}
|
|
2634
|
+
/**
|
|
2635
|
+
* 把表单归一化为保存请求:
|
|
2636
|
+
* - 「启用此同步节点」已移除,enabled 恒 true(停用语义由删除节点承担)。
|
|
2637
|
+
* - 元数据同步且不同步工作节点时没有任何调度内容,强制手动时机。
|
|
2638
|
+
* - 全量会话同步依赖工作节点配置,强制开启节点同步。
|
|
2639
|
+
*/
|
|
2515
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;
|
|
2516
2645
|
const fields = {
|
|
2517
2646
|
name: form.name.trim(),
|
|
2518
2647
|
host: form.host.trim(),
|
|
@@ -2520,11 +2649,12 @@ window.__ModuleLoader__.load({
|
|
|
2520
2649
|
username: form.username.trim(),
|
|
2521
2650
|
authKind: form.authKind,
|
|
2522
2651
|
direction: form.direction,
|
|
2523
|
-
schedule
|
|
2524
|
-
mode
|
|
2525
|
-
|
|
2652
|
+
schedule,
|
|
2653
|
+
mode,
|
|
2654
|
+
syncNodes,
|
|
2655
|
+
syncSessions,
|
|
2526
2656
|
selection: form.selection,
|
|
2527
|
-
enabled:
|
|
2657
|
+
enabled: true,
|
|
2528
2658
|
...form.remoteDshHome.trim() ? { remoteDshHome: form.remoteDshHome.trim() } : {},
|
|
2529
2659
|
...form.remoteProfile.trim() ? { remoteProfile: form.remoteProfile.trim() } : {},
|
|
2530
2660
|
...form.remoteWebPort.trim() ? { remoteWebPort: Number(form.remoteWebPort) } : {}
|
|
@@ -3414,28 +3544,66 @@ window.__ModuleLoader__.load({
|
|
|
3414
3544
|
},
|
|
3415
3545
|
children: "同步策略"
|
|
3416
3546
|
}),
|
|
3417
|
-
/* @__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", {
|
|
3418
3579
|
className: "dshb-sync-two-col",
|
|
3419
3580
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3420
3581
|
style: field,
|
|
3421
|
-
children: [
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
children: "
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
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
|
+
]
|
|
3439
3607
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3440
3608
|
style: field,
|
|
3441
3609
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -3465,87 +3633,66 @@ window.__ModuleLoader__.load({
|
|
|
3465
3633
|
flexDirection: "column",
|
|
3466
3634
|
gap: 10
|
|
3467
3635
|
},
|
|
3468
|
-
children: [
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3489
|
-
style: {
|
|
3490
|
-
display: "block",
|
|
3491
|
-
fontSize: 11,
|
|
3492
|
-
opacity: .5,
|
|
3493
|
-
marginTop: 2
|
|
3494
|
-
},
|
|
3495
|
-
children: form.mode === "metadata" ? "同步远端工作区与会话列表,通过加密通道实时访问会话内容" : "同步会话完整内容,导入后可在本机继续;保留冲突分支供恢复"
|
|
3496
|
-
})] })]
|
|
3497
|
-
}),
|
|
3498
|
-
form.syncSessions && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3499
|
-
style: {
|
|
3500
|
-
...field,
|
|
3501
|
-
margin: 0
|
|
3502
|
-
},
|
|
3503
|
-
children: [
|
|
3504
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3505
|
-
style: label,
|
|
3506
|
-
children: "同步模式"
|
|
3507
|
-
}),
|
|
3508
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
3509
|
-
style: inputStyle$1,
|
|
3510
|
-
value: form.mode,
|
|
3511
|
-
onChange: (e) => setForm((c) => ({
|
|
3512
|
-
...c,
|
|
3513
|
-
mode: e.target.value
|
|
3514
|
-
})),
|
|
3515
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3516
|
-
value: "full",
|
|
3517
|
-
children: "全量同步"
|
|
3518
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
3519
|
-
value: "metadata",
|
|
3520
|
-
children: "元数据同步"
|
|
3521
|
-
})]
|
|
3522
|
-
}),
|
|
3523
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3524
|
-
style: hint,
|
|
3525
|
-
children: form.mode === "metadata" ? "仅同步工作节点与工作区会话列表,不传输会话内容;点击同步来的会话时,通过加密 SSH 通道读取远端内容;wss 实时事件流与发送消息将在后续版本接入。" : "将工作节点配置与工作区会话内容完整传输到对端;导入后可在本机离线继续会话,数据量大时耗时较长。"
|
|
3526
|
-
})
|
|
3527
|
-
]
|
|
3528
|
-
}),
|
|
3529
|
-
/* @__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", {
|
|
3530
3656
|
style: {
|
|
3531
|
-
display: "
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3657
|
+
display: "block",
|
|
3658
|
+
fontSize: 11,
|
|
3659
|
+
opacity: .5,
|
|
3660
|
+
marginTop: 2
|
|
3535
3661
|
},
|
|
3536
|
-
children:
|
|
3537
|
-
|
|
3538
|
-
|
|
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,
|
|
3539
3677
|
onChange: (e) => setForm((c) => ({
|
|
3540
3678
|
...c,
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
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
|
+
})]
|
|
3549
3696
|
}),
|
|
3550
3697
|
selectedPeer && form.syncSessions && form.mode === "full" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3551
3698
|
style: {
|
|
@@ -5289,6 +5436,7 @@ window.__ModuleLoader__.load({
|
|
|
5289
5436
|
name: "sidebar.workspaces.directoryFlow",
|
|
5290
5437
|
priority: -10
|
|
5291
5438
|
}, DirectoryFlowOccupant));
|
|
5439
|
+
installRemoteSessionEntry(sub);
|
|
5292
5440
|
}
|
|
5293
5441
|
});
|
|
5294
5442
|
const ICON_SVG = {
|