@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
package/dist/ui/panel-hub.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { hj, joinError } from "./hub-company-join-strings.js";
|
|
2
|
+
import { joinRequest, companyInfoRequest, CompanyJoinInfoPage, useCompanyJoinContext, CompanyJoinLead, approveCompanyJoin, HubCompanyJoinPage, CompanyJoinAdminCard } from "./hub-company-join.js";
|
|
1
3
|
// AgEnD Hub P1, slice 3: the Hub workspace's pages — the chats (/ui/hub, a room at /ui/hub?room=<id>; #3226 B), My
|
|
2
4
|
// exposures and Administration (/ui/hub/exposures, /ui/hub/admin; reached from the session row's menu) — and its session row. Served only by a Hub's own listener at its own origin, over the Hub's /hub/v1/*
|
|
3
5
|
// API (hub-client.js createHubWebClient); nothing here reads or reaches a fleet. A lazy module: it imports only names
|
|
@@ -6,14 +8,15 @@
|
|
|
6
8
|
// What people see is what the server says now: every list is read fresh, every change is checked again by the server
|
|
7
9
|
// (who, the revision shown, the directory), and a conflict reloads the list instead of guessing.
|
|
8
10
|
import { html, useEffect, useLayoutEffect, useMemo, useRef, useState } from "/assets/app-html.js";
|
|
9
|
-
import { PanelHeader, closeDrawer, setTitle } from "/assets/app-shell.js";
|
|
10
|
-
import { lang, t } from "/assets/app-i18n.js";
|
|
11
|
+
import { DevicePrefs, PanelHeader, closeDrawer, isMacLike, searchShortcut, setTitle } from "/assets/app-shell.js";
|
|
12
|
+
import { lang, register, t } from "/assets/app-i18n.js";
|
|
11
13
|
import { createStore, useStore } from "/assets/app-store.js";
|
|
12
14
|
import { navigate, navStore } from "/assets/app-nav.js";
|
|
13
15
|
import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
|
|
14
16
|
import { Icon } from "/assets/ui-icons.js";
|
|
15
17
|
import { confirmDialog } from "/assets/ui-confirm.js";
|
|
16
18
|
import { Dialog } from "/assets/ui-dialog.js";
|
|
19
|
+
import { PairingNotices } from "./hub-quick-pairing.js";
|
|
17
20
|
import { Menu } from "/assets/ui-menu.js";
|
|
18
21
|
import { toast } from "/assets/ui-toast.js";
|
|
19
22
|
// #3226 B: the chat is the fleet chat's own drawing (PR A's shared modules), in the fleet chat's words.
|
|
@@ -25,6 +28,7 @@ import "/assets/chat-strings.js";
|
|
|
25
28
|
import { compareGroups, hubClient } from "./hub-client.js";
|
|
26
29
|
import { hw, linkHubCss } from "./hub-strings.js";
|
|
27
30
|
import { hc, linkHubChatCss } from "./hub-chat-strings.js";
|
|
31
|
+
import { hr } from "./hub-read-strings.js";
|
|
28
32
|
import { ho, linkHubOwnerCss } from "./hub-owner-strings.js";
|
|
29
33
|
import { hg } from "./hub-grant-strings.js";
|
|
30
34
|
import { createHubChatStore } from "./hub-chat-store.js";
|
|
@@ -32,6 +36,21 @@ import { QuotaBanner, QuotaCard, QuotaChip, QuotaVisibilityRow } from "./hub-quo
|
|
|
32
36
|
import { PageHead } from "/assets/page-head.js";
|
|
33
37
|
import { bindRoomFeedback, bootHubPreview, downloadHtml, draftWithLine, panelOpenFor, roomPanelKey, roomPanelOpts, setHubPreviewOptIn } from "./hub-preview.js";
|
|
34
38
|
import { PendingFiles, hf, pageCarriesFiles, roomTakesFiles, uploadChosen } from "./hub-attachments.js";
|
|
39
|
+
// #3298 S-89 (experimental): the group permissions editor and the signed-in welcome are their own LAZY modules, loaded only
|
|
40
|
+
// when the Hub's session says "group-policy-v1" and this tab's client has the calls — a Hub without them never serves or loads them.
|
|
41
|
+
// The one group-permissions sentence this module draws itself (shown when the lazy modules are NOT loaded: this Hub lacks them).
|
|
42
|
+
register("hubGroupsNote", {
|
|
43
|
+
en: { unavailable: "Group permissions aren't available on this Hub yet. Update the Hub, then try again." },
|
|
44
|
+
"zh-TW": { unavailable: "這個 Hub 還沒有群組權限。請更新 Hub 後再試。" },
|
|
45
|
+
});
|
|
46
|
+
const groupPolicyOn = (session, client) => !!session && Array.isArray(session.features) && session.features.includes("group-policy-v1")
|
|
47
|
+
&& !!client && client.groupPolicyV1 === true;
|
|
48
|
+
function LazyGroups({ pick, props }) {
|
|
49
|
+
const [C, setC] = useState(null), [failed, setFailed] = useState(false);
|
|
50
|
+
useEffect(() => { let live = true; Promise.all([import("./hub-welcome.js"), import("./hub-group-policy.js"), import("./hub-group-strings.js")])
|
|
51
|
+
.then(([w, p, g]) => { if (live) setC(() => pick({ ...w, ...p, ...g })); }, () => { if (live) setFailed(true); }); return () => { live = false; }; }, []);
|
|
52
|
+
return failed ? null : C ? html`<${C} ...${props} />` : html`<${Skeleton} variant="rows" lines=${3} />`;
|
|
53
|
+
}
|
|
35
54
|
|
|
36
55
|
const TITLES = { ask: "askTitle", exposures: "exposuresTitle", admin: "adminTitle" };
|
|
37
56
|
/** P1 room polling: at most once per ten seconds, one request at a time, paused while the page is hidden (hub.md §5). */
|
|
@@ -77,21 +96,36 @@ const errText = (r) => hw(r.code === "conflict" || r.code === "stale" ? "errConf
|
|
|
77
96
|
|
|
78
97
|
export function HubPanel({ route }) {
|
|
79
98
|
const tab = TITLES[route && route.tab] ? route.tab : "ask";
|
|
99
|
+
const companyPage = tab === "ask" && (companyInfoRequest() || !!joinRequest());
|
|
80
100
|
const s = useSession();
|
|
81
|
-
|
|
82
|
-
|
|
101
|
+
useStore(navStore); // ?view= changes without a new route
|
|
102
|
+
const view = viewParam();
|
|
103
|
+
// The owner stylesheet holds the page column (.hub-owner, 860 px) every page with a column uses — Notices too (Argon #12).
|
|
104
|
+
useEffect(() => { linkHubCss(); linkHubOwnerCss(); if (tab === "ask") linkHubChatCss(); }, [tab]);
|
|
105
|
+
// Join takes precedence over other query views. Rooms and Group permissions otherwise name their own pages.
|
|
106
|
+
const pageName = companyPage ? hj("title") : tab === "exposures" ? hc("mine") : tab === "admin" ? hc("admin") : view === "notices" ? hc("noticesTitle") : hc("chats");
|
|
107
|
+
useEffect(() => { if (companyPage || !(tab === "ask" && roomParam()) && !(tab === "admin" && view === "groups")) setTitle(pageName); }, [tab, view, pageName, roomParam(), companyPage]);
|
|
83
108
|
let body = tab === "ask" ? roomParam() ? html`<${HubRoomLoading} />`
|
|
84
109
|
: html`<${PanelHeader} title=${hc("chats")} /><div class="hub-home"><${Skeleton} variant="rows" lines=${4} /></div>`
|
|
85
110
|
: html`<${Skeleton} variant="rows" lines=${4} />`;
|
|
86
111
|
// Signed out: the sign-in page alone (no panel header, no chat chrome).
|
|
112
|
+
if (companyInfoRequest()) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-info"><${PanelHeader} title=${hj("title")} /><div data-trust="panel-content" class="panel-body hub-page-body"><${CompanyJoinInfoPage} /></div></div>`;
|
|
87
113
|
if (s === null) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-signin"><${HubSignIn} /></div>`;
|
|
88
114
|
if (s) body = tab === "ask" ? html`<${HubChats} />` : tab === "exposures" ? html`<${HubMine} />` : html`<${HubAdmin} admin=${!!s.admin} />`;
|
|
115
|
+
if (s && tab === "ask" && joinRequest()) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-join">
|
|
116
|
+
<${PanelHeader} title=${hj("title")} /><div data-trust="panel-content" class="panel-body hub-page-body"><${HubCompanyJoinPage} session=${s} /></div></div>`;
|
|
117
|
+
// Security notices stay on their own page. The bound join branch above never renders the chat or notices page.
|
|
118
|
+
if (s && tab === "ask" && view === "notices" && noticesOffered(s)) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-notices">
|
|
119
|
+
<${PanelHeader} title=${hc("noticesTitle")} /><div data-trust="panel-content" class="panel-body hub-page-body">
|
|
120
|
+
<div class="col hub-owner hub-notices-col"><p class="s-page-lead hub-page-lead">${hc("noticesLead")}</p>
|
|
121
|
+
<${PairingNotices} admin=${!!s.admin} empty=${html`<${Empty} icon="bell" title=${hc("noNotices")} />`} /></div></div></div>`;
|
|
89
122
|
// The chats draw their own header (the room's); the other pages keep the panel's.
|
|
90
123
|
if (s !== null && tab === "ask") return html`<div data-effect-panel="hub" class="panel p-hub p-hub-ask"><div data-trust="panel-content" class="panel-body hub-chat-body">${body}</div></div>`;
|
|
91
|
-
// #3226 C: My shared agents and Administration are Settings-like pages
|
|
92
|
-
|
|
124
|
+
// #3226 C: My shared agents and Administration are Settings-like pages. The panel's header names the page once, its scope
|
|
125
|
+
// beside it ("Yours" / "This Hub"); the page itself opens with its lead — no second title repeating the first (Argon #7).
|
|
126
|
+
const scope = s && tab === "exposures" && !agentParam() ? ho("scopeYou") : s && tab === "admin" && s.admin && view !== "groups" ? ho("scopeHub") : null;
|
|
93
127
|
return html`<div data-effect-panel="hub" class=${`panel p-hub p-hub-${tab}`}>
|
|
94
|
-
<${PanelHeader} title=${
|
|
128
|
+
<${PanelHeader} title=${pageName} sub=${scope ? html`<span class="s-scope">${scope}</span>` : null} />
|
|
95
129
|
<div data-trust="panel-content" class=${`panel-body ${s ? "hub-page-body" : "hub-body"}`}>${body}</div>
|
|
96
130
|
</div>`;
|
|
97
131
|
}
|
|
@@ -130,6 +164,7 @@ function linkHubSigninCss(doc = typeof document !== "undefined" ? document : nul
|
|
|
130
164
|
} catch { /* the page still works without it */ }
|
|
131
165
|
}
|
|
132
166
|
function HubSignIn() {
|
|
167
|
+
const company = useCompanyJoinContext();
|
|
133
168
|
useEffect(() => {
|
|
134
169
|
linkHubSigninCss();
|
|
135
170
|
// #3318 review F1: signed out from the phone drawer's session menu (or a session that ended while it was open), the
|
|
@@ -155,25 +190,34 @@ function HubSignIn() {
|
|
|
155
190
|
}
|
|
156
191
|
setBusy(true); setMsg(null);
|
|
157
192
|
const r = await hubClient().signIn(form.login.trim(), form.password);
|
|
193
|
+
if (r.ok) {
|
|
194
|
+
setForm({ login: "", password: "" });
|
|
195
|
+
if (company.requestId) {
|
|
196
|
+
const joined = await approveCompanyJoin(company.requestId, r.csrf);
|
|
197
|
+
if (!joined.ok) { setBusy(false); setSession({ ...r, companyJoinFailure: { requestId: company.requestId, code: joined.code } }); return; }
|
|
198
|
+
}
|
|
199
|
+
setBusy(false); setSession(r); return;
|
|
200
|
+
}
|
|
158
201
|
setBusy(false);
|
|
159
|
-
if (r.ok) { setForm({ login: "", password: "" }); setSession(r); return; }
|
|
160
202
|
setForm((f) => ({ ...f, password: "" }));
|
|
161
203
|
setMsg(r.code === "backpressure" ? hw("errBusyHub") : r.code === "unavailable" ? hw("errDirectory") : hw("errSignIn"));
|
|
162
204
|
};
|
|
163
205
|
return html`<main class="hub-signin-page"><section class="hub-signin hub-signin-card" aria-labelledby="hubSignInTitle">
|
|
164
206
|
<div class="hub-signin-brand"><strong>${t("hubShell.brand")}</strong>${name ? html`<span>${name}</span>` : null}</div>
|
|
165
207
|
<h1 id="hubSignInTitle">${hw("signInTitle")}</h1>
|
|
166
|
-
|
|
167
|
-
|
|
208
|
+
${company.requestId ? html`<${CompanyJoinLead} context=${company.view?.ok ? company.view : null} />` : html`<p class="hub-signin-lead">${hw("signInLead")}</p>`}
|
|
209
|
+
${company.requestId && company.view === undefined ? html`<${Skeleton} variant="form" lines=${2} label=${hj("loading")} />` : company.requestId && company.view && !company.view.ok ? html`<${ErrorState} message=${joinError(company.view.code)} onRetry=${company.retry} />` : null}
|
|
210
|
+
${!company.requestId || company.view?.ok && company.view.state === "pending" ? html`<form class="hub-signin-form" onSubmit=${submit}>
|
|
168
211
|
<label for="hubLogin">${hw("login")}</label>
|
|
169
212
|
<input id="hubLogin" autocomplete="username" spellcheck=${false} autocapitalize="none"
|
|
170
213
|
value=${form.login} onInput=${(e) => { const v = e.target.value; setForm((f) => ({ ...f, login: v })); }} />
|
|
171
214
|
<label for="hubPassword">${hw("password")}</label>
|
|
172
215
|
<input id="hubPassword" type="password" autocomplete="current-password"
|
|
173
216
|
value=${form.password} onInput=${(e) => { const v = e.target.value; setForm((f) => ({ ...f, password: v })); }} />
|
|
174
|
-
<button type="submit" class="hub-signin-go" disabled=${busy}>${hw("signIn")}</button>
|
|
175
|
-
</form
|
|
217
|
+
<button type="submit" class="hub-signin-go" disabled=${busy || company.requestId && !company.view?.ok}>${company.requestId ? hj("signInConnect") : hw("signIn")}</button>
|
|
218
|
+
</form>` : company.view?.ok ? html`<p role="status">${joinError(company.view.reason || company.view.state)}</p>` : null}
|
|
176
219
|
<p class="hub-signin-msg" role=${msg ? "alert" : undefined}>${msg || ""}</p>
|
|
220
|
+
${company.requestId && (msg || company.view?.state !== "pending") && company.view?.returnPath ? html`<a class="btn btn-sm" href=${company.view.returnPath} rel="noreferrer">${hj("return")}</a>` : null}
|
|
177
221
|
</section></main>`;
|
|
178
222
|
}
|
|
179
223
|
|
|
@@ -196,7 +240,10 @@ function useRead(read) {
|
|
|
196
240
|
export const ROOMS_MS = 30_000;
|
|
197
241
|
export function refreshRooms() {
|
|
198
242
|
return roomsReading ??= hubClient().rooms().then((r) => {
|
|
199
|
-
|
|
243
|
+
// With group permissions on, a person whose groups don't include chatting is refused the list: that is their access, shown
|
|
244
|
+
// by the welcome, not a failure (Cairn #3372) — the list stays empty and quiet. Every chat action still asks the server.
|
|
245
|
+
if (!r.ok && (r.code === "denied" || r.code === "revoked") && groupPolicyOn(session, hubClient())) roomsStore.set({ loaded: true, rooms: [], error: null, denied: true });
|
|
246
|
+
else roomsStore.set(r.ok ? { loaded: true, rooms: r.rooms || [], error: null } : { ...roomsStore.get(), loaded: true, error: errText(r) });
|
|
200
247
|
}, () => roomsStore.set({ ...roomsStore.get(), loaded: true, error: hw("errFailed") })).finally(() => { roomsReading = null; });
|
|
201
248
|
}
|
|
202
249
|
/** Keeps the list fresh while something shows it (every ROOMS_MS, paused while the page is hidden). */
|
|
@@ -211,6 +258,10 @@ function useRooms() {
|
|
|
211
258
|
}
|
|
212
259
|
const roomParam = () => { try { const v = new URLSearchParams(location.search).get("room"); return v && /^[a-f0-9-]{36}$/.test(v) ? v : null; } catch { return null; } };
|
|
213
260
|
const roomPath = (id) => `/ui/hub?room=${encodeURIComponent(id)}`;
|
|
261
|
+
/** cid-hub-shell-parity: the Notices page is /ui/hub?view=notices (the path every Hub listener and router already serves). */
|
|
262
|
+
const viewParam = () => { try { return new URLSearchParams(location.search).get("view"); } catch { return null; } };
|
|
263
|
+
export const NOTICES_PATH = "/ui/hub?view=notices";
|
|
264
|
+
const noticesOffered = (s) => !!s && Array.isArray(s.features) && s.features.includes("quick-pairing-v1") && !!hubClient().quickPairingV1;
|
|
214
265
|
const initial = (name) => (String(name || "?").trim()[0] || "?").toUpperCase();
|
|
215
266
|
const AV_TONES = 6;
|
|
216
267
|
const tone = (name) => { let h = 0; for (const c of String(name || "")) h = (h * 31 + c.codePointAt(0)) >>> 0; return h % AV_TONES; };
|
|
@@ -244,7 +295,7 @@ export function HubNav({ onPick } = {}) {
|
|
|
244
295
|
<div class="hub-sec">${hc("chats")}</div>
|
|
245
296
|
${rs.error ? html`<${ErrorState} message=${rs.error} onRetry=${refreshRooms} />` : null}
|
|
246
297
|
${!rs.loaded ? html`<${Skeleton} variant="rows" lines=${4} />` : null}
|
|
247
|
-
${rs.loaded && !rs.error && !rs.rooms.length ? html`<p class="note hub-list-empty">${hc("
|
|
298
|
+
${rs.loaded && !rs.error && !rs.denied && !rs.rooms.length ? html`<p class="note hub-list-empty">${hc("noChats")}</p>` : null}
|
|
248
299
|
${rs.rooms.length && !shown.length ? html`<p class="note hub-list-empty">${hc("noMatch")}</p>` : null}
|
|
249
300
|
<ul class="hub-rooms" role="list">${shown.map((r) => html`<li key=${r.id}>
|
|
250
301
|
<a class=${`hub-room-row${current === r.id ? " active" : ""}${r.state === "closed" ? " closed" : ""}`} href=${roomPath(r.id)} aria-current=${current === r.id ? "page" : undefined} onClick=${(e) => pick(e, r)}>
|
|
@@ -256,6 +307,115 @@ export function HubNav({ onPick } = {}) {
|
|
|
256
307
|
</div>`;
|
|
257
308
|
}
|
|
258
309
|
|
|
310
|
+
/**
|
|
311
|
+
* cid-hub-shell-parity (the user: 「agend 排得很好看, agend hub 醜到不行」; approved mockup): the Hub's sidebar is the fleet
|
|
312
|
+
* dashboard's own — style guide rule 1, its shell components, not Hub-only ones. Icon rows (`side-row`): Conversations, My
|
|
313
|
+
* shared agents, Administration (the administrator only), Notices (only where the Hub offers its security notices), Search
|
|
314
|
+
* (Ctrl K: the conversation filter) and New conversation (`side-new`); then the conversation list under a `side-label`
|
|
315
|
+
* section, with a one-line empty state. The app shell mounts it (HubSidebar); an older shell keeps HubNav.
|
|
316
|
+
* Notices has no count: the Hub exposes the retained notices, not which of them this person has read.
|
|
317
|
+
*/
|
|
318
|
+
export function HubSide({ onPick } = {}) {
|
|
319
|
+
const s = useSession();
|
|
320
|
+
const rs = useRooms();
|
|
321
|
+
const { route } = useStore(navStore);
|
|
322
|
+
const [q, setQ] = useState("");
|
|
323
|
+
const [filtering, setFiltering] = useState(false);
|
|
324
|
+
const [picking, setPicking] = useState(false);
|
|
325
|
+
const filter = useRef(null);
|
|
326
|
+
useEffect(() => { linkHubChatCss(); }, []);
|
|
327
|
+
const openFilter = () => { setFiltering(true); setTimeout(() => filter.current?.focus(), 0); };
|
|
328
|
+
// Ctrl K (⌘K): the conversation filter — the dashboard's search shortcut, on the Hub's own search (no fleet search here).
|
|
329
|
+
useEffect(() => {
|
|
330
|
+
const onKey = (e) => {
|
|
331
|
+
if (e.isComposing || e.altKey || e.shiftKey || !(isMacLike() ? e.metaKey : e.ctrlKey) || (e.key || "").toLowerCase() !== "k") return;
|
|
332
|
+
if (typeof document !== "undefined" && document.querySelector("dialog[open]:not(.side-panel)")) return;
|
|
333
|
+
e.preventDefault(); openFilter();
|
|
334
|
+
};
|
|
335
|
+
document.addEventListener("keydown", onKey);
|
|
336
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
337
|
+
}, []);
|
|
338
|
+
if (!s) return null;
|
|
339
|
+
const tab = route && route.panel === "hub" ? route.tab : "ask";
|
|
340
|
+
const view = viewParam();
|
|
341
|
+
const here = (key) => key === "notices" ? tab === "ask" && view === "notices" : key === "ask" ? tab === "ask" && view !== "notices" : tab === key;
|
|
342
|
+
const go = (e, href) => { if (onPick) onPick(); if (e && (e.metaKey || e.ctrlKey)) return; e && e.preventDefault(); navigate(href); };
|
|
343
|
+
const row = (key, href, icon, label) => html`<a class=${`side-row${here(key) ? " active" : ""}`} href=${href} aria-current=${here(key) ? "page" : undefined}
|
|
344
|
+
onClick=${(e) => go(e, href)}><${Icon} name=${icon} /><span class="grow">${label}</span></a>`;
|
|
345
|
+
// On the chats' own home (no room open, no filter) the page already says "No chats yet": the list doesn't say it twice (Argon #19).
|
|
346
|
+
const home = tab === "ask" && view !== "notices" && !roomParam();
|
|
347
|
+
return html`<nav data-trust="navigation" class="side-nav" aria-label=${t("app.menu")}>
|
|
348
|
+
${row("ask", "/ui/hub", "chat", hc("chats"))}
|
|
349
|
+
${row("exposures", "/ui/hub/exposures", "globe", hc("mine"))}
|
|
350
|
+
${s.admin ? row("admin", "/ui/hub/admin", "key", hc("admin")) : null}
|
|
351
|
+
${noticesOffered(s) ? row("notices", NOTICES_PATH, "bell", hc("notices")) : null}
|
|
352
|
+
<button type="button" class="side-row side-search" onClick=${openFilter} title=${`${hc("search")} (${searchShortcut()})`}
|
|
353
|
+
aria-keyshortcuts=${isMacLike() ? "Meta+K" : "Control+K"}><${Icon} name="search" /><span class="grow">${hc("navSearch")}</span><kbd class="kbd-hint" aria-hidden="true">${searchShortcut()}</kbd></button>
|
|
354
|
+
<button type="button" class="side-row side-new" onClick=${() => setPicking(true)}><${Icon} name="plus" /><span class="grow">${hc("newChat")}</span></button>
|
|
355
|
+
</nav>
|
|
356
|
+
<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} onPick=${onPick} quietEmpty=${home} />
|
|
357
|
+
${picking ? html`<${NewChatDialog} onClose=${() => setPicking(false)} />` : null}`;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* The conversation list, as the dashboard draws its roster (`view-roster inst-nav > side-section`, the section's label and
|
|
362
|
+
* count, one-line empty states) — the sidebar's (HubSide) and, on a phone, the chats' home page's (with its own New chat
|
|
363
|
+
* row and the filter always shown): one drawing, not two (Argon #9). `quietEmpty`: the page beside it already says "No chats yet".
|
|
364
|
+
*/
|
|
365
|
+
function HubRoomList({ rs, q, setQ, filtering, setFiltering, filterRef, onPick, quietEmpty = false, onNew = null }) {
|
|
366
|
+
const current = roomParam();
|
|
367
|
+
const go = (e, href) => { if (onPick) onPick(); if (e && (e.metaKey || e.ctrlKey)) return; e && e.preventDefault(); navigate(href); };
|
|
368
|
+
const shown = rs.rooms.filter((r) => !q.trim() || `${r.exposureName} ${r.ownerName}`.toLowerCase().includes(q.trim().toLowerCase()));
|
|
369
|
+
const always = !!onNew; // the home page's list: its filter is always there (when there's a list to filter)
|
|
370
|
+
return html`<div class="view-roster inst-nav hub-side-rooms"><div data-trust="navigation" class="side-section">
|
|
371
|
+
${onNew ? html`<button type="button" class="side-row side-new" onClick=${onNew}><${Icon} name="plus" /><span class="grow">${hc("newChat")}</span></button>` : null}
|
|
372
|
+
<div class="inst-head"><h2 class="side-label">${hc("chats")}</h2>${rs.rooms.length ? html`<span class="count">${rs.rooms.length}</span>` : null}</div>
|
|
373
|
+
${filtering || q || (always && rs.rooms.length) ? html`<label class="hub-side-filter"><${Icon} name="search" size=${14} /><input ref=${filterRef} type="search" placeholder=${hc("search")} aria-label=${hc("search")} value=${q}
|
|
374
|
+
onInput=${(e) => setQ(e.target.value)} onKeyDown=${(e) => { if (e.key === "Escape") { setQ(""); setFiltering(false); } }} /></label>` : null}
|
|
375
|
+
${rs.error ? html`<${ErrorState} message=${rs.error} onRetry=${refreshRooms} />` : null}
|
|
376
|
+
${!rs.loaded ? html`<${Skeleton} variant="rows" lines=${4} />` : null}
|
|
377
|
+
${rs.loaded && !rs.error && !rs.denied && !rs.rooms.length && !quietEmpty ? html`<p class="side-empty muted">${hc("noChats")}</p>` : null}
|
|
378
|
+
${rs.rooms.length && !shown.length ? html`<p class="side-empty muted">${hc("noMatch")}</p>` : null}
|
|
379
|
+
<ul class="hub-rooms" role="list">${shown.map((r) => html`<li key=${r.id}>
|
|
380
|
+
<a class=${`hub-room-row${current === r.id ? " active" : ""}${r.state === "closed" ? " closed" : ""}`} href=${roomPath(r.id)} aria-current=${current === r.id ? "page" : undefined} onClick=${(e) => go(e, roomPath(r.id))}>
|
|
381
|
+
<${Avatar} name=${r.exposureName} />
|
|
382
|
+
<span class="hub-room-text"><span class="t">${r.exposureName}</span><span class="s">${r.state === "closed" ? hc("tagClosed") : r.waiting ? hc("waiting") : r.ownerName ? hc("represents", r.ownerName) : ""}</span></span>
|
|
383
|
+
<span class="hub-room-side"><span class="time">${listTime(r.lastAt)}</span>${r.waiting ? html`<span class="pulse" title=${hc("waiting")}></span>` : null}</span>
|
|
384
|
+
</a></li>`)}</ul>
|
|
385
|
+
</div></div>`;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/** The phone's chats home: the same roster, with New chat at its head and the filter in place. */
|
|
389
|
+
function HubHomeList() {
|
|
390
|
+
const rs = useRooms();
|
|
391
|
+
const [q, setQ] = useState(""), [filtering, setFiltering] = useState(false), [picking, setPicking] = useState(false);
|
|
392
|
+
const filter = useRef(null);
|
|
393
|
+
return html`<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} onNew=${() => setPicking(true)} />
|
|
394
|
+
${picking ? html`<${NewChatDialog} onClose=${() => setPicking(false)} />` : null}`;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* cid-hub-shell-parity: the sidebar's foot, as the dashboard's — Settings (this device's theme and language: the shell's own
|
|
399
|
+
* DevicePrefs) and the session row ("Signed in", the person's name beside it), whose menu holds Sign out.
|
|
400
|
+
*/
|
|
401
|
+
export function HubFoot() {
|
|
402
|
+
const s = useSession();
|
|
403
|
+
const [busy, setBusy] = useState(false);
|
|
404
|
+
const prefs = html`<details class="prefs-pop hub-prefs"><summary class="side-row"><${Icon} name="settings" /><span class="grow">${hc("settings")}</span></summary>
|
|
405
|
+
<div data-trust="popover" class="pop" role="group" aria-label=${t("app.devicePrefs")}><${DevicePrefs} labels=${true} fields=${["theme", "language"]} /></div></details>`;
|
|
406
|
+
if (s === undefined) return html`${prefs}<div class="session"><${Skeleton} variant="inline" lines=${1} /></div>`;
|
|
407
|
+
if (!s) return prefs;
|
|
408
|
+
const out = async () => { setBusy(true); await hubClient().signOut(); setBusy(false); setSession(null); };
|
|
409
|
+
// Who is signed in heads the menu — their name and sign-in name (the foot's row says "Signed in", as the dashboard's) — then
|
|
410
|
+
// Sign out. My shared agents and Administration are the sidebar's own rows, not repeated here (Argon #10).
|
|
411
|
+
const items = [
|
|
412
|
+
{ key: "who", label: s.login && s.login !== s.displayName ? `${s.displayName} (${s.login})` : s.displayName, icon: "user", disabled: true },
|
|
413
|
+
{ key: "out", label: hc("signOut"), icon: "back", onSelect: out, disabled: busy },
|
|
414
|
+
];
|
|
415
|
+
return html`${prefs}<div class="session hub-session-row"><${Menu} items=${items} label=${hc("signedIn")} cls="hub-session-menu" triggerClass="side-row"
|
|
416
|
+
trigger=${html`<span class="dot ok" aria-hidden="true"></span><span class="grow">${hc("signedIn")}</span><span class="meta" title=${s.displayName}>${s.displayName}</span>`} /></div>`;
|
|
417
|
+
}
|
|
418
|
+
|
|
259
419
|
/** New chat: the agents someone allowed this person to ask; Ask opens (or reopens) its room. */
|
|
260
420
|
function NewChatDialog({ onClose }) {
|
|
261
421
|
const [cat, reload] = useRead(() => hubClient().catalog());
|
|
@@ -295,17 +455,21 @@ function NewChatDialog({ onClose }) {
|
|
|
295
455
|
function HubChats() {
|
|
296
456
|
useStore(navStore); // ?room= changes without a new route
|
|
297
457
|
const rs = useRooms();
|
|
458
|
+
const s = useSession();
|
|
459
|
+
const [picking, setPicking] = useState(false);
|
|
298
460
|
useEffect(() => { linkHubChatCss(); }, []);
|
|
299
461
|
const id = roomParam();
|
|
300
462
|
const room = id ? rs.rooms.find((r) => r.id === id) || (rs.loaded ? { id, exposureName: "", ownerName: "", features: [] } : null) : null;
|
|
301
463
|
if (id && room) return html`<${HubRoomView} key=${id} room=${room} />`;
|
|
302
464
|
if (id) return html`<${HubRoomLoading} error=${rs.error} />`;
|
|
303
465
|
return html`<${PanelHeader} title=${hc("chats")} />
|
|
304
|
-
<div class
|
|
305
|
-
<div class="hub-home-list"><${
|
|
306
|
-
|
|
307
|
-
? html`<${
|
|
308
|
-
|
|
466
|
+
<div class=${`hub-home${groupPolicyOn(s, hubClient()) ? " has-welcome" : ""}`}>
|
|
467
|
+
<div class="hub-home-list"><${HubHomeList} /></div>
|
|
468
|
+
${groupPolicyOn(s, hubClient()) ? html`<div class="hub-home-pick hub-home-welcome"><${LazyGroups} pick=${(m) => m.HubWelcome} props=${{ name: s.displayName, quick: s.features.includes("quick-pairing-v1"), onChats: () => setPicking(true) }} /></div>`
|
|
469
|
+
: html`<div class="hub-home-pick center">${!rs.loaded ? html`<${Skeleton} variant="rows" lines=${4} />` : rs.error && !rs.rooms.length ? html`<${ErrorState} message=${rs.error} onRetry=${refreshRooms} />` : !rs.rooms.length
|
|
470
|
+
? html`<${Empty} icon="chat" title=${hc("noChats")} />`
|
|
471
|
+
: html`<${Empty} icon="chat" title=${hc("choose")} hint=${hc("chooseHint")} />`}</div>`}
|
|
472
|
+
${picking ? html`<${NewChatDialog} onClose=${() => setPicking(false)} />` : null}
|
|
309
473
|
</div>`;
|
|
310
474
|
}
|
|
311
475
|
|
|
@@ -522,7 +686,8 @@ function HubThread({ store, name, panelKey, threadRef }) {
|
|
|
522
686
|
<div class="thread-host" ref=${host}></div>
|
|
523
687
|
${/* #3145: that every asker shares the agent's one conversation is said before anyone types. */ ""}
|
|
524
688
|
${!loaded && !store.error() && !store.closed() ? html`<${Skeleton} variant="rows" lines=${5} />` : null}
|
|
525
|
-
${
|
|
689
|
+
${store.error() === "backpressure" ? html`<p class="hub-banner warn" role="status">${hr("busy")}</p>`
|
|
690
|
+
: !loaded && store.error() ? html`<${ErrorState} message=${errText({ code: store.error() })} onRetry=${() => store.refresh()} />` : null}
|
|
526
691
|
${empty && loaded && !store.closed() ? html`<div class="center hub-room-empty"><${Empty} icon="chat" title=${hc("emptyRoom", name)} hint=${`${hc("emptyRoomHint", store.room().ownerName || name)}${lang() === "zh-TW" ? "" : " "}${hw("roomShared")}`} /></div>` : null}
|
|
527
692
|
<div class="jump-dock">${jump.show ? html`<button data-trust="thread-control" type="button" class="jump-latest" onClick=${() => th.current && th.current.jumpLatest()}>
|
|
528
693
|
<${Icon} name="down" size=${16} />${jump.unseen > 0 ? t("chat.newBelow", jump.unseen) : t("chat.jumpLatest")}</button>` : null}</div>
|
|
@@ -592,7 +757,8 @@ function HubMine() {
|
|
|
592
757
|
// Keyed by the agent: another ?agent= is another page (its reads, its dialog), and a late answer for the previous one
|
|
593
758
|
// lands nowhere (useRead's own liveness ends with that page).
|
|
594
759
|
if (x) return html`<${HubAgentPage} key=${x.id} x=${x} act=${act} msg=${msg} />`;
|
|
595
|
-
|
|
760
|
+
// Nothing shared yet: the empty state below says where to share from, so the lead doesn't say it too (Argon #20).
|
|
761
|
+
return html`<div class="col hub-owner"><p class="s-page-lead hub-page-lead">${ho(cat && !cat.error && !mine.length ? "mineLeadShort" : "mineLead")}</p>
|
|
596
762
|
<div class="s-section-layout">
|
|
597
763
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
598
764
|
${!pairings ? html`<${Skeleton} lines=${2} />` : pairings.error ? html`<${ErrorState} message=${pairings.error} onRetry=${reloadPairings} />` : null}
|
|
@@ -684,10 +850,28 @@ function AllowDialog({ x, act, onClose }) {
|
|
|
684
850
|
|
|
685
851
|
// ── Administration ──
|
|
686
852
|
function HubAdmin({ admin }) {
|
|
853
|
+
useStore(navStore); // ?view= changes without a new route
|
|
854
|
+
const s = useSession();
|
|
687
855
|
if (!admin) return html`<div class="center hub-empty"><${Empty} icon="key" title=${hw("adminOnly")} hint=${hw("adminOnlyHint")} /></div>`;
|
|
688
|
-
return html`<${
|
|
856
|
+
if (groupPolicyOn(s, hubClient()) && adminView() === "groups") return html`<${LazyGroups} pick=${(m) => m.HubGroupPolicyPage} props=${{}} />`;
|
|
857
|
+
// Reached from a fleet's Settings link on a Hub (or a tab) without group permissions: say so instead of a silent admin page.
|
|
858
|
+
const unavailable = adminView() === "groups" && !groupPolicyOn(s, hubClient());
|
|
859
|
+
return html`${unavailable ? html`<p class="note" role="status" data-groups="unavailable">${t("hubGroupsNote.unavailable")}</p>` : null}
|
|
860
|
+
<${HubAdminPage} groups=${groupPolicyOn(s, hubClient())} companyJoin=${s?.features?.includes("company-join-v1")} />`;
|
|
861
|
+
}
|
|
862
|
+
/** M-2682: Administration → This Hub, its own lazy module (an older server doesn't serve it: then it's left out). */
|
|
863
|
+
function LazyThisHub() {
|
|
864
|
+
const [C, setC] = useState(null);
|
|
865
|
+
useEffect(() => { let live = true; import("./hub-this-hub.js").then((m) => { if (live) setC(() => m.ThisHubCard); }, () => {}); return () => { live = false; }; }, []);
|
|
866
|
+
return C ? html`<${C} />` : null;
|
|
867
|
+
}
|
|
868
|
+
/** #3298 S-89: Administration's sub-page (?view=groups: Group permissions), from the page's own address. */
|
|
869
|
+
function adminView() { try { return new URLSearchParams(location.search).get("view") || ""; } catch { return ""; } }
|
|
870
|
+
/** #3298 S-89: the prominent entry to Group permissions at the top of Administration (discovery without docs). */
|
|
871
|
+
function GroupPermissionsEntry() {
|
|
872
|
+
return html`<${LazyGroups} pick=${(m) => m.GroupPermissionsCard} props=${{}} />`;
|
|
689
873
|
}
|
|
690
|
-
function HubAdminPage() {
|
|
874
|
+
function HubAdminPage({ groups = false, companyJoin = false } = {}) {
|
|
691
875
|
const [view, reload] = useRead(() => hubClient().adminOverview());
|
|
692
876
|
const [login, setLogin] = useState("");
|
|
693
877
|
const [offer, setOffer] = useState(null);
|
|
@@ -695,7 +879,8 @@ function HubAdminPage() {
|
|
|
695
879
|
useEffect(() => { linkHubChatCss(); linkHubOwnerCss(); }, []);
|
|
696
880
|
const create = async (e) => {
|
|
697
881
|
e.preventDefault();
|
|
698
|
-
|
|
882
|
+
// The button is always ready (a disabled one reads as grey, "broken" — Argon #16): an empty field just takes the focus.
|
|
883
|
+
if (!login.trim()) { (typeof document !== "undefined" ? document.getElementById("hubOwnerLogin") : null)?.focus(); return; }
|
|
699
884
|
setMsg(null);
|
|
700
885
|
const r = await hubClient().createPairing(login.trim());
|
|
701
886
|
if (!r.ok) { setMsg(errText(r)); return; }
|
|
@@ -715,19 +900,22 @@ function HubAdminPage() {
|
|
|
715
900
|
if (!r.ok) setMsg(errText(r));
|
|
716
901
|
reload();
|
|
717
902
|
};
|
|
718
|
-
|
|
903
|
+
const lead = html`<p class="s-page-lead hub-page-lead">${ho("adminLead")}</p>`;
|
|
904
|
+
if (!view || (view.error && !view.fleets)) return html`<div class="col hub-owner hub-admin">${lead}
|
|
719
905
|
<div class="s-section-layout">${view?.error ? html`<${ErrorState} message=${view.error} onRetry=${reload} />`
|
|
720
906
|
: html`<section class="card"><h3>${ho("pairSteps")}</h3><${Skeleton} variant="rows" lines=${3} /></section><section class="card"><${Skeleton} variant="rows" lines=${3} /></section>`}</div></div>`;
|
|
721
907
|
const fleets = view.fleets || [], pairings = view.pairings || [];
|
|
722
|
-
return html`<div class="col hub-owner hub-admin"
|
|
908
|
+
return html`<div class="col hub-owner hub-admin">${lead}
|
|
723
909
|
<div class="s-section-layout">
|
|
910
|
+
${groups ? html`<${GroupPermissionsEntry} />` : null}
|
|
911
|
+
${companyJoin ? html`<${CompanyJoinAdminCard} />` : null}
|
|
724
912
|
${view.error ? html`<${ErrorState} message=${view.error} onRetry=${reload} />` : null}
|
|
725
913
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
726
914
|
<section class="card"><h3>${ho("pairSteps")}</h3>
|
|
727
915
|
<ol class="hub-steps">
|
|
728
916
|
<li class=${offer || pairings.length ? "done" : "now"}><div class="hub-step-body"><span><b>${ho("stepCode")}</b><small class="note">${ho("stepCodeHint")}</small></span>
|
|
729
|
-
<form class="hub-step-form" onSubmit=${create}><label class="field"><span class="sr-only">${ho("ownerLogin")}</span><input placeholder=${ho("ownerLogin")} autocomplete="off" spellcheck=${false} autocapitalize="none" value=${login} onInput=${(e) => setLogin(e.target.value)} /></label>
|
|
730
|
-
<button type="submit" class="btn btn-sm"
|
|
917
|
+
<form class="hub-step-form" onSubmit=${create}><label class="field"><span class="sr-only">${ho("ownerLogin")}</span><input id="hubOwnerLogin" placeholder=${ho("ownerLogin")} autocomplete="off" spellcheck=${false} autocapitalize="none" value=${login} onInput=${(e) => setLogin(e.target.value)} /></label>
|
|
918
|
+
<button type="submit" class="btn btn-sm btn-primary">${ho("makeCode")}</button></form>
|
|
731
919
|
${offer ? html`<div class="hub-offer" role="status"><small class="note">${ho("codeFor", offer.login)}</small><code class="hub-code">${offer.code}</code><small class="note">${hw("expires", when(offer.expiresAt))}</small>
|
|
732
920
|
${offer.memberOrigin ? html`<div class="field"><span>${ho("memberAddress")}</span><span class="hub-origin"><code>${offer.memberOrigin}</code></span><small class="note">${ho("memberAddressHint")}</small></div>
|
|
733
921
|
<button type="button" class="btn btn-sm" onClick=${async () => { const ok = await copyText(`${ho("memberAddress")}: ${offer.memberOrigin}\n${ho("codeFor", offer.login)}: ${offer.code}\n${hw("expires", when(offer.expiresAt))}`); toast(ho(ok ? "handoffCopied" : "handoffCopyFailed"), !ok); }}><${Icon} name="copy" size=${14} />${ho("copyHandoff")}</button>`
|
|
@@ -752,6 +940,7 @@ function HubAdminPage() {
|
|
|
752
940
|
: html`<span class="tag">${ho("revokedTag")}</span>`}
|
|
753
941
|
</div>`)}</div>` : html`<p class="note">${ho("noFleets")}</p>`}
|
|
754
942
|
</section>
|
|
943
|
+
<${LazyThisHub} />
|
|
755
944
|
</div></div>`;
|
|
756
945
|
}
|
|
757
946
|
|
package/dist/ui/panel-needs.js
CHANGED
|
@@ -72,7 +72,7 @@ register("needs", {
|
|
|
72
72
|
notifyInsecure: "通知需要安全的網址(localhost 或 HTTPS 公開連結),區網的一般 HTTP 網址不行。",
|
|
73
73
|
notifyUnsupported: "這個瀏覽器無法顯示通知。", turnOn: "開啟", turnOff: "關閉",
|
|
74
74
|
typePrompt: "Fleet 提示", typeAwaiting: "在終端機上", typeInstance: "Instance", typeDelivery: "傳送", typeMissed: "離線時錯過",
|
|
75
|
-
proposals: "
|
|
75
|
+
proposals: "Agent 的請求", proposalFrom: "{0} 的請求", proposalHint: "在你核准之前,不會建立或修改任何東西。核准時,AgEnD 會再次檢查這個請求、目標電腦和你的登入,然後只執行一次。",
|
|
76
76
|
approve: "核准", reject: "拒絕", deciding: "處理中…", expiresIn: "{0} 分鐘後過期", expiresSoon: "不到一分鐘後過期",
|
|
77
77
|
applying: "正在套用…", openAgent: "開啟新 agent 的聊天", decided: "已在這裡決定", failedReason: "原因:{0}",
|
|
78
78
|
f_runtime: "執行於", f_machine: "電腦", f_thisPc: "這台電腦(Windows)", f_topic_name: "名稱", f_backend: "CLI", f_model: "模型", f_directory: "資料夾",
|
|
@@ -27,6 +27,7 @@ import { toast } from "/assets/ui-toast.js";
|
|
|
27
27
|
import { GroupMark, groupLabel, groupOf as navGroupOf, modelText } from "/assets/instance-nav.js";
|
|
28
28
|
import "./settings-strings.js";
|
|
29
29
|
import "./settings-shared-strings.js"; // see settings-shared.js: the words Shared agent settings added, which an older settings-strings.js in an open tab lacks
|
|
30
|
+
import "./settings-restart-strings.js"; // S-92: the restart words for a fleet with no chat connection (a file of its own: an open tab may hold an old settings-strings.js)
|
|
30
31
|
import "./settings-access-strings.js"; // the words Access & security added (settings.webLoginQr…): an older settings-strings.js from a tab that visited Fleet first lacks them (#3061)
|
|
31
32
|
import { api, attach, confirmedWrite, newKey } from "./settings-confirm.js";
|
|
32
33
|
import { dismissOperation, operationActive, restartFleet, startOperation, takeLeftover } from "./settings-apply.js";
|
|
@@ -420,7 +421,7 @@ export function SettingsPanel({ route, navKey }) {
|
|
|
420
421
|
: section === "web-dashboard" ? html`<${WebSection} key=${formKey} ctx=${ctx} staged=${staged} part="dashboard" /><${AppearanceSection} ...${you} part="dashboard" />`
|
|
421
422
|
: section === "access" ? html`<${WebSection} key=${formKey} ctx=${ctx} staged=${staged} part="access" />`
|
|
422
423
|
// alpha.6 feedback (#2): the Hub cards have their own section (they were under Access & security, unfound by search).
|
|
423
|
-
: section === "hub" ? html`<${HubSection} overPublicLink=${typeof document !== "undefined" && document.body?.dataset?.publicLink === "1"} hubHost=${!!ctx.fleet.hub?.hubId} />`
|
|
424
|
+
: section === "hub" ? html`<${HubSection} overPublicLink=${typeof document !== "undefined" && document.body?.dataset?.publicLink === "1"} hubHost=${!!ctx.fleet.hub?.hubId} hubOrigin=${ctx.fleet.hub?.webOrigin} />`
|
|
424
425
|
: html`<${AdvancedSettings} ctx=${ctx} staged=${staged} formKey=${formKey} draftEpoch=${draftEpoch} />`;
|
|
425
426
|
// #2347 §6: the setting a search result opened — brought into view once its section is drawn (its data may still be
|
|
426
427
|
// on its way), focused, and flashed for 2 s.
|
|
@@ -1402,7 +1403,7 @@ function WebSection({ ctx, staged, part = "all" }) {
|
|
|
1402
1403
|
</section>`)}
|
|
1403
1404
|
${!overPublicLink ? html`<${WebAuthorityCard} ctx=${ctx} staged=${staged} />` : null}
|
|
1404
1405
|
${/* A tab whose shell is from before Settings → Hub (its app-route.js has no "hub"): the Hub cards stay here. */ ""}
|
|
1405
|
-
${!SETTINGS_SECTIONS.includes("hub") ? html`<${HubSection} overPublicLink=${overPublicLink} hubHost=${!!ctx.fleet.hub?.hubId} />` : null}
|
|
1406
|
+
${!SETTINGS_SECTIONS.includes("hub") ? html`<${HubSection} overPublicLink=${overPublicLink} hubHost=${!!ctx.fleet.hub?.hubId} hubOrigin=${ctx.fleet.hub?.webOrigin} />` : null}
|
|
1406
1407
|
<details class="drawer s-terminal-disclosure"><summary>${tn("webTerminalTitle")}</summary><div class="drawer-body">${lock(html`<section class="card s-access-terminal"><h3>${tn("webTerminalTitle")}</h3>
|
|
1407
1408
|
<p class="note">${tn("webTerminalHint")}</p>
|
|
1408
1409
|
<label class=${fc("check", "termOn")}><input id="webTerminalEnabled" type="checkbox" checked=${f.termOn} onChange=${(e) => set("termOn")(e.target.checked)} /><span>${tn("webTerminalEnabled")}</span><${Impact} schema=${schema} field="web_terminal.enabled" /></label>
|
|
@@ -1574,17 +1575,19 @@ function OperationCard({ op, schema }) {
|
|
|
1574
1575
|
const needsRestart = rows.some((r) => r.status === "restart-required");
|
|
1575
1576
|
const failedRows = rows.some((r) => r.status === "failed");
|
|
1576
1577
|
const mismatch = schema && schema.fleet_signature_mismatch;
|
|
1578
|
+
// S-92: a fleet with no chat connection — its restart is recorded in the dashboard's Notices, not a chat channel.
|
|
1579
|
+
const webOnly = useStore(appStore).connections === 0;
|
|
1577
1580
|
const title = op.phase === "failed" ? tn("applyPartial") : fleetRestarting ? tn("restartFleetTitle") : busy ? tn("applying")
|
|
1578
1581
|
: failedRows ? tn("applyPartial") : needsRestart ? tn("applyRestartNeeded") : tn("applyDone");
|
|
1579
1582
|
const note = op.phase === "failed" ? (op.error === "busy" ? tn("applyBusy") : op.error ? tn("applyStepFailed", applyErrorText(op.error)) : "")
|
|
1580
1583
|
: fleetRestarting ? tn("restartFleetWaiting") : op.lostJob ? tn("applyLostJob")
|
|
1581
1584
|
: job && job.overdue ? tn("applyStillWorking", Math.round((job.elapsed_ms || 0) / 1000))
|
|
1582
|
-
: mismatch && needsRestart ? tn("signatureMismatch", mismatch.join(", ")) : needsRestart ? tn("applyRestartHint") : "";
|
|
1585
|
+
: mismatch && needsRestart ? tn("signatureMismatch", mismatch.join(", ")) : needsRestart ? tn(webOnly ? "applyRestartHintWebOnly" : "applyRestartHint") : "";
|
|
1583
1586
|
const lease = useLease("operation-card");
|
|
1584
1587
|
const restart = async () => {
|
|
1585
1588
|
// The yes is for the job this card shows: it restarts AgEnD for that job only, and only while the card stands.
|
|
1586
1589
|
const forJob = { opId: op.id, jobId: op.job && op.job.id };
|
|
1587
|
-
if (!(await ask(tn("restartFleetConfirm"), { title: tn("restartFleetButton"), confirmLabel: tn("restartFleetButton"), danger: true }))) return;
|
|
1590
|
+
if (!(await ask(tn(webOnly ? "restartFleetConfirmWebOnly" : "restartFleetConfirm"), { title: tn("restartFleetButton"), confirmLabel: tn("restartFleetButton"), danger: true }))) return;
|
|
1588
1591
|
if (!lease.current()) return;
|
|
1589
1592
|
setRestarting(true);
|
|
1590
1593
|
const res = await restartFleet(forJob);
|
|
@@ -213,12 +213,16 @@ async function watch(o, id) {
|
|
|
213
213
|
* A full AgEnD restart for a job that needs one: its own confirmation (the caller's), its own key, one at a time. The
|
|
214
214
|
* job's fleet row moves to "running" on the server; that job is watched again.
|
|
215
215
|
*/
|
|
216
|
-
/**
|
|
216
|
+
/**
|
|
217
|
+
* POST /api/settings/restart-fleet for `jobId`, with its own key: { ok, status, body } (a lost answer: status 0). `jobId`
|
|
218
|
+
* null (S-92): the pending changes' own restart, when no Settings job carries it (a hand edit) — the server makes one.
|
|
219
|
+
* The confirmation is this request's value; the person only clicks (and answers the restart's own dialog).
|
|
220
|
+
*/
|
|
217
221
|
async function postRestart(jobId) {
|
|
218
222
|
const key = newKey("restart");
|
|
219
223
|
try {
|
|
220
224
|
return await api("/api/settings/restart-fleet", { method: "POST", headers: { "Idempotency-Key": key },
|
|
221
|
-
body: JSON.stringify({ job_id: jobId, confirm: "restart-agend", idempotency_key: key }) });
|
|
225
|
+
body: JSON.stringify({ ...(jobId ? { job_id: jobId } : { pending: true }), confirm: "restart-agend", idempotency_key: key }) });
|
|
222
226
|
} catch { return { ok: false, status: 0, body: null }; }
|
|
223
227
|
}
|
|
224
228
|
|
|
@@ -247,11 +251,14 @@ export async function restartFleet(forJob) {
|
|
|
247
251
|
* become the operation, so its card and line follow the restart as they follow any other (a refusal leaves the banner
|
|
248
252
|
* as it was). The caller asked first.
|
|
249
253
|
*/
|
|
250
|
-
export async function restartPendingChanges(
|
|
254
|
+
export async function restartPendingChanges(asked) {
|
|
251
255
|
if (operationActive()) return { ok: false, busy: true };
|
|
252
|
-
if (op && op.job && op.job.id ===
|
|
253
|
-
const res = await postRestart(
|
|
256
|
+
if (asked && op && op.job && op.job.id === asked) return restartFleet({ opId: op.id, jobId: asked });
|
|
257
|
+
const res = await postRestart(asked || null);
|
|
254
258
|
if (!res.ok || operationActive()) return res;
|
|
259
|
+
// The job that carries it: the one asked for, or (S-92) the one the server made for it.
|
|
260
|
+
const jobId = asked || (res.body && typeof res.body.job_id === "string" ? res.body.job_id : null);
|
|
261
|
+
if (!jobId) return res;
|
|
255
262
|
toast(t("settings.restartFleetStarted"));
|
|
256
263
|
let fresh = null;
|
|
257
264
|
try { fresh = await api(`/api/settings/apply/${encodeURIComponent(jobId)}`); } catch { fresh = null; }
|
|
@@ -45,7 +45,7 @@ register("devices", {
|
|
|
45
45
|
signOutOwnerOnly: "Only a device whose owner is verified can sign out another device.",
|
|
46
46
|
signOutTitle: "Sign out this device?", signOutLead: "{0} will have to sign in again.", signOutGo: "Sign out",
|
|
47
47
|
signedOut: "{0} was signed out.", alreadyGone: "That device is already signed out.",
|
|
48
|
-
notSaved: "Signed out for now, but the change could not be saved: a restart may bring the session back.
|
|
48
|
+
notSaved: "Signed out for now, but the change could not be saved: a restart may bring the session back. This page cannot repair session storage.",
|
|
49
49
|
authorityOff: "Web authorization is off, so no device is the owner: none can add a device or sign another one out.",
|
|
50
50
|
},
|
|
51
51
|
"zh-TW": {
|
|
@@ -71,7 +71,7 @@ register("devices", {
|
|
|
71
71
|
signOutOwnerOnly: "只有已驗證擁有者的裝置才能登出其他裝置。",
|
|
72
72
|
signOutTitle: "登出這台裝置?", signOutLead: "{0} 需要重新登入。", signOutGo: "登出",
|
|
73
73
|
signedOut: "已登出 {0}。", alreadyGone: "這台裝置已經登出了。",
|
|
74
|
-
notSaved: "
|
|
74
|
+
notSaved: "暫時登出了,但變更沒能儲存:重新啟動後這個工作階段可能會回來。這個頁面無法修復工作階段的儲存問題。",
|
|
75
75
|
authorityOff: "網頁授權已關閉,所以沒有任何裝置是擁有者:不能新增裝置,也不能登出其他裝置。",
|
|
76
76
|
},
|
|
77
77
|
});
|
|
@@ -36,6 +36,8 @@ const CODEX_SPEED_CHOICES = ["", "standard", "fast"];
|
|
|
36
36
|
const byId = (id) => (typeof document !== "undefined" ? document.getElementById(id) : null);
|
|
37
37
|
|
|
38
38
|
const tn = (k, ...v) => t(`settings.${k}`, ...v);
|
|
39
|
+
// A cached older dictionary keeps the old alias label until reload, never a missing translation key.
|
|
40
|
+
const legacyPairingLabel = () => { const label = tn("legacyPairing"); return label === "settings.legacyPairing" ? "pairing" : label; };
|
|
39
41
|
export const impactText = (kind) => tn(kind === "now" ? "impactNow" : kind === "fleet" ? "impactFleet" : "impactAgent");
|
|
40
42
|
/** Ask in the app's own dialog (#1408 step 5): resolves true for the confirm button, false otherwise. */
|
|
41
43
|
export const ask = (message, opts = {}) => confirmDialog({ message, ...opts });
|
|
@@ -544,7 +546,7 @@ export function BotDialog({ id, ctx, onClose }) {
|
|
|
544
546
|
if (!ch) return null;
|
|
545
547
|
return html`<${EditDialog} title=${type === "telegram" ? "Telegram" : "Discord"} subtitle=${id} onClose=${onClose} onStage=${stage} impacts=${pendingImpacts()} schema=${schema}>
|
|
546
548
|
<div class="grid2">
|
|
547
|
-
<div class="field">${L(tn("accessMode"), "fleet.channel.access.mode", "bot-mode")}<${Select} id="bot-mode" value=${mode} onChange=${setMode} options=${ACCESS_MODES} />
|
|
549
|
+
<div class="field">${L(tn("accessMode"), "fleet.channel.access.mode", "bot-mode")}<${Select} id="bot-mode" value=${mode} onChange=${setMode} options=${ACCESS_MODES.map((value) => value === "pairing" ? { value, label: legacyPairingLabel() } : value)} />
|
|
548
550
|
<${Feedback} warning=${accessWarn} /></div>
|
|
549
551
|
<div class="field">${L(tn("allowedUsers"), "fleet.channel.access.allowed_users")}<${ChipList} items=${users} onChange=${setUsers} placeholder=${tn("userIdPlaceholder")} label=${tn("allowedUsers")} /></div>
|
|
550
552
|
</div>
|