@kedge/admin 0.9.0 → 0.10.0
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/app/assets/{account-CU7zcg6G.js → account-BAdVy9E2.js} +1 -1
- package/dist/app/assets/{home-DyJFgp2b.js → home-BCCZ6txc.js} +1 -1
- package/dist/app/assets/{index-BlePnLrI.js → index-kv11NdsY.js} +2 -2
- package/dist/app/assets/{invite-6BDKedf8.js → invite-C4IwtpZf.js} +1 -1
- package/dist/app/assets/{resource-detail-Bza50ZKR.js → resource-detail-CRWJVEL8.js} +1 -1
- package/dist/app/assets/{resource-form-k15UPNI4.js → resource-form-DulAO-yd.js} +1 -1
- package/dist/app/assets/{resource-list-91dh3eIq.js → resource-list-wxhtKedG.js} +1 -1
- package/dist/app/assets/{setup-GUJGt4SV.js → setup-CBpGZMzZ.js} +1 -1
- package/dist/app/assets/{use-command-QXAKOc9g.js → use-command-CVgCpnG6.js} +1 -1
- package/dist/app/assets/{work-lists-e8xFyCUq.js → work-lists-CKGWNjSC.js} +1 -1
- package/dist/app/build.json +1 -1
- package/dist/app/index.html +1 -1
- package/package.json +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,i as t,l as n,n as r,r as i,t as a,u as o}from"./card-CH9fCW35.js";import{f as s,i as c,n as l,p as u,u as d}from"./index-
|
|
1
|
+
import{f as e,i as t,l as n,n as r,r as i,t as a,u as o}from"./card-CH9fCW35.js";import{f as s,i as c,n as l,p as u,u as d}from"./index-kv11NdsY.js";var f=e(o(),1),p=n();function m(){let e=s(),n=u(),o=n.kind===`admin`?n.me:null,[m,h]=(0,f.useState)(``),[g,_]=(0,f.useState)(``),[v,y]=(0,f.useState)(null),b=o?`${o.principal.kind}:${o.principal.id}`:``,[x,S]=(0,f.useState)(()=>b?d.all(b):[]);if(!o||n.kind!==`admin`)return null;let C=o.session?.fresh_until?Date.parse(o.session.fresh_until)-(Date.now()+n.serverOffset)>0:!1;return(0,p.jsxs)(l,{id:`core.account`,title:`Your account`,children:[(0,p.jsx)(a,{title:`Who you are`,block:`core.account.who`,children:(0,p.jsxs)(`dl`,{className:`space-y-1 text-sm`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{className:`inline text-neutral-500`,children:`Signed in as `}),(0,p.jsx)(`dd`,{className:`inline`,children:o.principal.email})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`dt`,{className:`inline text-neutral-500`,children:`Roles `}),(0,p.jsx)(`dd`,{className:`inline`,children:(o.roles??[]).map(e=>`${e.name}${e.counted?``:` (needs a sign-in with your authenticator)`}`).join(`, `)||`none`})]})]})}),(0,p.jsxs)(a,{title:`Change your password`,block:`core.account.password`,children:[C?(0,p.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),y(null);try{await e.client.request(`POST`,`/auth/admin/password`,{body:{current_password:m,new_password:g},expect:o.authz}),y({tone:`info`,text:`Changed. Your other sessions have ended.`})}catch(n){if(n instanceof t&&n.code===`VIEW_CHANGED`)return e.viewChanged();n instanceof t&&n.status===401&&n.session!==null?y({tone:`error`,text:`Your current password didn't match.`}):n instanceof t&&n.status===403?y({tone:`error`,text:`This needs a sign-in with your authenticator in the last ten minutes. Sign out and in again.`}):y({tone:`error`,text:n instanceof t?n.message:`The store didn't answer.`})}},className:`max-w-sm space-y-2`,children:[(0,p.jsx)(`input`,{className:c,type:`password`,placeholder:`Current password`,value:m,onChange:e=>h(e.target.value)}),(0,p.jsx)(`input`,{className:c,type:`password`,placeholder:`New password`,value:g,onChange:e=>_(e.target.value)}),(0,p.jsx)(i,{type:`submit`,disabled:!m||!g,children:`Change password`})]}):(0,p.jsxs)(r,{tone:`warn`,children:[`Changing your password needs a sign-in with your authenticator in the last ten minutes.`,` `,(0,p.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>void e.signOut(),children:`Sign in again`}),`.`]}),v?(0,p.jsx)(r,{tone:v.tone,children:v.text}):null]}),x.length>0?(0,p.jsx)(a,{title:`Changes whose outcome isn't known`,block:`core.account.pending`,children:(0,p.jsx)(`ul`,{className:`space-y-1 text-sm`,children:x.map(e=>(0,p.jsxs)(`li`,{children:[e.label,`, sent `,new Date(e.at).toLocaleString(),`: open`,` `,(0,p.jsx)(`a`,{className:`underline`,href:`/app${e.reconcile}`,children:`where it would be`}),`, or`,` `,(0,p.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>{d.settle(e.key),S(d.all(b))},children:`abandon it (it may have happened)`}),`.`]},e.key))})}):null,(0,p.jsx)(i,{variant:`secondary`,onClick:()=>void e.signOut(!0),children:`Sign out everywhere`})]})}export{m as AccountPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e,n as t,r as n,t as r}from"./card-CH9fCW35.js";import{S as i,f as a,h as o,n as s,o as c,s as l}from"./index-
|
|
1
|
+
import{l as e,n as t,r as n,t as r}from"./card-CH9fCW35.js";import{S as i,f as a,h as o,n as s,o as c,s as l}from"./index-kv11NdsY.js";var u=e();function d(){let e=a(),d=l(),f=i({queryKey:[e.generation,`deliveries`,`health`],enabled:c(d,`delivery:read`),queryFn:async()=>(await e.client.request(`GET`,`/admin/deliveries/health`)).body}),p=Object.values(f.data?.failed??{}).reduce((e,t)=>e+t,0);return(0,u.jsx)(s,{id:`core.home`,title:`Home`,children:(0,u.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[c(d,`delivery:read`)?(0,u.jsxs)(r,{title:`Deliveries`,block:`core.home.deliveries`,children:[f.data?(0,u.jsxs)(`dl`,{className:`grid grid-cols-3 gap-2 text-sm`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`dt`,{className:`text-neutral-500`,children:`Failed`}),(0,u.jsx)(`dd`,{className:`text-lg font-semibold`,children:p})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`dt`,{className:`text-neutral-500`,children:`Blocked`}),(0,u.jsx)(`dd`,{className:`text-lg font-semibold`,children:f.data.blocked??0})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`dt`,{className:`text-neutral-500`,children:`Orphaned`}),(0,u.jsx)(`dd`,{className:`text-lg font-semibold`,children:f.data.orphaned??0})]})]}):f.isError?(0,u.jsxs)(t,{tone:`error`,children:[`Couldn't read the delivery health.`,` `,(0,u.jsx)(n,{variant:`secondary`,onClick:()=>void f.refetch(),children:`Retry`})]}):(0,u.jsx)(`p`,{className:`text-sm text-neutral-500`,children:`Loading…`}),(0,u.jsx)(o,{to:`/system/deliveries`,className:`mt-3 inline-block text-sm underline`,children:`See deliveries`})]}):null,c(d,`effect:read`)?(0,u.jsxs)(r,{title:`External calls`,block:`core.home.effects`,children:[(0,u.jsx)(`p`,{className:`text-sm text-neutral-600`,children:`Calls no observation settled are listed for staff to decide.`}),(0,u.jsx)(o,{to:`/system/effects`,className:`mt-3 inline-block text-sm underline`,children:`See unresolved effects`})]}):null,(0,u.jsx)(r,{title:`Setting up`,block:`core.home.setup`,children:(0,u.jsx)(o,{to:`/setup`,className:`text-sm underline`,children:`Open the setup checklist`})})]})})}export{d as HomePage};
|