@songsid/agend 2.4.0-beta.7 → 2.4.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-api.js +1 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/antigravity.d.ts +9 -2
- package/dist/backend/antigravity.js +24 -6
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/cli-env-probe.js +1 -1
- package/dist/backend/cli-env-probe.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/daemon.d.ts +13 -0
- package/dist/daemon.js +64 -1
- package/dist/daemon.js.map +1 -1
- package/dist/dispatcher-liveness.d.ts +51 -1
- package/dist/dispatcher-liveness.js +92 -2
- package/dist/dispatcher-liveness.js.map +1 -1
- package/dist/fleet-manager.d.ts +55 -0
- package/dist/fleet-manager.js +232 -16
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +6 -0
- package/dist/hub/catalog.d.ts +6 -4
- package/dist/hub/catalog.js +14 -7
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/group-policy/admin-impact.d.ts +32 -3
- package/dist/hub/group-policy/admin-impact.js +14 -2
- package/dist/hub/group-policy/admin-impact.js.map +1 -1
- package/dist/hub/group-policy/impact-inventory.d.ts +1 -1
- package/dist/hub/group-policy/impact-inventory.js.map +1 -1
- package/dist/hub/http/compose.js +70 -6
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.js +3 -0
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +1 -0
- package/dist/hub/join/service.d.ts +1 -1
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/mcp/auth-schema.d.ts +7 -0
- package/dist/hub/mcp/auth-schema.js +31 -0
- package/dist/hub/mcp/auth-schema.js.map +1 -0
- package/dist/hub/mcp/auth.d.ts +86 -0
- package/dist/hub/mcp/auth.js +364 -0
- package/dist/hub/mcp/auth.js.map +1 -0
- package/dist/hub/personal/owner-host.d.ts +64 -0
- package/dist/hub/personal/owner-host.js +190 -0
- package/dist/hub/personal/owner-host.js.map +1 -0
- package/dist/hub/personal/schema.d.ts +2 -0
- package/dist/hub/personal/schema.js +48 -0
- package/dist/hub/personal/schema.js.map +1 -0
- package/dist/hub/personal/types.d.ts +42 -0
- package/dist/hub/personal/types.js +2 -0
- package/dist/hub/personal/types.js.map +1 -0
- package/dist/hub/policy.js +2 -0
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/quota.js +3 -1
- package/dist/hub/quota.js.map +1 -1
- package/dist/hub/roles/admin-control.d.ts +29 -0
- package/dist/hub/roles/admin-control.js +134 -0
- package/dist/hub/roles/admin-control.js.map +1 -0
- package/dist/hub/roles/admin-types.d.ts +49 -0
- package/dist/hub/roles/admin-types.js +2 -0
- package/dist/hub/roles/admin-types.js.map +1 -0
- package/dist/hub/roles/resource-effects.d.ts +16 -0
- package/dist/hub/roles/resource-effects.js +62 -0
- package/dist/hub/roles/resource-effects.js.map +1 -0
- package/dist/hub/roles/writer.d.ts +6 -1
- package/dist/hub/roles/writer.js +10 -2
- package/dist/hub/roles/writer.js.map +1 -1
- package/dist/hub/rooms/agents.js +5 -2
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms.d.ts +1 -1
- package/dist/hub/rooms.js +12 -8
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/sessions.js +20 -2
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/sharing.js +2 -2
- package/dist/hub/sharing.js.map +1 -1
- package/dist/hub/types.d.ts +15 -3
- package/dist/locale.js +3 -0
- package/dist/locale.js.map +1 -1
- package/dist/native-model-catalog.d.ts +15 -0
- package/dist/native-model-catalog.js +43 -3
- package/dist/native-model-catalog.js.map +1 -1
- package/dist/runtime-build-info.js +1 -0
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli.js +31 -5
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.d.ts +5 -0
- package/dist/runtime-client-store.js +28 -0
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.d.ts +4 -0
- package/dist/runtime-client.js +33 -10
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +4 -2
- package/dist/runtime-coordinator.js +28 -6
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-install.d.ts +3 -0
- package/dist/runtime-install.js +7 -1
- package/dist/runtime-install.js.map +1 -1
- package/dist/runtime-personal-answer.d.ts +1 -0
- package/dist/runtime-personal-answer.js +2 -1
- package/dist/runtime-personal-answer.js.map +1 -1
- package/dist/runtime-personal-preflight.d.ts +5 -0
- package/dist/runtime-personal-preflight.js +57 -0
- package/dist/runtime-personal-preflight.js.map +1 -0
- package/dist/runtime-personal-profile.d.ts +3 -1
- package/dist/runtime-personal-profile.js +13 -4
- package/dist/runtime-personal-profile.js.map +1 -1
- package/dist/runtime-personal-protocol.d.ts +7 -0
- package/dist/runtime-personal-protocol.js +11 -0
- package/dist/runtime-personal-protocol.js.map +1 -0
- package/dist/runtime-personal-stage.d.ts +36 -0
- package/dist/runtime-personal-stage.js +163 -0
- package/dist/runtime-personal-stage.js.map +1 -0
- package/dist/runtime-protocol.d.ts +2 -0
- package/dist/ui/chat-store.js +39 -2
- package/dist/ui/hub-client.js +14 -0
- package/dist/ui/hub-roles-strings.js +15 -0
- package/dist/ui/hub-roles.js +48 -0
- package/dist/ui/hub-switcher.js +2 -2
- package/dist/ui/hub-this-hub.js +2 -2
- package/dist/ui/model-picker.js +4 -1
- package/dist/ui/panel-hub.js +15 -9
- package/dist/ui/panel-settings.js +2 -3
- package/dist/ui/settings-catalog.js +22 -0
- package/dist/ui/settings-hub-setup.js +2 -1
- package/dist/ui/settings-strings.js +2 -0
- package/dist/ui/shared/app-shell.js +19 -7
- package/dist/ui/shared/app-stream.js +3 -1
- package/dist/ui/shared/app.css +18 -8
- package/dist/ui/shared/hub-roles.css +27 -0
- package/dist/ui/shared/hub.css +11 -3
- package/dist/ui/shared/usage-dialog.js +67 -12
- package/dist/ui/shared/view-strings.js +8 -0
- package/dist/web-api.d.ts +4 -0
- package/dist/web-api.js +39 -23
- package/dist/web-api.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +7 -0
- package/dist/windows-cli-worker.js +80 -14
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +9 -1
- package/dist/windows-cli.js +43 -13
- package/dist/windows-cli.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Role settings use one checked policy proposal; browser flags are presentation only. */
|
|
2
|
+
import {html,useEffect,useRef,useState} from "/assets/app-html.js";
|
|
3
|
+
import {hr,linkRoleCss} from "./hub-roles-strings.js";
|
|
4
|
+
const copy=value=>structuredClone(value),key=person=>`${person?.realm}/${person?.objectId}`;
|
|
5
|
+
const management=["fleets.manage","join.manage","roles.assign","audit.view","hub.admin"];
|
|
6
|
+
const approvals=["team.approve_join","team.approve_ask"];
|
|
7
|
+
const name=role=>["admin","manager","member"].includes(role.kind)?hr(role.kind):role.name;
|
|
8
|
+
const error=out=>["denied","self-target"].includes(out?.code)?hr("denied"):["expired","stale-preview","conflict"].includes(out?.code)?hr("stale"):out?.code==="invalid"?hr("invalid"):hr("failed");
|
|
9
|
+
|
|
10
|
+
function Search({client,kind,onPick}){
|
|
11
|
+
const [q,setQ]=useState(""),[rows,setRows]=useState([]),[busy,setBusy]=useState(false),[failure,setFailure]=useState(null),epoch=useRef(0);
|
|
12
|
+
useEffect(()=>()=>{epoch.current++;},[client,kind]);
|
|
13
|
+
const search=async()=>{if(q.trim().length<2||busy)return;const mine=++epoch.current;setBusy(true);setFailure(null);let out;try{out=await client.roleSearch(kind,q.trim());}catch{out={ok:false};}if(mine!==epoch.current)return;setBusy(false);if(out.ok)setRows(out.candidates||[]);else setFailure(error(out));};
|
|
14
|
+
return html`<div class="hub-role-search"><label class="field"><span>${hr(kind)}</span><input value=${q} maxlength="64" placeholder=${hr("query")} onInput=${e=>{epoch.current++;setQ(e.target.value);setRows([]);setBusy(false);}} onKeyDown=${e=>{if(e.key==="Enter"){e.preventDefault();void search();}}}/></label><button type="button" class="btn" disabled=${busy||q.trim().length<2} onClick=${search}>${hr("search")}</button>${failure?html`<p role="alert" class="err">${failure}</p>`:null}<ul class="hub-role-list">${rows.map(row=>html`<li key=${key(row.key)}><span class="grow">${row.name}${row.login?html`<small class="note"> · ${row.login}</small>`:null}</span><button type="button" class="btn" onClick=${()=>{epoch.current++;onPick(row);setRows([]);setQ("");}}>${hr("choose")}</button></li>`)}</ul></div>`;
|
|
15
|
+
}
|
|
16
|
+
function RoleEditor({view,role,onCheck,onCancel,busy}){
|
|
17
|
+
const [quota,setQuota]=useState(String(role.defaultMaxFleets));const [draft,setDraft]=useState(()=>copy(role));const locked=role.kind==="admin"||!view.management.includes("hub.admin");
|
|
18
|
+
const save=e=>{e.preventDefault();if(locked||!draft.name.trim()||quota===""||!Number.isInteger(Number(quota))||Number(quota)<0||Number(quota)>8)return;const checkedRole={...draft,defaultMaxFleets:Number(quota)};const next=copy(view.policy),at=next.roles.findIndex(r=>r.id===draft.id);if(at<0)next.roles.push(checkedRole);else next.roles[at]=checkedRole;onCheck(next);};
|
|
19
|
+
return html`<form class="card hub-role-editor" onSubmit=${save}><h3>${name(role)}</h3><label class="field"><span>${hr("name")}</span><input required maxlength="100" value=${draft.name} disabled=${busy||locked} onInput=${e=>setDraft({...draft,name:e.target.value})}/></label><fieldset><legend>${hr("permissions")}</legend>${view.permissions.map(permission=>html`<label class="hub-role-check" key=${permission}><input type="checkbox" checked=${draft.permissions.includes(permission)} disabled=${busy||locked||permission==="hub.admin"||approvals.includes(permission)} onChange=${e=>setDraft({...draft,permissions:e.target.checked?[...draft.permissions,permission]:draft.permissions.filter(p=>p!==permission)})}/><span>${hr(permission)}${approvals.includes(permission)?html`<small class="note"> · ${hr("later")}</small>`:null}${permission==="hub.admin"?html`<small class="note"> · ${hr("locked")}</small>`:null}</span></label>`)}</fieldset><label class="field"><span>${hr("quota")}</span><input type="number" min="0" max="8" step="1" required value=${quota} disabled=${busy||locked} onInput=${e=>setQuota(e.target.value)}/></label><div class="hub-role-actions"><button type="submit" class="btn btn-primary" disabled=${busy||locked||!draft.name.trim()||quota===""||!Number.isInteger(Number(quota))||Number(quota)<0||Number(quota)>8}>${hr("preview")}</button>${role.kind==="custom"?html`<button type="button" class="btn btn-danger" disabled=${busy||locked} onClick=${()=>{const next=copy(view.policy);next.roles=next.roles.filter(r=>r.id!==role.id);next.assignments=next.assignments.filter(a=>a.roleId!==role.id);onCheck(next);}}>${hr("delete")}</button>`:null}<button type="button" class="btn" disabled=${busy} onClick=${onCancel}>${hr("cancel")}</button></div></form>`;
|
|
20
|
+
}
|
|
21
|
+
const inputDate=at=>at?new Date(at-new Date(at).getTimezoneOffset()*60000).toISOString().slice(0,16):"";
|
|
22
|
+
function AssignmentEditor({view,assignment=null,onCheck,onCancel,busy}){
|
|
23
|
+
const original=assignment&&typeof assignment==="object"?assignment:null;
|
|
24
|
+
const selected=original?.subject,initial=selected?(selected.kind==="person"?{kind:"person",key:selected.person,name:key(selected.person)}:{kind:"group",key:selected.group,name:selected.dn,dn:selected.dn}):null;
|
|
25
|
+
const [roleId,setRoleId]=useState(original?.roleId||view.policy.roles[0]?.id||""),[kind,setKind]=useState(selected?.kind||"person"),[subject,setSubject]=useState(initial),[scope,setScope]=useState(original?.scope.kind==="group"?{key:original.scope.group,name:original.scope.dn,dn:original.scope.dn}:null),[whole,setWhole]=useState(original?.scope.kind==="hub"),[expiry,setExpiry]=useState(inputDate(original?.expiresAt)),[start,setStart]=useState(inputDate(original?.startsAt)),[limit,setLimit]=useState(original?.maxFleets==null?"":String(original.maxFleets));
|
|
26
|
+
const role=view.policy.roles.find(r=>r.id===roleId),adminRole=role?.permissions.some(p=>management.includes(p)),teamRole=role?.permissions.some(p=>p.startsWith("team."));
|
|
27
|
+
const startsAt=start?new Date(start).getTime():0,expiresAt=expiry?new Date(expiry).getTime():null;
|
|
28
|
+
const valid=subject&&(!adminRole||subject.kind==="person")&&(!teamRole||adminRole||whole&&view.management.includes("hub.admin")||scope)&&Number.isFinite(startsAt)&&(expiresAt===null||Number.isFinite(expiresAt)&&expiresAt>startsAt)&&(limit===""||Number.isInteger(Number(limit))&&Number(limit)>=0&&Number(limit)<=8);
|
|
29
|
+
const save=e=>{e.preventDefault();if(!valid||busy)return;const next=copy(view.policy);const replacement={id:original?.id||`assignment:${crypto.randomUUID()}`,roleId,subject:subject.kind==="person"?{kind:"person",person:subject.key}:{kind:"group",group:subject.key,dn:subject.dn},scope:!teamRole||adminRole||whole?{kind:"hub"}:{kind:"group",group:scope.key,dn:scope.dn},maxFleets:limit===""?null:Number(limit),startsAt,expiresAt,assignedBy:original?.assignedBy||view.actor,assignedAt:original?.assignedAt||0};if(original)next.assignments=next.assignments.map(row=>row.id===original.id?replacement:row);else next.assignments.push(replacement);onCheck(next);};
|
|
30
|
+
return html`<form class="card hub-role-assignment" onSubmit=${save}><h3>${hr("assign")}</h3><label class="field"><span>${hr("role")}</span><select value=${roleId} disabled=${busy} onChange=${e=>setRoleId(e.target.value)}>${view.policy.roles.map(r=>html`<option key=${r.id} value=${r.id}>${name(r)}</option>`)}</select></label><label class="field"><span>${hr("subject")}</span><select value=${kind} disabled=${busy} onChange=${e=>{setKind(e.target.value);setSubject(null);}}><option value="person">${hr("person")}</option><option value="group" disabled=${adminRole}>${hr("group")}</option></select></label>${adminRole?html`<p class="note">${hr("personOnly")}</p>`:null}${kind==="group"?html`<p class="note">${hr("groupCost")}</p>`:null}<p>${subject?.name||hr("none")}</p><${Search} key=${kind} client=${view.client} kind=${kind} onPick=${setSubject}/>${teamRole&&!adminRole?html`<label class="field"><span>${hr("scope")}</span><select value=${whole?"hub":"group"} disabled=${busy} onChange=${e=>setWhole(e.target.value==="hub")}><option value="group">${hr("scopeGroup")}</option><option value="hub" disabled=${!view.management.includes("hub.admin")}>${hr("wholeHub")}</option></select></label>${!whole?html`<p>${scope?.name||hr("none")}</p><${Search} client=${view.client} kind="group" onPick=${setScope}/>`:null}`:null}<label class="field"><span>${hr("start")}</span><input type="datetime-local" value=${start} disabled=${busy} onInput=${e=>setStart(e.target.value)}/></label><label class="field"><span>${hr("expiry")}</span><input type="datetime-local" value=${expiry} disabled=${busy} onInput=${e=>setExpiry(e.target.value)}/></label>${role?.permissions.includes("pair_fleet")?html`<label class="field"><span>${hr("override")} · ${hr("quota")}: ${role.defaultMaxFleets}</span><input type="number" min="0" max="8" step="1" value=${limit} disabled=${busy} onInput=${e=>setLimit(e.target.value)}/></label>`:null}<div class="hub-role-actions"><button type="submit" class="btn btn-primary" disabled=${busy||!valid}>${hr("preview")}</button><button type="button" class="btn" disabled=${busy} onClick=${onCancel}>${hr("cancel")}</button></div></form>`;
|
|
31
|
+
}
|
|
32
|
+
export function HubRoles({client}){
|
|
33
|
+
const [styled,setStyled]=useState(null),[styleRetry,setStyleRetry]=useState(0);useEffect(()=>{let live=true;linkRoleCss().then(value=>{if(live)setStyled(value);});return()=>{live=false;};},[styleRetry]);
|
|
34
|
+
const [view,setView]=useState(null),[failure,setFailure]=useState(null),[busy,setBusy]=useState(false),[editor,setEditor]=useState(null),[checked,setChecked]=useState(null),[saved,setSaved]=useState(false),[audit,setAudit]=useState(null),[auditError,setAuditError]=useState(null),[reload,setReload]=useState(0),[notices,setNotices]=useState([]);const epoch=useRef(0),writing=useRef(false);
|
|
35
|
+
useEffect(()=>{let live=true;const mine=++epoch.current;setChecked(null);Promise.resolve().then(()=>client.roles()).then(out=>{if(!live||mine!==epoch.current)return;if(out.ok){setView(out.view);setFailure(null);if(out.view.management.includes("hub.admin")&&client.roleNotices)Promise.resolve(client.roleNotices()).then(n=>{if(live&&mine===epoch.current&&n.ok)setNotices(n.notices||[]);},()=>{});}else setFailure(error(out));},()=>{if(live&&mine===epoch.current)setFailure(hr("failed"));});Promise.resolve().then(()=>client.roleAudit()).then(out=>{if(!live||mine!==epoch.current)return;if(out.ok){setAudit(out);setAuditError(null);}else if(out.status!==403)setAuditError(hr("auditFailed"));},()=>{if(live&&mine===epoch.current)setAuditError(hr("auditFailed"));});const end=client.onSignedOut?.(()=>{epoch.current++;setView(null);setChecked(null);setEditor(null);setNotices([]);writing.current=false;setBusy(false);setFailure(hr("denied"));});return()=>{live=false;epoch.current++;end?.();};},[client,reload]);
|
|
36
|
+
const preview=async(policy,rootSelf=false)=>{if(writing.current)return;writing.current=true;setBusy(true);setFailure(null);setSaved(false);setChecked(null);const mine=++epoch.current;let out;try{out=rootSelf?await client.roleRootPreview():await client.rolePreview(policy);}catch{out={ok:false};}if(mine!==epoch.current)return;writing.current=false;setBusy(false);if(out.ok)setChecked({policy,rootSelf,...out});else setFailure(error(out));};
|
|
37
|
+
const apply=async()=>{if(!checked||writing.current)return;writing.current=true;setBusy(true);setFailure(null);const mine=++epoch.current;let out;try{out=checked.rootSelf?await client.roleRootApply(checked.previewDigest):await client.roleApply(checked.policy,checked.previewDigest);}catch{out={ok:false};}if(mine!==epoch.current)return;writing.current=false;setBusy(false);if(out.ok){setChecked(null);setEditor(null);setSaved(true);setReload(n=>n+1);}else{setChecked(null);setFailure(error(out));}};
|
|
38
|
+
const more=async()=>{if(!audit?.nextCursor||busy)return;setBusy(true);const mine=epoch.current;let out;try{out=await client.roleAudit(audit.nextCursor);}catch{out={ok:false};}if(mine!==epoch.current)return;setBusy(false);if(out.ok)setAudit({...out,rows:[...audit.rows,...out.rows]});else setAuditError(hr("auditFailed"));};
|
|
39
|
+
const acknowledge=async id=>{if(busy)return;setBusy(true);const mine=epoch.current;let out;try{out=await client.acknowledgeRoleNotice(id);}catch{out={ok:false};}if(mine!==epoch.current)return;setBusy(false);if(out.ok)setNotices(rows=>rows.filter(row=>row.id!==id));else setFailure(error(out));};
|
|
40
|
+
const isRoot=view&&key(view.actor)===key(view.root),canEdit=view?.management.includes("hub.admin"),canAssign=view?.management.includes("roles.assign");
|
|
41
|
+
if(!styled)return html`<section class="card"><p role="status">${hr(styled===false?"styleFailed":"styleLoading")}</p>${styled===false?html`<button type="button" class="btn" onClick=${()=>{setStyled(null);setStyleRetry(n=>n+1);}}>${hr("retry")}</button>`:null}</section>`;
|
|
42
|
+
return html`<div class="hub-roles"><p class="s-page-lead hub-page-lead">${hr("lead")}</p>${failure?html`<p role="alert" class="err">${failure}</p><button type="button" class="btn" disabled=${busy} onClick=${()=>setReload(n=>n+1)}>${hr("retry")}</button>`:null}${saved?html`<p role="status">${hr("saved")}</p>`:null}${!view&&!failure?html`<p role="status">${hr("loading")}</p>`:null}<div class="s-section-layout">${notices.length?html`<section class="card"><h3>${hr("notices")}</h3><ul class="hub-role-list">${notices.map(n=>html`<li key=${n.id}><p class="grow">${hr(n.body?.kind==="roles-available"?"migrationNotice":"adminNotice")}</p><button type="button" class="btn" disabled=${busy} onClick=${()=>acknowledge(n.id)}>${hr("ack")}</button></li>`)}</ul></section>`:null}${view?.policy?html`<section class="card"><h3>${hr(view.policy.rolesActive?"on":"off")}</h3><p class="note">${hr("offHelp")}</p>${canEdit?html`<button type="button" class="btn" disabled=${busy} onClick=${()=>preview({...copy(view.policy),rolesActive:!view.policy.rolesActive})}>${hr(view.policy.rolesActive?"turnOff":"turnOn")}</button>`:null}<p><strong>${hr("firstAdmin")}</strong> · <code>${key(view.root)}</code></p><p class="note">${hr("firstAdminHelp")}</p>${isRoot&&!view.rootSelfUsed?html`<p class="note">${hr("rootHelp")}</p><button type="button" class="btn" disabled=${busy} onClick=${()=>preview(null,true)}>${hr("rootDefaults")}</button>`:null}</section>`:view?html`<p class="note">${hr("noPolicy")}</p>`:null}
|
|
43
|
+
${view?.policy?html`<section class="card"><div class="hub-role-head"><h3>${hr("roles")}</h3>${canEdit?html`<button type="button" class="btn" disabled=${busy} onClick=${()=>{setChecked(null);setEditor({role:{id:`custom:${crypto.randomUUID()}`,name:"",kind:"custom",permissions:[],defaultMaxFleets:1}});}}>${hr("newRole")}</button>`:null}</div><ul class="hub-role-list">${view.policy.roles.map(role=>html`<li key=${role.id}><span class="grow"><strong>${name(role)}</strong><small class="note hub-role-detail">${role.permissions.map(p=>hr(p)).join(" · ")}</small></span><button type="button" class="btn" disabled=${busy} onClick=${()=>{setChecked(null);setEditor({role});}}>${hr("edit")}</button></li>`)}</ul><p class="note">${hr("inherited")}</p></section>`:null}
|
|
44
|
+
${editor?.role&&view?html`<${RoleEditor} key=${editor.role.id} view=${view} role=${editor.role} busy=${busy} onCheck=${preview} onCancel=${()=>{setEditor(null);setChecked(null);}}/>`:editor?.assignment&&view?html`<${AssignmentEditor} key=${editor.assignment?.id||"new"} assignment=${editor.assignment} view=${{...view,client}} busy=${busy} onCheck=${preview} onCancel=${()=>{setEditor(null);setChecked(null);}}/>`:null}
|
|
45
|
+
${view?.policy?html`<section class="card"><div class="hub-role-head"><h3>${hr("assignments")}</h3>${canAssign?html`<button type="button" class="btn" disabled=${busy} onClick=${()=>{setChecked(null);setEditor({assignment:true});}}>${hr("assign")}</button>`:null}</div><p class="note">${hr("selfHelp")}</p><ul class="hub-role-list">${view.policy.assignments.map(a=>html`<li key=${a.id}><span class="grow"><strong>${name(view.policy.roles.find(r=>r.id===a.roleId))}</strong><small class="note hub-role-detail">${a.subject.kind==="person"?key(a.subject.person):a.subject.dn} · ${a.scope.kind==="hub"?hr("wholeHub"):a.scope.dn}${a.expiresAt?` · ${new Date(a.expiresAt).toLocaleString()}`:""}</small></span>${canAssign?html`<button type="button" class="btn" disabled=${busy||a.subject.kind==="person"&&key(a.subject.person)===key(view.actor)} onClick=${()=>{setChecked(null);setEditor({assignment:a});}}>${hr("edit")}</button><button type="button" class="btn" disabled=${busy||a.subject.kind==="person"&&key(a.subject.person)===key(view.actor)} onClick=${()=>{const next=copy(view.policy);next.assignments=next.assignments.filter(row=>row.id!==a.id);preview(next);}}>${hr("remove")}</button>`:null}</li>`)}</ul></section>`:null}
|
|
46
|
+
${checked?html`<section class="card hub-role-preview" role="region" aria-label=${hr("changes")}><h3>${hr("changes")}</h3><p>${hr("affected",checked.impact?.losingActions?.length||0)}</p><p>${hr("paused",checked.impact?.suspendedOnSave?.length||0)}</p><p>${hr("unknown",checked.impact?.held?.length||0)}</p><p class="note">${hr("noPreview")}</p><div class="hub-role-actions"><button type="button" class="btn btn-primary" disabled=${busy} onClick=${apply}>${hr(busy?"saving":"apply")}</button><button type="button" class="btn" disabled=${busy} onClick=${()=>setChecked(null)}>${hr("cancel")}</button></div></section>`:null}
|
|
47
|
+
${audit||auditError?html`<section class="card"><h3>${hr("audit")}</h3>${auditError?html`<p class="err" role="alert">${auditError}</p>`:null}<div class="hub-role-table-wrap"><table><thead><tr><th>${hr("when")}</th><th>${hr("who")}</th><th>${hr("action")}</th><th>${hr("result")}</th></tr></thead><tbody>${audit?.rows?.map(row=>html`<tr key=${row.id}><td data-label=${hr("when")}>${new Date(row.at).toLocaleString()}</td><td data-label=${hr("who")} title=${row.actor.id}>${row.actor.name}</td><td data-label=${hr("action")}>${row.action}${row.summary?.map(line=>html`<small class="note hub-role-detail">${line}</small>`)}</td><td data-label=${hr("result")}>${row.result}</td></tr>`)}</tbody></table></div>${!audit?.rows?.length?html`<p class="note">${hr("empty")}</p>`:null}${audit?.nextCursor?html`<button type="button" class="btn" disabled=${busy} onClick=${more}>${hr("more")}</button>`:null}</section>`:null}</div></div>`;
|
|
48
|
+
}
|
package/dist/ui/hub-switcher.js
CHANGED
|
@@ -21,7 +21,7 @@ export function HubSwitcher() {
|
|
|
21
21
|
if (!origin) return null;
|
|
22
22
|
const name = pairing.hub.name || hw("hub");
|
|
23
23
|
return html`<div class="hub-switch" role="group" aria-label=${hw("switcher")} data-trust="navigation">
|
|
24
|
-
<span class="hub-switch-item is-current" aria-current="true">${hw("myFleet")}</span>
|
|
25
|
-
<a class="hub-switch-item" href=${origin} target="_blank" rel="noopener noreferrer" title=${hw("openHubTab", name)}>${name}
|
|
24
|
+
<span class="hub-switch-item is-current" aria-current="true"><span class="hub-switch-name">${hw("myFleet")}</span></span>
|
|
25
|
+
<a class="hub-switch-item" href=${origin} target="_blank" rel="noopener noreferrer" title=${hw("openHubTab", name)} aria-label=${hw("openHubTab", name)}><span class="hub-switch-name">${name}</span><${Icon} name="external" size=${13} /></a>
|
|
26
26
|
</div>`;
|
|
27
27
|
}
|
package/dist/ui/hub-this-hub.js
CHANGED
|
@@ -8,7 +8,7 @@ import { html, useEffect, useState } from "/assets/app-html.js";
|
|
|
8
8
|
import { register, t } from "/assets/app-i18n.js";
|
|
9
9
|
import { Skeleton } from "/assets/ui-states.js";
|
|
10
10
|
import { toast } from "/assets/ui-toast.js";
|
|
11
|
-
import { hubClient, compareGroups } from "./hub-client.js";
|
|
11
|
+
import { hubClient, compareGroups, HUB_NAME_MAX } from "./hub-client.js";
|
|
12
12
|
|
|
13
13
|
register("hubThisHub", {
|
|
14
14
|
en: {
|
|
@@ -93,7 +93,7 @@ export function ThisHubCard({ directory = false } = {}) {
|
|
|
93
93
|
// The Hub's name shows here in plain sight (the sidebar's brand carries it only as its tooltip — the leader on Argon #18).
|
|
94
94
|
return html`<section class="card hub-this-hub" data-section="this-hub"><div class="hub-card-head"><h3>${ht("title")}</h3><span class="s-scope" data-hub-name=${current ? "set" : "none"}>${current || ht("noName")}</span></div><p class="note">${ht("lead")}</p>
|
|
95
95
|
${info.rename ? html`<form class="hub-this-form" onSubmit=${(e) => { e.preventDefault(); if (typed && typed !== current) save(typed); }}>
|
|
96
|
-
<label class="field"><span>${ht("name")}</span><input id="hubThisName" maxlength
|
|
96
|
+
<label class="field"><span>${ht("name")}</span><input id="hubThisName" maxlength=${HUB_NAME_MAX} autocomplete="off" placeholder=${ht("namePlaceholder")} value=${draft} disabled=${busy}
|
|
97
97
|
onInput=${(e) => { setDraft(e.target.value); setError(""); }} /><small class="note">${ht("nameHint")}</small></label>
|
|
98
98
|
<div class="hub-this-actions">
|
|
99
99
|
<button type="submit" class="btn btn-primary" disabled=${busy || !typed || typed === current}>${busy ? ht("saving") : ht("save")}</button>
|
package/dist/ui/model-picker.js
CHANGED
|
@@ -22,6 +22,7 @@ export function useRefreshableModels(backend, instance, context = {}) {
|
|
|
22
22
|
const key = JSON.stringify(target);
|
|
23
23
|
const [state, set] = useState({ key, models: [], phase: "loading" });
|
|
24
24
|
const generation = useRef(0);
|
|
25
|
+
const [reads, setReads] = useState(0);
|
|
25
26
|
const current = useRef(key), flight = useRef(null), mounted = useRef(true);
|
|
26
27
|
current.current = key;
|
|
27
28
|
useEffect(() => { mounted.current = true; return () => { mounted.current = false; }; }, []);
|
|
@@ -38,7 +39,9 @@ export function useRefreshableModels(backend, instance, context = {}) {
|
|
|
38
39
|
promise.finally(() => { if (answers.get(key)?.promise === promise) answers.delete(key); }).catch(() => {});
|
|
39
40
|
promise.then(data => { if (live && gen === generation.current) set({ key, models: data.models, source: data.source, phase: "idle" }); }, () => { if (answers.get(key)?.promise === promise) answers.delete(key); if (live && gen === generation.current) set({ key, models: [], phase: "load_error" }); });
|
|
40
41
|
return () => { live = false; };
|
|
41
|
-
}, [key]);
|
|
42
|
+
}, [key, reads]);
|
|
43
|
+
// The list changed on the server (a sign-in ended, a discovery finished): read it again, never touching the selection.
|
|
44
|
+
catalogStore.useModelsEvent?.(backend, () => { answers.clear(); setReads(n => n + 1); });
|
|
42
45
|
const shown = state.key === key ? state : { key, models: [], phase: "loading" };
|
|
43
46
|
async function refresh() {
|
|
44
47
|
if (flight.current || !backend) return;
|
package/dist/ui/panel-hub.js
CHANGED
|
@@ -60,8 +60,8 @@ const ha = key => t(`hubAccess.${key}`);
|
|
|
60
60
|
// Kept with the fresh renderer: retained owner dictionaries do not know this label.
|
|
61
61
|
// M-3162: Administration's tabs (Lumen's names: "Manage" holds today's long page; "This Hub" its name already).
|
|
62
62
|
register("hubAdminTabs", {
|
|
63
|
-
en: { label: "Administration", overview: "Overview", manage: "Manage", teams: "Teams", groups: "Groups", thisHub: "This Hub" },
|
|
64
|
-
"zh-TW": { label: "管理", overview: "總覽", manage: "管理項目", teams: "團隊", groups: "群組", thisHub: "這個 Hub" },
|
|
63
|
+
en: { label: "Administration", overview: "Overview", manage: "Manage", teams: "Teams", groups: "Groups", roles: "Roles and permissions", thisHub: "This Hub" },
|
|
64
|
+
"zh-TW": { label: "管理", overview: "總覽", manage: "管理項目", teams: "團隊", groups: "群組", roles: "角色與權限", thisHub: "這個 Hub" },
|
|
65
65
|
});
|
|
66
66
|
const hat = (key) => t(`hubAdminTabs.${key}`);
|
|
67
67
|
register("hubGrantStatus", {
|
|
@@ -90,6 +90,8 @@ register("hubGroupsNote", {
|
|
|
90
90
|
en: { unavailable: "Group permissions aren't available on this Hub yet. Update the Hub, then try again." },
|
|
91
91
|
"zh-TW": { unavailable: "這個 Hub 還沒有群組權限。請更新 Hub 後再試。" },
|
|
92
92
|
});
|
|
93
|
+
const rolesOn = (session,client) => session?.features?.includes("role-settings-v1") && client?.roleSettingsV1 === true;
|
|
94
|
+
const manages = session => session?.admin === true || Array.isArray(session?.management) && session.management.length > 0;
|
|
93
95
|
const groupPolicyOn = (session, client) => !!session && Array.isArray(session.features) && session.features.includes("group-policy-v1")
|
|
94
96
|
&& !!client && client.groupPolicyV1 === true;
|
|
95
97
|
function LazyGroups({ pick, props }) {
|
|
@@ -438,7 +440,7 @@ export function HubSide({ onPick } = {}) {
|
|
|
438
440
|
${teamsLive() ? html`<${LazyRoomPart} load=${() => import("./hub-teams.js")} name="HubMyTeamsEntry" props=${{ client: hubClient(), person: s.person, active: here("teams"), onPick }} />` : null}
|
|
439
441
|
${roomsLive() && rs.invitations > 0 ? html`<a class=${`side-row${here("invitations") ? " active" : ""}`} href=${INVITATIONS_PATH} aria-current=${here("invitations") ? "page" : undefined}
|
|
440
442
|
onClick=${(e) => go(e, INVITATIONS_PATH)}><${Icon} name="inbox" /><span class="grow">${hroom("invitationsTitle")}</span><span class="nav-count" title=${hroom("invitationsN", String(rs.invitations))}>${rs.invitations}</span></a>` : null}
|
|
441
|
-
${s
|
|
443
|
+
${manages(s) ? row("admin", "/ui/hub/admin", "key", hc("admin")) : null}
|
|
442
444
|
${noticesOffered(s) ? row("notices", NOTICES_PATH, "bell", hc("notices")) : null}
|
|
443
445
|
<button type="button" class="side-row side-search" onClick=${openFilter} title=${`${hc("search")} (${searchShortcut()})`}
|
|
444
446
|
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>
|
|
@@ -1088,14 +1090,14 @@ function LegacyAllowDialog({ x, act, onClose }) {
|
|
|
1088
1090
|
* (today's long page, unchanged), Teams, Groups and This Hub (with its directory page); a tab whose feature is off is not
|
|
1089
1091
|
* drawn. The tab is the address's ?view=, so a reload or a shared link lands on it. On a phone the row scrolls sideways.
|
|
1090
1092
|
*/
|
|
1091
|
-
const ADMIN_TAB_VIEWS = { overview: "overview", manage: "manage", teams: "teams", groups: "groups", "this-hub": "this-hub", directory: "this-hub" };
|
|
1093
|
+
const ADMIN_TAB_VIEWS = { overview: "overview", manage: "manage", teams: "teams", groups: "groups", roles: "roles", "this-hub": "this-hub", directory: "this-hub" };
|
|
1092
1094
|
let pendingAnchor = ""; // M-3162: a card on Manage to bring into view once it is drawn (Overview's links: "join", "fleets")
|
|
1093
1095
|
export function takeAdminAnchor() { const a = pendingAnchor; pendingAnchor = ""; return a; }
|
|
1094
1096
|
function openAdminTab(view, anchor = "") { pendingAnchor = anchor; navigate(`/ui/hub/admin?view=${view}`); }
|
|
1095
1097
|
function AdminTabs({ tabs, current }) {
|
|
1096
1098
|
const row = useRef(null);
|
|
1097
1099
|
useEffect(() => { row.current?.querySelector?.('[aria-current="page"]')?.scrollIntoView?.({ block: "nearest", inline: "nearest" }); }, [current]);
|
|
1098
|
-
const label = { overview: hat("overview"), manage: hat("manage"), teams: hat("teams"), groups: hat("groups"), "this-hub": hat("thisHub") };
|
|
1100
|
+
const label = { overview: hat("overview"), manage: hat("manage"), teams: hat("teams"), groups: hat("groups"), roles: hat("roles"), "this-hub": hat("thisHub") };
|
|
1099
1101
|
return html`<div class="hub-admin-tabs-wrap"><nav class="hub-admin-tabs" aria-label=${hat("label")} ref=${row}>
|
|
1100
1102
|
${tabs.map((k) => html`<a key=${k} href=${`/ui/hub/admin?view=${k}`} class=${`hub-admin-tab${k === current ? " active" : ""}`} aria-current=${k === current ? "page" : undefined}
|
|
1101
1103
|
onClick=${(e) => { if (e.metaKey || e.ctrlKey || e.shiftKey || e.button) return; e.preventDefault(); openAdminTab(k); }}>${label[k]}</a>`)}
|
|
@@ -1106,17 +1108,21 @@ function HubAdmin({ admin }) {
|
|
|
1106
1108
|
const s = useSession();
|
|
1107
1109
|
const [overviewGone, setOverviewGone] = useState(false); // the route answered 404: an older Hub after all
|
|
1108
1110
|
useEffect(() => { linkHubOwnerCss(); }, []); // the tab row and Overview are styled there too (not only Manage)
|
|
1109
|
-
if (!admin) return html`<div class="center hub-empty"><${Empty} icon="key" title=${hw("adminOnly")} hint=${hw("adminOnlyHint")} /></div>`;
|
|
1111
|
+
if (!admin && !manages(s)) return html`<div class="center hub-empty"><${Empty} icon="key" title=${hw("adminOnly")} hint=${hw("adminOnlyHint")} /></div>`;
|
|
1110
1112
|
const directory = s?.features?.includes("directory-editor-v1") && hubClient()?.directoryEditorV1 === true;
|
|
1111
|
-
const groups = groupPolicyOn(s, hubClient()), teams = teamsLive();
|
|
1113
|
+
const groups = groupPolicyOn(s, hubClient()), teams = teamsLive(), roles = rolesOn(s,hubClient());
|
|
1114
|
+
const canRole = admin || s?.management?.some(p => ["roles.assign","audit.view"].includes(p));
|
|
1115
|
+
const canManage = admin || s?.management?.some(p => ["fleets.manage","join.manage"].includes(p));
|
|
1112
1116
|
const overview = !overviewGone && s?.features?.includes("admin-dashboard-v1") && typeof hubClient()?.adminDashboard === "function";
|
|
1113
|
-
const tabs = [overview ? "overview" : null, "manage", teams ? "teams" : null, groups ? "groups" : null, "this-hub"].filter(Boolean);
|
|
1117
|
+
const tabs = [admin && overview ? "overview" : null, canManage ? "manage" : null, admin && teams ? "teams" : null, roles && canRole ? "roles" : admin && groups ? "groups" : null, admin ? "this-hub" : null].filter(Boolean);
|
|
1114
1118
|
const view = adminView();
|
|
1115
|
-
const
|
|
1119
|
+
const selected = roles && view === "groups" ? "roles" : ADMIN_TAB_VIEWS[view];
|
|
1120
|
+
const current = view === "" ? tabs[0] : tabs.includes(selected) ? selected : tabs[0];
|
|
1116
1121
|
const bar = html`<${AdminTabs} tabs=${tabs} current=${current} />`;
|
|
1117
1122
|
if (current === "overview") return html`${bar}<div class="col hub-owner hub-admin-ov-col"><${LazyRoomPart} load=${() => import("./hub-admin-overview.js")} name="HubAdminOverview"
|
|
1118
1123
|
props=${{ client: hubClient(), onOpen: openAdminTab, onGone: () => { setOverviewGone(true); openAdminTab("manage"); } }} /></div>`;
|
|
1119
1124
|
if (current === "this-hub") return html`${bar}${directory && view === "directory" ? html`<${LazyDirectory} session=${s} />` : html`<div class="col hub-owner"><${LazyThisHub} directory=${directory} /></div>`}`;
|
|
1125
|
+
if (current === "roles") return html`${bar}<div class="col hub-owner"><${LazyRoomPart} load=${() => import("./hub-roles.js")} name="HubRoles" props=${{client:hubClient()}} /></div>`;
|
|
1120
1126
|
if (current === "groups") return html`${bar}<${LazyGroups} pick=${(m) => m.HubGroupPolicyPage} props=${{}} />`;
|
|
1121
1127
|
if (current === "teams") return html`${bar}<div class="col hub-owner"><h2 class="sr-only">${ht("title")}</h2><${LazyRoomPart} load=${() => import("./hub-teams.js")} name="HubTeamsPage" props=${{ client: hubClient(), mode: "admin", person: s?.person }} /></div>`;
|
|
1122
1128
|
// Reached from a fleet's Settings link on a Hub (or a tab) without group permissions: say so instead of a silent admin page.
|
|
@@ -513,11 +513,11 @@ export function SettingsPanel({ route, navKey }) {
|
|
|
513
513
|
const close = () => setDialog(null);
|
|
514
514
|
const searchable = section === "agents" || section === "chat";
|
|
515
515
|
// #2347 §7: on a phone, Settings itself (/settings) is the list of sections with search on top; a section opens on its
|
|
516
|
-
// own
|
|
516
|
+
// own, the header's ← back to it (M-3245: was a "‹ Settings" bar under a ☰). A wider screen always shows the list beside the section (the CSS decides).
|
|
517
517
|
// Which one is shown is the root's data-view: its class stays exactly the effects producer's ("panel p-settings", #1629).
|
|
518
518
|
const atList = typeof location !== "undefined" && location.pathname === "/settings";
|
|
519
519
|
return html`<div data-effect-panel="settings" class="panel p-settings" data-view=${atList ? "index" : "section"}>
|
|
520
|
-
<${PanelHeader} title=${tn("title")} sub=${data ? html`<${SettingsBuildVersion} version=${data.version} build=${data.build} /><${UpdatePillMark} />` : null}>
|
|
520
|
+
<${PanelHeader} title=${tn("title")} back=${atList ? null : { href: settingsPath(), label: tn("backToSettings") }} sub=${data ? html`<${SettingsBuildVersion} version=${data.version} build=${data.build} /><${UpdatePillMark} />` : null}>
|
|
521
521
|
<button type="button" class="btn btn-ghost btn-sm" disabled=${!ctx || yamlStaged(staged)} title=${ctx && yamlStaged(staged) ? tn("yamlUnsaved") : undefined} onClick=${openWizard}><${Icon} name="wand" size=${16} /><span class="hide-narrow">${tn("wizardButton")}</span></button>
|
|
522
522
|
<button type="button" class="icon-btn" aria-label=${tn("helpButton")} title=${tn("helpButton")} onClick=${() => setDialog({ kind: "help", key: navKey })}><${Icon} name="info" /></button>
|
|
523
523
|
</${PanelHeader}>
|
|
@@ -526,7 +526,6 @@ export function SettingsPanel({ route, navKey }) {
|
|
|
526
526
|
${g.sections.map((k) => html`<a key=${k} href=${sectionPath(k)} class=${`seg-item${k === section ? " active" : ""}`} title=${tn(`sec_${k}`)}
|
|
527
527
|
aria-current=${k === section ? "page" : undefined}><${Icon} name=${ICONS[k]} size=${16} /><span>${tn(`sec_${k}`)}</span></a>`)}</div>`)}</div></nav>
|
|
528
528
|
<div data-trust="panel-content" class="panel-body"><div class="col" data-settings-section=${section}>
|
|
529
|
-
<a class="s-back" href=${settingsPath()}><${Icon} name="back" size=${16} /><span>${tn("title")}</span><span class="s-back-here">${tn(`sec_${section}`)}</span></a>
|
|
530
529
|
${section !== "runtimes" ? html`<${SettingsPageHead} section=${section}>${section === "agents" && ctx ? html`<button type="button" id="newAgentBtn" class="btn btn-primary" disabled=${yamlStaged(staged)} onClick=${() => toDialog({ kind: "create" })}><${Icon} name="plus" size=${16} />${tn("newAgent")}</button>` : null}</${SettingsPageHead}>` : null}
|
|
531
530
|
${searchable ? html`<div class="s-toolbar"><label class="s-search"><${Icon} name="search" size=${14} /><span class="sr-only">${tn("searchAll")}</span>
|
|
532
531
|
<input type="search" value=${search} placeholder=${tn("searchAll")} onInput=${(e) => setSearch(e.target.value)} /></label></div>` : null}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// Both answers are the server's cached ones; nothing here makes the server probe. A page asks once and reuses the answer
|
|
4
4
|
// for a short while, so opening several dialogs costs one request each.
|
|
5
5
|
import { useEffect, useRef, useState } from "/assets/app-html.js";
|
|
6
|
+
import { appStore } from "/assets/app-store.js";
|
|
6
7
|
|
|
7
8
|
const TTL_MS = 30_000;
|
|
8
9
|
const cache = new Map(); // url → { at, value, pending }
|
|
@@ -32,6 +33,26 @@ function cached(url, force = false) {
|
|
|
32
33
|
*/
|
|
33
34
|
export function forgetCatalogs() { cache.clear(); }
|
|
34
35
|
|
|
36
|
+
/**
|
|
37
|
+
* The server says a backend's model list changed (`models`: a sign-in ended, a discovery finished). Calls `onChange`
|
|
38
|
+
* for the backend asked about (or for any, when the event names none), with the shared answers dropped so the read is fresh.
|
|
39
|
+
* Nothing is listened to without a stream (a poll page, a test); the page then shows the list at its next read, as before.
|
|
40
|
+
*/
|
|
41
|
+
export function useModelsEvent(backend, onChange) {
|
|
42
|
+
const latest = useRef(onChange);
|
|
43
|
+
latest.current = onChange;
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
const on = appStore.get().streamOn;
|
|
46
|
+
if (!backend || typeof on !== "function") return undefined;
|
|
47
|
+
const off = on("models", (event) => {
|
|
48
|
+
if (event && typeof event.backend === "string" && event.backend !== backend) return;
|
|
49
|
+
cache.clear();
|
|
50
|
+
latest.current?.();
|
|
51
|
+
});
|
|
52
|
+
return typeof off === "function" ? off : undefined;
|
|
53
|
+
}, [backend]);
|
|
54
|
+
}
|
|
55
|
+
|
|
35
56
|
function useAnswer(url) {
|
|
36
57
|
const [value, setValue] = useState(undefined); // undefined: loading; null: unavailable
|
|
37
58
|
useEffect(() => {
|
|
@@ -68,6 +89,7 @@ export function useModelCatalogState(backend, instance, runtime, machineId) {
|
|
|
68
89
|
if (url) load();
|
|
69
90
|
return () => { generation.current++; };
|
|
70
91
|
}, [url]);
|
|
92
|
+
useModelsEvent(backend, () => load(true));
|
|
71
93
|
const current = state.url === url ? state : { answer:null, loading:!!url };
|
|
72
94
|
const valid = current.answer && Array.isArray(current.answer.models);
|
|
73
95
|
return {
|
|
@@ -4,6 +4,7 @@ import { register, t } from "/assets/app-i18n.js";
|
|
|
4
4
|
import { Skeleton, ErrorState } from "/assets/ui-states.js";
|
|
5
5
|
import { api } from "./settings-confirm.js";
|
|
6
6
|
import { hs, setupError } from "./settings-hub-setup-strings.js";
|
|
7
|
+
import { HUB_NAME_MAX } from "./hub-client.js"; // M-3235: the one Hub-name maximum (what the brand shows)
|
|
7
8
|
// These words travel with the new renderer, even when the tab retains the setup dictionary.
|
|
8
9
|
register("hubSetupReady", {
|
|
9
10
|
en: {
|
|
@@ -195,7 +196,7 @@ export function HubSetupSettings() {
|
|
|
195
196
|
<p class="note" role="status">${step} / 4 · ${hs(titles[step])}</p>
|
|
196
197
|
<form class="form" onSubmit=${step === 3 ? prepare : step === 4 ? e => e.preventDefault() : next}>
|
|
197
198
|
<fieldset class="form" disabled=${busy}>
|
|
198
|
-
${step === 1 ? html`${field("name", { required: false, max:
|
|
199
|
+
${step === 1 ? html`${field("name", { required: false, max: HUB_NAME_MAX, hint: "nameHint" })}<div class="grid2">${field("webOrigin", { type: "url" })}${field("memberOrigin", { type: "url" })}</div><p class="note">${hs("addressHint")}</p>
|
|
199
200
|
<div class="grid2">${field("webHost")}${field("webPort", { type: "number", min: 1, maxNumber: 65535 })}${field("memberHost")}${field("memberPort", { type: "number", min: 1, maxNumber: 65535 })}</div><p class="note">${hs("listenHint")}</p>
|
|
200
201
|
${select("coexistence", [["", "choose"], ["dedicated", "dedicated"], ["same-user-pilot", "shared"]], "coexistenceHint")}
|
|
201
202
|
${select("certificate", [["generate", "generate"], ["import", "import"]], "certificateHint")}
|
|
@@ -8,6 +8,7 @@ register("settings", {
|
|
|
8
8
|
webNotifyLogin: "Web sign-in notices",
|
|
9
9
|
webNotifyLoginHint: "Posted in the topic. Off suppresses operator notices only; guest and public-link security notices still post. Default: Topic.",
|
|
10
10
|
title: "Settings",
|
|
11
|
+
backToSettings: "Back to Settings",
|
|
11
12
|
myAgents: "My Agents",
|
|
12
13
|
bots: "Bots",
|
|
13
14
|
classicChannels: "ClassicBot Channels",
|
|
@@ -694,6 +695,7 @@ register("settings", {
|
|
|
694
695
|
webNotifyLogin: "網頁登入通知",
|
|
695
696
|
webNotifyLoginHint: "發在頻道。關閉只停用管理員登入通知;訪客與公開連結安全通知仍會發出。預設:頻道。",
|
|
696
697
|
title: "設定",
|
|
698
|
+
backToSettings: "回到設定",
|
|
697
699
|
myAgents: "我的 Agent",
|
|
698
700
|
bots: "機器人",
|
|
699
701
|
classicChannels: "ClassicBot 頻道",
|
|
@@ -460,7 +460,7 @@ function Sidebar({ route, onNewInstance, viewOnly }) {
|
|
|
460
460
|
return html`<aside id="sidebar" class=${`sidebar fleet-side${narrowDrawer ? " drawer-narrow" : ""}`} aria-label=${t("app.menu")}>
|
|
461
461
|
<div class="side-head" data-trust="navigation">
|
|
462
462
|
<a class="brand" href="/ui" onClick=${closeDrawer}>${t("app.brand")}</a>
|
|
463
|
-
<button type="button" class="icon-btn side-collapse" onClick=${toggleSidebar} aria-label=${narrow() ? t("app.closeMenu") : t("app.collapse")} title=${narrow() ? t("app.closeMenu") : t("app.collapse")} aria-controls="sidebar"><${Icon} name="sidebar" cls="ic-sidebar" /><${Icon} name="
|
|
463
|
+
<button type="button" class="icon-btn side-collapse" onClick=${toggleSidebar} aria-label=${narrow() ? t("app.closeMenu") : t("app.collapse")} title=${narrow() ? t("app.closeMenu") : t("app.collapse")} aria-controls="sidebar"><${Icon} name="sidebar" cls="ic-sidebar" /><${Icon} name="close" cls="ic-close" /></button>
|
|
464
464
|
</div>
|
|
465
465
|
${/* AgEnD Hub P1: a member fleet's "My fleet ↔ Hub" (shown once paired; nothing loads when the switch is off) */ hubMarks().member ? html`<${HubSwitcherSlot} />` : null}
|
|
466
466
|
<nav data-trust="navigation" class="side-nav" aria-label=${t("app.menu")}>
|
|
@@ -547,6 +547,9 @@ function PrefsPopover() {
|
|
|
547
547
|
*/
|
|
548
548
|
// M-3115 (phone v2): inside an agent's pages a phone has no bottom tabs; the header's first button goes back to the
|
|
549
549
|
// agents (the drawer) — with no count since M-3166. Kept beside its caller: a retained dictionary has no such word.
|
|
550
|
+
// M-3245 (the user, beta.7: 「左箭頭和漢堡選單 icon 意義不明」): one rule for a phone's top-left button. ☰ opens the agents
|
|
551
|
+
// (the drawer) on a page with nothing above it; ← goes back one level (an agent's pages → the agents; a Settings section →
|
|
552
|
+
// Settings); ✕ closes the drawer. A page with a level above passes `back` ({ href, label }) to PanelHeader.
|
|
550
553
|
register("phoneNav", {
|
|
551
554
|
en: { back: "Back to your agents" },
|
|
552
555
|
"zh-TW": { back: "回到 Agent 清單" },
|
|
@@ -554,7 +557,7 @@ register("phoneNav", {
|
|
|
554
557
|
/** What Needs you counts: its items and the agents' proposals (the tab's badge, the sidebar's). */
|
|
555
558
|
export function needsCount(app) { return (app.needs || []).length + (app.proposals || []).length; }
|
|
556
559
|
|
|
557
|
-
export function PanelHeader({ title, sub, children, headingRef, nav, notice, pageControls, pageActions }) {
|
|
560
|
+
export function PanelHeader({ title, sub, children, headingRef, nav, notice, pageControls, pageActions, back = null }) {
|
|
558
561
|
const shell = useStore(shellStore);
|
|
559
562
|
const { route } = useStore(navStore);
|
|
560
563
|
// M-3166 (the user, round 2): no counts or badges on the Fleet side — ← goes back to the agents without a number.
|
|
@@ -567,10 +570,12 @@ export function PanelHeader({ title, sub, children, headingRef, nav, notice, pag
|
|
|
567
570
|
if (pane?.Header) return html`<${pane.Header} title=${title} sub=${sub} headingRef=${headingRef} nav=${nav} notice=${notice}
|
|
568
571
|
pageControls=${pageControls} pageActions=${pageActions} />`;
|
|
569
572
|
return html`<header data-trust="header" class=${`panel-head${shell.collapsed ? " collapsed" : ""}`}>
|
|
570
|
-
|
|
573
|
+
${back && narrow() && !agent ? html`<a id="sbOpen" class="icon-btn sb-open sb-back sb-up" href=${back.href} aria-label=${back.label} title=${back.label}
|
|
574
|
+
><${Icon} name="menu" cls="ic-menu" /><${Icon} name="back" cls="ic-back" /></a>`
|
|
575
|
+
: html`<button type="button" id="sbOpen" class=${`icon-btn sb-open${agent ? " sb-back" : ""}`} onClick=${() => (narrow() ? openDrawer() : toggleSidebar())}
|
|
571
576
|
aria-label=${narrow() ? agent ? t("phoneNav.back") : t("app.openMenu") : t("app.expand")}
|
|
572
577
|
title=${narrow() ? agent ? t("phoneNav.back") : t("app.openMenu") : t("app.expand")} aria-controls="sidebar" aria-expanded=${shell.drawer ? "true" : "false"}><${Icon} name="menu" cls="ic-menu" />${agent
|
|
573
|
-
? html`<${Icon} name="back" cls="ic-back" />` : null}</button
|
|
578
|
+
? html`<${Icon} name="back" cls="ic-back" />` : null}</button>`}
|
|
574
579
|
${canCreate && shell.collapsed ? html`<button type="button" class="icon-btn sb-new" onClick=${requestNewInstance} aria-label=${t("app.newAgent")} title=${t("app.newAgent")}><${Icon} name="plus" /></button>` : null}
|
|
575
580
|
${searchOffered(admin) ? html`<button type="button" class="icon-btn sb-search" onClick=${() => openSearch()} aria-label=${t("app.search")} title=${t("app.searchTitle", searchShortcut())}><${Icon} name="search" /></button>` : null}
|
|
576
581
|
<div class="panel-title"><h1 ref=${headingRef} tabindex="-1">${title}</h1>${sub ? html`<div class="panel-sub">${sub}</div>` : null}</div>
|
|
@@ -1237,7 +1242,8 @@ export function Shell({ panels, onNewInstance, viewOnly = false }) {
|
|
|
1237
1242
|
// Once up, the keyboard stays up while the field keeps focus: an IME's candidate bar (or the predictive row) coming and
|
|
1238
1243
|
// going moves the view by tens of px on every keystroke, and must never take the tabs out and back. Only leaving the
|
|
1239
1244
|
// field, or the view growing from its lowest by more than a keyboard (put away), takes it down. While an IME composes
|
|
1240
|
-
//
|
|
1245
|
+
// the keyboard's state does not change (the shell's height still follows a view that got shorter: M-3244, in fit);
|
|
1246
|
+
// what the view says then is applied at compositionend — or as soon as the field it composes
|
|
1241
1247
|
// in has lost focus or left the page (a composition can end without its compositionend: #2517 review).
|
|
1242
1248
|
let width = -1, tallest = 0, held = false, lowest = 0, upLowest = 0, composing = null, downSince = 0, downTimer = 0;
|
|
1243
1249
|
// beta.4 (the user, iPhone): a keystroke can move the view (the predictive or candidate bar, the caret panned into view)
|
|
@@ -1273,7 +1279,13 @@ export function Shell({ panels, onNewInstance, viewOnly = false }) {
|
|
|
1273
1279
|
const typingNow = coarse() && isTextEntry(document.activeElement);
|
|
1274
1280
|
const on = coarse() && (shellStore.get().keyboard || typingNow || now() < followUntil) && Math.abs((Number(vv.scale) || 1) - 1) < 0.01;
|
|
1275
1281
|
if (!on) { unfit(el); fitH = 0; fitTop = 0; fitW = -1; moveSince = 0; return; }
|
|
1276
|
-
|
|
1282
|
+
// M-3244 (the user, iPhone, Zhuyin): while an IME composes, the keyboard's state waits for compositionend (check) — the
|
|
1283
|
+
// shell's height does not. The keyboard coming up, or its candidate bar, mid-composition made the view shorter while the
|
|
1284
|
+
// shell kept the height it had (the whole screen, or the view before the bar), and the box sat under the keyboard for
|
|
1285
|
+
// the whole composition. Composing, the shell follows a view that got shorter; it grows back only once the IME is done.
|
|
1286
|
+
const composingNow = !!composing && composing.isConnected !== false && document.activeElement === composing;
|
|
1287
|
+
const seen = Math.round(vv.height), top = Math.max(0, Math.round(Number(vv.offsetTop) || 0)), w = Math.round(vv.width);
|
|
1288
|
+
const h = composingNow && fitH && w === fitW && seen > fitH ? fitH : seen;
|
|
1277
1289
|
const settled = fitH && typingNow && w === fitW && now() >= followUntil;
|
|
1278
1290
|
if (settled && (h !== fitH || top !== fitTop) && !(fitH - h > KEYBOARD_MIN_PX)) {
|
|
1279
1291
|
if (!moveSince) moveSince = now();
|
|
@@ -1300,7 +1312,7 @@ export function Shell({ panels, onNewInstance, viewOnly = false }) {
|
|
|
1300
1312
|
raf = frame(step);
|
|
1301
1313
|
};
|
|
1302
1314
|
const check = () => {
|
|
1303
|
-
if (composing && composing.isConnected !== false && document.activeElement === composing) return;
|
|
1315
|
+
if (composing && composing.isConnected !== false && document.activeElement === composing) { fit(); return; }
|
|
1304
1316
|
composing = null;
|
|
1305
1317
|
const w = Math.round(vv.width), h = vv.height;
|
|
1306
1318
|
const typing = coarse() && isTextEntry(document.activeElement);
|
|
@@ -36,13 +36,15 @@
|
|
|
36
36
|
// #1918: traffic — a message between instances moved; delegation — a task opened, or its report closed it (SSE only: the
|
|
37
37
|
// org canvas reads /ui/traffic when it has no stream).
|
|
38
38
|
// #2233: backend_login — a dashboard sign-in started, moved or ended (no details: the page reads its own view).
|
|
39
|
+
// models — a backend's model list changed (a sign-in ended, a discovery finished): `{ backend }`, SSE only; an open
|
|
40
|
+
// /model menu or Settings model field reads its list again.
|
|
39
41
|
// alpha.2 (M-2300): agent_proposals — an agent's Windows request came or was decided (no details: a web-only fleet's
|
|
40
42
|
// owner reads GET /ui/agent-proposals).
|
|
41
43
|
// tasks — the task board changed: the card numbers a write touched (SSE only: the board reads again when it is shown).
|
|
42
44
|
// offices — the stored offices changed ({ rev }; SSE only: the Office view reads /ui/offices again).
|
|
43
45
|
// office_skins — a skin pack was uploaded or deleted ({ rev }; SSE only: the Office view reads /ui/office-skins again).
|
|
44
46
|
// office_acts — the agents' live acts in the Office view changed ({ acts }, #2578; a poll page reads /ui/office-acts).
|
|
45
|
-
const EVENTS = ["status", "message", "agent_reply_live", "delivery", "deliveries", "prompt", "prompts", "prompt_resolved", "activity", "needs", "reply_buttons", "reactions", "steps_tick", "clock", "traffic", "delegation", "backend_login", "tasks", "offices", "office_skins", "office_acts", "office_pack_changes", "agent_proposals", "notice"];
|
|
47
|
+
const EVENTS = ["status", "message", "agent_reply_live", "delivery", "deliveries", "prompt", "prompts", "prompt_resolved", "activity", "needs", "reply_buttons", "reactions", "steps_tick", "clock", "traffic", "delegation", "backend_login", "models", "tasks", "offices", "office_skins", "office_acts", "office_pack_changes", "agent_proposals", "notice"];
|
|
46
48
|
const MAX_HELD = 1000; // live events held during one catch-up read; more → read again afterwards
|
|
47
49
|
const RETRY_DELAYS = [1000, 2000, 4000]; // after the first failed catch-up read; then it waits for Retry
|
|
48
50
|
const POLL_LIMIT_MS = 10000; // a poll that has not answered by then counts as failed
|
package/dist/ui/shared/app.css
CHANGED
|
@@ -292,7 +292,7 @@ html:has(.shell), html:has(.shell) body { overflow: hidden; }
|
|
|
292
292
|
}
|
|
293
293
|
.panel-head .sb-open { display: none; }
|
|
294
294
|
.sb-open .ic-back, .sb-open .sb-badge { display: none; } /* M-3115: the phone's ‹ (below); elsewhere ☰ only */
|
|
295
|
-
.side-collapse .ic-
|
|
295
|
+
.side-collapse .ic-close { display: none; } /* M-3211, M-3245: a phone's full-width drawer closes by ✕ (below); elsewhere the sidebar icon */
|
|
296
296
|
.sb-collapsed .panel-head .sb-open { display: inline-flex; }
|
|
297
297
|
/* #2074: a collapsed sidebar's "New agent", beside its ☰ (a phone opens the drawer, which has the row). */
|
|
298
298
|
.panel-head .sb-new { margin-left: calc(-1 * var(--s-1)); }
|
|
@@ -801,9 +801,6 @@ html:has(.shell), html:has(.shell) body { overflow: hidden; }
|
|
|
801
801
|
@media (max-width: 899px) {
|
|
802
802
|
.p-settings[data-view="index"] > .panel-body { display: none; }
|
|
803
803
|
.p-settings[data-view="section"] > .s-nav { display: none; }
|
|
804
|
-
.p-settings > .panel-body .s-back { display: flex; align-items: center; gap: var(--s-2); min-height: var(--tap); margin: 0 0 var(--s-2);
|
|
805
|
-
color: var(--accent); font-size: var(--fs-sm); text-decoration: none; }
|
|
806
|
-
.p-settings .s-back .s-back-here { margin-left: auto; color: var(--text); font-weight: var(--fw-semibold); }
|
|
807
804
|
.p-settings[data-view="index"] > .s-nav { flex-direction: column; align-items: stretch; padding: 0 var(--s-4) var(--s-4); }
|
|
808
805
|
.p-settings[data-view="index"] > .s-nav .s-nav-groups { flex-direction: column; align-items: stretch; flex-wrap: nowrap; overflow: visible; gap: var(--s-4); }
|
|
809
806
|
.p-settings[data-view="index"] > .s-nav .s-nav-group { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; }
|
|
@@ -1802,6 +1799,21 @@ body.side-resizing, body.side-resizing * { cursor: col-resize !important; user-s
|
|
|
1802
1799
|
letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
|
|
1803
1800
|
.u-cg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1804
1801
|
.u-cg-count { flex: none; }
|
|
1802
|
+
/* M-3241 (the user): a group of two or more logins folds — −/+ on its header's right cycles every window → one line per
|
|
1803
|
+
login (its binding window beside its name) → the header alone with the highest percent, in its warning colour. */
|
|
1804
|
+
.u-cg-tools { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s-2); align-self: center; text-transform: none; letter-spacing: 0; }
|
|
1805
|
+
.u-cg-top { font-size: var(--fs-sm); }
|
|
1806
|
+
.u-cg-top.u-cm-pct.is-stale { color: var(--text-3); } /* a stale login's cached number: muted, as its row (#4054 review) */
|
|
1807
|
+
.u-cg-toggle { width: 24px; height: 24px; margin: -4px calc(-1 * var(--s-1)) -4px 0; color: var(--text-3); }
|
|
1808
|
+
.u-cg-toggle:hover { color: var(--text); }
|
|
1809
|
+
.u-cgroup.is-collapsed > .u-cg-head { padding-bottom: 7px; }
|
|
1810
|
+
.u-crow.is-one { flex-direction: row; align-items: center; gap: var(--s-3); }
|
|
1811
|
+
.u-crow.is-one > .u-crow-head { flex: 0 0 32%; min-width: 0; }
|
|
1812
|
+
.u-crow.is-one > .u-crow-head .u-crow-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1813
|
+
.u-crow.is-one .u-plan { display: none; } /* one line: the name gets the room; the plan is in the full rows */
|
|
1814
|
+
.u-crow.is-one .u-cm { grid-template-columns: 3em minmax(0, 1fr) 2.9em 3.7em; } /* 「5小時」 whole */
|
|
1815
|
+
.u-crow.is-one > .u-cm, .u-crow.is-one > .u-crow-note { flex: 1 1 0; min-width: 0; }
|
|
1816
|
+
@media (pointer: coarse) { .u-cg-toggle { width: var(--tap); height: var(--tap); margin-block: calc((24px - var(--tap)) / 2); } }
|
|
1805
1817
|
.u-crow { display: flex; flex-direction: column; gap: 3px; width: 100%; min-width: 0; padding: 6px var(--s-3); border: 0; border-top: 1px solid var(--border);
|
|
1806
1818
|
background: transparent; color: inherit; font: inherit; line-height: 1.3; text-align: left; cursor: pointer; }
|
|
1807
1819
|
.u-cg-head + .u-crow { border-top: 0; }
|
|
@@ -4586,10 +4598,8 @@ html.oo-immersive .p-fleet > .panel-body { z-index: 50; }
|
|
|
4586
4598
|
.p-settings > .s-nav .seg-item.active { background: none; color: var(--accent); border-bottom-color: var(--accent); }
|
|
4587
4599
|
.p-settings > .s-nav .seg-item.active::before { display: none; }
|
|
4588
4600
|
}
|
|
4589
|
-
/* S5. Phone
|
|
4601
|
+
/* S5. Phone (M-3245: the section's way back is the header's ←; no "‹ Settings" bar). */
|
|
4590
4602
|
@media (max-width: 899px) {
|
|
4591
|
-
.p-settings > .panel-body .s-back { min-height: 48px; margin: calc(-1 * var(--s-4)) calc(-1 * var(--s-4)) var(--s-4); padding: 0 var(--s-4); background: var(--surface); border-bottom: 1px solid var(--border); font-weight: var(--fw-semibold); }
|
|
4592
|
-
.p-settings .s-back .s-back-here { font-weight: var(--fw-semibold); }
|
|
4593
4603
|
.p-settings[data-view="index"] > .s-nav .s-nav-group + .s-nav-group { border-top: 0; padding-top: 0; }
|
|
4594
4604
|
}
|
|
4595
4605
|
/* The agent page's cards: two columns on a wide page (`.ap-span2` across both), one column when it is narrow. */
|
|
@@ -4637,7 +4647,7 @@ html.oo-immersive .p-fleet > .panel-body { z-index: 50; }
|
|
|
4637
4647
|
.sidebar.fleet-side:not(.drawer-narrow) .side-head { padding-left: var(--s-1); }
|
|
4638
4648
|
.sidebar.fleet-side:not(.drawer-narrow) .side-collapse { order: -1; min-width: var(--tap); min-height: var(--tap); }
|
|
4639
4649
|
.sidebar.fleet-side:not(.drawer-narrow) .side-collapse .ic-sidebar { display: none; }
|
|
4640
|
-
.sidebar.fleet-side:not(.drawer-narrow) .side-collapse .ic-
|
|
4650
|
+
.sidebar.fleet-side:not(.drawer-narrow) .side-collapse .ic-close { display: inline-block; }
|
|
4641
4651
|
.sidebar.fleet-side:not(.drawer-narrow) .v-inst { min-height: 72px; gap: var(--s-3); padding-block: var(--s-2); }
|
|
4642
4652
|
.sidebar.fleet-side:not(.drawer-narrow) .v-inst .av { width: 54px; height: 54px; margin-top: 0; font-size: var(--fs-xl); }
|
|
4643
4653
|
.sidebar.fleet-side:not(.drawer-narrow) .v-inst .av.av-emoji { font-size: calc(var(--fs-xl) * 1.4); }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.hub-roles .btn, .hub-roles .field :is(input,select) { min-height: var(--tap); }
|
|
2
|
+
.hub-role-head, .hub-role-actions, .hub-role-list > li { display:flex; gap:var(--s-3); align-items:center; flex-wrap:wrap; }
|
|
3
|
+
.hub-role-head { justify-content:space-between; }
|
|
4
|
+
.hub-role-actions { margin-top:var(--s-4); }
|
|
5
|
+
.hub-role-list { list-style:none; padding:0; margin:0; }
|
|
6
|
+
.hub-role-list > li { padding:var(--s-3) 0; border-bottom:1px solid var(--border); }
|
|
7
|
+
.hub-role-list .grow { min-width:0; overflow-wrap:anywhere; }
|
|
8
|
+
.hub-role-detail { display:block; }
|
|
9
|
+
.hub-role-check { display:flex; align-items:center; gap:var(--s-3); min-height:var(--tap); padding:var(--s-2) 0; }
|
|
10
|
+
.hub-role-check input { flex:none; }
|
|
11
|
+
.hub-role-search { display:flex; gap:var(--s-3); flex-wrap:wrap; align-items:end; }
|
|
12
|
+
.hub-role-search > .field { flex:1; min-width:10rem; }
|
|
13
|
+
.hub-role-search > ul { width:100%; }
|
|
14
|
+
.hub-roles :is(code,p,td,small) { overflow-wrap:anywhere; }
|
|
15
|
+
.hub-roles code { white-space:normal; }
|
|
16
|
+
.hub-role-table-wrap { overflow-x:auto; }
|
|
17
|
+
.hub-roles table { width:100%; border-collapse:collapse; }
|
|
18
|
+
.hub-roles :is(th,td) { text-align:start; vertical-align:top; padding:var(--s-3); border-bottom:1px solid var(--border); }
|
|
19
|
+
@media (max-width:899px), (pointer:coarse) {
|
|
20
|
+
.hub-roles .field :is(input,select) { min-width:0; width:100%; font-size:var(--fs-md); }
|
|
21
|
+
.hub-role-table-wrap { overflow:visible; }
|
|
22
|
+
.hub-roles :is(table,tbody) { display:block; }
|
|
23
|
+
.hub-roles thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
|
|
24
|
+
.hub-roles tr { display:block; padding:var(--s-3) 0; border-bottom:1px solid var(--border); }
|
|
25
|
+
.hub-roles td { display:block; border:0; padding:var(--s-1) 0; }
|
|
26
|
+
.hub-roles td::before { content:attr(data-label); color:var(--text-2); margin-inline-end:var(--s-2); }
|
|
27
|
+
}
|
package/dist/ui/shared/hub.css
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/* AgEnD Hub P1, slice 3: the Hub pages' own stylesheet, linked by their lazy modules (hub-strings.js linkHubCss), so a
|
|
2
2
|
tab opened before an upgrade (an app.css without these rules) draws them the same. Never loaded while the Hub is off. */
|
|
3
|
-
|
|
4
|
-
.
|
|
5
|
-
|
|
3
|
+
/* M-3235 (the user, beta.6): the switch is on the column's gutters — the nav rows' (side-nav's padding) on a desk, the filter
|
|
4
|
+
row's in the phone drawer (below). Each half is as wide as what it says and the room left is shared equally, so both
|
|
5
|
+
have the same padding; when there is none left, 我的 Fleet stays whole and the Hub's name ends in "…" before its ↗ (the
|
|
6
|
+
whole name in the link's title and accessible name). */
|
|
7
|
+
.hub-switch { display: flex; gap: 2px; margin: 0 var(--s-2) var(--s-2); padding: 2px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
|
|
8
|
+
.hub-switch-item { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1); min-height: 28px; padding: 0 var(--s-2);
|
|
9
|
+
border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text-2); text-decoration: none; white-space: nowrap; overflow: hidden; }
|
|
10
|
+
.hub-switch-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
11
|
+
.hub-switch-item > .icon { flex: none; }
|
|
12
|
+
.hub-switch-item.is-current { flex-shrink: 0; }
|
|
13
|
+
@media (max-width: 899px) { .sidebar.fleet-side .hub-switch { margin: 0 var(--s-2) var(--s-2) var(--s-3); } }
|
|
6
14
|
.hub-switch-item.is-current { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); font-weight: var(--fw-medium); }
|
|
7
15
|
a.hub-switch-item:hover { color: var(--text); }
|
|
8
16
|
a.hub-switch-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
|