@songsid/agend 2.3.3-beta.9 → 2.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/dist/fleet-manager.d.ts +16 -0
- package/dist/fleet-manager.js +29 -1
- package/dist/fleet-manager.js.map +1 -1
- package/dist/locale.js +8 -2
- package/dist/locale.js.map +1 -1
- package/dist/public-link-progress.d.ts +5 -2
- package/dist/public-link-progress.js +4 -3
- package/dist/public-link-progress.js.map +1 -1
- package/dist/public-web-link.d.ts +10 -0
- package/dist/public-web-link.js +24 -5
- package/dist/public-web-link.js.map +1 -1
- package/dist/settings-api.d.ts +10 -0
- package/dist/settings-api.js +41 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/tunnel/cloudflared.d.ts +5 -0
- package/dist/tunnel/cloudflared.js +32 -1
- package/dist/tunnel/cloudflared.js.map +1 -1
- package/dist/tunnel/named-diagnostics.d.ts +2 -1
- package/dist/tunnel/named-diagnostics.js +4 -1
- package/dist/tunnel/named-diagnostics.js.map +1 -1
- package/dist/tunnel/named-link-test.d.ts +90 -0
- package/dist/tunnel/named-link-test.js +270 -0
- package/dist/tunnel/named-link-test.js.map +1 -0
- package/dist/tunnel/purpose-lane.d.ts +3 -1
- package/dist/tunnel/purpose-lane.js +2 -0
- package/dist/tunnel/purpose-lane.js.map +1 -1
- package/dist/ui/panel-settings.js +5 -3
- package/dist/ui/settings-named-test.js +144 -0
- package/dist/ui/settings-strings.js +6 -6
- package/dist/ui/shared/app.css +7 -0
- package/dist/ui/shared/web-authorize.js +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purpose-lane.js","sourceRoot":"","sources":["../../src/tunnel/purpose-lane.ts"],"names":[],"mappings":"AAYA,MAAM,QAAQ,GAAG,GAAqB,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ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,CAAC;gBAChB,CAAC,CAAC,EAAE,CAAC;YACP,CAAC;YACD,aAAa,EAAE,OAAO;SACvB,CAAC;QACF,IAAI,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC;QAC1C,OAAO,WAAW,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -50,6 +50,7 @@ import { GuestsCard } from "./settings-guests.js";
|
|
|
50
50
|
import { OfficeSharesCard } from "./office-share-dialog.js";
|
|
51
51
|
import { syncStage, useDraft } from "./settings-draft.js";
|
|
52
52
|
import { WebAuthorityCard } from "./settings-web-authority.js";
|
|
53
|
+
import { NamedLinkTest, setTypedTunnelToken } from "./settings-named-test.js";
|
|
53
54
|
import { SignInList } from "./backend-signin.js";
|
|
54
55
|
|
|
55
56
|
const tn = (k, ...v) => t(`settings.${k}`, ...v);
|
|
@@ -1353,6 +1354,7 @@ function WebSection({ ctx, staged, part = "all" }) {
|
|
|
1353
1354
|
<div class=${fc("field", "originPort")}><label for="publicWebOriginPort">${tn("namedOriginPort")}</label><input id="publicWebOriginPort" type="number" min="1024" max="65535" value=${f.originPort} class=${errors.originPort ? "invalid" : ""} onInput=${(e) => set("originPort")(e.target.value)} /><${Feedback} error=${errors.originPort} /></div>
|
|
1354
1355
|
</div>
|
|
1355
1356
|
<p class="note">${tn("namedTunnelHint")} <a href="https://github.com/songsid/AgEnD/blob/main/docs/named-tunnel.md" target="_blank" rel="noopener noreferrer">${tn("namedTunnelSetup")}</a></p>
|
|
1357
|
+
${String(f.hostname || "").trim() ? html`<${NamedLinkTest} hostname=${f.hostname} port=${f.originPort} protocol=${f.protocol} />` : null}
|
|
1356
1358
|
<div class="grid2">
|
|
1357
1359
|
<div class=${fc("field", "ttl")}><label for="publicWebTtl">${tn(named ? "publicTtlNamed" : "publicTtl")}</label><input id="publicWebTtl" type="number" min=${named ? "0" : "1"} max=${named ? "10080" : "480"} step="1" class=${errors.ttl ? "invalid" : ""} value=${f.ttl} onInput=${(e) => set("ttl")(e.target.value)} /><${Feedback} error=${errors.ttl} /></div>
|
|
1358
1360
|
<div class=${fc("field", "protocol")}><label for="publicWebProtocol">${tn("publicProtocol")}</label><${Select} id="publicWebProtocol" value=${f.protocol} onChange=${set("protocol")} options=${["http2", "quic", "auto"]} /></div>
|
|
@@ -1548,11 +1550,11 @@ function PublicTunnelToken() {
|
|
|
1548
1550
|
const result = await api(base);
|
|
1549
1551
|
if (lease.current() && result.ok) setPresent(result.body?.[0]?.token_present === true);
|
|
1550
1552
|
};
|
|
1551
|
-
useEffect(() => { refresh().catch(() => {}); }, []);
|
|
1553
|
+
useEffect(() => { refresh().catch(() => {}); return () => setTypedTunnelToken(""); }, []);
|
|
1552
1554
|
const go = async (clear) => {
|
|
1553
1555
|
if (inFlight.current || !clear && !secret) return;
|
|
1554
1556
|
const value = secret;
|
|
1555
|
-
setSecret(""); inFlight.current = true; setBusy(true); setMessage("");
|
|
1557
|
+
setSecret(""); setTypedTunnelToken(""); inFlight.current = true; setBusy(true); setMessage("");
|
|
1556
1558
|
const key = newKey("tunnel-token");
|
|
1557
1559
|
try {
|
|
1558
1560
|
const prepared = await api(`${base}/verify`, { method: "POST", headers: { "Idempotency-Key": key }, body: JSON.stringify(clear ? { clear: true } : { secret: value }) });
|
|
@@ -1576,7 +1578,7 @@ function PublicTunnelToken() {
|
|
|
1576
1578
|
return html`<section class="card"><h3>${tn("namedToken")}</h3>
|
|
1577
1579
|
<p class="note">${tn("namedTokenHint")}</p>
|
|
1578
1580
|
<span class="tag">${present ? tn("keyConfigured") : tn("keyNotConfigured")}</span>
|
|
1579
|
-
<input id="publicTunnelToken" type="password" autocomplete="new-password" aria-label=${tn("namedToken")} value=${secret} onInput=${e => setSecret(e.target.value)} />
|
|
1581
|
+
<input id="publicTunnelToken" type="password" autocomplete="new-password" aria-label=${tn("namedToken")} value=${secret} onInput=${e => { setSecret(e.target.value); setTypedTunnelToken(e.target.value); }} />
|
|
1580
1582
|
<button type="button" class="btn btn-sm" disabled=${busy || !secret} onClick=${() => go(false)}>${tn("namedTokenSet")}</button>
|
|
1581
1583
|
<button type="button" class="btn btn-sm" disabled=${busy || !present} onClick=${() => go(true)}>${tn("namedTokenClear")}</button>
|
|
1582
1584
|
${message ? html`<p class="note" role="status">${message}</p>` : null}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// #2906 (the user, 2026-11-01): Settings → Access → the fixed address's 「測試連線」 / "Test connection". It tests the
|
|
2
|
+
// values as filled in (unsaved too: the typed connector token, else the saved one) and shows each step ✓ or ✗; every ✗
|
|
3
|
+
// says what the person can do next. The server answers closed step codes only (settings-api.ts, named-link-test.ts):
|
|
4
|
+
// the token never comes back. Words never name the person's workplace — "this machine's network", "network administrator".
|
|
5
|
+
import { html, useRef, useState } from "/assets/app-html.js";
|
|
6
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
7
|
+
import { useLease } from "/assets/app-ctx.js";
|
|
8
|
+
import { api } from "./settings-confirm.js";
|
|
9
|
+
|
|
10
|
+
register("settings", {
|
|
11
|
+
en: {
|
|
12
|
+
ntButton: "Test connection",
|
|
13
|
+
ntRunning: "Testing… (up to about a minute)",
|
|
14
|
+
ntHint: "Tests the values above as filled in, saved or not — with the token typed below, or the saved one.",
|
|
15
|
+
ntBusy: "A test is already running. Try again when it ends.",
|
|
16
|
+
ntFailed: "The test could not run. Try again.",
|
|
17
|
+
ntNotRun: "Not tested (an earlier step failed).",
|
|
18
|
+
ntTimeout: "The test took too long and was stopped. Test again; if it repeats, check this machine's network.",
|
|
19
|
+
ntCancelled: "Your sign-in ended, so nothing was started. Sign in again and test again.",
|
|
20
|
+
ntCleanup: "The test's connector could not be confirmed stopped. Run agend restart before testing or opening the link again.",
|
|
21
|
+
ntStep_values: "The domain, port and token",
|
|
22
|
+
ntStep_origin: "This machine answers on port {1}",
|
|
23
|
+
ntStep_tunnel: "The tunnel connects to Cloudflare",
|
|
24
|
+
ntStep_dns: "{0} can be looked up",
|
|
25
|
+
ntStep_reach: "{0} reaches this AgEnD",
|
|
26
|
+
nt_values_ok: "Filled in correctly.",
|
|
27
|
+
"nt_values_bad-hostname": "Enter a domain such as agend.example.com (no https://, path or port).",
|
|
28
|
+
"nt_values_bad-port": "Enter a port from 1024 to 65535.",
|
|
29
|
+
"nt_values_no-token": "No connector token: paste it below (Cloudflare → your tunnel → the long string that starts with eyJ).",
|
|
30
|
+
"nt_values_bad-token": "This is not a connector token: copy only the long string that starts with eyJ.",
|
|
31
|
+
nt_origin_ok: "Answered for this test.",
|
|
32
|
+
nt_origin_live: "Your link is open on these values: it is tested as it is.",
|
|
33
|
+
"nt_origin_dashboard-port": "{1} is the dashboard's own port. Choose another (19282 by default), and make the Cloudflare route's service http://127.0.0.1:<that port>.",
|
|
34
|
+
"nt_origin_port-in-use": "Port {1} is used by another program on this machine. Choose another port here, and make the Cloudflare route's service http://127.0.0.1:<that port>.",
|
|
35
|
+
"nt_origin_origin-failed": "AgEnD could not listen on port {1}. Try another port.",
|
|
36
|
+
"nt_origin_link-open-other": "Your link is open with other settings. Close it (/web → Close public link), then test again.",
|
|
37
|
+
"nt_origin_tunnel-busy": "Another tunnel is starting or running (a public link or a sign-in). Try again in a minute.",
|
|
38
|
+
nt_tunnel_ok: "Connected to Cloudflare.",
|
|
39
|
+
nt_tunnel_live: "Your open link is connected.",
|
|
40
|
+
nt_tunnel_auth: "Cloudflare refused the token: it is wrong or was rotated. Copy the current token from the tunnel's page in Cloudflare and paste it again.",
|
|
41
|
+
nt_tunnel_network: "This machine could not reach Cloudflare within 20 seconds. Set the protocol to http2 here, or ask the network administrator to allow outbound connections to Cloudflare (port 7844).",
|
|
42
|
+
nt_tunnel_stopped: "cloudflared stopped before it connected. Test again; if it repeats, check the token and the protocol.",
|
|
43
|
+
"nt_tunnel_no-binary": "cloudflared could not be prepared on this machine (its download or install failed). Check this machine's internet access and test again.",
|
|
44
|
+
nt_dns_ok: "Found.",
|
|
45
|
+
"nt_dns_dns-missing": "{0} does not exist yet. In Cloudflare, add a Published application route for {0} on this tunnel.",
|
|
46
|
+
"nt_dns_dns-failed": "This machine could not look up {0}: this machine's network may block DNS. Ask the network administrator.",
|
|
47
|
+
nt_reach_ok: "It works: {0} reached this AgEnD.",
|
|
48
|
+
"nt_reach_wrong-service": "Cloudflare answered but could not reach the service: make the route's service http://127.0.0.1:{1} (HTTP, not HTTPS).",
|
|
49
|
+
"nt_reach_other-page": "{0} answered with another page: its route points to another service or tunnel. Point it to this tunnel, with the service http://127.0.0.1:{1}.",
|
|
50
|
+
"nt_reach_route-missing": "{0} is not routed to this tunnel. In Cloudflare, add a Published application route for {0}.",
|
|
51
|
+
"nt_reach_self-unreachable": "The tunnel is connected, but this machine's network can't open {0} (some networks filter new domains). From another network, such as a phone on mobile data, it may still work. Ask the network administrator to allow {0}.",
|
|
52
|
+
"nt_reach_reach-failed": "{0} did not answer as expected. Test again in a minute; if it repeats, check the route in Cloudflare.",
|
|
53
|
+
},
|
|
54
|
+
"zh-TW": {
|
|
55
|
+
ntButton: "測試連線",
|
|
56
|
+
ntRunning: "測試中…(最多約 1 分鐘)",
|
|
57
|
+
ntHint: "用上面填的設定測試(不論是否已儲存),token 用下方輸入的,沒有就用已儲存的。",
|
|
58
|
+
ntBusy: "已經有一個測試在進行,請等它結束再試。",
|
|
59
|
+
ntFailed: "測試沒有執行成功,請再試一次。",
|
|
60
|
+
ntNotRun: "未測試(前面的步驟失敗)。",
|
|
61
|
+
ntTimeout: "測試太久,已經停止。請再測一次;如果一直這樣,請檢查這台主機所在的網路。",
|
|
62
|
+
ntCancelled: "你的登入已結束,所以沒有啟動任何東西。請重新登入後再測。",
|
|
63
|
+
ntCleanup: "無法確認測試用的連接器已經停止。請先執行 agend restart,再測試或開啟連結。",
|
|
64
|
+
ntStep_values: "網域、port 與 token",
|
|
65
|
+
ntStep_origin: "這台主機在 port {1} 回應",
|
|
66
|
+
ntStep_tunnel: "tunnel 連上 Cloudflare",
|
|
67
|
+
ntStep_dns: "查得到 {0}",
|
|
68
|
+
ntStep_reach: "{0} 連得到這台 AgEnD",
|
|
69
|
+
nt_values_ok: "填寫正確。",
|
|
70
|
+
"nt_values_bad-hostname": "請填網域,例如 agend.example.com(不含 https://、路徑或 port)。",
|
|
71
|
+
"nt_values_bad-port": "請填 1024–65535 之間的 port。",
|
|
72
|
+
"nt_values_no-token": "沒有 connector token:請貼在下方(Cloudflare → 你的 tunnel → 以 eyJ 開頭的長字串)。",
|
|
73
|
+
"nt_values_bad-token": "這不是 connector token:只複製以 eyJ 開頭的那串長字串。",
|
|
74
|
+
nt_origin_ok: "這次測試有回應。",
|
|
75
|
+
nt_origin_live: "你的連結正以這些設定開著:直接測試它。",
|
|
76
|
+
"nt_origin_dashboard-port": "{1} 是儀表板自己的 port。請換一個(預設 19282),並把 Cloudflare 路由的 service 設成 http://127.0.0.1:<那個 port>。",
|
|
77
|
+
"nt_origin_port-in-use": "這台主機上有其他程式在用 port {1}。請在這裡換一個 port,並把 Cloudflare 路由的 service 改成 http://127.0.0.1:<那個 port>。",
|
|
78
|
+
"nt_origin_origin-failed": "AgEnD 無法在 port {1} 監聽,請換一個 port。",
|
|
79
|
+
"nt_origin_link-open-other": "你的連結正以其他設定開著。請先關閉(/web → 關閉公開連結),再測試。",
|
|
80
|
+
"nt_origin_tunnel-busy": "另一條 tunnel 正在啟動或執行(公開連結或登入用)。請過一分鐘再試。",
|
|
81
|
+
nt_tunnel_ok: "已連上 Cloudflare。",
|
|
82
|
+
nt_tunnel_live: "開著的連結已連線。",
|
|
83
|
+
nt_tunnel_auth: "Cloudflare 拒絕這個 token:它是錯的或已被更換。請到 Cloudflare 的 tunnel 頁面複製目前的 token 再貼上。",
|
|
84
|
+
nt_tunnel_network: "這台主機在 20 秒內連不上 Cloudflare。請在這裡把通訊協定改成 http2,或請網路管理員允許對 Cloudflare 的對外連線(port 7844)。",
|
|
85
|
+
nt_tunnel_stopped: "cloudflared 在連上之前就停止了。請再測一次;如果一直這樣,請檢查 token 與通訊協定。",
|
|
86
|
+
"nt_tunnel_no-binary": "這台主機無法準備 cloudflared(下載或安裝失敗)。請確認這台主機能連上網路後再測。",
|
|
87
|
+
nt_dns_ok: "查得到。",
|
|
88
|
+
"nt_dns_dns-missing": "{0} 還不存在。請在 Cloudflare 為這條 tunnel 新增 {0} 的 Published application 路由。",
|
|
89
|
+
"nt_dns_dns-failed": "這台主機查不到 {0}:這台主機所在的網路可能擋了 DNS。請洽網路管理員。",
|
|
90
|
+
nt_reach_ok: "正常:{0} 連到了這台 AgEnD。",
|
|
91
|
+
"nt_reach_wrong-service": "Cloudflare 有回應,但連不到服務:請把路由的 service 設成 http://127.0.0.1:{1}(HTTP,不是 HTTPS)。",
|
|
92
|
+
"nt_reach_other-page": "{0} 回應了別的頁面:它的路由指向別的服務或 tunnel。請把它指向這條 tunnel,service 設成 http://127.0.0.1:{1}。",
|
|
93
|
+
"nt_reach_route-missing": "{0} 沒有路由到這條 tunnel。請在 Cloudflare 新增 {0} 的 Published application 路由。",
|
|
94
|
+
"nt_reach_self-unreachable": "tunnel 已連上,但這台主機所在的網路打不開 {0}(有些網路會擋新的網域)。從其他網路(例如手機行動網路)可能可以正常使用。請網路管理員允許 {0}。",
|
|
95
|
+
"nt_reach_reach-failed": "{0} 沒有如預期回應。請過一分鐘再測;如果一直這樣,請檢查 Cloudflare 上的路由。",
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
const tn = (k, ...v) => t(`settings.${k}`, ...v);
|
|
99
|
+
const STEPS = ["values", "origin", "tunnel", "dns", "reach"];
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The connector token typed in the token card below (not yet saved): the test uses it when there is one. The card
|
|
103
|
+
* owns it: it sets it as typed and clears it when saved, cleared or unmounted (#2907 review: a hidden token from a
|
|
104
|
+
* card no longer on screen is never used).
|
|
105
|
+
*/
|
|
106
|
+
let typedToken = "";
|
|
107
|
+
export function setTypedTunnelToken(value) { typedToken = typeof value === "string" ? value : ""; }
|
|
108
|
+
|
|
109
|
+
/** The button and its result, for the fixed-address values the form holds now. */
|
|
110
|
+
export function NamedLinkTest({ hostname, port, protocol }) {
|
|
111
|
+
const lease = useLease("named-link-test");
|
|
112
|
+
const [busy, setBusy] = useState(false);
|
|
113
|
+
const [result, setResult] = useState(null);
|
|
114
|
+
const [note, setNote] = useState("");
|
|
115
|
+
const running = useRef(false);
|
|
116
|
+
const run = async () => {
|
|
117
|
+
if (running.current) return;
|
|
118
|
+
running.current = true; setBusy(true); setNote(""); setResult(null);
|
|
119
|
+
try {
|
|
120
|
+
const r = await api("/api/settings/public-link/test", { method: "POST", body: JSON.stringify({
|
|
121
|
+
hostname: String(hostname ?? "").trim(), origin_port: String(port ?? "").trim() || "19282", protocol, ...(typedToken.trim() ? { token: typedToken } : {}),
|
|
122
|
+
}) });
|
|
123
|
+
if (!lease.current()) return;
|
|
124
|
+
if (r.status === 409) setNote(tn("ntBusy"));
|
|
125
|
+
else if (!r.ok || !Array.isArray(r.body?.steps)) setNote(tn("ntFailed"));
|
|
126
|
+
else setResult(r.body);
|
|
127
|
+
} catch { if (lease.current()) setNote(tn("ntFailed")); }
|
|
128
|
+
finally { running.current = false; if (lease.current()) setBusy(false); }
|
|
129
|
+
};
|
|
130
|
+
const host = result?.hostname || String(hostname ?? "").trim() || "—", shownPort = result?.port ?? (String(port ?? "").trim() || "19282");
|
|
131
|
+
return html`<div class="named-test">
|
|
132
|
+
<div class="save-row"><button type="button" class="btn btn-sm" id="namedLinkTest" disabled=${busy} onClick=${run}>${busy ? tn("ntRunning") : tn("ntButton")}</button></div>
|
|
133
|
+
<p class="note">${tn("ntHint")}</p>
|
|
134
|
+
${note ? html`<p class="note" role="status">${note}</p>` : null}
|
|
135
|
+
${result ? html`<ol class="named-test-steps" role="status" aria-live="polite">${STEPS.map((step) => {
|
|
136
|
+
const r = result.steps.find((s) => s.step === step);
|
|
137
|
+
const mark = !r ? "–" : r.ok ? "✓" : "✗";
|
|
138
|
+
const said = !r ? tn("ntNotRun") : r.code === "timeout" ? tn("ntTimeout") : r.code === "cancelled" ? tn("ntCancelled") : tn(`nt_${step}_${r.code}`, host, shownPort);
|
|
139
|
+
return html`<li key=${step} class=${!r ? "nt-skip" : r.ok ? "nt-ok" : "nt-fail"} data-step=${step} data-code=${r ? r.code : ""}>
|
|
140
|
+
<span class="nt-mark" aria-hidden="true">${mark}</span> <strong>${tn(`ntStep_${step}`, host, shownPort)}</strong> — ${said}</li>`;
|
|
141
|
+
})}</ol>` : null}
|
|
142
|
+
${result?.cleanup ? html`<p class="feedback error" role="alert">${tn("ntCleanup")}</p>` : null}
|
|
143
|
+
</div>`;
|
|
144
|
+
}
|
|
@@ -470,7 +470,7 @@ register("settings", {
|
|
|
470
470
|
cssTitle: "Custom CSS (yours only)",
|
|
471
471
|
cssLead: "Applies to your screens only.",
|
|
472
472
|
cssLoadFailed: "Couldn't load your custom CSS. Reload the page to try again.",
|
|
473
|
-
cssPublicLink: "Custom CSS isn't available
|
|
473
|
+
cssPublicLink: "Custom CSS isn't available over a public link.",
|
|
474
474
|
cssInForce: "In force: {0}",
|
|
475
475
|
cssOnTrial: "On trial: {0}. Choose Keep, or it reverts.",
|
|
476
476
|
cssNone: "No custom CSS in force.",
|
|
@@ -507,9 +507,9 @@ register("settings", {
|
|
|
507
507
|
cssError_owner_css_needs_a_signed_in_person: "Sign in in the browser to change custom CSS.",
|
|
508
508
|
cssError_other: "Not saved ({0}).",
|
|
509
509
|
webLead: "How the web dashboard behaves. A change that loosens access (longer sessions, the browser terminal back on or for longer, the public link) waits for a fleet admin to confirm it in chat (General topic) or on the host; one that tightens it applies at once.",
|
|
510
|
-
webPublicRefused: "Web settings can't be changed over a
|
|
510
|
+
webPublicRefused: "Web settings can't be changed over a public link. Open the dashboard at its own address to change them.",
|
|
511
511
|
webSessionTitle: "Sign-in sessions",
|
|
512
|
-
webSessionHint: "For sign-ins at the dashboard's own address (this computer, the LAN, a tailnet).
|
|
512
|
+
webSessionHint: "For sign-ins at the dashboard's own address (this computer, the LAN, a tailnet). Over a public link (a temporary one or your permanent link), a session lasts at most 8 h, ends after 30 min idle and never outlives the link; an admin's also never lasts longer than these settings (a guest's follows the guest settings). Shortening ends the sessions it now outlives; lengthening applies to new sign-ins and to an existing one's idle time on its next use. Empty = the default.",
|
|
513
513
|
sessionAbsolute: "Session length, hours (1–720)",
|
|
514
514
|
sessionIdle: "Sign out after unused for, hours (1–720)",
|
|
515
515
|
sessionRange: "Must be a number of hours from 1 to 720",
|
|
@@ -1124,7 +1124,7 @@ register("settings", {
|
|
|
1124
1124
|
cssTitle: "自訂 CSS(只套用在你自己)",
|
|
1125
1125
|
cssLead: "只套用在你的畫面。",
|
|
1126
1126
|
cssLoadFailed: "無法載入你的自訂 CSS。請重新整理頁面再試一次。",
|
|
1127
|
-
cssPublicLink: "
|
|
1127
|
+
cssPublicLink: "透過公開連結無法使用自訂 CSS。",
|
|
1128
1128
|
cssInForce: "使用中:{0}",
|
|
1129
1129
|
cssOnTrial: "試用中:{0}。請按「保留」,否則會還原。",
|
|
1130
1130
|
cssNone: "目前沒有使用自訂 CSS。",
|
|
@@ -1161,9 +1161,9 @@ register("settings", {
|
|
|
1161
1161
|
cssError_owner_css_needs_a_signed_in_person: "請在瀏覽器登入後再變更自訂 CSS。",
|
|
1162
1162
|
cssError_other: "未儲存({0})。",
|
|
1163
1163
|
webLead: "網頁儀表板的行為。放寬存取的變更(延長 session、重新開啟或延長瀏覽器終端機、公開連結)需要 fleet admin 在聊天(General topic)或主機上確認;收緊的變更會立即套用。",
|
|
1164
|
-
webPublicRefused: "
|
|
1164
|
+
webPublicRefused: "無法透過公開連結變更網頁設定。請從儀表板本身的網址開啟後再變更。",
|
|
1165
1165
|
webSessionTitle: "登入 session",
|
|
1166
|
-
webSessionHint: "適用於從儀表板本身網址登入的 session(本機、區域網路、tailnet
|
|
1166
|
+
webSessionHint: "適用於從儀表板本身網址登入的 session(本機、區域網路、tailnet)。透過公開連結(臨時連結或你的固定網域)的 session 最長 8 小時、閒置 30 分鐘就結束,也不會超過連結本身;管理者的 session 也不會超過這裡的設定(訪客依訪客設定)。縮短會讓已超過新限制的 session 結束;延長會套用到新的登入,以及既有 session 下次使用時的閒置時間。留空 = 預設值。",
|
|
1167
1167
|
sessionAbsolute: "Session 時長,小時(1–720)",
|
|
1168
1168
|
sessionIdle: "閒置多久後登出,小時(1–720)",
|
|
1169
1169
|
sessionRange: "必須是 1 到 720 之間的小時數",
|
package/dist/ui/shared/app.css
CHANGED
|
@@ -935,6 +935,13 @@ img.amb-p { object-fit: contain; }
|
|
|
935
935
|
.webauth-tip[hidden] { display: none; }
|
|
936
936
|
/* #1920 phase 3 / #2348: Settings → Access & security → Guests. The fixed template (#2330): flat rows split by a rule,
|
|
937
937
|
no rounded box or fill; an edited row is .s-dirty (the shared straight bar + tint, square). A state is coloured text. */
|
|
938
|
+
/* #2906: the fixed address's Test connection — one row per step, ✓ / ✗ / – and what to do next. */
|
|
939
|
+
.named-test-steps { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: var(--s-1); font-size: var(--fs-sm); }
|
|
940
|
+
.named-test-steps li { overflow-wrap: anywhere; }
|
|
941
|
+
.named-test-steps .nt-mark { display: inline-block; width: 1.2em; font-weight: var(--fw-semibold); }
|
|
942
|
+
.named-test-steps .nt-ok .nt-mark { color: var(--ok); }
|
|
943
|
+
.named-test-steps .nt-fail .nt-mark { color: var(--danger); }
|
|
944
|
+
.named-test-steps .nt-skip { color: var(--text-3); }
|
|
938
945
|
.s-guests .guest-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px var(--s-3); max-height: 220px; overflow: auto;
|
|
939
946
|
padding: var(--s-1) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
|
|
940
947
|
.s-guests .guest-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
@@ -18,7 +18,7 @@ register("webauth", {
|
|
|
18
18
|
reason_not_admin: "Your account is not a fleet admin here.",
|
|
19
19
|
reason_not_admin_session: "Guests can't authorize.",
|
|
20
20
|
reason_token_rotated: "The dashboard's token changed: sign in again.",
|
|
21
|
-
reason_public_link: "
|
|
21
|
+
reason_public_link: "This sign-in can't be authorized over this link.",
|
|
22
22
|
reason_named_link_off: "Over your named link: turn on \"Also over my named link\" in Settings → Access & security on this computer.",
|
|
23
23
|
reason_quick_link_off: "Over the temporary public link: turn on \"Also over the temporary public link\" in Settings → Access & security on this computer.",
|
|
24
24
|
reason_not_session: "Sign in to authorize.",
|
|
@@ -46,7 +46,7 @@ register("webauth", {
|
|
|
46
46
|
reason_not_admin: "你的帳號在這裡不是 fleet 管理者。",
|
|
47
47
|
reason_not_admin_session: "訪客無法授權。",
|
|
48
48
|
reason_token_rotated: "儀表板的 token 已變更:請重新登入。",
|
|
49
|
-
reason_public_link: "
|
|
49
|
+
reason_public_link: "這個登入無法透過這個連結授權。",
|
|
50
50
|
reason_named_link_off: "透過固定網域:請在這台電腦的 設定 → 存取與安全 開啟「也允許透過我的固定網域」。",
|
|
51
51
|
reason_quick_link_off: "透過臨時公開連結:請在這台電腦的 設定 → 存取與安全 開啟「也允許透過臨時公開連結」。",
|
|
52
52
|
reason_not_session: "登入後才能授權。",
|