dsh-lan-guard 0.3.1 → 0.3.3
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/CHANGELOG.md +185 -35
- package/README.md +154 -93
- package/README.zh.md +149 -88
- package/cordis.patch.yml +4 -3
- package/lib/client.js +157 -33
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +30 -19
- package/lib/index.js +206 -71
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -8,13 +8,13 @@ window.__ModuleLoader__.load({
|
|
|
8
8
|
//#region src/client.ts
|
|
9
9
|
/**
|
|
10
10
|
* dsh-lan-guard — the browser half: one section inside DSH's OFFICIAL settings
|
|
11
|
-
* page
|
|
11
|
+
* page.
|
|
12
12
|
*
|
|
13
13
|
* Hard constraints from the spec, all of them load-bearing:
|
|
14
14
|
*
|
|
15
15
|
* - It registers the official `settings.section` seat and replaces NOTHING.
|
|
16
16
|
* Layout seats (`sidebar`, `rightbar`, `shell.leading`) and layout root
|
|
17
|
-
* hooks are out of bounds
|
|
17
|
+
* hooks are out of bounds.
|
|
18
18
|
* - Pure `React.createElement` — no JSX, no extra front-end build step.
|
|
19
19
|
* - Styles are inline CSS using the official `--dsw-alias-*` variables, so the
|
|
20
20
|
* light/dark theme follows automatically (dsh-mobile once shipped a
|
|
@@ -80,9 +80,33 @@ window.__ModuleLoader__.load({
|
|
|
80
80
|
* 12/18, 11/14) and weight (400 regular, 500 strong). Sizes, weights and
|
|
81
81
|
* line-heights therefore come from the official tokens; only colours use the
|
|
82
82
|
* official --dsw-alias-* variables, and only the URL box overrides the family
|
|
83
|
-
* (with the official code font).
|
|
83
|
+
* (with the official code font).
|
|
84
84
|
*/
|
|
85
|
-
.lg-root{max-width:790px;display:flex;flex-direction:column;gap:18px
|
|
85
|
+
.lg-root{max-width:790px;display:flex;flex-direction:column;gap:18px;
|
|
86
|
+
/* Liquid Glass (user request 2026-09-26). One material definition, every
|
|
87
|
+
value DERIVED from official tokens through color-mix, so the same rules
|
|
88
|
+
follow the light/dark palette with no theme branch and no invented token
|
|
89
|
+
name (see the 2026-09-24 contrast incident). Each surface below still
|
|
90
|
+
declares its solid token colour FIRST: if color-mix or backdrop-filter is
|
|
91
|
+
unsupported the later declaration is dropped at parse time and the card
|
|
92
|
+
stays a plain, fully legible token surface. */
|
|
93
|
+
--lg-blur:blur(20px) saturate(180%);
|
|
94
|
+
--lg-tint:color-mix(in srgb, var(--dsw-alias-bg-layer-1,#fff) 62%, transparent);
|
|
95
|
+
--lg-tint-soft:color-mix(in srgb, var(--dsw-alias-bg-layer-3,#f1f2f4) 62%, transparent);
|
|
96
|
+
--lg-edge:color-mix(in srgb, var(--dsw-alias-label-primary,#1f2329) 14%, transparent);
|
|
97
|
+
--lg-sheen:linear-gradient(158deg, color-mix(in srgb, #fff 12%, transparent) 0%, transparent 46%);
|
|
98
|
+
--lg-lift:0 10px 30px color-mix(in srgb, #000 20%, transparent),
|
|
99
|
+
inset 0 1px 0 color-mix(in srgb, #fff 30%, transparent),
|
|
100
|
+
inset 0 -1px 0 color-mix(in srgb, #000 7%, transparent);
|
|
101
|
+
position:relative;isolation:isolate}
|
|
102
|
+
/* The light the glass refracts. Scoped to this plugin's own subtree and kept
|
|
103
|
+
at inset:0 so it can never add overflow to the official settings dialog. */
|
|
104
|
+
.lg-root::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;border-radius:24px;
|
|
105
|
+
background:
|
|
106
|
+
radial-gradient(42% 36% at 14% 3%, color-mix(in srgb, var(--dsw-static-deepseek-500,#4176e6) 44%, transparent), transparent 70%),
|
|
107
|
+
radial-gradient(38% 32% at 90% 14%, color-mix(in srgb, var(--dsw-alias-state-business-primary,#1a3f8f) 38%, transparent), transparent 72%),
|
|
108
|
+
radial-gradient(50% 44% at 56% 100%, color-mix(in srgb, var(--dsw-alias-state-success-primary,#1b5e20) 30%, transparent), transparent 74%);
|
|
109
|
+
filter:blur(10px)}
|
|
86
110
|
/*
|
|
87
111
|
* Tab bar = the OFFICIAL segmented-control pattern (the 外观 浅色/深色/跟随系统
|
|
88
112
|
* selector in 通用设置): every item keeps the SAME font and the SAME
|
|
@@ -94,14 +118,33 @@ window.__ModuleLoader__.load({
|
|
|
94
118
|
.lg-tabs{display:flex;gap:8px;flex-wrap:wrap}
|
|
95
119
|
.lg-tab{font:var(--dsw-font-s-14,14px/22px sans-serif);cursor:pointer;
|
|
96
120
|
color:var(--dsw-alias-label-primary,#1f2329);background:transparent;
|
|
97
|
-
border:0.5px solid var(--dsw-alias-border-l2,#e5e6eb);border-radius:20px;padding:6px 14px
|
|
121
|
+
border:0.5px solid var(--dsw-alias-border-l2,#e5e6eb);border-radius:20px;padding:6px 14px;
|
|
122
|
+
backdrop-filter:blur(10px) saturate(150%);-webkit-backdrop-filter:blur(10px) saturate(150%);
|
|
123
|
+
box-shadow:inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent)}
|
|
98
124
|
.lg-tab[aria-selected=true]{background:var(--dsw-alias-bg-layer-3,#f1f2f4);
|
|
99
|
-
border-color:var(--dsw-alias-label-tertiary,#adb2b8)
|
|
125
|
+
border-color:var(--dsw-alias-label-tertiary,#adb2b8);
|
|
126
|
+
background-image:var(--lg-sheen);box-shadow:var(--lg-lift)}
|
|
100
127
|
.lg-tabbody{display:flex;flex-direction:column;gap:18px}
|
|
101
128
|
.lg-card{background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--dsw-alias-border-l2,#e5e6eb);
|
|
102
|
-
border-radius:
|
|
129
|
+
border-radius:20px;padding:16px 18px;
|
|
130
|
+
background-color:var(--lg-tint);background-image:var(--lg-sheen);
|
|
131
|
+
border-color:var(--lg-edge);
|
|
132
|
+
backdrop-filter:var(--lg-blur);-webkit-backdrop-filter:var(--lg-blur);
|
|
133
|
+
box-shadow:var(--lg-lift);position:relative}
|
|
134
|
+
/* Specular rim: a 1px gradient edge that is bright where the "light" enters
|
|
135
|
+
and fades away from it — the part of Liquid Glass that reads as glass rather
|
|
136
|
+
than as a plain translucent panel. Masked to the border ring only. */
|
|
137
|
+
.lg-card::after,.lg-choice::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;
|
|
138
|
+
background:linear-gradient(152deg,
|
|
139
|
+
color-mix(in srgb, #fff 55%, transparent) 0%,
|
|
140
|
+
color-mix(in srgb, #fff 8%, transparent) 38%,
|
|
141
|
+
transparent 62%,
|
|
142
|
+
color-mix(in srgb, #fff 22%, transparent) 100%);
|
|
143
|
+
-webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
|
|
144
|
+
-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
|
|
145
|
+
mask-composite:exclude;pointer-events:none}
|
|
103
146
|
.lg-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
|
|
104
|
-
.lg-title{font:var(--dsw-font-
|
|
147
|
+
.lg-title{font:var(--dsw-font-s-strong-14,500 14px/22px sans-serif);margin:0;
|
|
105
148
|
color:var(--dsw-alias-label-primary,#1f2329)}
|
|
106
149
|
.lg-sub{font:var(--dsw-font-xxs-12,12px/18px sans-serif);margin:4px 0 0;
|
|
107
150
|
color:var(--dsw-alias-label-secondary,#6b7280)}
|
|
@@ -109,25 +152,53 @@ window.__ModuleLoader__.load({
|
|
|
109
152
|
font:var(--dsw-font-xxs-12,12px/18px sans-serif);white-space:nowrap;
|
|
110
153
|
background:var(--dsw-alias-state-success-tertiary,#e8f5e9);color:var(--dsw-alias-state-success-primary,#1b5e20)}
|
|
111
154
|
.lg-pill.off{background:var(--dsw-alias-bg-layer-3,#f1f2f4);color:var(--dsw-alias-label-secondary,#6b7280)}
|
|
112
|
-
.lg-bar{display:flex;align-items:center;gap:
|
|
113
|
-
border-radius:
|
|
155
|
+
.lg-bar{display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap;margin-top:16px;padding:8px 12px;
|
|
156
|
+
border-radius:var(--dsw-radius-md,12px);font:var(--dsw-font-xs-13,13px/20px sans-serif);
|
|
114
157
|
background:var(--dsw-alias-state-success-tertiary,#e8f5e9);color:var(--dsw-alias-state-success-primary,#1b5e20)}
|
|
158
|
+
/* The notice text shrinks and wraps INSIDE itself; the action keeps its
|
|
159
|
+
intrinsic width and never breaks mid-label (user report 2026-09-26: the
|
|
160
|
+
button read "去设置访 / 问密码"). */
|
|
161
|
+
/* A non-zero basis keeps the text from collapsing to nothing, so a tight
|
|
162
|
+
container wraps the ACTION to its own line instead of squeezing it. */
|
|
163
|
+
.lg-bar>span:first-child{flex:1 1 16ch;min-width:0}
|
|
164
|
+
.lg-bar .lg-btn{flex:0 0 auto;white-space:nowrap;height:32px;padding:0 12px;
|
|
165
|
+
font:var(--dsw-font-xs-13,13px/20px sans-serif);font-weight:400}
|
|
115
166
|
.lg-bar-compact{margin-top:0;padding:6px 10px}
|
|
116
167
|
.lg-bar.info{background:var(--dsw-alias-state-business-tertiary,#e8f0fe);color:var(--dsw-alias-state-business-primary,#1a3f8f)}
|
|
117
168
|
.lg-bar.warn{background:var(--dsw-alias-state-warn-tertiary,#fffbeb);color:var(--dsw-alias-state-warn-label,#92400e)}
|
|
118
169
|
.lg-bar.danger{background:var(--dsw-alias-interactive-bg-hover-danger,#fef2f2);color:var(--dsw-alias-state-error-primary,#b91c1c)}
|
|
119
170
|
.lg-mono-sm{font:var(--dsw-font-xxs-12,12px/18px sans-serif)}
|
|
120
|
-
.lg-mono{margin-top:14px;padding:10px 12px;border-radius:
|
|
171
|
+
.lg-mono{margin-top:14px;padding:10px 12px;border-radius:12px;background:var(--dsw-alias-bg-base,#f1f2f4);
|
|
121
172
|
border:1px solid var(--dsw-alias-border-l2,#e5e6eb);
|
|
173
|
+
background-color:color-mix(in srgb, var(--dsw-alias-bg-base,#f1f2f4) 70%, transparent);
|
|
174
|
+
border-color:var(--lg-edge);
|
|
175
|
+
backdrop-filter:blur(12px) saturate(150%);-webkit-backdrop-filter:blur(12px) saturate(150%);
|
|
176
|
+
box-shadow:inset 0 1px 2px color-mix(in srgb, #000 10%, transparent),
|
|
177
|
+
inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent);
|
|
122
178
|
font:var(--dsw-font-xs-13,13px/20px sans-serif);
|
|
123
179
|
font-family:var(--ds-font-family-code,ui-monospace,SFMono-Regular,Menlo,monospace);
|
|
124
180
|
word-break:break-all;color:var(--dsw-alias-label-primary,#1f2329)}
|
|
181
|
+
/* Copyable values (the access URL, the upgrade command) are SINGLE-LINE fields:
|
|
182
|
+
no hard wrapping, horizontal scrolling instead, so a long URL can no longer
|
|
183
|
+
push the rest of the card down (user request 2026-09-26). Scrolling never
|
|
184
|
+
truncates what you get — the copy button writes the source string, never the
|
|
185
|
+
rendered text — and the thin scrollbar makes "there is more to the right"
|
|
186
|
+
visible. Dragging inside the field selects and auto-scrolls, like a text box. */
|
|
187
|
+
.lg-mono-scroll{white-space:nowrap;overflow-x:auto;overflow-y:hidden;word-break:normal;
|
|
188
|
+
cursor:text;scrollbar-width:thin}
|
|
189
|
+
.lg-mono-scroll::-webkit-scrollbar{height:6px}
|
|
190
|
+
.lg-mono-scroll::-webkit-scrollbar-track{background:transparent}
|
|
191
|
+
.lg-mono-scroll::-webkit-scrollbar-thumb{border-radius:999px;
|
|
192
|
+
background:color-mix(in srgb, var(--dsw-alias-label-tertiary,#adb2b8) 55%, transparent)}
|
|
125
193
|
.lg-row{display:flex;gap:10px;margin-top:12px}
|
|
126
194
|
/* auto-fit: two options (TLS) fill the row evenly instead of leaving a third
|
|
127
195
|
of the row empty, and three options (mode) still fit on one line. */
|
|
128
196
|
.lg-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;margin-top:12px}
|
|
129
|
-
.lg-choice{text-align:left;cursor:pointer;border-radius:12px;padding:14px;background:var(--dsw-alias-bg-layer-1,#fff);
|
|
130
|
-
border:1px solid var(--dsw-alias-border-l2,#e5e6eb);color:inherit
|
|
197
|
+
.lg-choice{text-align:left;cursor:pointer;border-radius:var(--dsw-radius-md,12px);padding:12px 14px;background:var(--dsw-alias-bg-layer-1,#fff);
|
|
198
|
+
border:1px solid var(--dsw-alias-border-l2,#e5e6eb);color:inherit;
|
|
199
|
+
background-color:var(--lg-tint);background-image:var(--lg-sheen);border-color:var(--lg-edge);
|
|
200
|
+
backdrop-filter:var(--lg-blur);-webkit-backdrop-filter:var(--lg-blur);box-shadow:var(--lg-lift);
|
|
201
|
+
position:relative}
|
|
131
202
|
.lg-choice[aria-pressed=true]{border:2px solid var(--dsw-static-deepseek-500,#4f46e5);
|
|
132
203
|
background:var(--dsw-alias-interactive-bg-hover,#eef0ff)}
|
|
133
204
|
.lg-choice h4{font:var(--dsw-font-s-strong-14,500 14px/22px sans-serif);margin:0 0 6px;
|
|
@@ -135,19 +206,30 @@ window.__ModuleLoader__.load({
|
|
|
135
206
|
.lg-choice p{font:var(--dsw-font-xxs-12,12px/18px sans-serif);margin:0;
|
|
136
207
|
color:var(--dsw-alias-label-secondary,#6b7280)}
|
|
137
208
|
.lg-field{display:flex;flex-direction:column;gap:6px;margin-top:14px}
|
|
138
|
-
.lg-label{font:var(--dsw-font-
|
|
139
|
-
.lg-input{box-sizing:border-box;height:
|
|
209
|
+
.lg-label{font:var(--dsw-font-s-14,14px/22px sans-serif);color:var(--dsw-alias-label-secondary,#6b7280)}
|
|
210
|
+
.lg-input{box-sizing:border-box;height:36px;padding:0 14px;border-radius:var(--dsw-radius-md,12px);border:1px solid var(--dsw-alias-border-l2,#d0d3d9);
|
|
211
|
+
font:var(--dsw-font-s-14,14px/22px sans-serif);
|
|
212
|
+
background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-primary,#1f2329);
|
|
213
|
+
background-color:color-mix(in srgb, var(--dsw-alias-bg-base,#fff) 74%, transparent);
|
|
214
|
+
border-color:var(--lg-edge);
|
|
215
|
+
backdrop-filter:blur(12px) saturate(150%);-webkit-backdrop-filter:blur(12px) saturate(150%);
|
|
216
|
+
box-shadow:inset 0 1px 2px color-mix(in srgb, #000 9%, transparent),
|
|
217
|
+
inset 0 1px 0 color-mix(in srgb, #fff 20%, transparent)}
|
|
218
|
+
.lg-btn{box-sizing:border-box;height:36px;padding:0 14px;border:0;border-radius:var(--dsw-radius-md,12px);cursor:pointer;
|
|
140
219
|
font:var(--dsw-font-s-14,14px/22px sans-serif);
|
|
141
|
-
background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-primary,#1f2329)}
|
|
142
|
-
.lg-btn{box-sizing:border-box;height:44px;padding:0 16px;border:0;border-radius:10px;cursor:pointer;
|
|
143
|
-
font:var(--dsw-font-s-strong-14,500 14px/22px sans-serif);
|
|
144
220
|
/* Brand blue + the official white token (both are official variables): the
|
|
145
221
|
reference implementation's primary action colour, chosen by the user
|
|
146
222
|
2026-09-24 over the theme-dependent near-white default. */
|
|
147
223
|
background:var(--dsw-static-deepseek-500,#4176e6);
|
|
148
|
-
color:var(--dsw-static-neutral-bluish-00,#fff)
|
|
224
|
+
color:var(--dsw-static-neutral-bluish-00,#fff);
|
|
225
|
+
background-image:linear-gradient(180deg, color-mix(in srgb, #fff 22%, transparent), transparent 62%);
|
|
226
|
+
box-shadow:0 6px 18px color-mix(in srgb, var(--dsw-static-deepseek-500,#4176e6) 32%, transparent),
|
|
227
|
+
inset 0 1px 0 color-mix(in srgb, #fff 36%, transparent)}
|
|
149
228
|
.lg-btn.secondary{background:var(--dsw-alias-bg-layer-3,#fff);color:var(--dsw-alias-label-primary,#1f2329);
|
|
150
|
-
border:1px solid var(--dsw-alias-border-l2,#d0d3d9)
|
|
229
|
+
border:1px solid var(--dsw-alias-border-l2,#d0d3d9);
|
|
230
|
+
background-color:var(--lg-tint-soft);background-image:var(--lg-sheen);border-color:var(--lg-edge);
|
|
231
|
+
backdrop-filter:blur(12px) saturate(150%);-webkit-backdrop-filter:blur(12px) saturate(150%);
|
|
232
|
+
box-shadow:inset 0 1px 0 color-mix(in srgb, #fff 26%, transparent)}
|
|
151
233
|
.lg-btn:disabled{opacity:.55;cursor:not-allowed}
|
|
152
234
|
.lg-btn.full{width:100%}
|
|
153
235
|
.lg-btn-small{height:28px;padding:0 10px;white-space:nowrap;flex-shrink:0;font:var(--dsw-font-xxs-12,12px/18px sans-serif)}
|
|
@@ -163,7 +245,9 @@ window.__ModuleLoader__.load({
|
|
|
163
245
|
/* The white plate HUGS the code (fit-content + auto margins) instead of
|
|
164
246
|
stretching across the card, and the code is a compact 190px — matching the
|
|
165
247
|
reference implementation's proportions (user feedback 2026-09-24). */
|
|
166
|
-
|
|
248
|
+
/* Deliberately OPAQUE: a QR code on a translucent plate loses contrast and
|
|
249
|
+
may stop scanning. Never give this rule a glass treatment. */
|
|
250
|
+
.lg-qr{margin:14px auto 0;padding:10px;border-radius:12px;background:#fff;
|
|
167
251
|
border:1px solid var(--dsw-alias-border-l2,#e5e6eb);width:fit-content}
|
|
168
252
|
.lg-qr svg{display:block;width:190px;height:190px}
|
|
169
253
|
.lg-hint{font:var(--dsw-font-xxs-12,12px/18px sans-serif);margin:14px 0 0;
|
|
@@ -187,8 +271,11 @@ window.__ModuleLoader__.load({
|
|
|
187
271
|
.lg-link{color:var(--dsw-alias-label-secondary,#6b7280);text-decoration:none;
|
|
188
272
|
font:var(--dsw-font-xxs-12,12px/18px sans-serif)}
|
|
189
273
|
.lg-link:hover{color:var(--dsw-alias-label-primary,#1f2329)}
|
|
190
|
-
.lg-update-panel{margin:0;padding:12px;border-radius:
|
|
191
|
-
background:var(--dsw-alias-layer-2,#f1f2f4);border:1px solid var(--dsw-alias-border-l2,#e5e6eb)
|
|
274
|
+
.lg-update-panel{margin:0;padding:12px;border-radius:var(--dsw-radius-md,12px);
|
|
275
|
+
background:var(--dsw-alias-layer-2,#f1f2f4);border:1px solid var(--dsw-alias-border-l2,#e5e6eb);
|
|
276
|
+
background-color:var(--lg-tint-soft);background-image:var(--lg-sheen);border-color:var(--lg-edge);
|
|
277
|
+
backdrop-filter:blur(14px) saturate(150%);-webkit-backdrop-filter:blur(14px) saturate(150%);
|
|
278
|
+
box-shadow:inset 0 1px 0 color-mix(in srgb, #fff 24%, transparent)}
|
|
192
279
|
.lg-update-title{font:var(--dsw-font-s-strong-14,500 14px/22px sans-serif);
|
|
193
280
|
color:var(--dsw-alias-label-primary,#1f2329);margin-bottom:8px}
|
|
194
281
|
.lg-sec-title{margin:18px 0 2px;font:var(--dsw-font-s-strong-14,500 14px/22px sans-serif);
|
|
@@ -197,8 +284,11 @@ window.__ModuleLoader__.load({
|
|
|
197
284
|
.lg-chip.wait{background:var(--dsw-alias-state-warn-tertiary,#3a2f16);color:var(--dsw-alias-state-warn-label,#fbbf24)}
|
|
198
285
|
.lg-chip.ban{background:var(--dsw-static-red-600-a08,#ec13131f);color:var(--dsw-static-red-400,#f25a5a)}
|
|
199
286
|
.lg-danger{color:var(--dsw-static-red-400,#f25a5a);border-color:var(--dsw-static-red-400,#f25a5a)}
|
|
200
|
-
.lg-device{display:block;margin-top:12px;padding:10px 12px;border-radius:
|
|
201
|
-
background:var(--dsw-alias-bg-base,#f1f2f4);border:1px solid var(--dsw-alias-border-l2,#e5e6eb)
|
|
287
|
+
.lg-device{display:block;margin-top:12px;padding:10px 12px;border-radius:var(--dsw-radius-md,12px);
|
|
288
|
+
background:var(--dsw-alias-bg-base,#f1f2f4);border:1px solid var(--dsw-alias-border-l2,#e5e6eb);
|
|
289
|
+
background-color:var(--lg-tint-soft);border-color:var(--lg-edge);
|
|
290
|
+
backdrop-filter:blur(12px) saturate(150%);-webkit-backdrop-filter:blur(12px) saturate(150%);
|
|
291
|
+
box-shadow:inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent)}
|
|
202
292
|
.lg-device-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
|
|
203
293
|
.lg-name-chip{display:inline-flex;align-items:center;min-width:0}
|
|
204
294
|
.lg-device-actions{display:inline-flex;align-items:center;gap:8px;flex-shrink:0}
|
|
@@ -467,14 +557,14 @@ window.__ModuleLoader__.load({
|
|
|
467
557
|
}), (0, react.createElement)("p", {
|
|
468
558
|
className: "lg-hint",
|
|
469
559
|
key: "l"
|
|
470
|
-
}, "
|
|
560
|
+
}, "上面的地址就是二维码内容:扫码即登录(免密链接,等同于密码)。首次访问还要给这台设备命名一次,之后才不用再问。")]) : (0, react.createElement)("div", { key: "normal-qr" }, [access.qrSvg === null ? null : (0, react.createElement)("div", {
|
|
471
561
|
key: "svg",
|
|
472
562
|
className: "lg-qr",
|
|
473
563
|
dangerouslySetInnerHTML: { __html: access.qrSvg }
|
|
474
564
|
}), (0, react.createElement)("p", {
|
|
475
565
|
className: "lg-hint",
|
|
476
566
|
key: "l"
|
|
477
|
-
}, hasPassword && !unlocked ? "
|
|
567
|
+
}, hasPassword && !unlocked ? "扫码后在手机上输入访问密码,首次访问还要给这台设备命名一次。解锁管理控制台后会改为显示免密二维码。" : "扫码后在手机上输入访问密码,首次访问还要给这台设备命名一次。")]);
|
|
478
568
|
const accessTab = (0, react.createElement)("div", { className: "lg-tabbody" }, [(0, react.createElement)(Card, {
|
|
479
569
|
key: "status",
|
|
480
570
|
title: "局域网访问",
|
|
@@ -484,10 +574,11 @@ window.__ModuleLoader__.load({
|
|
|
484
574
|
(0, react.createElement)("div", {
|
|
485
575
|
className: hasPassword ? "lg-bar" : "lg-bar warn",
|
|
486
576
|
key: "bar"
|
|
487
|
-
}, [(0, react.createElement)("span", { key: "txt" }, hasPassword ? "🛡️ 访问安全认证已生效" : "⚠️ 尚未设置访问密码,门禁不会放行任何设备"), hasPassword ? null : goSecurity]),
|
|
577
|
+
}, [(0, react.createElement)("span", { key: "txt" }, hasPassword ? listener.listenHost === "127.0.0.1" ? "🛡️ 访问安全认证已生效(当前仅本机可访问)" : "🛡️ 访问安全认证已生效" : listener.listenHost === "127.0.0.1" ? "⚠️ 尚未设置访问密码,门禁不会放行任何设备" : `⚠️ 端口已对局域网开放(${String(listener.listenPort)}),但尚未设置访问密码:门禁此刻拒绝所有设备,不会泄露数据;请先设置访问密码`), hasPassword ? null : goSecurity]),
|
|
488
578
|
(0, react.createElement)("div", {
|
|
489
|
-
className: "lg-mono",
|
|
490
|
-
key: "url"
|
|
579
|
+
className: "lg-mono lg-mono-scroll",
|
|
580
|
+
key: "url",
|
|
581
|
+
title: scanUrl ?? ""
|
|
491
582
|
}, scanUrl ?? "—"),
|
|
492
583
|
(0, react.createElement)("div", {
|
|
493
584
|
className: "lg-row",
|
|
@@ -712,7 +803,7 @@ window.__ModuleLoader__.load({
|
|
|
712
803
|
(0, react.createElement)("p", {
|
|
713
804
|
className: "lg-hint",
|
|
714
805
|
key: "approval-hint"
|
|
715
|
-
}, "开启「管理员批准」后:手机完成命名 →
|
|
806
|
+
}, "开启「管理员批准」后:手机完成命名 → 进入「待批准」,你在下面点「批准」它才能访问;「拒绝并拉黑」作废的是这台设备的身份:它在这个浏览器里会被一直拒绝,但清掉浏览器数据或换一个浏览器后,仍可用密码重新配对——要彻底挡住,请同时更换访问密码。"),
|
|
716
807
|
snapshot.pendingCount > 0 ? (0, react.createElement)("div", {
|
|
717
808
|
className: "lg-bar warn",
|
|
718
809
|
key: "pending-bar"
|
|
@@ -747,7 +838,7 @@ window.__ModuleLoader__.load({
|
|
|
747
838
|
const connectionTab = (0, react.createElement)("div", { className: "lg-tabbody" }, locked ? [lockCard] : [(0, react.createElement)(Card, {
|
|
748
839
|
key: "connection",
|
|
749
840
|
title: "连接与证书",
|
|
750
|
-
subtitle: "
|
|
841
|
+
subtitle: "监听范围、端口与传输安全",
|
|
751
842
|
children: [
|
|
752
843
|
(0, react.createElement)("div", {
|
|
753
844
|
className: "lg-mono",
|
|
@@ -757,6 +848,38 @@ window.__ModuleLoader__.load({
|
|
|
757
848
|
className: "lg-bar warn",
|
|
758
849
|
key: "port-busy"
|
|
759
850
|
}, `配置的端口 ${String(listener.configuredPort ?? "?")} 已被占用,已自动改用 ${String(listener.listenPort)}。可在下面改端口,或先关掉占用它的程序。`) : null,
|
|
851
|
+
(0, react.createElement)("div", {
|
|
852
|
+
className: "lg-field",
|
|
853
|
+
key: "scope"
|
|
854
|
+
}, [
|
|
855
|
+
(0, react.createElement)("span", {
|
|
856
|
+
className: "lg-label",
|
|
857
|
+
key: "l"
|
|
858
|
+
}, "监听范围(修改后需重启 dsh 生效)"),
|
|
859
|
+
(0, react.createElement)(ChoiceGrid, {
|
|
860
|
+
key: "g",
|
|
861
|
+
choices: [{
|
|
862
|
+
id: "0.0.0.0",
|
|
863
|
+
title: "局域网(默认)",
|
|
864
|
+
detail: "手机等同网段设备可访问;门禁与自签 HTTPS 全程生效"
|
|
865
|
+
}, {
|
|
866
|
+
id: "127.0.0.1",
|
|
867
|
+
title: "仅本机",
|
|
868
|
+
detail: "只有这台电脑能访问;手机扫码会连不上(更保守)"
|
|
869
|
+
}],
|
|
870
|
+
value: listener.listenHost,
|
|
871
|
+
disabled: busy,
|
|
872
|
+
onPick: (id) => void write({ preferences: { listenHost: id } })
|
|
873
|
+
}),
|
|
874
|
+
listener.listenHost === "0.0.0.0" || listener.listenHost === "127.0.0.1" ? null : (0, react.createElement)("span", {
|
|
875
|
+
className: "lg-label",
|
|
876
|
+
key: "custom"
|
|
877
|
+
}, `当前为自定义监听地址 ${listener.listenHost}(在 profile patch 中设置);选择上面任一项会覆盖它。`),
|
|
878
|
+
listener.listenHost === "127.0.0.1" ? null : (0, react.createElement)("p", {
|
|
879
|
+
className: "lg-hint",
|
|
880
|
+
key: "scope-hint"
|
|
881
|
+
}, "对外可达不等于可以进入:未设访问密码时,门禁拒绝所有设备;已设密码则需通过门禁。若只在固定网卡上公布,可在 profile patch 里把 listenHost 写成该网卡 IP。")
|
|
882
|
+
]),
|
|
760
883
|
(0, react.createElement)("div", {
|
|
761
884
|
className: "lg-field",
|
|
762
885
|
key: "port"
|
|
@@ -919,7 +1042,8 @@ window.__ModuleLoader__.load({
|
|
|
919
1042
|
}, `发现新版本 v${String(update.latest)}(当前 v${update.current})`),
|
|
920
1043
|
(0, react.createElement)("div", {
|
|
921
1044
|
key: "c",
|
|
922
|
-
className: "lg-mono"
|
|
1045
|
+
className: "lg-mono lg-mono-scroll",
|
|
1046
|
+
title: `dsh plugin --profile web add dsh-lan-guard@${String(update.latest)}`
|
|
923
1047
|
}, `dsh plugin --profile web add dsh-lan-guard@${String(update.latest)}`),
|
|
924
1048
|
(0, react.createElement)("div", {
|
|
925
1049
|
className: "lg-row",
|