dsh-pocket 1.3.0 → 1.3.2
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 +5 -5
- package/client/index.jsx +6 -5
- package/package.json +1 -1
package/client/client.js
CHANGED
|
@@ -1348,7 +1348,7 @@ function PocketSettingsTab({ rpcCall }) {
|
|
|
1348
1348
|
(async () => {
|
|
1349
1349
|
try {
|
|
1350
1350
|
const v = await call(POCKET_ENDPOINTS.version, {});
|
|
1351
|
-
const meta = await (await fetch("https://registry.npmjs.org/dsh-pocket/latest")).json();
|
|
1351
|
+
const meta = await (await fetch("https://registry.npmjs.org/dsh-pocket/latest", { cache: "no-store" })).json();
|
|
1352
1352
|
if (!alive) return;
|
|
1353
1353
|
const latest = typeof meta?.version === "string" ? meta.version : null;
|
|
1354
1354
|
if (latest && v.current && compareVersions(latest, v.current) > 0) {
|
|
@@ -1498,19 +1498,19 @@ function PocketSettingsTab({ rpcCall }) {
|
|
|
1498
1498
|
) : (0, import_react2.createElement)(
|
|
1499
1499
|
"div",
|
|
1500
1500
|
null,
|
|
1501
|
-
(0, import_react2.createElement)("button", { style: styles.primary, onClick: startTunnel, disabled: busy || tunnelStarting }, busy ? "\u5F00\u542F\u4E2D\u2026" : "\u5F00\u542F\u516C\u7F51\u8BBF\u95EE | Enable anywhere"),
|
|
1501
|
+
(0, import_react2.createElement)("button", { style: { ...styles.primary, margin: "8px 0" }, onClick: startTunnel, disabled: busy || tunnelStarting }, busy ? "\u5F00\u542F\u4E2D\u2026" : "\u5F00\u542F\u516C\u7F51\u8BBF\u95EE | Enable anywhere"),
|
|
1502
1502
|
tunnelStarting ? (0, import_react2.createElement)(
|
|
1503
1503
|
"div",
|
|
1504
|
-
{ style: { marginTop:
|
|
1504
|
+
{ style: { marginTop: 4, fontSize: 12, color: "var(--dsw-alias-label-secondary,#6b7280)" } },
|
|
1505
1505
|
tunnelPhase === "downloading" ? `\u23F3 \u4E0B\u8F7D cloudflared\uFF08\u9996\u6B21\u7EA6 20-50MB\uFF0C\u901A\u5E38 1-2 \u5206\u949F\uFF1B\u4E4B\u540E\u79D2\u5F00\uFF09\xB7 \u5DF2\u7B49\u5F85 ${elapsed(tunnelStateStarted)} \u79D2` : `\u23F3 \u8FDE\u63A5 Cloudflare \u8FB9\u7F18\uFF08\u901A\u5E38 5-30 \u79D2\uFF09\xB7 \u5DF2\u7B49\u5F85 ${elapsed(tunnelStateStarted)} \u79D2${elapsed(tunnelStateStarted) > 30 ? " \u2014 \u6709\u70B9\u4E45\uFF1F\u68C0\u67E5\u662F\u5426\u5F00\u7740\u4EE3\u7406/VPN\uFF08Clash TUN \u7B49\uFF09" : ""}`
|
|
1506
1506
|
) : tunnelPhase === "error" ? (0, import_react2.createElement)(
|
|
1507
1507
|
"div",
|
|
1508
|
-
{ style: { marginTop:
|
|
1508
|
+
{ style: { marginTop: 4, fontSize: 12, color: "var(--dsw-alias-state-error-primary,#dc2626)" } },
|
|
1509
1509
|
`\u274C \u5F00\u542F\u5931\u8D25\uFF1A${tunnelStateDetail || "\u672A\u77E5\u9519\u8BEF | failed"}\uFF08\u53EF\u91CD\u8BD5\uFF1B\u82E5\u662F\u4EE3\u7406/VPN \u95EE\u9898\u89C1 README \u6392\u969C\uFF09`
|
|
1510
1510
|
) : (0, import_react2.createElement)(
|
|
1511
1511
|
"div",
|
|
1512
1512
|
null,
|
|
1513
|
-
(0, import_react2.createElement)("div", { style: styles.warn, marginTop:
|
|
1513
|
+
(0, import_react2.createElement)("div", { style: styles.warn, marginTop: 4 }, "\u26A0\uFE0F DSH \u80FD\u6267\u884C\u7535\u8111\u4EE3\u7801\uFF1A\u4E8C\u7EF4\u7801/URL \u5C31\u662F\u94A5\u5319\uFF0C\u8BF7\u52FF\u53D1\u7ED9\u522B\u4EBA | the QR/URL is the key \u2014 never share it"),
|
|
1514
1514
|
(0, import_react2.createElement)("div", { style: styles.muted, marginTop: 4 }, "\u4E0D\u614E\u6CC4\u9732\u4E86\uFF1F\u91CD\u542F dsh web\uFF0CURL \u81EA\u52A8\u6362\u65B0\u3001\u65E7\u94FE\u63A5\u7ACB\u5373\u5931\u6548 | Leaked it? Restart dsh web \u2014 the URL rotates and the old one dies instantly")
|
|
1515
1515
|
)
|
|
1516
1516
|
)
|
package/client/index.jsx
CHANGED
|
@@ -84,12 +84,13 @@ function PocketSettingsTab({ rpcCall }) {
|
|
|
84
84
|
|
|
85
85
|
// 版本检测:host 当前版本 vs npm registry latest(registry 带 CORS *)
|
|
86
86
|
// 两种情况显示横幅:① 有新版可更新;② 磁盘已更新但进程还是旧代码(重启生效)
|
|
87
|
+
// cache: 'no-store' —— registry 响应带缓存头,浏览器会缓存旧版本号导致「小版本不提示」
|
|
87
88
|
useEffect(() => {
|
|
88
89
|
let alive = true;
|
|
89
90
|
(async () => {
|
|
90
91
|
try {
|
|
91
92
|
const v = await call(POCKET_ENDPOINTS.version, {});
|
|
92
|
-
const meta = await (await fetch('https://registry.npmjs.org/dsh-pocket/latest')).json();
|
|
93
|
+
const meta = await (await fetch('https://registry.npmjs.org/dsh-pocket/latest', { cache: 'no-store' })).json();
|
|
93
94
|
if (!alive) return;
|
|
94
95
|
const latest = typeof meta?.version === 'string' ? meta.version : null;
|
|
95
96
|
if (latest && v.current && compareVersions(latest, v.current) > 0) {
|
|
@@ -235,17 +236,17 @@ function PocketSettingsTab({ rpcCall }) {
|
|
|
235
236
|
h('button', { style: styles.btn, onClick: stopTunnel }, '关闭公网 | Stop'),
|
|
236
237
|
)
|
|
237
238
|
: h('div', null,
|
|
238
|
-
h('button', { style: styles.primary, onClick: startTunnel, disabled: busy || tunnelStarting }, busy ? '开启中…' : '开启公网访问 | Enable anywhere'),
|
|
239
|
+
h('button', { style: { ...styles.primary, margin: '8px 0' }, onClick: startTunnel, disabled: busy || tunnelStarting }, busy ? '开启中…' : '开启公网访问 | Enable anywhere'),
|
|
239
240
|
tunnelStarting
|
|
240
|
-
? h('div', { style: { marginTop:
|
|
241
|
+
? h('div', { style: { marginTop: 4, fontSize: 12, color: 'var(--dsw-alias-label-secondary,#6b7280)' } },
|
|
241
242
|
tunnelPhase === 'downloading'
|
|
242
243
|
? `⏳ 下载 cloudflared(首次约 20-50MB,通常 1-2 分钟;之后秒开)· 已等待 ${elapsed(tunnelStateStarted)} 秒`
|
|
243
244
|
: `⏳ 连接 Cloudflare 边缘(通常 5-30 秒)· 已等待 ${elapsed(tunnelStateStarted)} 秒${elapsed(tunnelStateStarted) > 30 ? ' — 有点久?检查是否开着代理/VPN(Clash TUN 等)' : ''}`)
|
|
244
245
|
: tunnelPhase === 'error'
|
|
245
|
-
? h('div', { style: { marginTop:
|
|
246
|
+
? h('div', { style: { marginTop: 4, fontSize: 12, color: 'var(--dsw-alias-state-error-primary,#dc2626)' } },
|
|
246
247
|
`❌ 开启失败:${tunnelStateDetail || '未知错误 | failed'}(可重试;若是代理/VPN 问题见 README 排障)`)
|
|
247
248
|
: h('div', null,
|
|
248
|
-
h('div', { style: styles.warn, marginTop:
|
|
249
|
+
h('div', { style: styles.warn, marginTop: 4 }, '⚠️ DSH 能执行电脑代码:二维码/URL 就是钥匙,请勿发给别人 | the QR/URL is the key — never share it'),
|
|
249
250
|
h('div', { style: styles.muted, marginTop: 4 }, '不慎泄露了?重启 dsh web,URL 自动换新、旧链接立即失效 | Leaked it? Restart dsh web — the URL rotates and the old one dies instantly'),
|
|
250
251
|
),
|
|
251
252
|
),
|
package/package.json
CHANGED