dsh-remote-web 0.7.6-beta.8 → 0.7.6-beta.9
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 +83 -8
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -98,7 +98,7 @@ window.__ModuleLoader__.load({
|
|
|
98
98
|
// 绝不写 :root / body —— 否则会污染整个 GUI。JS 解析出主题后往根节点写
|
|
99
99
|
// data-dru-theme="dark|light",下面按属性切换;末一条 `:not([data-dru-theme])`
|
|
100
100
|
// 是 JS 尚未执行时的纯 CSS 兜底(一旦 JS 写过属性就不再参与,不会打架)。
|
|
101
|
-
".dru-settings-section,.dru-popup,.dru-nav-remote{",
|
|
101
|
+
".dru-settings-section,.dru-popup,.dru-nav-remote,.dru-standalone-card{",
|
|
102
102
|
" color-scheme:light;",
|
|
103
103
|
" --dru-surface:#f6f8fa;", // 卡片底
|
|
104
104
|
" --dru-surface-2:#ffffff;", // 抬升面(输入框/行/弹窗卡)
|
|
@@ -149,10 +149,11 @@ window.__ModuleLoader__.load({
|
|
|
149
149
|
// 深色:JS 写的 data-dru-theme 优先;宿主属性作 JS 未执行时的兜底。
|
|
150
150
|
// 取值跟着宿主的深色基色走(body 实测 #151517 / 层 1 #232324 / 层 2 #2c2c2e / 层 3 #353638),
|
|
151
151
|
// 语义色**在深底上重新取值**,不是沿用亮色值(亮色的 #1a7f37 / #cf222e 在深底对比度不足)。
|
|
152
|
-
".dru-settings-section[data-dru-theme=\"dark\"],.dru-popup[data-dru-theme=\"dark\"],.dru-nav-remote[data-dru-theme=\"dark\"],",
|
|
152
|
+
".dru-settings-section[data-dru-theme=\"dark\"],.dru-popup[data-dru-theme=\"dark\"],.dru-nav-remote[data-dru-theme=\"dark\"],.dru-standalone-card[data-dru-theme=\"dark\"],",
|
|
153
153
|
"body[data-ds-dark-theme] .dru-settings-section:not([data-dru-theme]),",
|
|
154
154
|
"body[data-ds-dark-theme] .dru-popup:not([data-dru-theme]),",
|
|
155
|
-
"body[data-ds-dark-theme] .dru-nav-remote:not([data-dru-theme])
|
|
155
|
+
"body[data-ds-dark-theme] .dru-nav-remote:not([data-dru-theme]),",
|
|
156
|
+
"body[data-ds-dark-theme] .dru-standalone-card:not([data-dru-theme]){",
|
|
156
157
|
" color-scheme:dark;",
|
|
157
158
|
" --dru-surface:#232324;",
|
|
158
159
|
" --dru-surface-2:#2c2c2e;",
|
|
@@ -202,6 +203,15 @@ window.__ModuleLoader__.load({
|
|
|
202
203
|
"}",
|
|
203
204
|
// 设置页栏目容器(nav 选中后渲染在 settings.section 内容区)
|
|
204
205
|
".dru-settings-section{max-width:720px;display:flex;flex-direction:column;gap:14px;padding-top:2px;color:var(--dru-fg)}",
|
|
206
|
+
// 📱 独立「远程访问」弹层(2026-10-25):入口点击不再去"猜"官方设置面板的 DOM,
|
|
207
|
+
// 直接弹我们自己的一份设置页 —— 宿主改版也影响不到它。
|
|
208
|
+
".dru-standalone-overlay{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:24px;background:var(--dru-overlay)}",
|
|
209
|
+
".dru-standalone-card{width:min(760px,100%);max-height:88vh;overflow:auto;box-sizing:border-box;padding:18px 20px 22px;border:1px solid var(--dru-border);border-radius:14px;background:var(--dru-surface-2);color:var(--dru-fg);box-shadow:0 18px 60px var(--dru-shadow)}",
|
|
210
|
+
".dru-standalone-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}",
|
|
211
|
+
".dru-standalone-title{font-size:16px;font-weight:700}",
|
|
212
|
+
".dru-standalone-close{appearance:none;border:1px solid var(--dru-border-ctl);background:var(--dru-surface-2);color:var(--dru-fg-muted);width:30px;height:30px;border-radius:8px;font-size:18px;line-height:1;cursor:pointer}",
|
|
213
|
+
".dru-standalone-close:hover{background:var(--dru-hover);color:var(--dru-fg)}",
|
|
214
|
+
"@media (max-width:640px){.dru-standalone-overlay{padding:8px}.dru-standalone-card{max-height:94vh;border-radius:12px;padding:14px 14px 18px}}",
|
|
205
215
|
".dru-settings-head{display:flex;align-items:center;gap:10px;padding:6px 2px 2px}",
|
|
206
216
|
".dru-settings-icon{font-size:24px;line-height:1;flex:none}",
|
|
207
217
|
// 标题/副标题优先沿用宿主语义令牌(自带深浅两套),取不到再退回本插件令牌
|
|
@@ -1117,6 +1127,61 @@ window.__ModuleLoader__.load({
|
|
|
1117
1127
|
0.2 实测该槽就在侧栏底部、且**当前是空的**)—— 位置、宽度、折叠态全由宿主负责。
|
|
1118
1128
|
所以这里不再注入任何 DOM,直接注册进槽位。id 仍保留 `dru-nav-remote`:
|
|
1119
1129
|
公告徽标 / 首次红点那套按 id 取节点的既有逻辑因此不用改。 */
|
|
1130
|
+
/* 📱 独立「远程访问」弹层(2026-10-25 用户拍板):
|
|
1131
|
+
桌面端点击侧栏入口时,不再去"点官方设置/找栏目"(宿主一改版就点错或没反应,
|
|
1132
|
+
实测会点到左上角「更多→浏览插件」),而是弹出我们自己的一份设置页。
|
|
1133
|
+
「设置 → 远程访问」栏目保留,正常从官方设置页进入的用户仍走那条路。
|
|
1134
|
+
实现上用 shell.overlay 槽(宿主最上层,不受侧栏容器裁剪),组件常驻、按事件开关。 */
|
|
1135
|
+
var standaloneOverlayMounted = false;
|
|
1136
|
+
function openRemoteStandalonePanel() {
|
|
1137
|
+
try { window.dispatchEvent(new CustomEvent("dsh-remote:open-standalone")); } catch (e) { /* 忽略 */ }
|
|
1138
|
+
}
|
|
1139
|
+
function RemoteStandaloneOverlay() {
|
|
1140
|
+
var st = useState(false);
|
|
1141
|
+
var open = st[0];
|
|
1142
|
+
var setOpen = st[1];
|
|
1143
|
+
useEffect(function () {
|
|
1144
|
+
standaloneOverlayMounted = true;
|
|
1145
|
+
function onOpen() { try { setOpen(true); } catch (e) { /* 忽略 */ } }
|
|
1146
|
+
function onKey(e) {
|
|
1147
|
+
if (!e) return;
|
|
1148
|
+
if (e.key === "Escape" || e.keyCode === 27) { try { setOpen(false); } catch (e2) { /* 忽略 */ } }
|
|
1149
|
+
}
|
|
1150
|
+
try {
|
|
1151
|
+
window.addEventListener("dsh-remote:open-standalone", onOpen);
|
|
1152
|
+
window.addEventListener("keydown", onKey);
|
|
1153
|
+
} catch (e3) { /* 忽略 */ }
|
|
1154
|
+
return function () {
|
|
1155
|
+
standaloneOverlayMounted = false;
|
|
1156
|
+
try {
|
|
1157
|
+
window.removeEventListener("dsh-remote:open-standalone", onOpen);
|
|
1158
|
+
window.removeEventListener("keydown", onKey);
|
|
1159
|
+
} catch (e4) { /* 忽略 */ }
|
|
1160
|
+
};
|
|
1161
|
+
}, []);
|
|
1162
|
+
if (!open) return null;
|
|
1163
|
+
var dark = false;
|
|
1164
|
+
try { dark = !!document.body && document.body.hasAttribute("data-ds-dark-theme"); } catch (e5) { /* 忽略 */ }
|
|
1165
|
+
return h("div", {
|
|
1166
|
+
className: "dru-standalone-overlay",
|
|
1167
|
+
role: "dialog",
|
|
1168
|
+
"aria-modal": "true",
|
|
1169
|
+
"aria-label": "远程访问",
|
|
1170
|
+
onClick: function (e) { if (e && e.target === e.currentTarget) setOpen(false); }
|
|
1171
|
+
},
|
|
1172
|
+
h("div", { className: "dru-standalone-card", "data-dru-theme": dark ? "dark" : "light" },
|
|
1173
|
+
h("div", { className: "dru-standalone-head" },
|
|
1174
|
+
h("b", { className: "dru-standalone-title" }, "📱 远程访问"),
|
|
1175
|
+
h("button", {
|
|
1176
|
+
type: "button",
|
|
1177
|
+
className: "dru-standalone-close",
|
|
1178
|
+
"aria-label": "关闭",
|
|
1179
|
+
onClick: function () { setOpen(false); }
|
|
1180
|
+
}, "×")),
|
|
1181
|
+
h(RemoteControlSection, { standalone: true })
|
|
1182
|
+
));
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1120
1185
|
function RemoteNavEntry(props) {
|
|
1121
1186
|
var wide = !(props && props.wide === false);
|
|
1122
1187
|
var seenArr = useState(false);
|
|
@@ -1133,12 +1198,15 @@ window.__ModuleLoader__.load({
|
|
|
1133
1198
|
try { e.preventDefault(); } catch (err) { /* 忽略 */ }
|
|
1134
1199
|
setClicked(true);
|
|
1135
1200
|
dotMarkSeen(); // 用过入口 = 已了解位置 → 收起首次红点
|
|
1136
|
-
// 2026-10-25
|
|
1137
|
-
//
|
|
1138
|
-
// 打开链内部自带兜底:侧栏候选 → 官方快捷键 → 更多/账号菜单 → 栏目点击。
|
|
1201
|
+
// 2026-10-25(用户拍板):优先弹**我们自己的独立设置页**(不再依赖官方设置面板 DOM);
|
|
1202
|
+
// 只有宿主没有 shell.overlay 槽(极老版本)时才退回旧的"打开官方设置栏目"链路。
|
|
1139
1203
|
try {
|
|
1140
|
-
|
|
1141
|
-
|
|
1204
|
+
openRemoteStandalonePanel();
|
|
1205
|
+
setTimeout(function () {
|
|
1206
|
+
if (!standaloneOverlayMounted) {
|
|
1207
|
+
try { openRemoteSettings(); } catch (e2) { /* 忽略 */ }
|
|
1208
|
+
}
|
|
1209
|
+
}, 150);
|
|
1142
1210
|
} catch (errOpen) { /* 绝不因打开失败抛到宿主 */ }
|
|
1143
1211
|
}
|
|
1144
1212
|
}, [
|
|
@@ -6136,6 +6204,13 @@ window.__ModuleLoader__.load({
|
|
|
6136
6204
|
// 公告是锦上添花,**没有任何资格**把门关上 —— 任何异常都只是"这次没有弹窗"。
|
|
6137
6205
|
}
|
|
6138
6206
|
|
|
6207
|
+
// 📱 独立「远程访问」弹层(入口点击用;见 RemoteStandaloneOverlay 注释)
|
|
6208
|
+
try {
|
|
6209
|
+
ctx.slots.inject("shell.overlay", function () {
|
|
6210
|
+
return ctx.slots.register({ name: "shell.overlay", id: "dsh-remote-standalone", order: 95 }, RemoteStandaloneOverlay);
|
|
6211
|
+
});
|
|
6212
|
+
} catch (eStand) { /* 老宿主没有 shell.overlay:入口会在 150ms 后回退到官方设置栏目链路 */ }
|
|
6213
|
+
|
|
6139
6214
|
// 📣 公告:每次页面加载**只拉一次**(sessionStorage 一次性标记,见 annPullOnce)。
|
|
6140
6215
|
// 放在 apply() 里是刻意的:apply 跑在 app mount **之前**,所以这里**绝不能碰产品 DOM**
|
|
6141
6216
|
// (那时还没有),只做数据拉取;UI 全部交给上面那个槽位与面板卡片。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote-web",
|
|
3
|
-
"version": "0.7.6-beta.
|
|
3
|
+
"version": "0.7.6-beta.9",
|
|
4
4
|
"description": "公网远程控制 DeepSeek Harness(dsh web):安装即得专属加密地址,人在外面也能用手机访问电脑上的 dsh——无需同一局域网/WiFi、无需公网 IP 与内网穿透,全程加密;手机端 100% 还原电脑体验(对话/工具/审批/设置)。技术用户可选自建服务,流量走自己的服务器。Remote control DeepSeek Harness (dsh web) from anywhere over the public internet — install, get an encrypted URL, use it from your phone on any network (dual-half cordis plugin: Settings panel + same-origin /dsh-remote routes). (2026-09 由 dsh-remote-ui 更名 / renamed from dsh-remote-ui; dsh-remote 的 dsh web 插件半,不是纯 UI/皮肤插件)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|