@songsid/agend 2.3.5-alpha.6 → 2.3.5-alpha.8
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/accounts-view.d.ts +17 -0
- package/dist/accounts-view.js +33 -6
- package/dist/accounts-view.js.map +1 -1
- package/dist/apply-job.d.ts +5 -0
- package/dist/apply-job.js +10 -3
- package/dist/apply-job.js.map +1 -1
- package/dist/auth-api.d.ts +1 -1
- package/dist/auth-api.js +15 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/web-authority.d.ts +13 -0
- package/dist/authority/web-authority.js +12 -0
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/claude-code.js +47 -9
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/kiro.js +1 -1
- package/dist/backend/kiro.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/access-manager.d.ts +1 -6
- package/dist/channel/access-manager.js +4 -94
- package/dist/channel/access-manager.js.map +1 -1
- package/dist/channel/adapters/discord.d.ts +0 -2
- package/dist/channel/adapters/discord.js +0 -8
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +0 -3
- package/dist/channel/adapters/telegram.js +1 -30
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/types.d.ts +0 -2
- package/dist/cli.js +1 -19
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +2 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/fleet-manager.d.ts +84 -3
- package/dist/fleet-manager.js +494 -51
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +22 -7
- package/dist/general-knowledge/steering/core-rules.md +7 -5
- package/dist/hub/buttons.js +4 -2
- package/dist/hub/buttons.js.map +1 -1
- package/dist/hub/catalog.d.ts +2 -2
- package/dist/hub/catalog.js +233 -48
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.js +2 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +6 -0
- package/dist/hub/compose/member.js +9 -1
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +11 -1
- package/dist/hub/compose/server.js +70 -3
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/directory/directory.d.ts +1 -1
- package/dist/hub/directory/directory.js +32 -23
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/index.d.ts +1 -1
- package/dist/hub/directory/types.d.ts +8 -2
- package/dist/hub/directory/types.js.map +1 -1
- package/dist/hub/group-policy/admin-api.d.ts +30 -0
- package/dist/hub/group-policy/admin-api.js +83 -0
- package/dist/hub/group-policy/admin-api.js.map +1 -0
- package/dist/hub/group-policy/admin-context.d.ts +23 -0
- package/dist/hub/group-policy/admin-context.js +52 -0
- package/dist/hub/group-policy/admin-context.js.map +1 -0
- package/dist/hub/group-policy/admin-control.d.ts +34 -0
- package/dist/hub/group-policy/admin-control.js +258 -0
- package/dist/hub/group-policy/admin-control.js.map +1 -0
- package/dist/hub/group-policy/admin-dto.d.ts +243 -0
- package/dist/hub/group-policy/admin-dto.js +55 -0
- package/dist/hub/group-policy/admin-dto.js.map +1 -0
- package/dist/hub/group-policy/admin-facts.d.ts +17 -0
- package/dist/hub/group-policy/admin-facts.js +33 -0
- package/dist/hub/group-policy/admin-facts.js.map +1 -0
- package/dist/hub/group-policy/admin-impact.d.ts +51 -0
- package/dist/hub/group-policy/admin-impact.js +88 -0
- package/dist/hub/group-policy/admin-impact.js.map +1 -0
- package/dist/hub/group-policy/admin-inventory.d.ts +24 -0
- package/dist/hub/group-policy/admin-inventory.js +72 -0
- package/dist/hub/group-policy/admin-inventory.js.map +1 -0
- package/dist/hub/group-policy/admin-read.d.ts +21 -0
- package/dist/hub/group-policy/admin-read.js +90 -0
- package/dist/hub/group-policy/admin-read.js.map +1 -0
- package/dist/hub/group-policy/authorization.d.ts +60 -0
- package/dist/hub/group-policy/authorization.js +292 -0
- package/dist/hub/group-policy/authorization.js.map +1 -0
- package/dist/hub/group-policy/impact-inventory.d.ts +21 -0
- package/dist/hub/group-policy/impact-inventory.js +75 -0
- package/dist/hub/group-policy/impact-inventory.js.map +1 -0
- package/dist/hub/group-policy/resources.d.ts +22 -2
- package/dist/hub/group-policy/resources.js +119 -25
- package/dist/hub/group-policy/resources.js.map +1 -1
- package/dist/hub/group-policy/store.d.ts +19 -2
- package/dist/hub/group-policy/store.js +66 -5
- package/dist/hub/group-policy/store.js.map +1 -1
- package/dist/hub/group-policy/welcome.d.ts +36 -0
- package/dist/hub/group-policy/welcome.js +55 -0
- package/dist/hub/group-policy/welcome.js.map +1 -0
- package/dist/hub/http/compose.d.ts +2 -0
- package/dist/hub/http/compose.js +133 -12
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +23 -3
- package/dist/hub/http/core.js +138 -5
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +10 -0
- package/dist/hub/member/pairing-api.d.ts +2 -0
- package/dist/hub/member/pairing-api.js +1 -0
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/member/pairing-notices.d.ts +18 -0
- package/dist/hub/member/pairing-notices.js +58 -0
- package/dist/hub/member/pairing-notices.js.map +1 -0
- package/dist/hub/pairing-notices.d.ts +47 -0
- package/dist/hub/pairing-notices.js +241 -0
- package/dist/hub/pairing-notices.js.map +1 -0
- package/dist/hub/pairing.d.ts +33 -1
- package/dist/hub/pairing.js +315 -15
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/policy.d.ts +3 -1
- package/dist/hub/policy.js +13 -6
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/protocol.d.ts +32 -0
- package/dist/hub/protocol.js +6 -1
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/rooms.d.ts +1 -0
- package/dist/hub/rooms.js +76 -26
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +4 -1
- package/dist/hub/runtime.js +11 -0
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.js +4 -0
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/sessions.js +2 -1
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/store.d.ts +10 -1
- package/dist/hub/store.js +7 -4
- package/dist/hub/store.js.map +1 -1
- package/dist/hub/types.d.ts +15 -2
- package/dist/locale.js +48 -36
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +9 -1
- package/dist/login-controller.js +20 -1
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.js +4 -2
- package/dist/login-flows.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/outbound-handlers.js +1 -1
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/quickstart-api.js +2 -2
- package/dist/quickstart-api.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +5 -1
- package/dist/reply-buttons-controller.js +8 -4
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/reply-buttons.d.ts +6 -2
- package/dist/reply-buttons.js +7 -3
- package/dist/reply-buttons.js.map +1 -1
- package/dist/runtime-api.js +10 -2
- package/dist/runtime-api.js.map +1 -1
- package/dist/settings-api.d.ts +2 -1
- package/dist/settings-api.js +7 -5
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.d.ts +10 -0
- package/dist/settings-change.js +17 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +25 -1
- package/dist/settings-confirmation.js +11 -3
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.js +18 -6
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +21 -0
- package/dist/settings-http-confirmation.js +74 -3
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/signin-keepalive.d.ts +2 -0
- package/dist/signin-keepalive.js +30 -2
- package/dist/signin-keepalive.js.map +1 -1
- package/dist/structured-signin.js +3 -1
- package/dist/structured-signin.js.map +1 -1
- package/dist/tips.js +4 -4
- package/dist/tips.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.js.map +1 -1
- package/dist/ui/accounts-keepalive.js +14 -8
- package/dist/ui/accounts-manage.js +31 -13
- package/dist/ui/accounts-view.js +93 -35
- package/dist/ui/backend-signin.js +22 -4
- package/dist/ui/general-location.js +28 -14
- package/dist/ui/hub-chat-store.js +2 -1
- package/dist/ui/hub-client.js +43 -3
- package/dist/ui/hub-grant-strings.js +13 -0
- package/dist/ui/hub-group-policy.js +170 -0
- package/dist/ui/hub-group-strings.js +97 -0
- package/dist/ui/hub-owner-strings.js +6 -2
- package/dist/ui/hub-pairing-progress-strings.js +15 -0
- package/dist/ui/hub-quick-pairing.js +202 -0
- package/dist/ui/hub-quick-strings.js +43 -0
- package/dist/ui/hub-read-strings.js +7 -0
- package/dist/ui/hub-strings.js +4 -2
- package/dist/ui/hub-welcome.js +99 -0
- package/dist/ui/panel-hub.js +115 -33
- package/dist/ui/panel-log.js +2 -2
- package/dist/ui/panel-runtimes.js +14 -6
- package/dist/ui/panel-settings.js +12 -21
- package/dist/ui/runtime-cli-install.js +24 -4
- package/dist/ui/settings-apply.js +12 -5
- package/dist/ui/settings-confirm.js +28 -0
- package/dist/ui/settings-devices.js +8 -12
- package/dist/ui/settings-dialogs.js +3 -1
- package/dist/ui/settings-hub-membership.js +24 -10
- package/dist/ui/settings-hub-section.js +60 -0
- package/dist/ui/settings-hub.js +58 -13
- package/dist/ui/settings-layout.js +6 -2
- package/dist/ui/settings-named-test.js +2 -2
- package/dist/ui/settings-outside.js +1 -1
- package/dist/ui/settings-quota-notice.js +8 -6
- package/dist/ui/settings-registry.js +3 -0
- package/dist/ui/settings-restart-strings.js +17 -0
- package/dist/ui/settings-strings.js +12 -10
- package/dist/ui/shared/accounts-keepalive.css +11 -6
- package/dist/ui/shared/accounts.css +68 -18
- package/dist/ui/shared/app-i18n.js +7 -2
- package/dist/ui/shared/app-route.js +1 -1
- package/dist/ui/shared/app-shell.js +114 -7
- package/dist/ui/shared/app.css +16 -0
- package/dist/ui/shared/chat-strings.js +8 -8
- package/dist/ui/shared/hub-groups.css +26 -0
- package/dist/ui/shared/hub-owner.css +2 -2
- package/dist/ui/shared/hub-signin.css +24 -0
- package/dist/ui/shared/hub.css +1 -0
- package/dist/ui/shared/setup-host-text.js +4 -1
- package/dist/ui/shared/signin.js +3 -1
- package/dist/ui/shared/usage-dialog.js +3 -72
- package/dist/ui/shared/usage-meter.js +84 -0
- package/dist/ui/shared/view-strings.js +4 -4
- package/dist/ui/shared/web-authorize.js +4 -4
- package/dist/ui/structured-signin.js +16 -8
- package/dist/update-marker.d.ts +2 -0
- package/dist/update-marker.js.map +1 -1
- package/dist/usage/providers.d.ts +1 -0
- package/dist/usage/providers.js +13 -9
- package/dist/usage/providers.js.map +1 -1
- package/dist/web-api.d.ts +10 -1
- package/dist/web-api.js +40 -11
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +16 -2
- package/dist/web-backend-login.js +14 -0
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-notices.d.ts +9 -0
- package/dist/web-notices.js +19 -0
- package/dist/web-notices.js.map +1 -1
- package/dist/web-remote-access.d.ts +6 -0
- package/dist/web-remote-access.js +10 -1
- package/dist/web-remote-access.js.map +1 -1
- package/dist/web-shell-routes.d.ts +1 -1
- package/dist/web-shell-routes.js +1 -1
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-terminal.d.ts +7 -0
- package/dist/web-terminal.js +14 -2
- package/dist/web-terminal.js.map +1 -1
- package/dist/windows-cli-api.d.ts +8 -0
- package/dist/windows-cli-api.js +10 -0
- package/dist/windows-cli-api.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// #3298 S-89: Administration → Group permissions, on the Hub's own listener, for the Hub's configured directory administrator.
|
|
2
|
+
// Experimental and off by default. The page is a presentation of the server's control (S-88): every list is read fresh, the
|
|
3
|
+
// group is looked up by the server (its GUID is the server's, never typed here), the effect of a change is the server's own
|
|
4
|
+
// preview, and Save applies exactly that preview (its digest) — one click on the preview already on screen, no extra dialog
|
|
5
|
+
// (721ca0c3 addendum 2). Nothing here decides who may do what. Shared components: PageHead, card, s-row, field, btn, tag, note,
|
|
6
|
+
// Empty/ErrorState/Skeleton.
|
|
7
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
8
|
+
import { PageHead } from "/assets/page-head.js";
|
|
9
|
+
import { ErrorState, Skeleton } from "/assets/ui-states.js";
|
|
10
|
+
import { navigate } from "/assets/app-nav.js";
|
|
11
|
+
import { hubClient } from "./hub-client.js";
|
|
12
|
+
import { hg } from "./hub-group-strings.js";
|
|
13
|
+
import { hr } from "./hub-read-strings.js";
|
|
14
|
+
|
|
15
|
+
export const CAPS = [["ask_agents", "capAsk"], ["publish_agents", "capPublish"], ["pair_fleet", "capPair"]];
|
|
16
|
+
const PREVIEW_DELAY_MS = 400;
|
|
17
|
+
const READ_BUSY = "busy";
|
|
18
|
+
const RESOLVE_REASON = { "not-found": "notFound", "not-security-group": "notSecurity", invalid: "invalidDn", unsupported: "unsupported", unknown: "unknownGroup" };
|
|
19
|
+
|
|
20
|
+
/** The draft as the server receives it: the saved policy with this page's state and groups, its revision as the compare-and-set. */
|
|
21
|
+
export function draftPolicy(saved, state, groups) {
|
|
22
|
+
return { ...saved, state, groups: groups.map((g) => ({ group: { realm: g.group.realm, objectId: g.group.objectId }, dn: g.dn, allow: CAPS.map(([c]) => c).filter((c) => g.allow.includes(c)), maxFleets: g.maxFleets })) };
|
|
23
|
+
}
|
|
24
|
+
const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
25
|
+
|
|
26
|
+
/** #3298 S-89: the prominent entry to Group permissions at the top of Administration (discovery without docs). */
|
|
27
|
+
export function GroupPermissionsCard() {
|
|
28
|
+
const go = (e) => { e.preventDefault(); navigate("/ui/hub/admin?view=groups"); };
|
|
29
|
+
return html`<section class="card hub-groups-entry" data-entry="group-permissions"><h3>${hg("entryTitle")} <span class="tag warn">${hg("experimental")}</span></h3>
|
|
30
|
+
<p class="note">${hg("entryHint")}</p>
|
|
31
|
+
<div class="hub-groups-actions"><a class="btn btn-primary" href="/ui/hub/admin?view=groups" onClick=${go}>${hg("entryOpen")}</a></div></section>`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function HubGroupPolicyPage() {
|
|
35
|
+
const c = hubClient();
|
|
36
|
+
const [view, setView] = useState(null), [error, setError] = useState(""), [msg, setMsg] = useState(null);
|
|
37
|
+
const [state, setState] = useState("never-enabled"), [groups, setGroups] = useState([]);
|
|
38
|
+
const [dn, setDn] = useState(""), [adding, setAdding] = useState(false), [addError, setAddError] = useState("");
|
|
39
|
+
const [preview, setPreview] = useState(null), [saving, setSaving] = useState(false), [again, setAgain] = useState(0);
|
|
40
|
+
const live = useRef(true), seq = useRef(0), readSeq = useRef(0), retry = useRef(null);
|
|
41
|
+
useEffect(() => { live.current = true; return () => { live.current = false; readSeq.current++; clearTimeout(retry.current); }; }, []);
|
|
42
|
+
const load = async () => {
|
|
43
|
+
if (!live.current) return;
|
|
44
|
+
clearTimeout(retry.current); retry.current = null;
|
|
45
|
+
const mine = ++readSeq.current;
|
|
46
|
+
setError("");
|
|
47
|
+
const r = await c.groupPolicy();
|
|
48
|
+
if (!live.current || mine !== readSeq.current) return;
|
|
49
|
+
if (!r.ok && r.code === "backpressure") {
|
|
50
|
+
setError(READ_BUSY); const seconds = Number(r.retryAfter);
|
|
51
|
+
retry.current = setTimeout(() => { if (live.current && mine === readSeq.current) void load(); },
|
|
52
|
+
(Number.isFinite(seconds) && seconds > 0 ? Math.max(1, Math.min(300, seconds)) : 10) * 1000);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!r.ok) { setError(r.code === "denied" ? hg("contactAdmin") : hg("failed")); return; }
|
|
56
|
+
setView(r);
|
|
57
|
+
if (r.policy) { setState(r.policy.state); setGroups(r.policy.groups.map((g) => ({ ...g, allow: [...g.allow] }))); }
|
|
58
|
+
setPreview(null);
|
|
59
|
+
};
|
|
60
|
+
useEffect(() => { void load(); }, []);
|
|
61
|
+
const policy = view && view.policy;
|
|
62
|
+
const editable = !!policy && view.supported === true && view.binding === "ready";
|
|
63
|
+
const draft = policy ? draftPolicy(policy, state, groups) : null;
|
|
64
|
+
const changed = !!draft && !same(draft, draftPolicy(policy, policy.state, policy.groups));
|
|
65
|
+
// The server's preview of the draft, refreshed as it changes. A stale answer (an older draft) is dropped.
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (!editable || !changed) { setPreview(null); return undefined; }
|
|
68
|
+
const mine = ++seq.current;
|
|
69
|
+
setPreview({ loading: true });
|
|
70
|
+
const timer = setTimeout(async () => {
|
|
71
|
+
const r = await c.previewGroupPolicy(draft);
|
|
72
|
+
if (!live.current || mine !== seq.current) return;
|
|
73
|
+
setPreview(r.ok ? { ok: true, ...r } : { ok: false, code: r.code });
|
|
74
|
+
}, PREVIEW_DELAY_MS);
|
|
75
|
+
return () => clearTimeout(timer);
|
|
76
|
+
}, [editable, JSON.stringify(draft), again]);
|
|
77
|
+
const add = async (e) => {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
const text = dn.trim();
|
|
80
|
+
if (!text || adding) return;
|
|
81
|
+
setAdding(true); setAddError("");
|
|
82
|
+
const r = await c.resolveGroup(text);
|
|
83
|
+
if (!live.current) return;
|
|
84
|
+
setAdding(false);
|
|
85
|
+
if (!r.ok) { setAddError(hg(r.code === "unsupported" ? "unsupported" : "unknownGroup")); return; }
|
|
86
|
+
if (r.ok && r.reason) { setAddError(hg(RESOLVE_REASON[r.reason] || "unknownGroup")); return; }
|
|
87
|
+
const key = { realm: r.realm, objectId: r.objectId };
|
|
88
|
+
if (groups.some((g) => g.group.objectId === key.objectId)) { setAddError(hg("duplicate")); return; }
|
|
89
|
+
// A newly allowed group starts with chat only and one fleet (#3298 decision 2); more is the admin's explicit choice.
|
|
90
|
+
setGroups([...groups, { group: key, dn: r.dn, allow: ["ask_agents"], maxFleets: 1 }]); setDn("");
|
|
91
|
+
};
|
|
92
|
+
const setCap = (i, cap, on) => setGroups(groups.map((g, j) => j !== i ? g : { ...g, allow: on ? [...g.allow, cap] : g.allow.filter((x) => x !== cap),
|
|
93
|
+
// Connecting a fleet needs at least one slot.
|
|
94
|
+
maxFleets: on && cap === "pair_fleet" && g.maxFleets === 0 ? 1 : g.maxFleets }));
|
|
95
|
+
const setFleets = (i, n) => setGroups(groups.map((g, j) => j !== i ? g : { ...g, maxFleets: Math.max(0, Math.min(8, Number(n) || 0)) }));
|
|
96
|
+
const save = async () => {
|
|
97
|
+
if (!preview || !preview.ok || saving) return;
|
|
98
|
+
setSaving(true); setMsg(null);
|
|
99
|
+
const r = await c.saveGroupPolicy(draft, preview.previewDigest);
|
|
100
|
+
if (!live.current) return;
|
|
101
|
+
setSaving(false);
|
|
102
|
+
if (r.ok) { setMsg({ ok: true, text: hg("saved") }); await load(); return; }
|
|
103
|
+
setMsg({ ok: false, text: hg(r.code === "conflict" ? "conflict" : r.code === "stale-preview" ? "previewStale" : r.code === "expired" ? "previewExpired" : "failed") });
|
|
104
|
+
// A preview the server no longer holds is checked again (the person sees the fresh effect before saving).
|
|
105
|
+
if (r.code === "stale-preview" || r.code === "expired") setAgain((n) => n + 1);
|
|
106
|
+
};
|
|
107
|
+
const resume = async (row) => {
|
|
108
|
+
setMsg(null);
|
|
109
|
+
const r = await c.resumeGroupResource(row.resource, policy.revision, row.lifecycleRevision); // the resource carries its own revision
|
|
110
|
+
if (!live.current) return;
|
|
111
|
+
setMsg(r.ok ? { ok: true, text: hg("resumed") } : { ok: false, text: hg(r.code === "conflict" ? "conflict" : "failed") });
|
|
112
|
+
await load();
|
|
113
|
+
};
|
|
114
|
+
const head = html`<${PageHead} title=${hg("title")} scope=${hg("experimental")} lead=${hg("lead")} />`;
|
|
115
|
+
if (error) return html`<div class="col hub-owner hub-groups">${head}<div class="s-section-layout">${error === READ_BUSY
|
|
116
|
+
? html`<p class="note" role="status" data-groups="busy">${hr("busy")}</p>`
|
|
117
|
+
: html`<${ErrorState} message=${error} onRetry=${load} />`}</div></div>`;
|
|
118
|
+
if (!view) return html`<div class="col hub-owner hub-groups">${head}<div class="s-section-layout"><section class="card"><${Skeleton} variant="rows" lines=${4} /></section></div></div>`;
|
|
119
|
+
// The card names the SAVED state; a turn on/off not saved yet is shown as pending, never as already on (Cairn #3372).
|
|
120
|
+
const saved = policy ? policy.state : "never-enabled";
|
|
121
|
+
const stateKey = saved === "enabled" ? "Enabled" : saved === "suspended" ? "Suspended" : "Never";
|
|
122
|
+
const pending = !!policy && state !== saved;
|
|
123
|
+
const paused = Array.isArray(view.paused) ? view.paused : [];
|
|
124
|
+
const pv = preview && preview.ok ? preview.impact || {} : null;
|
|
125
|
+
const list = (rows, label) => rows && rows.length ? html`<div class="hub-groups-impact"><b>${label}</b><ul>${rows.map((r, i) => html`<li key=${i}>${r.name || r.label || r.dn || r.id}${r.login ? html` <small class="note"><code>${r.login}</code></small>` : null}</li>`)}</ul></div>` : null;
|
|
126
|
+
return html`<div class="col hub-owner hub-groups">${head}
|
|
127
|
+
<div class="s-section-layout">
|
|
128
|
+
<p class="note"><a href="/ui/hub/admin" onClick=${(e) => { e.preventDefault(); navigate("/ui/hub/admin"); }}>← ${hg("back")}</a></p>
|
|
129
|
+
${view.supported !== true ? html`<p class="note" role="status" data-reason="unsupported">${hg("unsupported")}</p>` : null}
|
|
130
|
+
${view.binding === "repair-required" ? html`<p class="err" role="alert" data-reason="repair">${hg("repair")}</p>` : null}
|
|
131
|
+
${msg ? html`<p class=${msg.ok ? "note" : "err"} role=${msg.ok ? "status" : "alert"}>${msg.text}</p>` : null}
|
|
132
|
+
${!policy ? null : html`<section class="card hub-groups-state"><h3>${hg(`state${stateKey}`)}</h3><p class="note">${hg(`state${stateKey}Hint`)}</p>
|
|
133
|
+
${pending ? html`<p class="note" role="status" data-pending=${state === "enabled" ? "on" : "off"}><span class="tag warn">${hg("notSaved")}</span> ${hg(state === "enabled" ? "pendingOn" : "pendingOff")}</p>` : null}
|
|
134
|
+
${editable ? html`<div class="hub-groups-actions">${pending
|
|
135
|
+
? html`<button type="button" class="btn btn-sm" onClick=${() => setState(saved)}>${hg("undo")}</button>`
|
|
136
|
+
: state === "enabled"
|
|
137
|
+
? html`<button type="button" class="btn btn-sm" onClick=${() => setState("suspended")}>${hg("turnOff")}</button>`
|
|
138
|
+
: html`<button type="button" class="btn btn-sm" onClick=${() => setState("enabled")}>${hg("turnOn")}</button>`}</div>` : null}
|
|
139
|
+
</section>
|
|
140
|
+
<section class="card hub-groups-list"><h3>${hg("groupsTitle")}</h3>
|
|
141
|
+
${groups.length ? html`<div class="hub-rows">${groups.map((g, i) => html`<div key=${g.group.objectId} class="s-row hub-row hub-group-row" data-group=${g.group.objectId}>
|
|
142
|
+
<span class="hub-row-text"><code class="hub-group-dn">${g.dn}</code></span>
|
|
143
|
+
${CAPS.map(([cap, word]) => html`<label key=${cap} class="hub-group-cap"><input type="checkbox" checked=${g.allow.includes(cap)} disabled=${!editable} onChange=${(e) => setCap(i, cap, e.target.checked)} /> ${hg(word)}</label>`)}
|
|
144
|
+
<label class="field hub-group-fleets" title=${hg("fleetsHint")}><span>${hg("fleets")}</span><input type="number" min="0" max="8" value=${String(g.maxFleets)} disabled=${!editable || !g.allow.includes("pair_fleet")} onInput=${(e) => setFleets(i, e.target.value)} /></label>
|
|
145
|
+
${editable ? html`<button type="button" class="btn btn-sm btn-ghost" onClick=${() => setGroups(groups.filter((_, j) => j !== i))}>${hg("remove")}</button>` : null}
|
|
146
|
+
</div>`)}</div>` : html`<p class="note">${hg("noGroups")}</p>`}
|
|
147
|
+
${editable ? html`<form class="hub-step-form" onSubmit=${add}><label class="field"><span class="sr-only">${hg("addLabel")}</span>
|
|
148
|
+
<input placeholder=${hg("addPlaceholder")} aria-label=${hg("addLabel")} autocomplete="off" spellcheck=${false} autocapitalize="none" value=${dn} onInput=${(e) => { setDn(e.target.value); setAddError(""); }} /></label>
|
|
149
|
+
<button type="submit" class="btn btn-sm" disabled=${!dn.trim() || adding}>${adding ? hg("resolving") : hg("add")}</button></form>` : null}
|
|
150
|
+
${addError ? html`<p class="err" role="alert">${addError}</p>` : null}
|
|
151
|
+
</section>
|
|
152
|
+
${policy && policy.denies && policy.denies.length ? html`<section class="card"><h3>${hg("deniesTitle")}</h3><p class="note">${hg("deniesHint")}</p>
|
|
153
|
+
<div class="hub-rows">${policy.denies.map((d) => html`<div key=${d.person.objectId} class="s-row hub-row"><span class="hub-row-text">${d.name || d.person.objectId}</span>
|
|
154
|
+
${d.deny.map((cap) => html`<span key=${cap} class="tag warn">${hg((CAPS.find(([c]) => c === cap) || [0, cap])[1])}</span>`)}</div>`)}</div></section>` : null}
|
|
155
|
+
${changed ? html`<section class="card hub-groups-preview" aria-live="polite"><h3>${hg("previewTitle")}</h3>
|
|
156
|
+
${!preview || preview.loading ? html`<p class="note" aria-busy="true"><span class="out-spin" aria-hidden="true"></span> ${hg("previewing")}</p>`
|
|
157
|
+
: !preview.ok ? html`<p class="note" role="status">${preview.code === "unavailable" || preview.code === "not-found" ? hg("enableLater") : preview.code === "conflict" ? hg("conflict") : hg("failed")}</p>`
|
|
158
|
+
: html`${pv.adminLosesChat ? html`<p class="err" role="alert">${hg("adminLosesChat")}</p>` : null}
|
|
159
|
+
${list(pv.losingActions, hg("losingActions"))}${pv.held && pv.held.length ? html`<div class="hub-groups-impact hub-groups-held" data-held=${pv.held.length}><b>${hg("held", pv.held.length)}</b><p class="note">${hg("heldHint")}</p>
|
|
160
|
+
<ul>${pv.held.map((r, i) => html`<li key=${i}>${r.name || r.personId}${r.login ? html` <small class="note"><code>${r.login}</code></small>` : null}</li>`)}</ul></div>` : null}${list(pv.losingPublication, hg("losingPublication"))}${list(pv.grandfathered, hg("grandfathered"))}${list(pv.suspendedOnSave || pv.suspended, hg("suspended"))}
|
|
161
|
+
${!(pv.losingActions || []).length && !(pv.losingPublication || []).length && !(pv.suspendedOnSave || pv.suspended || []).length && !pv.adminLosesChat ? html`<p class="note">${hg("noImpact")}</p>` : null}
|
|
162
|
+
<div class="hub-groups-actions"><button type="button" class="btn btn-primary" disabled=${saving} onClick=${save}>${state === "enabled" && policy.state !== "enabled" ? hg("saveOn") : hg("save")}</button></div>`}
|
|
163
|
+
</section>` : null}
|
|
164
|
+
${paused.length ? html`<section class="card hub-groups-paused"><h3>${hg("pausedTitle")}</h3><p class="note">${hg("pausedHint")}</p>
|
|
165
|
+
<div class="hub-rows">${paused.map((row) => html`<div key=${`${row.resource.kind}:${row.resource.id}`} class="s-row hub-row" data-paused=${row.resource.id}>
|
|
166
|
+
<span class="tag">${hg(row.resource.kind === "fleet" ? "kindFleet" : row.resource.kind === "exposure" ? "kindExposure" : "kindAsker")}</span>
|
|
167
|
+
<span class="hub-row-text"><strong>${row.label || row.resource.id}</strong>${row.owner ? html`<small class="note">${row.owner.name || ""}</small>` : null}</span>
|
|
168
|
+
<button type="button" class="btn btn-sm" onClick=${() => resume(row)}>${hg("resume")}</button></div>`)}</div></section>` : null}`}
|
|
169
|
+
</div></div>`;
|
|
170
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// #3298 S-89: the words of the Hub's group permissions editor, the signed-in welcome and their discovery entries, in their own
|
|
2
|
+
// module so a tab holding an older hub-strings.js still draws these pages (retained-module SKEW). Experimental; off unless the
|
|
3
|
+
// Hub's session says `group-policy-v1`.
|
|
4
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
5
|
+
|
|
6
|
+
register("hubGroups", {
|
|
7
|
+
en: {
|
|
8
|
+
// Discovery
|
|
9
|
+
entryTitle: "Group permissions", entryHint: "Let members of chosen directory groups chat with agents, share agents or connect their fleet, without approving each person.",
|
|
10
|
+
entryOpen: "Open group permissions", entryOpenHub: "Open on the Hub", settingsRowHint: "Set on the Hub's Administration page, signed in as its administrator.",
|
|
11
|
+
experimental: "Experimental",
|
|
12
|
+
// Editor
|
|
13
|
+
title: "Group permissions", lead: "Members of these directory groups get these actions. Sign-in stays open to everyone in the directory; chatting with an agent still needs its owner's grant.",
|
|
14
|
+
back: "Administration", unsupported: "This Hub's directory can't be used for group permissions. Group permissions need Active Directory over LDAPS (port 636).",
|
|
15
|
+
repair: "The directory settings changed since group permissions were saved. Group permissions are paused until the Hub is repaired.",
|
|
16
|
+
stateNever: "Off", stateEnabled: "On", stateSuspended: "Switched off — resources paused",
|
|
17
|
+
stateNeverHint: "Nothing changes for anyone until you turn this on.", stateEnabledHint: "Only the actions below are allowed.",
|
|
18
|
+
stateSuspendedHint: "What group permissions allowed is paused. Resume each one below, or turn group permissions on again.",
|
|
19
|
+
groupsTitle: "Groups", noGroups: "No groups yet. Add a directory group by its distinguished name.",
|
|
20
|
+
addLabel: "Group (distinguished name)", addPlaceholder: "CN=Hub-Members,OU=Groups,DC=example,DC=test", add: "Add group",
|
|
21
|
+
resolving: "Looking up the group…", capAsk: "Chat with agents", capPublish: "Share agents", capPair: "Connect a fleet",
|
|
22
|
+
fleets: "Fleets", fleetsHint: "How many fleets each member may connect (0–8).", remove: "Remove",
|
|
23
|
+
notFound: "No such group in the directory.", notSecurity: "That is not a security group.", invalidDn: "That is not a distinguished name.",
|
|
24
|
+
unknownGroup: "The directory didn't answer. Try again.", duplicate: "That group is already listed.",
|
|
25
|
+
deniesTitle: "People excluded", deniesHint: "Exclusions win over any group.",
|
|
26
|
+
previewTitle: "What this change does", previewing: "Checking who is affected…", noImpact: "No one loses anything they can do now.",
|
|
27
|
+
losingActions: "Lose actions they can do now", losingPublication: "After saving, can't share new or revised agents (already shared ones stay)",
|
|
28
|
+
grandfathered: "Shared agents kept as they are", suspended: "Paused by this change",
|
|
29
|
+
held: "Held, unchanged: {0} people", heldHint: "AD did not report group membership for these people. Nothing changes for them now: they gain nothing and nothing of theirs is paused. They are checked again at their next action.", adminLosesChat: "After saving, you won't be able to chat with agents: you are not in a group that allows it.",
|
|
30
|
+
previewStale: "Something changed since this was checked. Check again.", previewExpired: "This check expired. Check again.",
|
|
31
|
+
save: "Save", saveOn: "Turn on and save", turnOff: "Turn off", turnOn: "Turn on", undo: "Undo", notSaved: "Not saved", pendingOn: "Turns on when you save.", pendingOff: "Turns off when you save; what depends on it is paused.", check: "Check what changes",
|
|
32
|
+
saved: "Saved.", conflict: "Someone else changed group permissions. Reload to see their version.", failed: "Couldn't save. Try again.",
|
|
33
|
+
pausedTitle: "Paused", pausedHint: "Allowed by a group before, paused now. Resume one after checking it is still wanted.", resume: "Resume", resumed: "Resumed.",
|
|
34
|
+
kindFleet: "Fleet", kindExposure: "Shared agent", kindAsker: "Chat access",
|
|
35
|
+
enableLater: "Turning group permissions on becomes available once the Hub's enforcement is installed.",
|
|
36
|
+
// Welcome
|
|
37
|
+
welcomeTitle: "Welcome, {0}", welcomeLead: "What would you like to do?",
|
|
38
|
+
chatTitle: "Chat with an agent", chatHint: "Ask the agents their owners have shared with you.", chatGo: "Open chats",
|
|
39
|
+
chatNone: "No agents have been shared with you yet. An agent's owner has to give you access.",
|
|
40
|
+
connectTitle: "Connect your fleet", connectHint: "Pair your own AgEnD with this Hub, then choose which agents to share.", connectGo: "Connect my fleet",
|
|
41
|
+
connectFleets: "Your fleets: {0} of {1}", fleetActive: "Active", fleetPaused: "Paused", fleetRevoked: "Revoked", fleetUnknown: "Can't be checked right now", connectLimit: "You have connected as many fleets as you may. Manage them, or ask your Hub admin for more.",
|
|
42
|
+
connectManual: "Your Hub admin pairs fleets for you. Ask them for a pairing code.", connectNotIncluded: "Connecting a fleet is not included in your access.",
|
|
43
|
+
contactAdmin: "Contact your Hub admin.", noActions: "Your account can sign in, but no actions are allowed yet.",
|
|
44
|
+
unknown: "The directory didn't answer, so this can't be checked right now.", retry: "Retry", ineligible: "Your directory account can't use this right now.",
|
|
45
|
+
deniedPerson: "Your Hub admin has excluded your account from this.", suspended: "Paused by your Hub admin.",
|
|
46
|
+
publishNot: "Sharing agents is not included in your access.",
|
|
47
|
+
},
|
|
48
|
+
"zh-TW": {
|
|
49
|
+
entryTitle: "群組權限", entryHint: "讓指定目錄群組的成員與 Agent 對話、分享 Agent 或連接自己的 Fleet,不必逐一核准每個人。",
|
|
50
|
+
entryOpen: "開啟群組權限", entryOpenHub: "在 Hub 上開啟", settingsRowHint: "在 Hub 的「管理」頁設定,需以 Hub 管理員身分登入。",
|
|
51
|
+
experimental: "實驗性",
|
|
52
|
+
title: "群組權限", lead: "這些目錄群組的成員可以做下列動作。目錄中的每個人仍然都能登入;與 Agent 對話仍需要 Agent 擁有者的授權。",
|
|
53
|
+
back: "管理", unsupported: "這個 Hub 的目錄無法用於群組權限。群組權限需要透過 LDAPS(連接埠 636)的 Active Directory。",
|
|
54
|
+
repair: "目錄設定在群組權限儲存後改變了。在修復 Hub 之前,群組權限暫停。",
|
|
55
|
+
stateNever: "關閉", stateEnabled: "開啟", stateSuspended: "已關閉——資源已暫停",
|
|
56
|
+
stateNeverHint: "開啟前,任何人都不受影響。", stateEnabledHint: "只允許下列動作。",
|
|
57
|
+
stateSuspendedHint: "群組權限先前允許的項目已暫停。可在下方逐一恢復,或再次開啟群組權限。",
|
|
58
|
+
groupsTitle: "群組", noGroups: "還沒有群組。請用辨別名稱(DN)新增目錄群組。",
|
|
59
|
+
addLabel: "群組(辨別名稱)", addPlaceholder: "CN=Hub-Members,OU=Groups,DC=example,DC=test", add: "新增群組",
|
|
60
|
+
resolving: "正在查詢群組…", capAsk: "與 Agent 對話", capPublish: "分享 Agent", capPair: "連接 Fleet",
|
|
61
|
+
fleets: "Fleet 數", fleetsHint: "每位成員可連接的 Fleet 數(0–8)。", remove: "移除",
|
|
62
|
+
notFound: "目錄中沒有這個群組。", notSecurity: "這不是安全性群組。", invalidDn: "這不是辨別名稱。",
|
|
63
|
+
unknownGroup: "目錄沒有回應,請再試一次。", duplicate: "這個群組已經在清單中。",
|
|
64
|
+
deniesTitle: "排除的人", deniesHint: "排除優先於任何群組。",
|
|
65
|
+
previewTitle: "這次變更的影響", previewing: "正在檢查受影響的人…", noImpact: "沒有人會失去目前能做的事。",
|
|
66
|
+
losingActions: "會失去目前能做的動作", losingPublication: "儲存後,無法分享新的或修改過的 Agent(已分享的保留)",
|
|
67
|
+
grandfathered: "保留原狀的已分享 Agent", suspended: "這次變更會暫停",
|
|
68
|
+
held: "暫緩、維持不變:{0} 人", heldHint: "AD 沒有回報這些人的群組成員資格。現在他們不受影響:不會得到新的權限,也不會暫停他們的任何東西。下次他們操作時會再檢查一次。", adminLosesChat: "儲存後,你將無法與 Agent 對話:你不在允許對話的群組中。",
|
|
69
|
+
previewStale: "檢查後有東西變了,請再檢查一次。", previewExpired: "這次檢查已過期,請再檢查一次。",
|
|
70
|
+
save: "儲存", saveOn: "開啟並儲存", turnOff: "關閉", turnOn: "開啟", undo: "復原", notSaved: "尚未儲存", pendingOn: "儲存後才會開啟。", pendingOff: "儲存後才會關閉;依賴它的項目會暫停。", check: "檢查會改變什麼",
|
|
71
|
+
saved: "已儲存。", conflict: "有人改了群組權限。請重新載入查看他們的版本。", failed: "無法儲存,請再試一次。",
|
|
72
|
+
pausedTitle: "已暫停", pausedHint: "先前由群組允許、目前暫停。確認仍然需要後再逐一恢復。", resume: "恢復", resumed: "已恢復。",
|
|
73
|
+
kindFleet: "Fleet", kindExposure: "已分享的 Agent", kindAsker: "對話權限",
|
|
74
|
+
enableLater: "安裝 Hub 的權限執行功能後,才能開啟群組權限。",
|
|
75
|
+
welcomeTitle: "歡迎,{0}", welcomeLead: "你想做什麼?",
|
|
76
|
+
chatTitle: "與 Agent 對話", chatHint: "詢問擁有者分享給你的 Agent。", chatGo: "開啟對話",
|
|
77
|
+
chatNone: "還沒有人分享 Agent 給你。需要 Agent 的擁有者給你存取權。",
|
|
78
|
+
connectTitle: "連接你的 Fleet", connectHint: "將你自己的 AgEnD 與這個 Hub 配對,再選擇要分享的 Agent。", connectGo: "連接我的 Fleet",
|
|
79
|
+
connectFleets: "你的 Fleet:{0} / {1}", fleetActive: "使用中", fleetPaused: "已暫停", fleetRevoked: "已撤銷", fleetUnknown: "目前無法確認", connectLimit: "你已連接允許的最多 Fleet 數。可以管理它們,或請 Hub 管理員增加。",
|
|
80
|
+
connectManual: "你的 Hub 管理員會幫你配對 Fleet。請向他索取配對碼。", connectNotIncluded: "你的存取權不包含連接 Fleet。",
|
|
81
|
+
contactAdmin: "請聯絡你的 Hub 管理員。", noActions: "你的帳號可以登入,但還沒有允許任何動作。",
|
|
82
|
+
unknown: "目錄沒有回應,現在無法確認。", retry: "重試", ineligible: "你的目錄帳號目前無法使用這個功能。",
|
|
83
|
+
deniedPerson: "Hub 管理員已將你的帳號排除在外。", suspended: "已被 Hub 管理員暫停。",
|
|
84
|
+
publishNot: "你的存取權不包含分享 Agent。",
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
export const hg = (key, ...values) => t(`hubGroups.${key}`, ...values);
|
|
88
|
+
/** This module's stylesheet, linked once when it loads (the pages work without it, plainer). */
|
|
89
|
+
export function linkHubGroupsCss(doc = typeof document !== "undefined" ? document : null) {
|
|
90
|
+
try {
|
|
91
|
+
if (!doc || !doc.head || doc.querySelector('link[data-hub-groups-css="1"]')) return;
|
|
92
|
+
const link = doc.createElement("link");
|
|
93
|
+
link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/hub-groups.css"); link.setAttribute("data-hub-groups-css", "1");
|
|
94
|
+
doc.head.appendChild(link);
|
|
95
|
+
} catch { /* the pages still work without it */ }
|
|
96
|
+
}
|
|
97
|
+
linkHubGroupsCss();
|
|
@@ -5,12 +5,14 @@ import { register, t } from "/assets/app-i18n.js";
|
|
|
5
5
|
|
|
6
6
|
register("hubOwner", {
|
|
7
7
|
en: {
|
|
8
|
+
memberAddress: "Hub address", memberAddressHint: "Paste this address into the Hub address field in your fleet's Settings → Hub → Connect to a Hub, together with the code. This is separate from the Hub's browser address.",
|
|
9
|
+
memberAddressMissing: "Ask the administrator for the address to enter in the Hub address field; it may use a different port from this page.", copyHandoff: "Copy address and code", handoffCopied: "Address and code copied", handoffCopyFailed: "Couldn't copy. Select the address and code above to copy them.",
|
|
8
10
|
active: "Active", adminLead: "Pair a fleet with this Hub and see the fleets that are paired. You can't read anyone's chats here.",
|
|
9
11
|
allow: "Allow…", allowDays: "For", allowGo: "Allow", allowLogin: "Their sign-in name",
|
|
10
12
|
allowLoginHint: "The account they sign in to this Hub with.", allowTitle: "Allow someone to ask {0}", approveGo: "Approve…",
|
|
11
13
|
approvedTag: "Approved", backToMine: "My shared agents", codeFor: "Code for {0}", codeUnusedYet: "Not used yet", fleetOf: "{0}'s fleet",
|
|
12
14
|
makeCode: "Make code", mayAsk: "{0} may ask", mayAskNone: "No one may ask yet", mayAskOne: "1 may ask",
|
|
13
|
-
mineLead: "The agents that answer for you on this Hub: who may ask them, until when, and who asked lately. To share or stop sharing one, use your fleet's Settings →
|
|
15
|
+
mineLead: "The agents that answer for you on this Hub: who may ask them, until when, and who asked lately. To share or stop sharing one, use your fleet's Settings → Hub.",
|
|
14
16
|
noFleets: "No fleet is paired yet.", ownerChecked: "The owner confirmed", ownerLogin: "Owner's sign-in name", pairSteps: "Pair a fleet",
|
|
15
17
|
pairedFleets: "Paired fleets · {0}", pauseGo: "Pause…", pauseLead: "No one can ask it until it is shared again. What was asked stays readable.",
|
|
16
18
|
pauseTitle: "Pause questions", pendingLead: "Check that this fingerprint matches the one your fleet shows, then confirm.",
|
|
@@ -24,10 +26,12 @@ register("hubOwner", {
|
|
|
24
26
|
untilLeft: "until {0} ({1})", waitingOwner: "Waiting for the owner", whoMayAsk: "Who may ask",
|
|
25
27
|
},
|
|
26
28
|
"zh-TW": {
|
|
29
|
+
memberAddress: "Hub 位址", memberAddressHint: "在你的 Fleet「設定 → Hub → 連線到 Hub」的「Hub 位址」欄位貼上這個位址,並輸入配對碼。這與 Hub 的瀏覽器位址不同。",
|
|
30
|
+
memberAddressMissing: "請向管理員索取要填入「Hub 位址」欄位的位址;它的連接埠可能與這個頁面不同。", copyHandoff: "複製位址與配對碼", handoffCopied: "已複製位址與配對碼", handoffCopyFailed: "無法複製。請選取上方的位址與配對碼來複製。",
|
|
27
31
|
active: "使用中", adminLead: "把 fleet 配對到這個 Hub,並查看已配對的 fleet。這裡看不到任何人的對話。", allow: "允許提問…", allowDays: "期限", allowGo: "允許", allowLogin: "對方的登入名稱",
|
|
28
32
|
allowLoginHint: "對方登入這個 Hub 用的帳號。", allowTitle: "允許提問 {0}", approveGo: "核准…", approvedTag: "已核准", backToMine: "我分享的 Agent",
|
|
29
33
|
codeFor: "給 {0} 的配對碼", codeUnusedYet: "還沒使用", fleetOf: "{0} 的 fleet", makeCode: "產生配對碼", mayAsk: "{0} 人可以提問", mayAskNone: "還沒有人可以提問",
|
|
30
|
-
mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 fleet 的 設定 →
|
|
34
|
+
mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 fleet 的 設定 → Hub。", noFleets: "還沒有配對的 fleet。",
|
|
31
35
|
ownerChecked: "擁有者已確認", ownerLogin: "擁有者的登入名稱", pairSteps: "配對一個 fleet", pairedFleets: "已配對的 fleet · {0}", pauseGo: "暫停…",
|
|
32
36
|
pauseLead: "重新分享之前,沒有人能再提問。已經問過的內容仍然看得到。", pauseTitle: "暫停提問", pendingLead: "確認這個指紋和你 fleet 上顯示的一致,再按確認。", pendingPairings: "等你核對的配對",
|
|
33
37
|
recent: "最近的提問", recentLead: "誰問的、什麼時候,有沒有回答。問了什麼留在你 fleet 的聊天裡。", recentNone: "還沒有人問過。", refresh: "重新整理", revokeItem: "撤銷…", revokedTag: "已撤銷",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Kept with the new card behavior so a cached earlier hub-strings module cannot expose raw keys.
|
|
2
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
3
|
+
register("hubPairingProgress", {
|
|
4
|
+
en: {
|
|
5
|
+
connectFailed: "Pairing did not finish. Start a new pairing on the Hub and use its new code here.",
|
|
6
|
+
notApplied: "This request was not applied. Check the pairing status above before trying again.",
|
|
7
|
+
unknown: "The result cannot be checked right now. Review the pairing status and the confirmation card before trying again.",
|
|
8
|
+
},
|
|
9
|
+
"zh-TW": {
|
|
10
|
+
connectFailed: "配對未完成。請在 Hub 重新開始配對,再將新的代碼填在這裡。",
|
|
11
|
+
notApplied: "這次要求未套用。請先查看上方的配對狀態,再決定是否重試。",
|
|
12
|
+
unknown: "目前無法確認結果。請先查看配對狀態與確認卡片,再決定是否重試。",
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export const hp = key => t(`hubPairingProgress.${key}`);
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
2
|
+
import { ErrorState, Skeleton } from "/assets/ui-states.js";
|
|
3
|
+
import { compareGroups, hubClient, safeWebOrigin } from "./hub-client.js";
|
|
4
|
+
import { hq } from "./hub-quick-strings.js";
|
|
5
|
+
import { hr } from "./hub-read-strings.js";
|
|
6
|
+
import { linkHubOwnerCss } from "./hub-owner-strings.js";
|
|
7
|
+
|
|
8
|
+
const reason = (r) => hq(r.code === "expired" ? "expired" : r.code === "conflict" ? "conflict" : r.code === "backpressure" ? "limit"
|
|
9
|
+
: r.code === "denied" || r.code === "revoked" ? "denied" : r.code === "unavailable" || r.code === "unreachable" ? "unavailable" : "failed");
|
|
10
|
+
const time = (at) => new Date(at).toLocaleString();
|
|
11
|
+
|
|
12
|
+
/** The page controls its own attempt only. The separate fleet-local proof is never performed by this component. */
|
|
13
|
+
export function QuickPairingGuide({ allowed = false, publishAllowed = false, onConnected = () => {} }) {
|
|
14
|
+
const c = hubClient(), live = useRef(true), generation = useRef(0), reported = useRef(null);
|
|
15
|
+
const [attempt, setAttempt] = useState(null), [loading, setLoading] = useState(true), [busy, setBusy] = useState(false);
|
|
16
|
+
const [label, setLabel] = useState(""), [error, setError] = useState(null), [mismatch, setMismatch] = useState(false), [stopped, setStopped] = useState(false);
|
|
17
|
+
const [copied, setCopied] = useState(null), [full, setFull] = useState(false);
|
|
18
|
+
const load = async (id = null) => {
|
|
19
|
+
const captured = generation.current, r = await c.quickPairing(id);
|
|
20
|
+
if (!live.current || captured !== generation.current) return;
|
|
21
|
+
setLoading(false);
|
|
22
|
+
if (!r.ok) { if (r.code === "expired") { generation.current++; setAttempt(null); } setError(reason(r)); return; }
|
|
23
|
+
setError(null); setAttempt(old => r.attempt ? { ...(old?.id === r.attempt.id ? old : {}), ...r.attempt, memberOrigin: r.memberOrigin } : null);
|
|
24
|
+
};
|
|
25
|
+
useEffect(() => { linkHubOwnerCss(); live.current = true; void load(); return () => { live.current = false; generation.current++; }; }, []);
|
|
26
|
+
useEffect(() => { if (attempt?.connected && reported.current !== attempt.id) { reported.current = attempt.id; onConnected(); } }, [attempt?.connected, attempt?.id]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!attempt?.id || attempt.connected || mismatch || stopped) return;
|
|
29
|
+
let pending = false;
|
|
30
|
+
const timer = setInterval(() => { if (!document.hidden && !pending) { pending = true; void load(attempt.id).finally(() => { pending = false; }); } }, 2000);
|
|
31
|
+
return () => clearInterval(timer);
|
|
32
|
+
}, [attempt?.id, attempt?.connected, mismatch, stopped]);
|
|
33
|
+
const create = async (event) => {
|
|
34
|
+
event.preventDefault(); if (busy || !allowed || !label.trim()) return;
|
|
35
|
+
const captured = ++generation.current; setBusy(true); setError(null); setMismatch(false); setStopped(false);
|
|
36
|
+
const r = await c.createQuickPairing(label.trim());
|
|
37
|
+
if (!live.current || captured !== generation.current) return;
|
|
38
|
+
setBusy(false);
|
|
39
|
+
if (!r.ok) { setError(reason(r)); return; }
|
|
40
|
+
setAttempt({ id: r.pairingId, code: r.code, expiresAt: r.expiresAt, memberOrigin: r.memberOrigin, state: "offered", connected: false });
|
|
41
|
+
};
|
|
42
|
+
const stop = async (different = false) => {
|
|
43
|
+
if (busy || !attempt?.id) return;
|
|
44
|
+
if (different) setMismatch(true);
|
|
45
|
+
const id = attempt.id, captured = ++generation.current; setBusy(true); setError(null);
|
|
46
|
+
const r = await c.stopQuickPairing(id);
|
|
47
|
+
if (!live.current || captured !== generation.current) return;
|
|
48
|
+
setBusy(false);
|
|
49
|
+
if (!r.ok) { setError(reason(r)); return; }
|
|
50
|
+
setStopped(true); setAttempt(null);
|
|
51
|
+
};
|
|
52
|
+
const match = async () => {
|
|
53
|
+
if (busy || mismatch || !attempt?.fingerprint) return;
|
|
54
|
+
const id = attempt.id, fp = attempt.fingerprint, captured = generation.current; setBusy(true); setError(null);
|
|
55
|
+
const r = await c.confirmPairing(id, fp);
|
|
56
|
+
if (!live.current || captured !== generation.current) return;
|
|
57
|
+
setBusy(false); if (!r.ok) { setError(reason(r)); return; }
|
|
58
|
+
await load(id);
|
|
59
|
+
};
|
|
60
|
+
const copy = async (key, value) => { try { await navigator.clipboard.writeText(value); if (live.current) setCopied(key); } catch { /* text remains selectable */ } };
|
|
61
|
+
// The Hub cannot observe the fleet-local button. Only its later claim proves that step completed; accepting
|
|
62
|
+
// the code or confirming on the Hub alone does not. Connected still requires the pinned ready link below.
|
|
63
|
+
if (loading) return html`<${Skeleton} variant="rows" lines=${2} />`;
|
|
64
|
+
if (!allowed && !attempt && !error) return null;
|
|
65
|
+
return html`<div data-quick-pairing="guide">
|
|
66
|
+
${error ? html`<${ErrorState} message=${error} onRetry=${() => load(attempt?.id)} />` : null}
|
|
67
|
+
${mismatch ? html`<p class="err" role="alert">${stopped ? hq("mismatchStop") : hq("compare")}</p>` : null}
|
|
68
|
+
${stopped ? html`<p class="note" role="status">${hq("stopped")}</p>` : null}
|
|
69
|
+
${!attempt ? allowed ? html`<form onSubmit=${create}><label for="quickFleetLabel">${hq("label")}</label>
|
|
70
|
+
<input id="quickFleetLabel" value=${label} maxLength="120" required placeholder=${hq("labelExample")} onInput=${e => setLabel(e.target.value)} />
|
|
71
|
+
<p class="note">${hq("labelHint")} ${hq("privacy")}</p><div class="field-row"><button type="submit" class="btn btn-primary" disabled=${busy || !label.trim()}>${hq(stopped ? "again" : "start")}</button></div></form>` : null
|
|
72
|
+
: attempt.connected ? html`<p class="note" role="status"><b>${hq("connected")}</b></p><h4>${hq("publish")}</h4><p class="note">${hq(publishAllowed ? "publishHint" : "publishNo")}</p>
|
|
73
|
+
${allowed ? html`<div class="field-row"><button type="button" class="btn" onClick=${() => { generation.current++; setAttempt(null); }}>${hq("another")}</button></div>` : null}`
|
|
74
|
+
: html`<ol class="hub-steps"><li class=${attempt.state === "claimed" ? "done" : "now"}><div class="hub-step-body"><h4>${hq("localTitle")}</h4><p class="note">${hq("local")}</p>
|
|
75
|
+
<span class="note">${hq("address")}</span><code class="hub-fp-full">${attempt.memberOrigin}</code>
|
|
76
|
+
${attempt.code ? html`<span class="note">${hq("code")}</span><code class="hub-fp-groups">${attempt.code}</code><button type="button" class="btn btn-sm" onClick=${() => copy("code", attempt.code)}>${hq(copied === "code" ? "copied" : "copy")}</button>` : html`<p class="note">${hq(attempt.state === "claimed" ? "claim" : "waiting")}</p>`}
|
|
77
|
+
<p class="note">${hq("expires", time(attempt.expiresAt))}</p></div></li>
|
|
78
|
+
<li class=${attempt.fingerprint ? "now" : ""}><div class="hub-step-body"><h4>${hq("compareTitle")}</h4><p class="note">${hq("compare")}</p>
|
|
79
|
+
${attempt.fingerprint ? html`<code class="hub-fp-groups">${compareGroups(attempt.fingerprint)}</code>
|
|
80
|
+
<button type="button" class="btn btn-sm btn-link" aria-expanded=${full} onClick=${() => setFull(!full)}>${full ? "SHA-256 −" : "SHA-256 +"}</button>
|
|
81
|
+
${full ? html`<code class="hub-fp-full">${attempt.fingerprint}</code>` : null}
|
|
82
|
+
${attempt.ownerConfirmed ? html`<p class="note" role="status">${hq("claim")}</p>` : html`<div class="field-row"><button type="button" class="btn btn-primary" disabled=${busy || mismatch} onClick=${match}>${hq("match")}</button>
|
|
83
|
+
<button type="button" class="btn" disabled=${busy} onClick=${() => stop(true)}>${hq("mismatch")}</button></div>`}` : null}
|
|
84
|
+
</div></li></ol>`}
|
|
85
|
+
${attempt && !attempt.connected ? html`<div class="field-row"><button type="button" class="btn" disabled=${busy} onClick=${() => stop(false)}>${hq("stop")}</button></div>` : null}
|
|
86
|
+
</div>`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function Notice({ notice, admin = false, memberOrigin = null, after = () => {} }) {
|
|
90
|
+
const [busy, setBusy] = useState(false), [error, setError] = useState(false);
|
|
91
|
+
const live = useRef(true); useEffect(() => () => { live.current = false; }, []);
|
|
92
|
+
const revoke = async () => {
|
|
93
|
+
if (busy || notice.revoked) return;
|
|
94
|
+
setBusy(true); setError(false); const c = hubClient();
|
|
95
|
+
const r = await (admin ? c.revokeFleet(notice.fleetId) : c.revokeOwnFleet(notice.fleetId, notice.generation));
|
|
96
|
+
if (!live.current) return;
|
|
97
|
+
setBusy(false); if (!r.ok) setError(true); else after();
|
|
98
|
+
};
|
|
99
|
+
let href = null;
|
|
100
|
+
if (memberOrigin) { try { const origin = new URL(memberOrigin); if (origin.protocol === "https:") href = `${origin.origin}/ui/hub?securityNotice=${encodeURIComponent(notice.id)}`; } catch { /* no link */ } }
|
|
101
|
+
return html`<div data-pairing-notice=${notice.id}><p><b>${hq("notice", notice.label)}</b></p><p class="note">${hq("approved")} ${time(notice.at)}</p>
|
|
102
|
+
<p class="note">${hq("fleetId")} <code class="hub-fp-full">${notice.fleetId}</code></p>
|
|
103
|
+
<p class="note">${hq("revokeHint")}</p>
|
|
104
|
+
${notice.revoked ? html`<span class="tag">${hq("revoked")}</span>` : href ? html`<a class="btn" target="_blank" rel="noopener noreferrer" href=${href}>${hq("review")}</a>`
|
|
105
|
+
: html`<div class="field-row"><button type="button" class="btn btn-danger" disabled=${busy} onClick=${revoke}>${hq("revoke")}</button></div>`}
|
|
106
|
+
${error ? html`<p class="err" role="alert">${hq("revokeFailed")}</p>` : null}</div>`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Narrowing remains available when current connect permission is denied or unknown. */
|
|
110
|
+
export function OwnedFleetRevoke({ fleet, onRevoked }) {
|
|
111
|
+
const [busy, setBusy] = useState(false), [error, setError] = useState(false);
|
|
112
|
+
const live = useRef(true); useEffect(() => () => { live.current = false; }, []);
|
|
113
|
+
if (!Number.isSafeInteger(fleet.generation) || fleet.status === "revoked") return null;
|
|
114
|
+
const revoke = async () => {
|
|
115
|
+
if (busy) return; setBusy(true); setError(false);
|
|
116
|
+
const r = await hubClient().revokeOwnFleet(fleet.id, fleet.generation);
|
|
117
|
+
if (!live.current) return;
|
|
118
|
+
setBusy(false); if (r.ok) onRevoked(); else setError(true);
|
|
119
|
+
};
|
|
120
|
+
return html`<button type="button" class="btn btn-sm btn-danger" disabled=${busy} onClick=${revoke}>${hq("revoke")}</button>
|
|
121
|
+
${error ? html`<small class="err" role="alert">${hq("revokeFailed")}</small>` : null}`;
|
|
122
|
+
}
|
|
123
|
+
export function PairingNotices({ admin = false, memberNotices = null, memberOrigin = null }) {
|
|
124
|
+
const c = hubClient(), live = useRef(true), epoch = useRef(0), acked = useRef(new Set());
|
|
125
|
+
const [noticeError, setNoticeError] = useState(null);
|
|
126
|
+
const [notices, setNotices] = useState(memberNotices || []);
|
|
127
|
+
const [historyOpen, setHistoryOpen] = useState(false), [historyCount, setHistoryCount] = useState(99);
|
|
128
|
+
const load = async () => {
|
|
129
|
+
const mine = epoch.current;
|
|
130
|
+
let r; try { r = await c.pairingNotices(); } catch { r = { ok: false, code: "unreachable" }; }
|
|
131
|
+
if (live.current && mine === epoch.current) {
|
|
132
|
+
if (r.ok) { setNotices(r.notices || []); setNoticeError(null); }
|
|
133
|
+
else { setNotices([]); setNoticeError(r.code === "backpressure" ? "busy" : "noticesUnavailable"); }
|
|
134
|
+
}
|
|
135
|
+
return r;
|
|
136
|
+
};
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
live.current = true; const mine = ++epoch.current;
|
|
139
|
+
const current = () => live.current && mine === epoch.current;
|
|
140
|
+
if (memberNotices) { setNotices(memberNotices); setNoticeError(null); return () => { live.current = false; epoch.current++; }; }
|
|
141
|
+
let off = () => {}, timer = null, reading = false;
|
|
142
|
+
const later = (fn, r = {}) => {
|
|
143
|
+
const seconds = Number(r.retryAfter); clearTimeout(timer);
|
|
144
|
+
timer = setTimeout(() => { if (current()) void fn(); },
|
|
145
|
+
(Number.isFinite(seconds) && seconds > 0 ? Math.max(1, Math.min(300, seconds)) : 10) * 1000);
|
|
146
|
+
};
|
|
147
|
+
const recover = async () => {
|
|
148
|
+
if (!current() || reading) return;
|
|
149
|
+
off(); reading = true;
|
|
150
|
+
const r = await load(); reading = false;
|
|
151
|
+
if (!current()) return;
|
|
152
|
+
if (r.ok) { setNoticeError("noticesRetry"); later(subscribe); }
|
|
153
|
+
else later(recover, r);
|
|
154
|
+
};
|
|
155
|
+
const subscribe = () => {
|
|
156
|
+
if (!current()) return;
|
|
157
|
+
off(); off = c.subscribePairingNotices(rows => { if (current()) { setNotices(rows); setNoticeError(null); } },
|
|
158
|
+
() => { if (current()) { setNoticeError("noticesRetry"); void recover(); } });
|
|
159
|
+
};
|
|
160
|
+
if (c.pairingNoticeSnapshotV1 === true) subscribe();
|
|
161
|
+
else void load().then(r => { if (current()) { if (r.ok) subscribe(); else later(recover, r); } });
|
|
162
|
+
return () => { live.current = false; epoch.current++; clearTimeout(timer); off(); };
|
|
163
|
+
}, [memberNotices]);
|
|
164
|
+
const requested = new URLSearchParams(location.search).get("securityNotice"), target = notices.find(n => n.id === requested) || notices[0];
|
|
165
|
+
const older = notices.filter(n => n !== target);
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
if (memberNotices || !target) return;
|
|
168
|
+
let cancelled = false;
|
|
169
|
+
// A collapsed history is not shown. Bound rendering and ACK fan-out even at the 1024-record retention cap.
|
|
170
|
+
void (async () => { for (const n of [target, ...(historyOpen ? older.slice(0, historyCount) : [])]) {
|
|
171
|
+
if (cancelled || !live.current) return;
|
|
172
|
+
if (acked.current.has(n.id)) continue;
|
|
173
|
+
acked.current.add(n.id);
|
|
174
|
+
try { if (!(await c.acknowledgePairingNotice(n.id)).ok) acked.current.delete(n.id); }
|
|
175
|
+
catch { acked.current.delete(n.id); }
|
|
176
|
+
} })();
|
|
177
|
+
return () => { cancelled = true; };
|
|
178
|
+
}, [notices, memberNotices, historyOpen, historyCount]);
|
|
179
|
+
if (!target && !noticeError) return null;
|
|
180
|
+
const status = noticeError ? html`<p class="note" role="status" data-notices="retrying">${hr(noticeError)}</p>` : null;
|
|
181
|
+
if (!target) return html`<aside class="card hub-security-notices" aria-label=${hq("notices")}><h3>${hq("notices")}</h3>${status}</aside>`;
|
|
182
|
+
return html`<aside class="card hub-security-notices" aria-label=${hq("notices")}><h3>${hq("notices")}</h3>${status}
|
|
183
|
+
<${Notice} key=${target.id} notice=${target} admin=${admin} memberOrigin=${memberOrigin} after=${load} />
|
|
184
|
+
${older.length ? html`<details onToggle=${e => setHistoryOpen(e.currentTarget.open)}><summary>${hq("previous")} (${older.length})</summary>
|
|
185
|
+
${older.slice(0, historyCount).map(n => html`<${Notice} key=${n.id} notice=${n} admin=${admin} memberOrigin=${memberOrigin} after=${load} />`)}
|
|
186
|
+
${historyCount < older.length ? html`<button type="button" class="btn btn-sm" onClick=${() => setHistoryCount(n => n + 100)}>${hq("more")}</button>` : null}</details>` : null}
|
|
187
|
+
</aside>`;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Same private, visible-only member poll as the switcher; no notice payload enters the fleet-wide SSE/guest stream. */
|
|
191
|
+
export function MemberPairingNotices() {
|
|
192
|
+
const c = hubClient(), [pairing, setPairing] = useState(null), [rows, setRows] = useState([]);
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
if (!c.member || typeof c.pairingNotices !== "function") return;
|
|
195
|
+
let live = true;
|
|
196
|
+
const update = p => { if (live) { setPairing(p); setRows(c.pairingNotices()); } };
|
|
197
|
+
void c.pairing().then(update, () => {});
|
|
198
|
+
const off = c.subscribe(update); return () => { live = false; off(); };
|
|
199
|
+
}, []);
|
|
200
|
+
const origin = safeWebOrigin(pairing);
|
|
201
|
+
return origin && rows.length ? html`<${PairingNotices} memberNotices=${rows} memberOrigin=${origin} />` : null;
|
|
202
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Separate words so a cached earlier hub-strings module cannot expose raw keys.
|
|
2
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
3
|
+
register("hubQuick", {
|
|
4
|
+
en: {
|
|
5
|
+
start: "Connect my fleet", label: "Fleet name", labelHint: "A name you and your Hub admin will recognise.",
|
|
6
|
+
labelExample: "For example, my laptop", privacy: "Connect only a fleet you control. Your other Hub sessions, connected fleets and Hub admin will be notified.",
|
|
7
|
+
localTitle: "Confirm on your fleet", local: "On your fleet's web page, open Settings → Hub. Turn on Allow this fleet to connect to a Hub, then paste this address into the Hub address field and enter the one-time code. Confirm the local prompt there.",
|
|
8
|
+
remoteSteps: "Finish the fingerprint check on the Hub too.", ownerStep: "On the Hub, compare this fingerprint and confirm your pairing.", policyStep: "The Hub checks its group policy, or waits for its administrator's approval.",
|
|
9
|
+
address: "Hub address", code: "One-time code", copy: "Copy", copied: "Copied", expires: "Expires {0}",
|
|
10
|
+
compareTitle: "Compare the fingerprints", compare: "On your fleet, open Settings → Hub → Waiting for approval. Compare its fingerprint with this one. Confirm locally on your fleet too.",
|
|
11
|
+
match: "They match", mismatch: "They differ", mismatchStop: "The fingerprints differ. Pairing is stopped; no connection was approved. Start again only after checking the address.",
|
|
12
|
+
stop: "Stop pairing", stopped: "Pairing stopped", again: "Start again", waiting: "Waiting for your fleet's code and local confirmation…",
|
|
13
|
+
another: "Connect another fleet",
|
|
14
|
+
claim: "Waiting for your fleet's pinned connection…", connected: "Connected", publish: "Share agents on your fleet", publishHint: "On your fleet, open Settings → Hub → Shared agents. Choose only the agents you want to share and confirm there. Nothing is shared automatically.",
|
|
15
|
+
publishNo: "Your fleet is connected. Sharing new agents is not included in your current permissions; contact your Hub admin.",
|
|
16
|
+
expired: "This attempt expired or was replaced. It cannot connect a fleet. Start again.", unavailable: "Permissions or the connection can't be checked right now. Retry; this page can't confirm whether pairing finished.",
|
|
17
|
+
denied: "Connecting a fleet is not available to you. Contact your Hub admin.", conflict: "An administrator's pairing code is already waiting for you. Use that code, or ask the admin for help.",
|
|
18
|
+
limit: "Your fleet or pairing limit is reached. Stop an unused attempt or revoke a fleet you no longer use, then try again.", retry: "Retry", failed: "This action could not finish. Retry.",
|
|
19
|
+
notices: "Fleet security notices", notice: "A new fleet was connected: {0}", approved: "Approved by your Hub's group policy.",
|
|
20
|
+
revoke: "Revoke this fleet", revoked: "Revoked", revokeHint: "Stops this fleet's Hub access. Your other fleets and local agent work stay in place.",
|
|
21
|
+
review: "Review and revoke on the Hub", previous: "Earlier notices", more: "Show older notices", fleetId: "Fleet ID", revokeFailed: "The fleet could not be revoked. Sign in again if your session ended, then retry.",
|
|
22
|
+
},
|
|
23
|
+
"zh-TW": {
|
|
24
|
+
start: "連接我的 Fleet", label: "Fleet 名稱", labelHint: "取一個你和 Hub 管理員都認得的名字。", labelExample: "例如:我的筆電",
|
|
25
|
+
privacy: "只連接你能控制的 Fleet。你的其他 Hub 登入工作階段、已連接的 Fleet 和 Hub 管理員都會收到通知。",
|
|
26
|
+
localTitle: "在你的 Fleet 確認", local: "在你的 Fleet 網頁開啟「設定 → Hub」,開啟「允許這個 Fleet 連線至 Hub」,將以下位址貼到「Hub 位址」欄位,再輸入一次性代碼,並在當地確認提示。",
|
|
27
|
+
remoteSteps: "也要在 Hub 完成指紋比對。", ownerStep: "在 Hub 比對這個指紋,並確認你的配對。", policyStep: "Hub 會檢查群組規則,或等待管理員核准。",
|
|
28
|
+
address: "Hub 位址", code: "一次性代碼", copy: "複製", copied: "已複製", expires: "有效至 {0}",
|
|
29
|
+
compareTitle: "比對指紋", compare: "在你的 Fleet 開啟「設定 → Hub → 等待核准」,將當地指紋與下方逐一比對,也要在你的 Fleet 確認。",
|
|
30
|
+
match: "指紋相符", mismatch: "指紋不同", mismatchStop: "指紋不同,已停止配對,沒有核准連線。請先檢查位址,再重新開始。",
|
|
31
|
+
stop: "停止配對", stopped: "已停止配對", again: "重新開始", waiting: "等待你的 Fleet 使用代碼並在當地確認…", claim: "等待你的 Fleet 建立已固定憑證的連線…",
|
|
32
|
+
another: "連接另一個 Fleet",
|
|
33
|
+
connected: "已連接", publish: "在你的 Fleet 分享 Agent", publishHint: "在你的 Fleet 開啟「設定 → Hub → 已分享的 Agent」,選擇你要分享的 Agent 並在當地確認。不會自動分享任何 Agent。",
|
|
34
|
+
publishNo: "Fleet 已連接,但你目前的權限不包含分享新的 Agent。請聯絡 Hub 管理員。",
|
|
35
|
+
expired: "這次配對已過期或被取代,無法再連接 Fleet。請重新開始。", unavailable: "目前無法確認權限或連線。請重試;此頁無法確認配對是否已完成。",
|
|
36
|
+
denied: "你目前無法連接 Fleet。請聯絡 Hub 管理員。", conflict: "管理員已為你建立配對代碼。請使用該代碼,或請管理員協助。",
|
|
37
|
+
limit: "已達 Fleet 或配對數量上限。請停止未使用的配對,或撤銷不再使用的 Fleet,再重試。", retry: "重試", failed: "這次操作未能完成,請重試。",
|
|
38
|
+
notices: "Fleet 安全通知", notice: "已連接新的 Fleet:{0}", approved: "由 Hub 群組規則核准。", revoke: "撤銷此 Fleet", revoked: "已撤銷",
|
|
39
|
+
revokeHint: "停止這個 Fleet 的 Hub 存取。你的其他 Fleet 和當地 Agent 工作不受影響。", review: "在 Hub 查看並撤銷", previous: "較早的通知", more: "顯示更早的通知", fleetId: "Fleet ID",
|
|
40
|
+
revokeFailed: "無法撤銷此 Fleet。如果登入已結束,請重新登入後再重試。",
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
export const hq = (key, ...args) => t(`hubQuick.${key}`, ...args);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Read recovery copy is loaded with its consumers, including tabs retaining older group strings.
|
|
2
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
3
|
+
register("hubRead", {
|
|
4
|
+
en: { noticesRetry: "Live security notices are reconnecting. Retrying shortly…", noticesUnavailable: "Security notices can't be checked right now. Retrying shortly…", busy: "The Hub is busy. Retrying shortly…", catalogUnavailable: "Shared agents can't be checked right now. Retry." },
|
|
5
|
+
"zh-TW": { noticesRetry: "安全通知連線中斷,稍後會自動重試…", noticesUnavailable: "目前無法讀取安全通知,稍後會自動重試…", busy: "Hub 忙碌中,稍後會自動重試…", catalogUnavailable: "目前無法確認已分享的 Agent,請重試。" },
|
|
6
|
+
});
|
|
7
|
+
export const hr = (key) => t(`hubRead.${key}`);
|