@songsid/agend 2.3.5-alpha.7 → 2.3.5-alpha.9
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-profiles.d.ts +6 -0
- package/dist/accounts-profiles.js +16 -0
- package/dist/accounts-profiles.js.map +1 -1
- 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/agent-cli-instructions.md +1 -1
- package/dist/agent-cli.js +5 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-whats-new.js +5 -0
- package/dist/agent-whats-new.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 +4 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/company-join.d.ts +16 -0
- package/dist/authority/company-join.js +37 -0
- package/dist/authority/company-join.js.map +1 -0
- package/dist/authority/hub-initialization.d.ts +13 -0
- package/dist/authority/hub-initialization.js +30 -0
- package/dist/authority/hub-initialization.js.map +1 -0
- package/dist/backend/claude-code.d.ts +1 -0
- package/dist/backend/claude-code.js +13 -0
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/types.d.ts +4 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-tools.js +2 -2
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/claude-model-minimum.d.ts +7 -0
- package/dist/claude-model-minimum.js +16 -0
- package/dist/claude-model-minimum.js.map +1 -0
- package/dist/config-validator.js +2 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/daemon.d.ts +43 -1
- package/dist/daemon.js +176 -27
- package/dist/daemon.js.map +1 -1
- package/dist/decision-list.d.ts +2 -0
- package/dist/decision-list.js +1 -1
- package/dist/decision-list.js.map +1 -1
- package/dist/fleet-manager.d.ts +75 -3
- package/dist/fleet-manager.js +462 -53
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +14 -3
- package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +4 -1
- package/dist/general-knowledge/steering/core-rules.md +1 -1
- package/dist/hub/catalog.d.ts +1 -1
- package/dist/hub/catalog.js +151 -33
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.js +4 -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 +55 -1
- package/dist/hub/compose/server.js +76 -10
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/directory/directory.d.ts +2 -0
- package/dist/hub/directory/directory.js +49 -4
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/types.d.ts +2 -0
- package/dist/hub/directory/types.js.map +1 -1
- package/dist/hub/enrollment-budget.d.ts +6 -0
- package/dist/hub/enrollment-budget.js +24 -0
- package/dist/hub/enrollment-budget.js.map +1 -0
- 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-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 +9 -1
- package/dist/hub/group-policy/admin-dto.js.map +1 -1
- 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/authorization.d.ts +22 -0
- package/dist/hub/group-policy/authorization.js +147 -2
- package/dist/hub/group-policy/authorization.js.map +1 -1
- 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 +13 -1
- package/dist/hub/group-policy/resources.js +92 -23
- package/dist/hub/group-policy/resources.js.map +1 -1
- package/dist/hub/group-policy/store.d.ts +11 -0
- package/dist/hub/group-policy/store.js +57 -2
- 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 +184 -8
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +2 -0
- package/dist/hub/http/core.js +10 -1
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +10 -0
- package/dist/hub/http/schema.js +4 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/init/browser-certificate.d.ts +6 -1
- package/dist/hub/init/browser-certificate.js +22 -1
- package/dist/hub/init/browser-certificate.js.map +1 -1
- package/dist/hub/init/initializer.d.ts +11 -1
- package/dist/hub/init/initializer.js +202 -83
- package/dist/hub/init/initializer.js.map +1 -1
- package/dist/hub/init/layout.js +1 -1
- package/dist/hub/init/layout.js.map +1 -1
- package/dist/hub/init/text.js +2 -2
- package/dist/hub/init/text.js.map +1 -1
- package/dist/hub/init/types.d.ts +32 -4
- package/dist/hub/init/types.js.map +1 -1
- package/dist/hub/init/web-audit-import.d.ts +12 -0
- package/dist/hub/init/web-audit-import.js +39 -0
- package/dist/hub/init/web-audit-import.js.map +1 -0
- package/dist/hub/init/web-audit.d.ts +30 -0
- package/dist/hub/init/web-audit.js +42 -0
- package/dist/hub/init/web-audit.js.map +1 -0
- package/dist/hub/init/web-error.d.ts +6 -0
- package/dist/hub/init/web-error.js +8 -0
- package/dist/hub/init/web-error.js.map +1 -0
- package/dist/hub/init/web-http.d.ts +9 -0
- package/dist/hub/init/web-http.js +103 -0
- package/dist/hub/init/web-http.js.map +1 -0
- package/dist/hub/init/web.d.ts +118 -0
- package/dist/hub/init/web.js +428 -0
- package/dist/hub/init/web.js.map +1 -0
- package/dist/hub/init/wizard.js +1 -3
- package/dist/hub/init/wizard.js.map +1 -1
- package/dist/hub/join/client.d.ts +35 -0
- package/dist/hub/join/client.js +112 -0
- package/dist/hub/join/client.js.map +1 -0
- package/dist/hub/join/descriptor.d.ts +45 -0
- package/dist/hub/join/descriptor.js +52 -0
- package/dist/hub/join/descriptor.js.map +1 -0
- package/dist/hub/join/fleet-authority.d.ts +2 -0
- package/dist/hub/join/fleet-authority.js +3 -0
- package/dist/hub/join/fleet-authority.js.map +1 -0
- package/dist/hub/join/http.d.ts +8 -0
- package/dist/hub/join/http.js +112 -0
- package/dist/hub/join/http.js.map +1 -0
- package/dist/hub/join/invitation.d.ts +28 -0
- package/dist/hub/join/invitation.js +28 -0
- package/dist/hub/join/invitation.js.map +1 -0
- package/dist/hub/join/local-journal.d.ts +84 -0
- package/dist/hub/join/local-journal.js +65 -0
- package/dist/hub/join/local-journal.js.map +1 -0
- package/dist/hub/join/local.d.ts +116 -0
- package/dist/hub/join/local.js +419 -0
- package/dist/hub/join/local.js.map +1 -0
- package/dist/hub/join/private.d.ts +3 -0
- package/dist/hub/join/private.js +46 -0
- package/dist/hub/join/private.js.map +1 -0
- package/dist/hub/join/protocol.d.ts +69 -0
- package/dist/hub/join/protocol.js +96 -0
- package/dist/hub/join/protocol.js.map +1 -0
- package/dist/hub/join/receipt.d.ts +42 -0
- package/dist/hub/join/receipt.js +75 -0
- package/dist/hub/join/receipt.js.map +1 -0
- package/dist/hub/join/service.d.ts +177 -0
- package/dist/hub/join/service.js +564 -0
- package/dist/hub/join/service.js.map +1 -0
- package/dist/hub/join/store.d.ts +97 -0
- package/dist/hub/join/store.js +87 -0
- package/dist/hub/join/store.js.map +1 -0
- package/dist/hub/join/trust.d.ts +13 -0
- package/dist/hub/join/trust.js +68 -0
- package/dist/hub/join/trust.js.map +1 -0
- package/dist/hub/member/pairing-api.d.ts +2 -0
- package/dist/hub/member/pairing-api.js +7 -1
- 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 +60 -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 +246 -0
- package/dist/hub/pairing-notices.js.map +1 -0
- package/dist/hub/pairing.d.ts +39 -1
- package/dist/hub/pairing.js +316 -16
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/protocol.d.ts +61 -0
- package/dist/hub/protocol.js +8 -1
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/room-read-pacer.d.ts +14 -0
- package/dist/hub/room-read-pacer.js +51 -0
- package/dist/hub/room-read-pacer.js.map +1 -0
- package/dist/hub/rooms.d.ts +7 -1
- package/dist/hub/rooms.js +25 -13
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +8 -1
- package/dist/hub/runtime.js +13 -0
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.d.ts +3 -0
- package/dist/hub/server.js +18 -0
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-directory-transition.d.ts +48 -0
- package/dist/hub/session-directory-transition.js +118 -0
- package/dist/hub/session-directory-transition.js.map +1 -0
- package/dist/hub/session-epoch.d.ts +16 -0
- package/dist/hub/session-epoch.js +50 -0
- package/dist/hub/session-epoch.js.map +1 -0
- package/dist/hub/sessions.d.ts +13 -0
- package/dist/hub/sessions.js +36 -16
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/settings-api.d.ts +50 -0
- package/dist/hub/settings-api.js +92 -0
- package/dist/hub/settings-api.js.map +1 -0
- package/dist/hub/settings-commit.d.ts +95 -0
- package/dist/hub/settings-commit.js +490 -0
- package/dist/hub/settings-commit.js.map +1 -0
- package/dist/hub/settings-directory-decision.d.ts +433 -0
- package/dist/hub/settings-directory-decision.js +236 -0
- package/dist/hub/settings-directory-decision.js.map +1 -0
- package/dist/hub/settings-directory-proof.d.ts +77 -0
- package/dist/hub/settings-directory-proof.js +303 -0
- package/dist/hub/settings-directory-proof.js.map +1 -0
- package/dist/hub/store.d.ts +12 -2
- package/dist/hub/store.js +9 -5
- package/dist/hub/store.js.map +1 -1
- package/dist/hub/types.d.ts +15 -2
- package/dist/hub-host-settings.d.ts +48 -0
- package/dist/hub-host-settings.js +85 -0
- package/dist/hub-host-settings.js.map +1 -0
- package/dist/instance-lifecycle.d.ts +3 -0
- package/dist/instance-lifecycle.js +4 -0
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +54 -30
- 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/outbound-schemas.d.ts +2 -0
- package/dist/outbound-schemas.js +4 -2
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-port.d.ts +1 -1
- package/dist/profile-signins.d.ts +107 -0
- package/dist/profile-signins.js +249 -0
- package/dist/profile-signins.js.map +1 -0
- 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/scheduler/db.d.ts +10 -0
- package/dist/scheduler/db.js +38 -11
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/types.d.ts +6 -1
- package/dist/settings-api.d.ts +9 -1
- package/dist/settings-api.js +200 -4
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-confirmation.d.ts +1 -1
- package/dist/settings-confirmation.js +1 -1
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.js +58 -0
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +3 -0
- package/dist/settings-http-confirmation.js +8 -5
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-request-capability.d.ts +5 -0
- package/dist/settings-request-capability.js +6 -1
- package/dist/settings-request-capability.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-transport.d.ts +20 -2
- package/dist/structured-signin-transport.js +57 -6
- package/dist/structured-signin-transport.js.map +1 -1
- package/dist/team-membership.d.ts +7 -0
- package/dist/team-membership.js +10 -0
- package/dist/team-membership.js.map +1 -0
- package/dist/tmux-manager.d.ts +1 -1
- package/dist/tmux-manager.js +4 -1
- package/dist/tmux-manager.js.map +1 -1
- package/dist/topic-commands.js +1 -1
- package/dist/topic-commands.js.map +1 -1
- package/dist/ui/accounts-keepalive.js +10 -5
- package/dist/ui/accounts-manage.js +29 -11
- package/dist/ui/accounts-view.js +75 -28
- package/dist/ui/backend-signin.js +61 -16
- package/dist/ui/hub-attachments.js +3 -3
- package/dist/ui/hub-chat-strings.js +2 -0
- package/dist/ui/hub-client.js +50 -4
- package/dist/ui/hub-company-join-strings.js +74 -0
- package/dist/ui/hub-company-join.js +119 -0
- package/dist/ui/hub-group-policy.js +175 -0
- package/dist/ui/hub-group-strings.js +97 -0
- package/dist/ui/hub-owner-strings.js +12 -12
- package/dist/ui/hub-pairing-progress-strings.js +15 -0
- package/dist/ui/hub-quick-pairing.js +209 -0
- package/dist/ui/hub-quick-strings.js +43 -0
- package/dist/ui/hub-read-strings.js +7 -0
- package/dist/ui/hub-this-hub.js +112 -0
- package/dist/ui/hub-welcome.js +102 -0
- package/dist/ui/panel-hub.js +217 -28
- package/dist/ui/panel-needs.js +1 -1
- package/dist/ui/panel-settings.js +7 -4
- package/dist/ui/settings-apply.js +12 -5
- package/dist/ui/settings-devices.js +2 -2
- package/dist/ui/settings-dialogs.js +3 -1
- package/dist/ui/settings-hub-company-join.js +90 -0
- package/dist/ui/settings-hub-membership.js +20 -5
- package/dist/ui/settings-hub-preview.js +74 -0
- package/dist/ui/settings-hub-run.js +60 -0
- package/dist/ui/settings-hub-section.js +30 -3
- package/dist/ui/settings-hub.js +52 -11
- package/dist/ui/settings-registry.js +2 -0
- package/dist/ui/settings-restart-strings.js +17 -0
- package/dist/ui/settings-strings.js +6 -4
- package/dist/ui/shared/accounts-keepalive.css +11 -6
- package/dist/ui/shared/accounts.css +68 -18
- package/dist/ui/shared/app-i18n.js +4 -1
- package/dist/ui/shared/app-shell.js +39 -25
- package/dist/ui/shared/app.css +9 -8
- package/dist/ui/shared/chat-strings.js +13 -13
- package/dist/ui/shared/hub-chat.css +12 -0
- package/dist/ui/shared/hub-groups.css +28 -0
- package/dist/ui/shared/hub-owner.css +19 -1
- package/dist/ui/shared/hub.css +8 -1
- 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/web-authorize.js +4 -4
- package/dist/ui/structured-signin.js +24 -6
- package/dist/update-dispatch.d.ts +32 -4
- package/dist/update-dispatch.js +146 -16
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-launch.d.ts +1 -1
- package/dist/update-launch.js +2 -2
- package/dist/update-launch.js.map +1 -1
- package/dist/update-marker.d.ts +2 -0
- package/dist/update-marker.js.map +1 -1
- package/dist/view-api.d.ts +2 -8
- package/dist/view-api.js +3 -9
- package/dist/view-api.js.map +1 -1
- package/dist/web-api.d.ts +7 -1
- package/dist/web-api.js +91 -14
- 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-terminal.d.ts +7 -0
- package/dist/web-terminal.js +14 -2
- package/dist/web-terminal.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** Fleet-only company handoff; all fields live in the actual Settings section and use its shared confirmation card. */
|
|
2
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
3
|
+
import { Skeleton, ErrorState } from "/assets/ui-states.js";
|
|
4
|
+
import { api, confirmedWrite } from "./settings-confirm.js";
|
|
5
|
+
import { hj, joinError, joinResponseCode } from "./hub-company-join-strings.js";
|
|
6
|
+
const root = "/api/hub/member/company-join";
|
|
7
|
+
export function CompanyJoinSettings({ onSaved, memberEnabled = false } = {}) {
|
|
8
|
+
const notified = useRef(null);
|
|
9
|
+
const waiting = (() => { try { return new URLSearchParams(location.search).get("joinWait"); } catch { return null; } })();
|
|
10
|
+
const [view, setView] = useState(undefined), [error, setError] = useState(null), [busy, setBusy] = useState(false), [pending, setPending] = useState(false), [identityChanged, setIdentityChanged] = useState(false);
|
|
11
|
+
const [bound, setBound] = useState(false);
|
|
12
|
+
const [form, setForm] = useState(() => {
|
|
13
|
+
let address = ""; try { const candidate = new URLSearchParams(location.hash.slice(1)).get("join"); if (candidate && candidate.length <= 8192) address = candidate; } catch {}
|
|
14
|
+
return { address, label: hj("defaultFleet") };
|
|
15
|
+
}), live = useRef(true), token = useRef(0);
|
|
16
|
+
const read = async () => {
|
|
17
|
+
const gen = token.current;
|
|
18
|
+
try { const result = await api(root + (view?.operationId ? `?operationId=${encodeURIComponent(view.operationId)}` : ""));
|
|
19
|
+
if (!live.current || gen !== token.current) return;
|
|
20
|
+
if (!result.ok) { setError(joinError(result.body?.error)); return; }
|
|
21
|
+
setView(result.body.operation ?? null); setBound(result.body.bound === true); setError(null);
|
|
22
|
+
} catch { if (live.current && gen === token.current) setError(hj("unknown")); }
|
|
23
|
+
};
|
|
24
|
+
useEffect(() => { live.current = true; read(); return () => { live.current = false; token.current++; }; }, []);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!waiting && (!view?.operationId || !["joining", "awaiting-sign-in", "durable"].includes(view.state) && !(view.state === "saved" && view.link !== "online"))) return;
|
|
27
|
+
if (waiting && view?.handoffId === waiting && view.state === "awaiting-sign-in") {
|
|
28
|
+
location.replace(root + "/bridge?operationId=" + encodeURIComponent(view.operationId)); return;
|
|
29
|
+
}
|
|
30
|
+
const timer = setTimeout(read, 1500); return () => clearTimeout(timer);
|
|
31
|
+
}, [view, waiting]);
|
|
32
|
+
useEffect(() => { if (view?.state === "saved" && view.link === "online" && notified.current !== view.operationId) { notified.current = view.operationId; onSaved?.(); } }, [view, onSaved]);
|
|
33
|
+
const start = async e => {
|
|
34
|
+
e.preventDefault(); if (busy) return;
|
|
35
|
+
const gen = ++token.current; setBusy(true); setError(null); setPending(false); setIdentityChanged(false);
|
|
36
|
+
const handoffId = crypto.randomUUID();
|
|
37
|
+
// Open the Fleet-owned waiting page during the user gesture, with no opener or cross-origin messaging.
|
|
38
|
+
globalThis.open("/settings/hub?joinWait=" + encodeURIComponent(handoffId), "_blank", "noopener");
|
|
39
|
+
try {
|
|
40
|
+
const result = await confirmedWrite(root + "/start", { body: { ...form, handoffId }, label: hj("title"), onPending: () => { if (live.current && gen === token.current) setPending(true); } });
|
|
41
|
+
if (!live.current || gen !== token.current) return;
|
|
42
|
+
if (!result.ok || !result.body?.operation) { await read(); const code = joinResponseCode(result); setError(joinError(code)); setIdentityChanged(code === "identity-changed"); return; }
|
|
43
|
+
const operation = result.body.operation; setView(operation); setError(null);
|
|
44
|
+
|
|
45
|
+
} catch { if (live.current && gen === token.current) setError(hj("unknown")); }
|
|
46
|
+
finally { if (live.current && gen === token.current) { setBusy(false); setPending(false); } }
|
|
47
|
+
};
|
|
48
|
+
const repair = async () => {
|
|
49
|
+
if (busy) return; const gen = ++token.current; setBusy(true); setError(null);
|
|
50
|
+
try {
|
|
51
|
+
const result = await confirmedWrite(root + "/repair-trust", { body: { address: form.address }, label: hj("repair"), onPending: () => { if (live.current && gen === token.current) setPending(true); } });
|
|
52
|
+
if (!live.current || gen !== token.current) return;
|
|
53
|
+
if (result.ok) { setIdentityChanged(false); setError(null); } else setError(joinError(joinResponseCode(result)));
|
|
54
|
+
} catch { if (live.current && gen === token.current) setError(hj("unknown")); }
|
|
55
|
+
finally { if (live.current && gen === token.current) { setBusy(false); setPending(false); } }
|
|
56
|
+
};
|
|
57
|
+
const action = async step => {
|
|
58
|
+
if (busy || !view?.operationId) return;
|
|
59
|
+
const gen = ++token.current; setBusy(true); setError(null);
|
|
60
|
+
try {
|
|
61
|
+
const options = { body: { operationId: view.operationId }, label: hj("title") };
|
|
62
|
+
const result = step === "resume" ? await confirmedWrite(root + "/resume", options) : await api(root + "/cancel", { method: "POST", body: JSON.stringify(options.body) });
|
|
63
|
+
if (!live.current || gen !== token.current) return;
|
|
64
|
+
if (result.ok) setView(result.body.operation); else setError(joinError(joinResponseCode(result)));
|
|
65
|
+
} catch { if (live.current && gen === token.current) setError(hj("unknown")); }
|
|
66
|
+
finally { if (live.current && gen === token.current) setBusy(false); }
|
|
67
|
+
};
|
|
68
|
+
const canStart = !waiting && (view === null || view && ["ended", "cancelled"].includes(view.state) && !view.issued && view.outcomeKnown);
|
|
69
|
+
// The existing connection card owns ready status, sharing and disconnect. Do not duplicate it after handoff.
|
|
70
|
+
if (!waiting && bound && view === null || view?.state === "saved" && (memberEnabled || view.link === "online") && onSaved) return null;
|
|
71
|
+
return html`<section class="card s-company-join"><h3>${hj("title")}</h3><p class="note">${hj("lead")}</p>
|
|
72
|
+
${(view === undefined || waiting && view?.handoffId !== waiting) && !error ? html`<${Skeleton} variant="form" lines=${4} label=${hj("loading")} />` : null}
|
|
73
|
+
${error ? html`<${ErrorState} message=${error} onRetry=${read} />` : null}
|
|
74
|
+
${pending ? html`<p role="status" class="note">${hj("pending")}</p>` : null}
|
|
75
|
+
${waiting && view !== undefined && view?.handoffId !== waiting ? html`<p role="status" class="note">${hj("pending")}</p><a class="btn btn-sm" href="/settings/hub">${hj("return")}</a>` : null}
|
|
76
|
+
${canStart ? html`<form class="form" onSubmit=${start}>
|
|
77
|
+
<label class="field" for="hubCompanyAddress"><span>${hj("address")}</span><input id="hubCompanyAddress" type="text" value=${form.address} autocomplete="off" spellcheck=${false} onInput=${e => setForm(f => ({ ...f, address: e.target.value }))} /><small class="note">${hj("addressHint")}</small></label>
|
|
78
|
+
<label class="field" for="hubCompanyFleetName"><span>${hj("fleetName")}</span><input id="hubCompanyFleetName" value=${form.label} maxlength="120" onInput=${e => setForm(f => ({ ...f, label: e.target.value }))} /></label>
|
|
79
|
+
<p class="note">${hj("firstUse")}</p><div class="field-row"><button class="btn btn-primary" type="submit" disabled=${busy || !form.address.trim() || !form.label.trim()}>${hj("start")}</button></div>
|
|
80
|
+
${identityChanged ? html`<p class="note">${hj("repairLead")}</p><button class="btn btn-sm" type="button" disabled=${busy || !form.address.trim()} onClick=${repair}>${hj("repair")}</button>` : null}
|
|
81
|
+
</form>` : null}
|
|
82
|
+
${view && (!waiting || view.handoffId === waiting) ? html`<div role="status"><strong>${hj(view.state === "saved" ? view.link === "online" ? "saved" : "joining" : view.state === "awaiting-sign-in" ? "awaiting" : view.state === "cancelled" ? "cancelled" : view.state === "held" || view.state === "ended" ? "held" : "joining")}</strong>
|
|
83
|
+
${view.state === "saved" ? html`<p class="note">${hj(view.link === "online" ? "fleetDone" : "offline")}</p>` : view.reason && view.reason !== "cancelled" ? html`<p class="note">${joinError(view.reason)}</p>` : null}
|
|
84
|
+
${view.issued && view.state !== "saved" ? html`<p class="note">${hj("issued")}</p>` : null}
|
|
85
|
+
<div class="field-row">${view.state === "awaiting-sign-in" ? html`<a class="btn btn-sm" href=${root + "/bridge?operationId=" + encodeURIComponent(view.operationId)} target="_blank" rel="noopener">${hj("start")}</a>` : null}${view.state === "held" && !["authority", "expired"].includes(view.reason) ? html`<button type="button" class="btn btn-sm" disabled=${busy} onClick=${() => action("resume")}>${hj("resume")}</button>` : null}
|
|
86
|
+
${!["saved", "cancelled", "ended"].includes(view.state) ? html`<button type="button" class="btn btn-sm" disabled=${busy} onClick=${() => action("cancel")}>${hj("stop")}</button>` : null}
|
|
87
|
+
${view.hubOrigin ? html`<a class="btn btn-sm" href=${view.hubOrigin + "/ui/hub"} target="_blank" rel="noopener noreferrer">${hj("inspect")}</a>` : null}</div>
|
|
88
|
+
</div>` : null}
|
|
89
|
+
</section>`;
|
|
90
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CompanyJoinSettings } from "./settings-hub-company-join.js";
|
|
1
2
|
// Pure lazy owner Settings while off. Hub clients/pairing UI load only after a saved on state and a member page mark.
|
|
2
3
|
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
3
4
|
import { Skeleton, ErrorState } from "/assets/ui-states.js";
|
|
@@ -11,7 +12,7 @@ register("hubMembership", {
|
|
|
11
12
|
loading: "Reading membership settings…", pending: "Waiting for owner confirmation…",
|
|
12
13
|
failed: "The membership change could not be verified. Check again before trying another change.",
|
|
13
14
|
unavailable: "Membership settings are unavailable. Open this fleet's own owner Settings and check again.",
|
|
14
|
-
retry: "Check again",
|
|
15
|
+
retry: "Check again",
|
|
15
16
|
},
|
|
16
17
|
"zh-TW": {
|
|
17
18
|
title: "Hub 成員功能", enabled: "允許這個 Fleet 連線至 Hub",
|
|
@@ -20,12 +21,27 @@ register("hubMembership", {
|
|
|
20
21
|
loading: "正在讀取成員設定…", pending: "等待擁有者確認…",
|
|
21
22
|
failed: "無法確認成員設定是否已變更。請再次檢查,再嘗試其他變更。",
|
|
22
23
|
unavailable: "目前無法使用成員設定。請開啟這個 Fleet 自己的擁有者設定頁面,再次檢查。",
|
|
23
|
-
retry: "再次檢查",
|
|
24
|
+
retry: "再次檢查",
|
|
24
25
|
},
|
|
25
26
|
});
|
|
26
27
|
const copy = key => t(`hubMembership.${key}`);
|
|
27
28
|
const path = "/api/settings/hub/membership";
|
|
28
29
|
const markedMember = () => String(globalThis.document?.body?.dataset?.hub || "").split(/\s+/).includes("member");
|
|
30
|
+
/**
|
|
31
|
+
* The leader's cid-hub-no-reload (#3319: the user stuck on "Reload page"): the page's Hub mark follows the saved switch, in
|
|
32
|
+
* place — what the server would mark a fresh page with (web-api hubBodyAttrs: `hub_member.enabled`, never over a public
|
|
33
|
+
* link, which this card never renders on). So once turning membership on is applied — confirmed here, in General, or by the
|
|
34
|
+
* host's Apply now: confirmedWrite follows it to the end either way, then this card reads it again — the Connect card loads
|
|
35
|
+
* with its address and code fields, and no reload is asked for. Nothing has loaded the Hub client before (no Hub module loads
|
|
36
|
+
* on an unmarked page), so it starts as the member client. Presentation only: a mark confers no authority.
|
|
37
|
+
*/
|
|
38
|
+
const markMember = on => {
|
|
39
|
+
const body = globalThis.document?.body;
|
|
40
|
+
if (!body || markedMember() === on) return;
|
|
41
|
+
const tokens = String(body.dataset.hub || "").split(/\s+/).filter(t => t && t !== "member");
|
|
42
|
+
if (on) tokens.push("member");
|
|
43
|
+
if (tokens.length) body.dataset.hub = tokens.join(" "); else delete body.dataset.hub;
|
|
44
|
+
};
|
|
29
45
|
export function HubMembershipSettings() {
|
|
30
46
|
const publicPage = globalThis.document?.body?.dataset?.publicLink === "1";
|
|
31
47
|
const [view, setView] = useState(null), [busy, setBusy] = useState(false), [messageKey, setMessageKey] = useState("loading");
|
|
@@ -37,7 +53,7 @@ export function HubMembershipSettings() {
|
|
|
37
53
|
if (!view) setMessageKey("loading");
|
|
38
54
|
let result; try { result = await api(path); } catch { result = null; }
|
|
39
55
|
if (!owner.current.mounted || owner.current.seq !== seq) return;
|
|
40
|
-
if (result?.ok && typeof result.body?.enabled === "boolean") { setView({ enabled: result.body.enabled }); setMessageKey(""); }
|
|
56
|
+
if (result?.ok && typeof result.body?.enabled === "boolean") { markMember(result.body.enabled); setView({ enabled: result.body.enabled }); setMessageKey(""); }
|
|
41
57
|
else { setView(null); setMessageKey("unavailable"); }
|
|
42
58
|
};
|
|
43
59
|
useEffect(() => {
|
|
@@ -66,13 +82,12 @@ export function HubMembershipSettings() {
|
|
|
66
82
|
finally { owner.current.busy = false; if (owner.current.mounted) setBusy(false); }
|
|
67
83
|
};
|
|
68
84
|
if (publicPage) return null;
|
|
69
|
-
return html`<div class="form hub-membership-settings"
|
|
85
|
+
return html`<div class="form hub-membership-settings"><${CompanyJoinSettings} onSaved=${read} memberEnabled=${view?.enabled === true} /><section class="card" id="hub-membership">
|
|
70
86
|
<h3>${copy("title")}</h3><p class="note">${copy("hint")}</p>
|
|
71
87
|
${!view && messageKey === "loading" ? html`<${Skeleton} variant="rows" lines=${2} label=${copy("loading")} />` : html`<label class="check"><input id="hubMemberEnabled" class="s-ui-toggle" type="checkbox" role="switch" checked=${view?.enabled === true}
|
|
72
88
|
disabled=${!view || busy} onChange=${e => change(e.target.checked)} /><span>${copy("enabled")}</span></label>`}
|
|
73
89
|
<p class="note">${copy("off")}</p>
|
|
74
90
|
${messageKey && messageKey !== "loading" ? html`<p role="status">${copy(messageKey)}</p>` : null}
|
|
75
91
|
${!view && !busy && messageKey !== "loading" ? html`<button class="btn btn-sm" type="button" onClick=${read}>${copy("retry")}</button>` : null}
|
|
76
|
-
${view && view.enabled !== markedMember() ? html`<p class="note">${copy("reloadHint")} <button class="btn btn-sm" type="button" disabled=${busy} onClick=${() => location.reload()}>${copy("reload")}</button></p>` : null}
|
|
77
92
|
</section>${view?.enabled && markedMember() ? Connect ? html`<${Connect} />` : connectError ? html`<${ErrorState} message=${copy("unavailable")} onRetry=${() => setAttempt(n => n + 1)} />` : html`<${Skeleton} variant="form" lines=${4} />` : null}</div>`;
|
|
78
93
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// M-2682 part B: fleet Settings → Hub → "HTML previews on this Hub" (host owner, on a fleet that runs a Hub). The switch and
|
|
2
|
+
// port behind hub.web.preview_port, saved and confirmed like the retention card; the server checks the port against the
|
|
3
|
+
// Hub's own listeners, this fleet's ports and a free bind before it saves. The Hub reloads to apply it (the runtime's
|
|
4
|
+
// reload key includes this setting). Own lazy module with its own words, so an older tab's strings still work.
|
|
5
|
+
import { html, useEffect, useState } from "/assets/app-html.js";
|
|
6
|
+
import { Skeleton } from "/assets/ui-states.js";
|
|
7
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
8
|
+
import { api, confirmedWrite } from "./settings-confirm.js";
|
|
9
|
+
register("hubPreview", {
|
|
10
|
+
en: {
|
|
11
|
+
title: "HTML previews on this Hub",
|
|
12
|
+
hint: "When this is on, an HTML page an agent sends in a Hub chat can open as a preview. The Hub serves previews on their own port, which people's browsers must be able to reach.",
|
|
13
|
+
on: "Allow HTML previews", port: "Preview port", portHint: "1–65535, not one of the Hub's or this fleet's own ports.",
|
|
14
|
+
save: "Save previews", saved: "Saved. The Hub reloads to apply it.",
|
|
15
|
+
invalid_port: "Use a whole number from 1 to 65535.",
|
|
16
|
+
port_conflict: "That port is already one of the Hub's or this fleet's own. Pick another.",
|
|
17
|
+
port_in_use: "Something on this computer is already using that port. Pick another.",
|
|
18
|
+
busy: "Another change to the Hub's settings is still finishing. Try again in a moment.",
|
|
19
|
+
failed: "Previews could not be saved. Reload and try again.",
|
|
20
|
+
unavailable: "Previews can be set here once this fleet runs its Hub.",
|
|
21
|
+
},
|
|
22
|
+
"zh-TW": {
|
|
23
|
+
title: "這個 Hub 的 HTML 預覽",
|
|
24
|
+
hint: "開啟後,Agent 在 Hub 對話中傳送的 HTML 頁面可以開成預覽。Hub 用另一個連接埠提供預覽,使用者的瀏覽器必須連得到這個連接埠。",
|
|
25
|
+
on: "允許 HTML 預覽", port: "預覽連接埠", portHint: "1 到 65535,不能是 Hub 或這個 Fleet 自己使用的連接埠。",
|
|
26
|
+
save: "儲存預覽設定", saved: "已儲存。Hub 會重新載入以套用。",
|
|
27
|
+
invalid_port: "請輸入 1 到 65535 的整數。",
|
|
28
|
+
port_conflict: "這個連接埠已經是 Hub 或這個 Fleet 自己在用的,請換一個。",
|
|
29
|
+
port_in_use: "這台電腦上已經有程式在使用這個連接埠,請換一個。",
|
|
30
|
+
busy: "Hub 設定的另一項變更還在完成中,請稍後再試。",
|
|
31
|
+
failed: "無法儲存預覽設定。請重新整理後再試。",
|
|
32
|
+
unavailable: "這個 Fleet 執行自己的 Hub 之後,才能在這裡設定預覽。",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
const copy = (key) => t(`hubPreview.${key}`);
|
|
36
|
+
const REFUSALS = new Set(["invalid_port", "port_conflict", "port_in_use", "busy"]);
|
|
37
|
+
// #3451: a confirmed save answers through the pending change; the route's own refusal is its failed outcome's detail.
|
|
38
|
+
const refusalOf = (r) => /^apply_rejected: ([a-z_]+)$/.exec(r.confirmed?.outcome?.detail ?? "")?.[1] ?? r.body?.error;
|
|
39
|
+
const validPort = (v) => /^\d{1,5}$/.test(v) && Number(v) >= 1 && Number(v) <= 65535;
|
|
40
|
+
|
|
41
|
+
export function HubPreviewSettings() {
|
|
42
|
+
const [view, setView] = useState(null), [on, setOn] = useState(false), [port, setPort] = useState("");
|
|
43
|
+
const [busy, setBusy] = useState(false), [messageKey, setMessageKey] = useState("");
|
|
44
|
+
const show = (v) => { setView(v); setOn(v.enabled); setPort(v.port !== null ? String(v.port) : v.suggested !== null ? String(v.suggested) : ""); };
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
let live = true;
|
|
47
|
+
api("/api/settings/hub/preview").then((r) => {
|
|
48
|
+
if (!live) return;
|
|
49
|
+
if (r.ok && r.body?.hosted) show(r.body); else setMessageKey("unavailable");
|
|
50
|
+
}, () => { if (live) setMessageKey("unavailable"); });
|
|
51
|
+
return () => { live = false; };
|
|
52
|
+
}, []);
|
|
53
|
+
const changed = view && (on !== view.enabled || (on && String(view.port ?? "") !== port));
|
|
54
|
+
const save = async (e) => {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
if (!view || busy || !changed || (on && !validPort(port))) return;
|
|
57
|
+
setBusy(true); setMessageKey("");
|
|
58
|
+
try {
|
|
59
|
+
const r = await confirmedWrite("/api/settings/hub/preview", { method: "PUT", label: copy("title"), body: on ? { enabled: true, port: Number(port) } : { enabled: false } });
|
|
60
|
+
if (r.ok && r.body?.ok) { show(r.body); setMessageKey("saved"); }
|
|
61
|
+
else { const why = refusalOf(r); setMessageKey(REFUSALS.has(why) ? why : "failed"); }
|
|
62
|
+
} catch { setMessageKey("failed"); } finally { setBusy(false); }
|
|
63
|
+
};
|
|
64
|
+
return html`<section class="card hub-preview-settings"><h3>${copy("title")}</h3>
|
|
65
|
+
<p class="note">${copy("hint")}</p>
|
|
66
|
+
${!view && !messageKey ? html`<${Skeleton} variant="form" lines=${3} />` : null}
|
|
67
|
+
${view ? html`<form class="form" onSubmit=${save}>
|
|
68
|
+
<label class="check"><input type="checkbox" class="s-ui-toggle" id="hubPreviewOn" checked=${on} disabled=${busy} onChange=${(e) => { setOn(e.target.checked); setMessageKey(""); }} /> ${copy("on")}</label>
|
|
69
|
+
${on ? html`<label class="field">${copy("port")}<input id="hubPreviewPort" type="number" min="1" max="65535" step="1" inputmode="numeric" value=${port} disabled=${busy}
|
|
70
|
+
onInput=${(e) => { setPort(e.target.value); setMessageKey(""); }} /><small class="note">${copy("portHint")}</small></label>` : null}
|
|
71
|
+
<button class="btn" type="submit" disabled=${busy || !changed || (on && !validPort(port))}>${copy("save")}</button></form>` : null}
|
|
72
|
+
${messageKey ? html`<p role="status" class=${REFUSALS.has(messageKey) || messageKey === "failed" ? "err" : "note"}>${copy(messageKey)}</p>` : null}
|
|
73
|
+
</section>`;
|
|
74
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// M-2682 (leader, cid-hubname-ui): fleet Settings → Hub → "Run this Hub" (host owner, on a fleet with an initialized Hub).
|
|
2
|
+
// The switch behind hub.enabled, saved and confirmed like the retention card. Stopping the Hub signs everyone out of it and
|
|
3
|
+
// stops every shared agent's chats there, so turning it off asks once first (the shared confirmation, as for a restart);
|
|
4
|
+
// turning it on doesn't. Own lazy module with its own words, so an older tab's strings still work.
|
|
5
|
+
import { html, useEffect, useState } from "/assets/app-html.js";
|
|
6
|
+
import { Skeleton } from "/assets/ui-states.js";
|
|
7
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
8
|
+
import { confirmDialog } from "/assets/ui-confirm.js";
|
|
9
|
+
import { api, confirmedWrite } from "./settings-confirm.js";
|
|
10
|
+
register("hubRun", {
|
|
11
|
+
en: {
|
|
12
|
+
title: "Run this Hub", on: "This Hub is running",
|
|
13
|
+
hint: "When this is off, the Hub stops: nobody can sign in to it, and chats with shared agents wait until it runs again. Its settings, people and records are kept.",
|
|
14
|
+
stopTitle: "Stop this Hub?", stopAsk: "Everyone signed in to the Hub is signed out, and chats with shared agents stop until you turn it on again. Nothing is deleted.",
|
|
15
|
+
stopGo: "Stop the Hub", saved_on: "The Hub is starting.", saved_off: "The Hub is stopped.",
|
|
16
|
+
busy: "Another change to the Hub's settings is still finishing. Try again in a moment.",
|
|
17
|
+
failed: "The change could not be saved. Reload and try again.",
|
|
18
|
+
unavailable: "This switch applies once this fleet's Hub is set up.",
|
|
19
|
+
},
|
|
20
|
+
"zh-TW": {
|
|
21
|
+
title: "執行這個 Hub", on: "這個 Hub 正在執行",
|
|
22
|
+
hint: "關閉後 Hub 會停止:沒有人能登入,與分享的 Agent 的對話會暫停,直到再次開啟。設定、人員和紀錄都會保留。",
|
|
23
|
+
stopTitle: "要停止這個 Hub 嗎?", stopAsk: "所有登入 Hub 的人都會被登出,與分享的 Agent 的對話會暫停,直到你再次開啟。不會刪除任何資料。",
|
|
24
|
+
stopGo: "停止 Hub", saved_on: "Hub 正在啟動。", saved_off: "Hub 已停止。",
|
|
25
|
+
busy: "Hub 設定的另一項變更還在完成中,請稍後再試。",
|
|
26
|
+
failed: "無法儲存這項變更。請重新整理後再試。",
|
|
27
|
+
unavailable: "這個 Fleet 的 Hub 設定完成後,才能使用這個開關。",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const copy = (key) => t(`hubRun.${key}`);
|
|
31
|
+
|
|
32
|
+
export function HubRunSettings() {
|
|
33
|
+
const [view, setView] = useState(null), [busy, setBusy] = useState(false), [messageKey, setMessageKey] = useState("");
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
let live = true;
|
|
36
|
+
api("/api/settings/hub/run").then((r) => {
|
|
37
|
+
if (!live) return;
|
|
38
|
+
if (r.ok && r.body?.initialized) setView(r.body); else setMessageKey("unavailable");
|
|
39
|
+
}, () => { if (live) setMessageKey("unavailable"); });
|
|
40
|
+
return () => { live = false; };
|
|
41
|
+
}, []);
|
|
42
|
+
const toggle = async (e) => {
|
|
43
|
+
const on = e.target.checked;
|
|
44
|
+
e.target.checked = !on; // the saved state stays shown until the save answers
|
|
45
|
+
if (!view || busy) return;
|
|
46
|
+
if (!on && !(await confirmDialog({ title: copy("stopTitle"), message: copy("stopAsk"), confirmLabel: copy("stopGo"), danger: true }))) return;
|
|
47
|
+
setBusy(true); setMessageKey("");
|
|
48
|
+
try {
|
|
49
|
+
const r = await confirmedWrite("/api/settings/hub/run", { method: "PUT", label: copy("title"), body: { enabled: on } });
|
|
50
|
+
if (r.ok && r.body?.ok) { setView(r.body); setMessageKey(r.body.enabled ? "saved_on" : "saved_off"); }
|
|
51
|
+
else setMessageKey((/^apply_rejected: ([a-z_]+)$/.exec(r.confirmed?.outcome?.detail ?? "")?.[1] ?? r.body?.error) === "busy" ? "busy" : "failed"); // #3451
|
|
52
|
+
} catch { setMessageKey("failed"); } finally { setBusy(false); }
|
|
53
|
+
};
|
|
54
|
+
return html`<section class="card hub-run-settings"><h3>${copy("title")}</h3>
|
|
55
|
+
<p class="note">${copy("hint")}</p>
|
|
56
|
+
${!view && !messageKey ? html`<${Skeleton} variant="form" lines=${2} />` : null}
|
|
57
|
+
${view ? html`<label class="check"><input type="checkbox" class="s-ui-toggle" id="hubRunOn" checked=${view.enabled} disabled=${busy} onChange=${toggle} /> ${copy("on")}</label>` : null}
|
|
58
|
+
${messageKey ? html`<p role="status" class=${messageKey === "busy" || messageKey === "failed" ? "err" : "note"}>${copy(messageKey)}</p>` : null}
|
|
59
|
+
</section>`;
|
|
60
|
+
}
|
|
@@ -10,10 +10,14 @@ register("settingsHubSection", {
|
|
|
10
10
|
en: {
|
|
11
11
|
publicLink: "Hub settings are only on this fleet's own dashboard, not over the public link.",
|
|
12
12
|
relatedTitle: "Hub", relatedHint: "Connect this fleet to a team Hub and choose which agents to share.",
|
|
13
|
+
groupsTitle: "Group permissions", groupsHint: "Let members of chosen directory groups chat with agents, share agents or connect their fleet. Set on the Hub, signed in as its administrator.",
|
|
14
|
+
groupsOpen: "Open on the Hub", experimental: "Experimental",
|
|
13
15
|
},
|
|
14
16
|
"zh-TW": {
|
|
15
17
|
publicLink: "Hub 設定只在這個 Fleet 自己的儀表板上提供,公開連結上沒有。",
|
|
16
18
|
relatedTitle: "Hub", relatedHint: "將這個 Fleet 連線至團隊 Hub,並選擇要分享的 Agent。",
|
|
19
|
+
groupsTitle: "群組權限", groupsHint: "讓指定目錄群組的成員與 Agent 對話、分享 Agent 或連接自己的 Fleet。在 Hub 上以管理員身分登入後設定。",
|
|
20
|
+
groupsOpen: "在 Hub 上開啟", experimental: "實驗性",
|
|
17
21
|
},
|
|
18
22
|
});
|
|
19
23
|
export const hubSectionText = (key) => t(`settingsHubSection.${key}`);
|
|
@@ -25,11 +29,34 @@ function Lazy({ load, pick }) {
|
|
|
25
29
|
return Card ? html`<${Card} />` : null;
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
/**
|
|
33
|
+
* #3298 S-89: where the Hub's group permissions are set, found from this fleet's Settings. Only a link: the Hub's own sign-in and
|
|
34
|
+
* its own capability marks decide what opens there (this page never reads a Hub session across origins). The address is this
|
|
35
|
+
* fleet's own configured Hub web origin, accepted only as a bare HTTPS origin.
|
|
36
|
+
*/
|
|
37
|
+
export function hubGroupsHref(webOrigin) {
|
|
38
|
+
try { const u = new URL(String(webOrigin || "")); return u.protocol === "https:" && u.origin === String(webOrigin).replace(/\/$/, "") ? `${u.origin}/ui/hub/admin?view=groups` : null; } catch { return null; }
|
|
39
|
+
}
|
|
40
|
+
/** The page mark the fleet's server sets when its own Hub has group permissions composed (#3372 N2). */
|
|
41
|
+
export function hubGroupsMarked(doc = typeof document !== "undefined" ? document : null) {
|
|
42
|
+
try { return !!doc && !!doc.body && doc.body.dataset.hubGroups === "1"; } catch { return false; }
|
|
43
|
+
}
|
|
44
|
+
function GroupPermissionsRow({ href }) {
|
|
45
|
+
return html`<section class="card s-group" id="hub-group-permissions"><h3>${hubSectionText("groupsTitle")} <span class="tag warn">${hubSectionText("experimental")}</span></h3>
|
|
46
|
+
<p class="note">${hubSectionText("groupsHint")}</p>
|
|
47
|
+
<div class="s-row"><a class="btn btn-sm" href=${href} target="_blank" rel="noopener noreferrer">${hubSectionText("groupsOpen")}</a></div></section>`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function HubSection({ overPublicLink, hubHost, hubOrigin }) {
|
|
51
|
+
// Only when this fleet's own Hub offers group permissions (the server's page mark), the same gate as the Hub's editor.
|
|
52
|
+
const groupsHref = hubHost && hubGroupsMarked() ? hubGroupsHref(hubOrigin) : null;
|
|
29
53
|
if (overPublicLink) return html`<section class="card s-group" id="hub-public-link"><p class="note">${hubSectionText("publicLink")}</p></section>`;
|
|
30
54
|
return html`<div class="s-hub-section">
|
|
31
55
|
<${Lazy} load=${() => import("./settings-hub-membership.js")} pick=${(m) => m.HubMembershipSettings} />
|
|
32
|
-
${hubHost ? html`<${Lazy} load=${() => import("./settings-hub-
|
|
33
|
-
<${Lazy} load=${() => import("./settings-hub-
|
|
56
|
+
${hubHost ? html`<${Lazy} load=${() => import("./settings-hub-run.js")} pick=${(m) => m.HubRunSettings} />
|
|
57
|
+
<${Lazy} load=${() => import("./settings-hub-retention.js")} pick=${(m) => m.HubRetentionSettings} />
|
|
58
|
+
<${Lazy} load=${() => import("./settings-hub-browser-certificate.js")} pick=${(m) => m.HubBrowserCertificateSettings} />
|
|
59
|
+
<${Lazy} load=${() => import("./settings-hub-preview.js")} pick=${(m) => m.HubPreviewSettings} />` : null}
|
|
60
|
+
${groupsHref ? html`<${GroupPermissionsRow} href=${groupsHref} />` : null}
|
|
34
61
|
</div>`;
|
|
35
62
|
}
|
package/dist/ui/settings-hub.js
CHANGED
|
@@ -12,6 +12,9 @@ import { compareGroups, hubClient, safeWebOrigin, ADDRESS_HINT, CODE_HINT } from
|
|
|
12
12
|
import { hw, linkHubCss } from "./hub-strings.js";
|
|
13
13
|
import { guidanceFor } from "./hub-provider-guidance.js";
|
|
14
14
|
import { AGENT_CHOICE } from "./hub-agent-copy.js";
|
|
15
|
+
import { PairingNotices } from "./hub-quick-pairing.js";
|
|
16
|
+
import { hq } from "./hub-quick-strings.js";
|
|
17
|
+
import { hp } from "./hub-pairing-progress-strings.js";
|
|
15
18
|
|
|
16
19
|
const CONNECT_ERRORS = { address: "errAddress", code: "errCode", busy: "errBusy", unreachable: "errUnreachable", refused: "errRefused" };
|
|
17
20
|
const HOLDS = new Set(["unknown_outcome", "expired", "unsaved", "refused", "revoked", "disconnected"]);
|
|
@@ -20,6 +23,15 @@ const PUBLISH_ERRORS = { conflict: "errConflict", unsaved: "errUnsaved", not_pai
|
|
|
20
23
|
// The switcher may have cached hub-strings before this action existed. Its original Allow word is still available.
|
|
21
24
|
const allowOnHubLabel = () => { const label = hw("allowOnHub"); return label === "hub.allowOnHub" ? `${hw("allow")}…` : label; };
|
|
22
25
|
|
|
26
|
+
// A queued local confirmation describes one operation, not every later pairing or link state.
|
|
27
|
+
function waitingForPairing(msg, p) {
|
|
28
|
+
const pending = msg?.pending;
|
|
29
|
+
if (!pending) return true;
|
|
30
|
+
if (pending.action === "connect") return p?.state === "unpaired";
|
|
31
|
+
if (pending.action === "confirm") return p?.state === "pending" && p.localConfirmed === false && p.fingerprint?.digest === pending.fingerprint;
|
|
32
|
+
return pending.action === "disconnect" && p?.state === "paired" && p.binding === pending.binding && p.hub?.hubId === pending.hubId;
|
|
33
|
+
}
|
|
34
|
+
|
|
23
35
|
/** A fingerprint: its first 128 bits in groups people compare, the whole digest on request. */
|
|
24
36
|
function Fingerprint({ label, fp }) {
|
|
25
37
|
const [full, setFull] = useState(false);
|
|
@@ -40,6 +52,33 @@ export function HubConnectCard() {
|
|
|
40
52
|
const [busy, setBusy] = useState(false);
|
|
41
53
|
const [msg, setMsg] = useState(null);
|
|
42
54
|
const live = useRef(true);
|
|
55
|
+
const generation = useRef(0), activePending = useRef(null);
|
|
56
|
+
const pendingMessage = (action, shown, result, token) => {
|
|
57
|
+
const pending = { action, fingerprint: shown?.fingerprint?.digest, binding: shown?.binding, hubId: shown?.hub?.hubId };
|
|
58
|
+
activePending.current = pending;
|
|
59
|
+
setMsg({ error: false, text: hw("waitingConfirm"), pending });
|
|
60
|
+
if (!result.settled?.then) return; // An older client still clears its hint when the projection advances.
|
|
61
|
+
const current = () => live.current && generation.current === token && activePending.current === pending;
|
|
62
|
+
const finish = async outcome => {
|
|
63
|
+
if (!current()) return;
|
|
64
|
+
let next;
|
|
65
|
+
try { next = await client.pairing(); } catch { /* unknown result, never a retry/success claim */ }
|
|
66
|
+
if (!current()) return;
|
|
67
|
+
if (next) setPairing(next);
|
|
68
|
+
activePending.current = null;
|
|
69
|
+
const text = !next || !["applied", "failed", "expired", "rejected", "stale"].includes(outcome?.state) ? hp("unknown")
|
|
70
|
+
: outcome.state === "applied" || !waitingForPairing({ pending }, next) ? null
|
|
71
|
+
: action === "connect" && next.state === "unpaired" && ["failed", "expired"].includes(outcome.state) ? hp("connectFailed") : hp("notApplied");
|
|
72
|
+
setMsg(old => old?.pending === pending ? text ? { error: true, text } : null : old);
|
|
73
|
+
};
|
|
74
|
+
void Promise.resolve(result.settled).then(finish, () => finish(null));
|
|
75
|
+
};
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (msg?.pending && !waitingForPairing(msg, pairing)) {
|
|
78
|
+
if (activePending.current === msg.pending) activePending.current = null;
|
|
79
|
+
setMsg(null);
|
|
80
|
+
}
|
|
81
|
+
}, [msg, pairing]);
|
|
43
82
|
const readPairing = () => {
|
|
44
83
|
setReadError(false);
|
|
45
84
|
return client.pairing().then((p) => { if (live.current) setPairing(p); }, () => { if (live.current) setReadError(true); });
|
|
@@ -49,28 +88,29 @@ export function HubConnectCard() {
|
|
|
49
88
|
live.current = true;
|
|
50
89
|
readPairing();
|
|
51
90
|
const off = client.subscribe((p) => { if (live.current) setPairing(p); });
|
|
52
|
-
return () => { live.current = false; off(); };
|
|
91
|
+
return () => { live.current = false; generation.current++; activePending.current = null; off(); };
|
|
53
92
|
}, []);
|
|
54
93
|
const act = async (fn) => {
|
|
55
94
|
if (busy) return;
|
|
95
|
+
const token = ++generation.current; activePending.current = null;
|
|
56
96
|
setBusy(true); setMsg(null);
|
|
57
|
-
try { await fn(); } catch { if (live.current) setMsg({ error: true, text: hw("errFailed") }); }
|
|
97
|
+
try { await fn(token); } catch { if (live.current && token === generation.current) setMsg({ error: true, text: hw("errFailed") }); }
|
|
58
98
|
finally { if (live.current) setBusy(false); }
|
|
59
99
|
};
|
|
60
|
-
const connect = () => act(async
|
|
100
|
+
const connect = () => act(async token => {
|
|
61
101
|
const r = await client.connect({ address: form.address.trim(), code: form.code.trim() });
|
|
62
102
|
if (!live.current) return;
|
|
63
|
-
if (r.ok) { setPairing(r.pairing); setForm({ address: "", code: "" }); if (r.pendingConfirmation)
|
|
103
|
+
if (r.ok) { setPairing(r.pairing); setForm({ address: "", code: "" }); if (r.pendingConfirmation) pendingMessage("connect", null, r, token); }
|
|
64
104
|
else setMsg({ error: true, text: hw(CONNECT_ERRORS[r.error] || "errFailed") });
|
|
65
105
|
});
|
|
66
|
-
const disconnect = (name) => act(async
|
|
106
|
+
const disconnect = (name) => act(async token => {
|
|
67
107
|
const shown = pairing; // #3115 r2: the pairing on screen now, before the dialog
|
|
68
108
|
if (!(await confirmDialog({ message: hw("disconnectAsk", name), confirmLabel: hw("disconnect"), danger: true }))) return;
|
|
69
109
|
const r = await client.disconnect(shown);
|
|
70
110
|
if (!live.current) return;
|
|
71
111
|
if (!r.ok) { setMsg({ error: true, text: hw("errUnsaved") }); return; }
|
|
72
112
|
setPairing(await client.pairing());
|
|
73
|
-
if (r.pendingConfirmation) {
|
|
113
|
+
if (r.pendingConfirmation) { pendingMessage("disconnect", shown, r, token); return; }
|
|
74
114
|
if (r.remote === "pending") setMsg({ error: false, text: hw("disconnectPending") });
|
|
75
115
|
});
|
|
76
116
|
const cancel = () => act(async () => { const p = await client.cancel(); if (live.current) setPairing(p); });
|
|
@@ -95,14 +135,14 @@ export function HubConnectCard() {
|
|
|
95
135
|
<${Fingerprint} label=${hw("pairingFp")} fp=${p.fingerprint} />
|
|
96
136
|
<p class="note">${hw("pendingCompare")}</p>
|
|
97
137
|
${p.localConfirmed === false && client.confirmFingerprint ? html`<div class="field-row"><button type="button" class="btn btn-primary hub-local-confirm" disabled=${busy}
|
|
98
|
-
onClick=${() => act(async
|
|
99
|
-
if (r.ok) { setPairing(r.pairing); if (r.pendingConfirmation)
|
|
138
|
+
onClick=${() => act(async token => { const r = await client.confirmFingerprint(p.fingerprint.digest); if (!live.current) return;
|
|
139
|
+
if (r.ok) { setPairing(r.pairing); if (r.pendingConfirmation) pendingMessage("confirm", p, r, token); }
|
|
100
140
|
else setMsg({ error: true, text: hw(r.error === "expired" ? "hold_expired" : r.error === "conflict" ? "errConflict" : "errUnsaved") }); })}>${hw("localMatch")}</button></div>`
|
|
101
141
|
: p.localConfirmed === true ? html`<p class="note hub-local-confirmed">${hw("localConfirmed")}</p>` : null}
|
|
102
142
|
${p.ownerConfirmed === null && p.adminApproved === null
|
|
103
143
|
// S3c: the member cannot see the Hub's progress — the two steps as instructions, no marks.
|
|
104
|
-
? html`<p class="hub-steps-lead">${
|
|
105
|
-
<ul class="hub-steps hub-steps-unknown"><li><span>${
|
|
144
|
+
? html`<p class="hub-steps-lead">${hq("remoteSteps")}</p>
|
|
145
|
+
<ul class="hub-steps hub-steps-unknown"><li><span>${hq("ownerStep")}</span></li><li><span>${hq("policyStep")}</span></li></ul>
|
|
106
146
|
<p class="note">${hw("hubProgressHidden")}</p>`
|
|
107
147
|
: html`<p class="hub-steps-lead">${hw("pendingSteps")}</p>
|
|
108
148
|
<ul class="hub-steps">${step(p.ownerConfirmed, "ownerStep")}${step(p.adminApproved, "adminStep")}</ul>`}
|
|
@@ -148,7 +188,8 @@ export function HubConnectCard() {
|
|
|
148
188
|
<p class="note">${hw("lead")}</p>
|
|
149
189
|
${client.stub ? html`<p class="note hub-preview" role="note">${hw("preview")}</p>` : null}
|
|
150
190
|
${body}
|
|
151
|
-
${
|
|
191
|
+
${p?.state === "paired" && client.pairingNotices?.().length ? html`<${PairingNotices} memberNotices=${client.pairingNotices()} memberOrigin=${safeWebOrigin(p)} />` : null}
|
|
192
|
+
${msg && waitingForPairing(msg, p) ? html`<p class=${msg.error ? "err" : "note"} role=${msg.error ? "alert" : "status"}>${msg.text}</p>` : null}
|
|
152
193
|
${p && p.state === "paired" ? html`<${HubExposures} key=${`${p.binding}|${p.hub.hubId}|${p.hub.fingerprint?.digest}|${safeWebOrigin(p)}`} client=${client} pairing=${p} />` : null}
|
|
153
194
|
</section>`;
|
|
154
195
|
}
|
|
@@ -17,6 +17,8 @@ const ROWS = [
|
|
|
17
17
|
["general.location", "agent-defaults", "#general-location", null, null, ["general", "windows", "paired PC", "host", "location"], ["General", "Windows", "電腦", "主機", "執行位置"], L("Run General on", "General 執行位置")],
|
|
18
18
|
// alpha.6 feedback (#2): "hub" found nothing — Settings → Hub's cards. Connect to a Hub is drawn once membership is on.
|
|
19
19
|
["hub.membership", "hub", "#hubMemberEnabled", null, "hub_member.enabled", ["hub", "team hub", "membership", "connect", "join", "pair", "share agents"], ["Hub", "團隊 Hub", "成員", "連線", "加入", "配對", "分享"], L("Allow this fleet to connect to a Hub", "允許這個 Fleet 連線至 Hub")],
|
|
20
|
+
["hub.company-address", "hub", "#hubCompanyAddress", null, null, ["hub", "company account", "company link", "sign in", "connect", "join"], ["Hub", "公司帳號", "公司連結", "登入", "連接", "加入"], L("Hub address or company link", "Hub 位址或公司連結")],
|
|
21
|
+
["hub.company-name", "hub", "#hubCompanyFleetName", null, null, ["fleet", "name", "hub", "company"], ["Fleet", "名稱", "Hub", "公司"], L("Fleet name", "Fleet 名稱")],
|
|
20
22
|
["hub.connect", "hub", "#hub-connect", null, null, ["hub", "connect to a hub", "pairing code", "hub address", "fingerprint", "pair", "unpair", "disconnect", "join"], ["Hub", "連線至 Hub", "配對碼", "Hub 位址", "指紋", "配對", "解除配對", "中斷連線", "加入"], L("Connect to a Hub", "連線至 Hub")],
|
|
21
23
|
["quota.notices", "notifications", "#quota-notices", null, "defaults.quota_notice", ["usage", "quota", "notifications", "remaining", "weekly"], ["用量", "額度", "提醒", "通知", "剩餘"], L("Quota notices", "用量提醒")],
|
|
22
24
|
// You · Preferences
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// S-92 (#3326 D1): the settings.* words for restarting AgEnD from Settings on a fleet with no chat connection, kept in a file
|
|
2
|
+
// of their own for the same reason as settings-shared-strings.js: a tab opened before an upgrade already holds the old
|
|
3
|
+
// settings-strings.js, and this file's URL is new, so no tab can hold an old copy of it. register() merges these over what
|
|
4
|
+
// settings-strings.js said. Every module that reads one of these keys imports this file after "./settings-strings.js".
|
|
5
|
+
import { register } from "/assets/app-i18n.js";
|
|
6
|
+
|
|
7
|
+
register("settings", {
|
|
8
|
+
en: {
|
|
9
|
+
// On a web-only fleet a restart from Settings is recorded in the dashboard's Notices (there is no chat channel).
|
|
10
|
+
applyRestartHintWebOnly: "This change needs AgEnD itself restarted. You can restart it here.",
|
|
11
|
+
restartFleetConfirmWebOnly: "Restart AgEnD now?\n\nEvery agent stops and starts again, work in progress is interrupted, and the panel is unreachable for up to a minute. It is recorded in this dashboard's Notices.",
|
|
12
|
+
},
|
|
13
|
+
"zh-TW": {
|
|
14
|
+
applyRestartHintWebOnly: "此變更需要重新啟動 AgEnD 本身。可以在這裡重新啟動。",
|
|
15
|
+
restartFleetConfirmWebOnly: "現在重新啟動 AgEnD?\n\n所有 agent 都會停止再啟動,進行中的工作會被中斷,面板會有最多約一分鐘無法連線。這次重新啟動會記錄在這個儀表板的通知中。",
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -126,6 +126,7 @@ register("settings", {
|
|
|
126
126
|
pause: "Pause",
|
|
127
127
|
wake: "Wake",
|
|
128
128
|
accessMode: "Access mode",
|
|
129
|
+
legacyPairing: "pairing (legacy; same as locked)",
|
|
129
130
|
affected: "Affected instances",
|
|
130
131
|
language: "Language (bot replies)",
|
|
131
132
|
defaultBackend: "Default backend",
|
|
@@ -569,10 +570,10 @@ register("settings", {
|
|
|
569
570
|
vaSessionsTitle: "Authorized sessions", vaSessionsNone: "No session is authorized now.", vaSessionUntil: "Authorized {0} · until {1}",
|
|
570
571
|
vaRevoke: "Revoke web authority", vaRevokeTitle: "Revoke all web authority?", vaRevokeConfirm: "Every authority given from the web so far reads as none from now on, and every session's authorization ends. Nobody is signed out: a session carries authority again once it is authorized again.",
|
|
571
572
|
vaRevoked: "Web authority given so far is revoked.", vaRevokedNotDurable: "Revoked for now, but it could not be saved: web authority stays off until it can be, and a restart before then undoes the revocation.", vaRevokeFailed: "That did not work — try again.",
|
|
572
|
-
webReadOnlyLead: "Read-only
|
|
573
|
+
webReadOnlyLead: "Read-only: these values control the dashboard's listeners and exposure. This page cannot change them.",
|
|
573
574
|
searchRetentionUnset: "not set (no age limit; 300,000-row cap)",
|
|
574
575
|
searchRetentionZero: "0 (no age limit; 300,000-row cap)",
|
|
575
|
-
webSearchHint: "Global search keeps entries with no age limit by default. The daily prune still caps the index at 300,000 rows (oldest first).
|
|
576
|
+
webSearchHint: "Global search keeps entries with no age limit by default. The daily prune still caps the index at 300,000 rows (oldest first). Retention cannot be changed here.",
|
|
576
577
|
classicBackend: "ClassicBot default backend",
|
|
577
578
|
whoUsesClassic: "Who can use ClassicBot",
|
|
578
579
|
userIdPlaceholder: "user id",
|
|
@@ -779,6 +780,7 @@ register("settings", {
|
|
|
779
780
|
pause: "暫停",
|
|
780
781
|
wake: "喚醒",
|
|
781
782
|
accessMode: "存取模式",
|
|
783
|
+
legacyPairing: "pairing(舊版;等同 locked)",
|
|
782
784
|
affected: "受影響 instances",
|
|
783
785
|
language: "語言(bot 回覆)",
|
|
784
786
|
defaultBackend: "預設後端",
|
|
@@ -1220,10 +1222,10 @@ register("settings", {
|
|
|
1220
1222
|
vaSessionsTitle: "已授權的 session", vaSessionsNone: "目前沒有已授權的 session。", vaSessionUntil: "{0} 授權 · 到 {1}",
|
|
1221
1223
|
vaRevoke: "撤銷網頁授權", vaRevokeTitle: "撤銷所有網頁授權?", vaRevokeConfirm: "到目前為止從網頁給出的授權,從現在起都視為無,所有 session 的授權也會結束。不會登出任何人:session 再授權一次後,送出的訊息會再帶有授權。",
|
|
1222
1224
|
vaRevoked: "已撤銷到目前為止的網頁授權。", vaRevokedNotDurable: "已暫時撤銷,但無法保存:在可以保存之前網頁授權會保持關閉,而在那之前重新啟動會讓這次撤銷失效。", vaRevokeFailed: "沒有成功,請再試一次。",
|
|
1223
|
-
webReadOnlyLead: "
|
|
1225
|
+
webReadOnlyLead: "僅供檢視:這些設定決定儀表板監聽和公開的內容。這個頁面無法修改。",
|
|
1224
1226
|
searchRetentionUnset: "未設定(不限天數;上限 30 萬筆)",
|
|
1225
1227
|
searchRetentionZero: "0(不限天數;上限 30 萬筆)",
|
|
1226
|
-
webSearchHint: "全域搜尋預設不限天數。每日清理仍會把索引上限維持在 30
|
|
1228
|
+
webSearchHint: "全域搜尋預設不限天數。每日清理仍會把索引上限維持在 30 萬筆(先刪最舊的)。這裡無法變更保存期限。",
|
|
1227
1229
|
classicBackend: "ClassicBot 預設 backend",
|
|
1228
1230
|
whoUsesClassic: "誰可以使用 ClassicBot",
|
|
1229
1231
|
userIdPlaceholder: "使用者 id",
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
/* #3292: Settings → Accounts → Keep sign-in alive — linked by accounts-keepalive.js (an older accounts.css lacks these rules).
|
|
2
|
-
|
|
3
|
-
.s-
|
|
1
|
+
/* #3292: Settings → Accounts → Keep sign-in alive — linked by accounts-keepalive.js (an older accounts.css lacks these rules).
|
|
2
|
+
* The foot of an account's box: one line (it wraps only when the box is too narrow), one tone off the box (--surface-2 on --bg, a tone the CLI card around it does not have), no line. What each switch does is the
|
|
3
|
+
* settings pages' ⓘ after it (`InfoTip`, app.css `.s-tipwrap`): its words are a layer over the box (position: absolute), never in the flow, so nothing moves.
|
|
4
|
+
* The colours are the theme's (tokens.css); nothing here has one of its own. */
|
|
5
|
+
.s-account-keepalive { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin: var(--s-3) calc(-1 * var(--s-4)) calc(-1 * var(--s-3)); padding: var(--s-2) var(--s-4); border-radius: 0 0 var(--r-md) var(--r-md); background: var(--surface-2); }
|
|
6
|
+
.s-account-keepalive .check { display: flex; align-items: center; gap: var(--s-2); }
|
|
4
7
|
.s-account-keepalive small { color: var(--text-2); font-size: var(--fs-xs); overflow-wrap: anywhere; }
|
|
5
|
-
.s-account-keepalive .
|
|
6
|
-
.s-account-keepalive .is-
|
|
7
|
-
|
|
8
|
+
.s-account-keepalive .is-warn { color: var(--warn); font-weight: var(--fw-semibold); }
|
|
9
|
+
.s-account-keepalive .is-bad { color: var(--danger); font-weight: var(--fw-semibold); }
|
|
10
|
+
/* The ⓘ sits against the switch it explains; the backup-renewal switch is on the same line, with its own ⓘ. */
|
|
11
|
+
.s-account-keepalive > .s-tipwrap { margin-left: calc(-1 * var(--s-2)); }
|
|
12
|
+
.s-account-keepalive .s-keepalive-fallback { display: flex; align-items: center; gap: var(--s-2); }
|