adminizer 5.0.0-build.13 → 5.0.0-build.15
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/assets/{add-B_hn__Ba.js → add-DIIY5dXL.js} +1 -1
- package/assets/add-group-Hjg8tUyg.js +1 -0
- package/assets/{add-user-Bh1iqSem.js → add-user-BgNJ0sw6.js} +1 -1
- package/assets/ai-assistant/agent.es.js +1 -1
- package/assets/app-Lpo3bWGf.css +1 -0
- package/assets/app.js +2 -2
- package/assets/{catalog-DjK8r0Mn.js → catalog-r732BMhv.js} +4 -4
- package/assets/{dashboard-CbJIK7ka.js → dashboard-Cp15RaUp.js} +1 -1
- package/assets/history-DOGuvQaF.js +1 -0
- package/assets/{init-user-8aUohVDq.js → init-user-QihBlzjm.js} +1 -1
- package/assets/{list-C6w_xDK2.js → list-BMvTxE5X.js} +1 -1
- package/assets/{login-CO4laf6m.js → login-TJqrgvWB.js} +1 -1
- package/assets/manifest.json +33 -33
- package/assets/{media-manager-BDbpSSjH.js → media-manager-CHrLjpDc.js} +3 -3
- package/assets/{module-DvPjKyF_.js → module-B8L3KtWB.js} +1 -1
- package/assets/{notification-N_b-N0Zu.js → notification-8xmbg7ox.js} +1 -1
- package/assets/{register-DBYIMXGQ.js → register-C9ZkVhe0.js} +1 -1
- package/assets/{ru-rYKdQbWF.js → ru-3AOtVW4L.js} +1 -1
- package/assets/{user-filters-list-xbJoY_5_.js → user-filters-list-DkWe7yxt.js} +1 -1
- package/assets/{welcome-BUkdkKa5.js → welcome-B08pjcb2.js} +1 -1
- package/assets/with-app-layout-DxjmlLrK.js +1 -0
- package/controllers/access-rights/permissionOptions.d.ts +2 -0
- package/controllers/access-rights/permissionOptions.js +23 -0
- package/controllers/add.js +1 -1
- package/controllers/addGroup.js +15 -6
- package/controllers/ai/AiAssistantController.js +4 -3
- package/controllers/edit.js +1 -1
- package/controllers/editGroup.js +15 -6
- package/controllers/filter-fields/savedFilters.js +1 -1
- package/controllers/history-actions/HistoryController.js +6 -6
- package/controllers/list.js +1 -1
- package/controllers/login.js +1 -1
- package/controllers/notifications/NotificationController.js +14 -8
- package/controllers/view.js +1 -1
- package/controllers/widgets/filterInfo.js +1 -1
- package/helpers/accessRightsHelper.d.ts +9 -2
- package/helpers/accessRightsHelper.js +79 -12
- package/helpers/inertiaActionsHelper.d.ts +1 -1
- package/helpers/inertiaActionsHelper.js +4 -5
- package/helpers/inertiaAddHelper.d.ts +1 -1
- package/helpers/inertiaAddHelper.js +3 -3
- package/helpers/inertiaGroupHelper.js +10 -2
- package/helpers/inertiaListHelper.d.ts +1 -1
- package/helpers/inertiaListHelper.js +7 -8
- package/interfaces/types.d.ts +18 -0
- package/lib/app-manager/AdminizerApp.d.ts +7 -2
- package/lib/app-manager/AppManager.js +4 -0
- package/lib/notifications/GeneralNotificationService.js +1 -1
- package/lib/notifications/SystemNotificationService.js +1 -1
- package/models/Group.d.ts +2 -1
- package/package.json +2 -2
- package/policies/authPolicies.js +6 -6
- package/system/Router.js +2 -0
- package/assets/add-group-0SdYgiXZ.js +0 -1
- package/assets/app-DcWwG3m4.css +0 -1
- package/assets/history-CZAJgVXP.js +0 -1
- package/assets/with-app-layout-WhRyO5WK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e,r as a,t,j as r,
|
|
1
|
+
import{u as e,r as a,t,j as r,v as c,A as u}from"./app.js";import{w as p}from"./with-app-layout-DxjmlLrK.js";import"./use-appearance-_EbbjHTh.js";const f=[];function n(){const o=e();return a.useEffect(()=>{const s=o.props.flash;s&&(s.success&&t.success(s.success),s.error&&t.error(s.error))},[o.props.flash]),r.jsxs(r.Fragment,{children:[r.jsx(c,{position:"top-center",richColors:!0,closeButton:!0}),r.jsx(u,{page:o,catalog:!1})]})}const d=p(n,{breadcrumbs:f,className:"overflow-auto h-[calc(100svh-16px)]"});export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as E,a as I,r as p,j as e,B as f,L as S,I as C,M as A,b as w,c as b,d as N,C as O,T as R,e as z,f as B,g as D,h as M,P as G,i as q,k as U,l as H}from"./app.js";import{w as J}from"./with-app-layout-DxjmlLrK.js";import"./use-appearance-_EbbjHTh.js";const v=p.memo(({field:s,disabled:c,value:d,onCheckedChange:m,tooltip:i})=>{const x=p.useCallback(h=>{m(s.name,h)},[s.name,m]);return e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(O,{id:s.name,className:"cursor-pointer size-5",disabled:c,checked:d,onCheckedChange:x}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(b,{className:"cursor-pointer",htmlFor:s.name,children:s.label}),i&&e.jsx(R,{children:e.jsxs(z,{children:[e.jsx(B,{onClick:h=>h.preventDefault(),children:e.jsx(C,{iconNode:D,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(M,{align:"center",side:"top",children:e.jsx("p",{children:s.tooltip})})]})})]})]})}),_=p.memo(({field:s,disabled:c,value:d,onCheckedChange:m,onRightsChange:i})=>{const x=s.options?.permissionOptions,[h,k]=p.useState(!1),[o,r]=p.useState(null),[l,g]=p.useState(!1),[t,a]=p.useState(null);if(!x)return e.jsx(v,{field:s,disabled:c,value:d,onCheckedChange:m,tooltip:!0});const y=`token-record-rights-${s.name.slice(15)}`,j=x.rights,F=async()=>{if(!(o||l)){g(!0),a(null);try{const n=s.name.slice(15),u=await H.getJson(`${window.routePrefix}/access-rights/permission-options`,{params:{tokenId:n}});r(u.data.options)}catch{a("Не удалось загрузить варианты разрешения")}finally{g(!1)}}},T=n=>{k(n),n&&F()},$=(n,u)=>{const L=u===!0?Array.from(new Set([...j,n])):j.filter(P=>P!==n);i(y,L)};return e.jsxs("div",{className:"grid gap-2",children:[e.jsx(v,{field:s,disabled:c,value:d,onCheckedChange:m,tooltip:!0}),d&&e.jsxs(G,{open:h,onOpenChange:T,children:[e.jsx(q,{asChild:!0,children:e.jsxs(f,{type:"button",variant:"outline",size:"sm",className:"w-fit ml-8",disabled:c,children:["Выбрать варианты (",j.length,")"]})}),e.jsxs(U,{align:"start",className:"max-h-80 overflow-y-auto",children:[l&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(w,{className:"size-4 animate-spin"}),"Загрузка…"]}),t&&e.jsx("p",{className:"text-sm text-destructive",children:t}),o?.map(n=>e.jsxs("div",{className:"flex gap-3 items-start py-1",children:[e.jsx(O,{id:`${s.name}-${n.id}`,checked:j.includes(n.id),disabled:c,onCheckedChange:u=>$(n.id,u)}),e.jsxs(b,{className:"cursor-pointer grid gap-0.5",htmlFor:`${s.name}-${n.id}`,children:[e.jsx("span",{children:n.name}),n.description&&e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:n.description})]})]},n.id)),o?.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Вариантов нет"})]})]})]})});function K(){const s=E(),{fields:c,groupedTokens:d,users:m}=s.props,{data:i,setData:x,clearErrors:h,post:k,processing:o}=I({...Object.fromEntries(c.map(t=>[t.name,t.value])),...Object.fromEntries(m.map(t=>[t.name,t.value])),...Object.fromEntries(d.flatMap(t=>t.fields.flatMap(a=>[[a.name,a.value],...a.options?.permissionOptions?[[`token-record-rights-${a.name.slice(15)}`,a.options.permissionOptions.rights]]:[]])))}),r=t=>s.props.fields.find(a=>a.name===t),l=p.useCallback((t,a)=>{h(),x(t,a)},[]),g=t=>{t.preventDefault(),k(s.props.postLink)};return e.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[e.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[e.jsx(f,{className:"mb-3 w-fit",asChild:!0,children:e.jsxs(S,{href:s.props.btnBack.link,children:[e.jsx(C,{iconNode:A}),s.props.btnBack.title]})}),e.jsxs(f,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:o||s.props.view,children:[o&&e.jsx(w,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:g,className:`${s.props.view?"cursor-not-allowed":""}`,children:e.jsxs("div",{className:"flex flex-col gap-6 max-w-[1144px]",children:[e.jsx("h2",{className:"font-bold text-xl",children:s.props.head}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(b,{htmlFor:r("name")?.name,children:r("name")?.label}),e.jsx(N,{id:r("name")?.name,type:"text",required:!0,tabIndex:1,autoComplete:r("name")?.name,value:i.name,onChange:t=>l("name",t.target.value),disabled:o||s.props.view,placeholder:r("name")?.label})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(b,{htmlFor:r("description")?.name,children:r("description")?.label}),e.jsx(N,{id:r("description")?.name,type:"text",required:!0,tabIndex:1,autoComplete:r("description")?.name,value:i.description,onChange:t=>l("description",t.target.value),disabled:o||s.props.view,placeholder:r("description")?.label})]}),s.props.users.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-bold text-xl",children:s.props.userHead}),s.props.users.map(t=>e.jsx(v,{field:t,disabled:o||s.props.view,value:i[t.name],onCheckedChange:l},t.name))]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 gap-4",children:s.props.groupedTokens?.length>0&&s.props.groupedTokens.map(t=>e.jsxs("div",{className:"grid gap-4 content-start justify-between",children:[e.jsx("h2",{className:"font-bold text-xl mt-3",children:t.header}),t.fields.map(a=>a.options?.permissionOptions?e.jsx(_,{field:{...a,options:{permissionOptions:{...a.options.permissionOptions,rights:i[`token-record-rights-${a.name.slice(15)}`]}}},disabled:o||s.props.view,value:i[a.name],onCheckedChange:l,onRightsChange:l},a.name):e.jsx(v,{field:a,disabled:o||s.props.view,value:i[a.name],onCheckedChange:l,tooltip:!0},a.name))]},t.header))})]})})]})}const Q=[];function V(){return e.jsx(K,{})}const Z=J(V,{breadcrumbs:Q});export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as B,r as m,a as M,j as e,B as d,L as j,I as f,M as H,b as O,c as n,d as c,S as w,
|
|
1
|
+
import{u as B,r as m,a as M,j as e,B as d,L as j,I as f,M as H,b as O,c as n,d as c,S as w,m as b,n as v,o as N,p as y,C as g,T as Y,e as $,f as _,g as G,h as J,q as Q,K as W,s as X,R as Z,l as C,t as h}from"./app.js";import{M as ee,w as se}from"./with-app-layout-DxjmlLrK.js";import"./use-appearance-_EbbjHTh.js";function ae(){const l=B(),[k,P]=m.useState(),{fields:A,groups:F,auth:I}=l.props,[p,U]=m.useState(!1),[x,z]=m.useState(l.props.apiKey),[K,u]=m.useState(!1),{data:r,setData:S,errors:R,setError:T,clearErrors:L,post:E,processing:i}=M({...Object.fromEntries(A.map(s=>[s.name,s.value])),...Object.fromEntries(F.map(s=>[s.name,s.value]))});m.useEffect(()=>{(async()=>{const o=await C.get(`${window.routePrefix}/get-timezones`);P(o.data.timezones)})()},[]);const a=s=>l.props.fields.find(o=>o.name===s),q=s=>{if(s.preventDefault(),r.userPassword!==r.repeatUserPassword){T("repeatUserPassword",l.props.passwordError);return}E(l.props.postLink)},t=(s,o)=>{L(),S(s,o)},D=async()=>{try{const s=await C.post(`${window.routePrefix}/api/user-key/regenerate`);z(s.data.apiKey),h.success("User API key regenerated")}catch(s){console.error("Failed to regenerate user API key:",s),h.error("Failed to regenerate user API key")}u(!1)},V=async()=>{if(x)try{await navigator.clipboard.writeText(x),h.success("API key copied to clipboard")}catch{h.error("Failed to copy")}};return e.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[e.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[e.jsx(d,{className:"mb-3 w-fit",asChild:!0,children:e.jsxs(j,{href:l.props.btnBack.link,children:[e.jsx(f,{iconNode:H}),l.props.btnBack.title]})}),e.jsxs(d,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:i||l.props.view,children:[i&&e.jsx(O,{className:"h-4 w-4 animate-spin"}),l.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:q,className:l.props.view?"cursor-not-allowed":"",children:e.jsxs("div",{className:"flex flex-col gap-10 max-w-[1144px]",children:[e.jsx("h2",{className:"font-bold text-xl",children:l.props.head}),e.jsxs("div",{className:"flex-col xl:flex-row flex gap-16",children:[e.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsx(n,{htmlFor:a("login")?.name,children:a("login")?.label}),e.jsx(c,{id:a("login")?.name,type:"text",required:!0,tabIndex:1,autoComplete:"username",value:r.login,onChange:s=>t("login",s.target.value),disabled:i||l.props.view,placeholder:a("login")?.label})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(n,{htmlFor:a("fullName")?.name,children:a("fullName")?.label}),e.jsx(c,{id:a("fullName")?.name,type:"text",required:!0,tabIndex:1,autoComplete:"additional-name",value:r.fullName,onChange:s=>t("fullName",s.target.value),disabled:i||l.props.view,placeholder:a("fullName")?.label})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(n,{htmlFor:a("email")?.name,children:a("email")?.label}),e.jsx(c,{id:a("email")?.name,type:"email",required:!0,tabIndex:1,autoComplete:"email",value:r.email,onChange:s=>t("email",s.target.value),disabled:i||l.props.view,placeholder:a("email")?.label})]})]}),e.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsx(n,{htmlFor:a("timezone")?.name,children:a("timezone")?.label}),e.jsxs(w,{onValueChange:s=>t("timezone",s),defaultValue:r.timezone,disabled:i||l.props.view,children:[e.jsx(b,{className:"w-full cursor-pointer",children:e.jsx(v,{placeholder:a("timezone")?.name})}),e.jsx(N,{children:(k??[]).map(s=>e.jsx(y,{value:s.value,children:s.label},s.value))})]})]}),e.jsxs("div",{className:"flex flex-col md:flex-row justify-start gap-4 xl:justify-between items-start md:items-center",children:[a("date")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(n,{htmlFor:a("date")?.name,children:a("date")?.label}),e.jsx(c,{id:a("date")?.name,type:"date",className:"max-w-fit",tabIndex:1,value:r.date,onChange:s=>t("date",s.target.value),disabled:i})]}),e.jsxs("div",{className:"flex gap-6",children:[a("isAdmin")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(n,{className:"cursor-pointer",htmlFor:a("isAdmin")?.name,children:a("isAdmin")?.label}),e.jsx(g,{id:a("isAdmin")?.name,className:"cursor-pointer size-5",disabled:i||l.props.view,checked:r.isAdmin,onCheckedChange:s=>t("isAdmin",s)})]}),a("isConfirmed")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(n,{className:"cursor-pointer",htmlFor:a("isConfirmed")?.name,children:a("isConfirmed")?.label}),e.jsx(g,{id:a("isConfirmed")?.name,className:"cursor-pointer size-5",disabled:i||l.props.view,checked:r.isConfirmed,onCheckedChange:s=>t("isConfirmed",s)})]})]})]}),a("locale")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(n,{htmlFor:a("locale")?.name,children:a("locale")?.label}),e.jsxs(w,{onValueChange:s=>t("locale",s),defaultValue:r.locale,disabled:i||l.props.view,children:[e.jsx(b,{className:"w-full cursor-pointer",children:e.jsx(v,{placeholder:a("locale")?.name})}),e.jsx(N,{children:(l.props.locales??[]).map(s=>e.jsx(y,{value:s.value,children:s.label},s.value))})]})]})]})]}),I.user.isAdministrator&&e.jsx(d,{className:"w-fit",asChild:!0,variant:"outline",children:e.jsxs(j,{href:l.props.userPretend.postLink,method:"post",data:{login:r.login,pretend:!0},children:[e.jsx(ee,{name:"masks",className:"!text-[18px]"}),l.props.userPretend.label]})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("label",{className:"font-bold text-xl",children:a("userPassword")?.label}),e.jsx(Y,{children:e.jsxs($,{children:[e.jsx(_,{onClick:s=>s.preventDefault(),children:e.jsx(f,{iconNode:G,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(J,{align:"center",side:"top",children:e.jsx("p",{children:a("userPassword")?.tooltip})})]})})]}),e.jsxs("div",{className:"grid grid-col-1 lg:grid-cols-2 grid-rows-2 gap-x-16 gap-y-6",children:[e.jsxs("div",{className:"grid gap-4 col-span-1",children:[e.jsx(n,{htmlFor:a("userPassword")?.name,children:a("userPassword")?.label}),e.jsx(c,{id:a("userPassword")?.name,type:"password",required:!l.props.edit,tabIndex:1,autoComplete:"new-password",value:r.password,onChange:s=>t("userPassword",s.target.value),disabled:i||l.props.view,placeholder:a("userPassword")?.label})]}),e.jsxs("div",{className:"grid gap-4 col-span-1 col-start-1",children:[e.jsx(n,{htmlFor:a("repeatUserPassword")?.name,children:a("repeatUserPassword")?.label}),e.jsx(c,{id:a("repeatUserPassword")?.name,type:"password",required:!l.props.edit,tabIndex:1,autoComplete:"new-password",value:r.repeatUserPassword,onChange:s=>t("repeatUserPassword",s.target.value),disabled:i||l.props.view,placeholder:a("repeatUserPassword")?.label}),e.jsx(Q,{message:R.repeatUserPassword})]})]}),l.props.groups.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-bold text-xl",children:l.props.groupHead}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 xl:grid-cols-6 gap-4",children:l.props.groups.map(s=>e.jsxs("div",{className:"grid gap-4",children:[e.jsx(n,{className:"cursor-pointer",htmlFor:s.name,children:s.label}),e.jsx(g,{id:s.name,disabled:i||l.props.view,className:"cursor-pointer size-5",checked:r[s.name],onCheckedChange:o=>t(s.name,o)})]},s.name))})]}),l.props.edit&&!l.props.view&&e.jsxs(e.Fragment,{children:[e.jsxs("h2",{className:"font-bold text-xl flex items-center gap-2",children:[e.jsx(W,{className:"w-5 h-5"}),"User API Key (for feeds)"]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[x&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 text-sm bg-muted px-3 py-2 rounded font-mono truncate",children:p?x:"••••••••••••••••••••••••"}),e.jsx(d,{variant:"outline",size:"sm",type:"button",onClick:()=>U(!p),children:p?"Hide":"Show"}),p&&e.jsx(d,{variant:"outline",size:"sm",type:"button",onClick:V,children:e.jsx(X,{className:"w-4 h-4"})})]}),e.jsxs(d,{variant:"outline",size:"sm",type:"button",className:"w-fit",onClick:()=>u(!0),children:[e.jsx(Z,{className:"w-4 h-4 mr-2"}),"Regenerate User API Key"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Regenerating this key will invalidate all existing feed URLs. You will need to update the ",e.jsx("code",{className:"bg-muted px-1 text-xs",children:"?userKey="})," parameter in all feed links."]})]})]}),K&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-background rounded-lg shadow-lg max-w-md w-full p-6",children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Regenerate User API Key"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"This will invalidate all existing feed URLs. You will need to update them with the new userKey."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(d,{variant:"outline",type:"button",onClick:()=>u(!1),children:"Cancel"}),e.jsx(d,{variant:"destructive",type:"button",onClick:D,children:"Regenerate"})]})]})})]})})]})}const le=[];function re(){return e.jsx(ae,{})}const de=se(re,{breadcrumbs:le});export{de as default};
|