dsh-pocket 1.4.5 → 1.4.7
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/client/client.js +11 -6
- package/client/index.jsx +1 -4
- package/client/mobile/mobile.css.ts +10 -0
- package/lib/service.mjs +20 -7
- package/package.json +1 -1
package/client/client.js
CHANGED
|
@@ -427,6 +427,16 @@ var MOBILE_CSS = `
|
|
|
427
427
|
padding-top: env(safe-area-inset-top, 0px) !important;
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
+
/* \u4E3B\u5185\u5BB9\u5217\uFF08\u7B2C 2 \u4E2A\u7F51\u683C\u5B50\u5143\u7D20\uFF09\u5728\u5B98\u65B9\u6837\u5F0F\u91CC\u6709\u663E\u5F0F grid-column: 2\u2014\u2014
|
|
431
|
+
\u7F51\u683C\u88AB\u538B\u7F29\u6210 [1fr, 0, 0] \u540E\u5B83\u4F1A\u843D\u5728 0px \u7684\u7B2C 2 \u8F68\uFF0C\u6574\u4E2A\u4E3B\u754C\u9762\u88AB\u6324\u51FA
|
|
432
|
+
\u89C6\u53E3\uFF08\u53EA\u5269\u80CC\u666F\u56FE\uFF09\u3002\u5FC5\u987B\u663E\u5F0F\u628A\u5B83\u62C9\u56DE\u7B2C 1 \u8F68\uFF08issue #5\uFF09\u3002
|
|
433
|
+
\u7B2C 3 \u5217\uFF08details\uFF09\u4FDD\u6301 0 \u8F68\u5373\u53EF\uFF0C\u65E0\u9700\u5904\u7406\u3002 */
|
|
434
|
+
[data-mobile-nav="frame"] > :nth-child(2) {
|
|
435
|
+
grid-column: 1 !important;
|
|
436
|
+
grid-row: 1 !important;
|
|
437
|
+
min-width: 0 !important;
|
|
438
|
+
}
|
|
439
|
+
|
|
430
440
|
/* The sidebar column (first grid child) becomes a left drawer. The drawer
|
|
431
441
|
hugs the sidebar content exactly (the wide sidebar carries an inline
|
|
432
442
|
width, ~280px): a fixed 92vw box would leave a white strip where the
|
|
@@ -1449,12 +1459,7 @@ function PocketSettingsTab({ rpcCall }) {
|
|
|
1449
1459
|
)
|
|
1450
1460
|
)
|
|
1451
1461
|
),
|
|
1452
|
-
//
|
|
1453
|
-
isDesktop ? (0, import_react2.createElement)(
|
|
1454
|
-
"div",
|
|
1455
|
-
{ style: { ...styles.block, padding: "8px 0 0" } },
|
|
1456
|
-
(0, import_react2.createElement)("div", { style: styles.muted }, "\u{1F4BB} DSH Desktop \u73AF\u5883\uFF1A\u66F4\u65B0\u4E0E\u91CD\u542F\u7531\u684C\u9762\u7248\u7BA1\u7406\uFF0C\u6B64\u5904\u5DF2\u505C\u7528 | Running inside DSH Desktop: updates & restart are managed by the desktop app")
|
|
1457
|
-
) : null,
|
|
1462
|
+
// 桌面端不显示更新/重启横幅(更新由 DSH Desktop 管理),也不需要额外提示
|
|
1458
1463
|
// 重启后提示(进程在后台运行,停止方法)——左侧蓝色色条(桌面端不会触发本插件的自重启)
|
|
1459
1464
|
!isDesktop && restartNotice ? (0, import_react2.createElement)(
|
|
1460
1465
|
"div",
|
package/client/index.jsx
CHANGED
|
@@ -188,10 +188,7 @@ function PocketSettingsTab({ rpcCall }) {
|
|
|
188
188
|
),
|
|
189
189
|
),
|
|
190
190
|
|
|
191
|
-
//
|
|
192
|
-
isDesktop ? h('div', { style: { ...styles.block, padding: '8px 0 0' } },
|
|
193
|
-
h('div', { style: styles.muted }, '💻 DSH Desktop 环境:更新与重启由桌面版管理,此处已停用 | Running inside DSH Desktop: updates & restart are managed by the desktop app'),
|
|
194
|
-
) : null,
|
|
191
|
+
// 桌面端不显示更新/重启横幅(更新由 DSH Desktop 管理),也不需要额外提示
|
|
195
192
|
|
|
196
193
|
// 重启后提示(进程在后台运行,停止方法)——左侧蓝色色条(桌面端不会触发本插件的自重启)
|
|
197
194
|
!isDesktop && restartNotice ? h('div', { style: { ...styles.block, borderLeft: '4px solid var(--dsw-alias-brand-primary,#4f6ef7)', borderRadius: 8, background: 'var(--dsw-alias-bg-layer-2,#f3f4f6)', padding: '10px 12px' } },
|
|
@@ -175,6 +175,16 @@ export const MOBILE_CSS = `
|
|
|
175
175
|
padding-top: env(safe-area-inset-top, 0px) !important;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
/* 主内容列(第 2 个网格子元素)在官方样式里有显式 grid-column: 2——
|
|
179
|
+
网格被压缩成 [1fr, 0, 0] 后它会落在 0px 的第 2 轨,整个主界面被挤出
|
|
180
|
+
视口(只剩背景图)。必须显式把它拉回第 1 轨(issue #5)。
|
|
181
|
+
第 3 列(details)保持 0 轨即可,无需处理。 */
|
|
182
|
+
[data-mobile-nav="frame"] > :nth-child(2) {
|
|
183
|
+
grid-column: 1 !important;
|
|
184
|
+
grid-row: 1 !important;
|
|
185
|
+
min-width: 0 !important;
|
|
186
|
+
}
|
|
187
|
+
|
|
178
188
|
/* The sidebar column (first grid child) becomes a left drawer. The drawer
|
|
179
189
|
hugs the sidebar content exactly (the wide sidebar carries an inline
|
|
180
190
|
width, ~280px): a fixed 92vw box would leave a white strip where the
|
package/lib/service.mjs
CHANGED
|
@@ -114,15 +114,28 @@ export function createPocketService({
|
|
|
114
114
|
|
|
115
115
|
return {
|
|
116
116
|
dshPort,
|
|
117
|
-
/**
|
|
117
|
+
/** 启动局域网代理(幂等)。端口被占(EADDRINUSE,如桌面版与普通环境同时运行)时自动尝试下一个端口。 */
|
|
118
118
|
async startProxy() {
|
|
119
119
|
if (proxy) return proxy;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
let lastErr = null;
|
|
121
|
+
for (let p = port; p < port + 10; p++) {
|
|
122
|
+
try {
|
|
123
|
+
proxy = await createProxy({
|
|
124
|
+
port: p,
|
|
125
|
+
host: '0.0.0.0',
|
|
126
|
+
upstream: { host: '127.0.0.1', port: dshPort },
|
|
127
|
+
...(injectHtml ? { injectHtml } : {}),
|
|
128
|
+
});
|
|
129
|
+
if (p !== port) {
|
|
130
|
+
console.log(`dsh-pocket: port ${port} busy, proxy on ${p} | 端口 ${port} 被占用,代理改用 ${p}`);
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
} catch (err) {
|
|
134
|
+
if (err?.code !== 'EADDRINUSE') throw err; // 非端口冲突直接失败
|
|
135
|
+
lastErr = err;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (!proxy) throw lastErr ?? new Error('proxy start failed | 代理启动失败');
|
|
126
139
|
return proxy;
|
|
127
140
|
},
|
|
128
141
|
|
package/package.json
CHANGED