adminizer 4.0.0-commit.a0ff2f0 → 4.0.0-commit.d27d87e
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/{app-B3KHqZ_H.css → app-C4A2HUBD.css} +1 -1
- package/assets/app.js +2 -2
- package/assets/field-renderer-CvC9UdC0.js +1 -1
- package/assets/home-CmIZ3AL2.js +1 -1
- package/assets/login-Bg7ZQrZc.js +6 -0
- package/assets/manifest.json +2 -2
- package/controllers/add.d.ts +1 -1
- package/controllers/add.js +7 -17
- package/controllers/addGroup.js +1 -4
- package/controllers/addUser.js +1 -4
- package/controllers/catalog/Catalog.js +1 -1
- package/controllers/ckeditorUpload.js +1 -1
- package/controllers/dashboard.d.ts +1 -1
- package/controllers/dashboard.js +2 -4
- package/controllers/edit.js +7 -13
- package/controllers/editGroup.js +1 -3
- package/controllers/editUser.js +1 -3
- package/controllers/form.js +1 -2
- package/controllers/getAllWidgets.js +1 -1
- package/controllers/initUser.js +1 -1
- package/controllers/list.js +1 -1
- package/controllers/login.js +3 -4
- package/controllers/media-manager/mediaManagerApi.js +1 -1
- package/controllers/navigation/edit.js +1 -1
- package/controllers/processInstallFinalize.js +1 -1
- package/controllers/processInstallStep.js +1 -1
- package/controllers/register.js +1 -5
- package/controllers/remove.js +1 -4
- package/controllers/timezones.js +1 -1
- package/controllers/view.js +1 -6
- package/controllers/welcome.js +1 -1
- package/controllers/widgets/Action.js +1 -1
- package/controllers/widgets/Custom.js +1 -1
- package/controllers/widgets/Info.js +1 -1
- package/controllers/widgets/switch.js +1 -1
- package/controllers/widgetsDB.js +1 -1
- package/helpers/accessRightsHelper.js +1 -1
- package/helpers/inertiaAddHelper.d.ts +5 -5
- package/interfaces/adminpanelConfig.d.ts +6 -1
- package/lib/Adminizer.js +1 -5
- package/lib/controls/ControlsHandler.d.ts +1 -1
- package/lib/controls/ControlsHandler.js +1 -1
- package/lib/datatable/NodeTable.js +0 -42
- package/lib/inertia/inertiaAdapter.js +1 -1
- package/package.json +3 -3
- package/policies/checkAuth.js +1 -1
- package/system/Router.js +0 -2
- package/system/bindAuthorization.js +17 -2
- package/system/bindInertia.js +2 -2
- package/system/defaults.js +3 -0
- package/assets/login-B7INjWDi.js +0 -6
- package/controllers/listJson.d.ts +0 -1
- package/controllers/listJson.js +0 -35
- package/helpers/viewsHelper.d.ts +0 -44
- package/helpers/viewsHelper.js +0 -82
- package/system/bindResFunctions.d.ts +0 -2
- package/system/bindResFunctions.js +0 -52
- package/system/bindViewsLocals.d.ts +0 -2
- package/system/bindViewsLocals.js +0 -19
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./toast-editor-X2U_pFls.js","./app.js","./app-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./toast-editor-X2U_pFls.js","./app.js","./app-C4A2HUBD.css","./compiler-runtime-tM4jBQ-T.js","./index-Vcq4gwWv.js","./use-window-size-B8l6Bpkf.js","./use-appearance-CL_TqHcP.js","./handsontable-D_wNwOhu.js","./VanillaJSONEditor-OdBvR1ds.js","./form-state-702tb_BV.js","./geo-json-BVpmaj6P.js","./button-CcO4Q6h6.js","./index-CNFwBlc7.js","./utils-jAU0Cazi.js","./createLucideIcon-BFG25zNo.js","./check-LAUWAnlX.js","./trash-2-BoK5Xp2F.js","./monaco-editor-BWdkjOSO.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Np=Object.defineProperty;var Dp=(o,i,e)=>i in o?Np(o,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[i]=e;var u=(o,i,e)=>Dp(o,typeof i!="symbol"?i+"":i,e);import{j as D,r as j,W as ui,g as ph,_ as no}from"./app.js";import{c as Aa}from"./compiler-runtime-tM4jBQ-T.js";import{C as Op}from"./checkbox-zNG98WS7.js";import{c as Fo}from"./utils-jAU0Cazi.js";import{e as bh,S as zp,d as Fp,a as Up,b as Hp,c as Wp}from"./select-B1LhFAX0.js";import{u as qp,c as Ui,a as jp}from"./index-B6nPyxx_.js";import{P as Ir,u as oo}from"./index-Dv6YbCDH.js";import{c as Gp}from"./index-D8YaJIVm.js";import{c as Kp,u as $p}from"./index-S2Olh4hE.js";import{u as Zp}from"./index-DwctwfU0.js";import xi from"./dynamic-controls-CSVVCONh.js";import{I as Jp}from"./input-coEb8Hta.js";import Yp from"./multi-select-CgIsryRX.js";import"./index-B7QLmddv.js";import"./index-CJTkueDA.js";import"./check-LAUWAnlX.js";import"./createLucideIcon-BFG25zNo.js";import"./index-DlfDI23T.js";import"./index-BNKtUMNI.js";import"./index-C4BeqGbx.js";import"./chevron-down-B5XuAFRu.js";import"./floating-ui.react-dom-DEWQUtJU.js";import"./button-CcO4Q6h6.js";import"./index-CNFwBlc7.js";import"./popover-DXKNm8mO.js";import"./index-DZ2G3GiC.js";import"./search-BspystAk.js";function Xp(o,i){for(var e=0;e<i.length;e++){const t=i[e];if(typeof t!="string"&&!Array.isArray(t)){for(const n in t)if(n!=="default"&&!(n in o)){const r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}function Qp(o){const i=Aa.c(8);let e,t;i[0]!==o?({className:e,...t}=o,i[0]=o,i[1]=e,i[2]=t):(e=i[1],t=i[2]);let n;i[3]!==e?(n=Fo("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),i[3]=e,i[4]=n):n=i[4];let r;return i[5]!==t||i[6]!==n?(r=D.jsx("textarea",{"data-slot":"textarea",className:n,...t}),i[5]=t,i[6]=n,i[7]=r):r=i[7],r}var wh=["PageUp","PageDown"],kh=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],yh={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Qi="Slider",[Vs,eb,tb]=Kp(Qi),[vh,w2]=Gp(Qi,[tb]),[ib,Rr]=vh(Qi),_h=j.forwardRef((o,i)=>{const{name:e,min:t=0,max:n=100,step:r=1,orientation:s="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[t],value:d,onValueChange:h=()=>{},onValueCommit:m=()=>{},inverted:g=!1,form:f,...p}=o,w=j.useRef(new Set),k=j.useRef(0),I=s==="horizontal"?nb:ob,[V=[],K]=qp({prop:d,defaultProp:c,onChange:$=>{var mt;(mt=[...w.current][k.current])==null||mt.focus(),h($)}}),F=j.useRef(V);function M($){const Z=cb(V,$);O($,Z)}function z($){O($,k.current)}function T(){const $=F.current[k.current];V[k.current]!==$&&m(V)}function O($,Z,{commit:mt}={commit:!1}){const Ut=mb(r),Ti=gb(Math.round(($-t)/r)*r+t,Ut),Ht=bh(Ti,[t,n]);K((Tt=[])=>{const gt=ab(Tt,Ht,Z);if(hb(gt,l*r)){k.current=gt.indexOf(Ht);const ln=String(gt)!==String(Tt);return ln&&mt&&m(gt),ln?gt:Tt}else return Tt})}return D.jsx(ib,{scope:o.__scopeSlider,name:e,disabled:a,min:t,max:n,valueIndexToChangeRef:k,thumbs:w.current,values:V,orientation:s,form:f,children:D.jsx(Vs.Provider,{scope:o.__scopeSlider,children:D.jsx(Vs.Slot,{scope:o.__scopeSlider,children:D.jsx(I,{"aria-disabled":a,"data-disabled":a?"":void 0,...p,ref:i,onPointerDown:Ui(p.onPointerDown,()=>{a||(F.current=V)}),min:t,max:n,inverted:g,onSlideStart:a?void 0:M,onSlideMove:a?void 0:z,onSlideEnd:a?void 0:T,onHomeKeyDown:()=>!a&&O(t,0,{commit:!0}),onEndKeyDown:()=>!a&&O(n,V.length-1,{commit:!0}),onStepKeyDown:({event:$,direction:Z})=>{if(!a){const Ti=wh.includes($.key)||$.shiftKey&&kh.includes($.key)?10:1,Ht=k.current,Tt=V[Ht],gt=r*Ti*Z;O(Tt+gt,Ht,{commit:!0})}}})})})})});_h.displayName=Qi;var[Ch,Lh]=vh(Qi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),nb=j.forwardRef((o,i)=>{const{min:e,max:t,dir:n,inverted:r,onSlideStart:s,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=o,[h,m]=j.useState(null),g=oo(i,I=>m(I)),f=j.useRef(void 0),p=$p(n),w=p==="ltr",k=w&&!r||!w&&r;function v(I){const V=f.current||h.getBoundingClientRect(),K=[0,V.width],M=Pa(K,k?[e,t]:[t,e]);return f.current=V,M(I-V.left)}return D.jsx(Ch,{scope:o.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:D.jsx(Th,{dir:p,"data-orientation":"horizontal",...d,ref:g,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:I=>{const V=v(I.clientX);s==null||s(V)},onSlideMove:I=>{const V=v(I.clientX);a==null||a(V)},onSlideEnd:()=>{f.current=void 0,l==null||l()},onStepKeyDown:I=>{const K=yh[k?"from-left":"from-right"].includes(I.key);c==null||c({event:I,direction:K?-1:1})}})})}),ob=j.forwardRef((o,i)=>{const{min:e,max:t,inverted:n,onSlideStart:r,onSlideMove:s,onSlideEnd:a,onStepKeyDown:l,...c}=o,d=j.useRef(null),h=oo(i,d),m=j.useRef(void 0),g=!n;function f(p){const w=m.current||d.current.getBoundingClientRect(),k=[0,w.height],I=Pa(k,g?[t,e]:[e,t]);return m.current=w,I(p-w.top)}return D.jsx(Ch,{scope:o.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:D.jsx(Th,{"data-orientation":"vertical",...c,ref:h,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const w=f(p.clientY);r==null||r(w)},onSlideMove:p=>{const w=f(p.clientY);s==null||s(w)},onSlideEnd:()=>{m.current=void 0,a==null||a()},onStepKeyDown:p=>{const k=yh[g?"from-bottom":"from-top"].includes(p.key);l==null||l({event:p,direction:k?-1:1})}})})}),Th=j.forwardRef((o,i)=>{const{__scopeSlider:e,onSlideStart:t,onSlideMove:n,onSlideEnd:r,onHomeKeyDown:s,onEndKeyDown:a,onStepKeyDown:l,...c}=o,d=Rr(Qi,e);return D.jsx(Ir.span,{...c,ref:i,onKeyDown:Ui(o.onKeyDown,h=>{h.key==="Home"?(s(h),h.preventDefault()):h.key==="End"?(a(h),h.preventDefault()):wh.concat(kh).includes(h.key)&&(l(h),h.preventDefault())}),onPointerDown:Ui(o.onPointerDown,h=>{const m=h.target;m.setPointerCapture(h.pointerId),h.preventDefault(),d.thumbs.has(m)?m.focus():t(h)}),onPointerMove:Ui(o.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&n(h)}),onPointerUp:Ui(o.onPointerUp,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&(m.releasePointerCapture(h.pointerId),r(h))})})}),Eh="SliderTrack",xh=j.forwardRef((o,i)=>{const{__scopeSlider:e,...t}=o,n=Rr(Eh,e);return D.jsx(Ir.span,{"data-disabled":n.disabled?"":void 0,"data-orientation":n.orientation,...t,ref:i})});xh.displayName=Eh;var Ns="SliderRange",Sh=j.forwardRef((o,i)=>{const{__scopeSlider:e,...t}=o,n=Rr(Ns,e),r=Lh(Ns,e),s=j.useRef(null),a=oo(i,s),l=n.values.length,c=n.values.map(m=>Ph(m,n.min,n.max)),d=l>1?Math.min(...c):0,h=100-Math.max(...c);return D.jsx(Ir.span,{"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,...t,ref:a,style:{...o.style,[r.startEdge]:d+"%",[r.endEdge]:h+"%"}})});Sh.displayName=Ns;var Ds="SliderThumb",Ah=j.forwardRef((o,i)=>{const e=eb(o.__scopeSlider),[t,n]=j.useState(null),r=oo(i,a=>n(a)),s=j.useMemo(()=>t?e().findIndex(a=>a.ref.current===t):-1,[e,t]);return D.jsx(rb,{...o,ref:r,index:s})}),rb=j.forwardRef((o,i)=>{const{__scopeSlider:e,index:t,name:n,...r}=o,s=Rr(Ds,e),a=Lh(Ds,e),[l,c]=j.useState(null),d=oo(i,v=>c(v)),h=l?s.form||!!l.closest("form"):!0,m=jp(l),g=s.values[t],f=g===void 0?0:Ph(g,s.min,s.max),p=lb(t,s.values.length),w=m==null?void 0:m[a.size],k=w?db(w,f,a.direction):0;return j.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]),D.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${f}% + ${k}px)`},children:[D.jsx(Vs.ItemSlot,{scope:o.__scopeSlider,children:D.jsx(Ir.span,{role:"slider","aria-label":o["aria-label"]||p,"aria-valuemin":s.min,"aria-valuenow":g,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...r,ref:d,style:g===void 0?{display:"none"}:o.style,onFocus:Ui(o.onFocus,()=>{s.valueIndexToChangeRef.current=t})})}),h&&D.jsx(sb,{name:n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:g},t)]})});Ah.displayName=Ds;var sb=o=>{const{value:i,...e}=o,t=j.useRef(null),n=Zp(i);return j.useEffect(()=>{const r=t.current,s=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(s,"value").set;if(n!==i&&l){const c=new Event("input",{bubbles:!0});l.call(r,i),r.dispatchEvent(c)}},[n,i]),D.jsx("input",{style:{display:"none"},...e,ref:t,defaultValue:i})};function ab(o=[],i,e){const t=[...o];return t[e]=i,t.sort((n,r)=>n-r)}function Ph(o,i,e){const r=100/(e-i)*(o-i);return bh(r,[0,100])}function lb(o,i){return i>2?`Value ${o+1} of ${i}`:i===2?["Minimum","Maximum"][o]:void 0}function cb(o,i){if(o.length===1)return 0;const e=o.map(n=>Math.abs(n-i)),t=Math.min(...e);return e.indexOf(t)}function db(o,i,e){const t=o/2,r=Pa([0,50],[0,t]);return(t-r(i)*e)*e}function ub(o){return o.slice(0,-1).map((i,e)=>o[e+1]-i)}function hb(o,i){if(i>0){const e=ub(o);return Math.min(...e)>=i}return!0}function Pa(o,i){return e=>{if(o[0]===o[1]||i[0]===i[1])return i[0];const t=(i[1]-i[0])/(o[1]-o[0]);return i[0]+t*(e-o[0])}}function mb(o){return(String(o).split(".")[1]||"").length}function gb(o,i){const e=Math.pow(10,i);return Math.round(o*e)/e}var fb=_h,pb=xh,bb=Sh,wb=Ah;function kb(o){const i=Aa.c(28);let e,t,n,r,s,a,l;i[0]!==o?({className:e,defaultValue:t,value:l,min:s,max:a,id:n,...r}=o,i[0]=o,i[1]=e,i[2]=t,i[3]=n,i[4]=r,i[5]=s,i[6]=a,i[7]=l):(e=i[1],t=i[2],n=i[3],r=i[4],s=i[5],a=i[6],l=i[7]);const c=s===void 0?0:s,d=a===void 0?100:a;let h,m;i[8]!==t||i[9]!==d||i[10]!==c||i[11]!==l?(m=Array.isArray(l)?l:Array.isArray(t)?t:[c,d],i[8]=t,i[9]=d,i[10]=c,i[11]=l,i[12]=m):m=i[12],h=m;const g=h;let f;i[13]!==e?(f=Fo("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),i[13]=e,i[14]=f):f=i[14];let p;i[15]===Symbol.for("react.memo_cache_sentinel")?(p=Fo("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),i[15]=p):p=i[15];let w;i[16]===Symbol.for("react.memo_cache_sentinel")?(w=D.jsx(pb,{"data-slot":"slider-track",className:p,children:D.jsx(bb,{"data-slot":"slider-range",className:Fo("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),i[16]=w):w=i[16];let k;i[17]!==g.length?(k=Array.from({length:g.length},yb),i[17]=g.length,i[18]=k):k=i[18];let v;return i[19]!==t||i[20]!==n||i[21]!==d||i[22]!==c||i[23]!==r||i[24]!==f||i[25]!==k||i[26]!==l?(v=D.jsxs(fb,{"data-slot":"slider",defaultValue:t,value:l,min:c,max:d,id:n,className:f,...r,children:[w,k]}),i[19]=t,i[20]=n,i[21]=d,i[22]=c,i[23]=r,i[24]=f,i[25]=k,i[26]=l,i[27]=v):v=i[27],v}function yb(o,i){return D.jsx(wb,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},i)}/**
|
|
3
3
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
4
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
package/assets/home-CmIZ3AL2.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./VanillaJSONEditor-OdBvR1ds.js","./app.js","./app-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./VanillaJSONEditor-OdBvR1ds.js","./app.js","./app-C4A2HUBD.css","./compiler-runtime-tM4jBQ-T.js","./index-Vcq4gwWv.js","./use-appearance-CL_TqHcP.js","./form-state-702tb_BV.js","./add-form-D7Gz1uwX.js","./button-CcO4Q6h6.js","./index-CNFwBlc7.js","./utils-jAU0Cazi.js","./icon-CgDnRol2.js","./label-BH_NLtVH.js","./index-Dv6YbCDH.js","./tooltip-DXyAGFz-.js","./index-B6nPyxx_.js","./index-D8YaJIVm.js","./floating-ui.react-dom-DEWQUtJU.js","./index-CJTkueDA.js","./index-DlfDI23T.js","./index-B7QLmddv.js","./index-BNKtUMNI.js","./field-renderer-CvC9UdC0.js","./checkbox-zNG98WS7.js","./index-DwctwfU0.js","./check-LAUWAnlX.js","./createLucideIcon-BFG25zNo.js","./select-B1LhFAX0.js","./index-S2Olh4hE.js","./index-C4BeqGbx.js","./chevron-down-B5XuAFRu.js","./dynamic-controls-CSVVCONh.js","./input-coEb8Hta.js","./multi-select-CgIsryRX.js","./popover-DXKNm8mO.js","./index-DZ2G3GiC.js","./search-BspystAk.js","./field-renderer-BlBZuSiD.css","./input-error-Dt30bqav.js","./move-left-BhKZRPb4.js","./loader-circle-Utah5tGx.js","./add-group-form-CFw1igaY.js","./add-user-form-fxpU-oac.js","./app-shell-Dgf4uNFy.js","./sidebar-C9-ESAx1.js","./app-sidebar-header-C5wVa7ER.js","./breadcrumbs-DlS-hpHL.js","./chevron-right-D5q8rF7h.js","./nav-user-p58e1wG0.js","./dropdown-menu-CKLjASQo.js","./user-info-D89n2REb.js","./user-menu-content-D25M1xxo.js","./chevrons-up-down-kALltqHV.js","./app-sidebar-D5-eQKSx.js","./nav-main-CcQo_Ho4.js","./material-icon-DpKyAc3Z.js","./date-picker-DMW7NWSI.js","./chevron-left-CoMhTMUD.js","./form-XjYeizmY.js","./geo-json-BVpmaj6P.js","./trash-2-BoK5Xp2F.js","./handsontable-D_wNwOhu.js","./list-table-CJgy5FsP.js","./sonner-Dzckw3U3.js","./pagination-render-S4EXTE9a.js","./monaco-editor-BWdkjOSO.js","./use-window-size-B8l6Bpkf.js","./nav-footer-BioIOL2n.js","./toast-editor-X2U_pFls.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{K as x,r as u,j as o,L as v,$ as L,_ as t}from"./app.js";const P=(m,r,_)=>{const e=m[r];return e?typeof e=="function"?e():Promise.resolve(e):new Promise((s,n)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+r+(r.split("/").length!==_?". Note that variables only represent file names one level deep.":""))))})};function I(){const m=x(),[r,_]=u.useState(null),[e,s]=u.useState(null),n=m.props.controls,l=async()=>{const{component:i,props:p}=n[0],d=(await P(Object.assign({"../components/VanillaJSONEditor.tsx":()=>t(()=>import("./VanillaJSONEditor-OdBvR1ds.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),"../components/add-form.tsx":()=>t(()=>import("./add-form-D7Gz1uwX.js"),__vite__mapDeps([7,1,2,3,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,6,38,39,40]),import.meta.url),"../components/add-group-form.tsx":()=>t(()=>import("./add-group-form-CFw1igaY.js"),__vite__mapDeps([41,1,2,3,8,9,10,11,12,13,32,23,16,15,17,18,24,20,25,26,14,19,21,39,40]),import.meta.url),"../components/add-user-form.tsx":()=>t(()=>import("./add-user-form-fxpU-oac.js"),__vite__mapDeps([42,1,2,3,11,10,8,9,12,13,32,27,15,16,17,18,28,19,24,21,29,30,26,25,23,20,14,38,39,40]),import.meta.url),"../components/app-shell.tsx":()=>t(()=>import("./app-shell-Dgf4uNFy.js"),__vite__mapDeps([43,1,2,3,44,9,8,10,35,26,29,14,15,13,16,17,18,19,20,21]),import.meta.url),"../components/app-sidebar-header.tsx":()=>t(()=>import("./app-sidebar-header-C5wVa7ER.js"),__vite__mapDeps([45,1,2,3,46,9,10,47,26,44,8,35,29,14,15,13,16,17,18,19,20,21,48,49,28,50,51,52,11,5]),import.meta.url),"../components/app-sidebar.tsx":()=>t(()=>import("./app-sidebar-D5-eQKSx.js"),__vite__mapDeps([53,1,2,3,54,44,9,8,10,35,26,29,14,15,13,16,17,18,19,20,21,55,47,52]),import.meta.url),"../components/breadcrumbs.tsx":()=>t(()=>import("./breadcrumbs-DlS-hpHL.js"),__vite__mapDeps([46,1,2,3,9,10,47,26]),import.meta.url),"../components/date-picker.tsx":()=>t(()=>import("./date-picker-DMW7NWSI.js"),__vite__mapDeps([56,1,2,3,10,8,9,47,26,57,34,17,29]),import.meta.url),"../components/dynamic-controls.tsx":()=>t(()=>import("./dynamic-controls-CSVVCONh.js"),__vite__mapDeps([31,1,2]),import.meta.url),"../components/field-renderer.tsx":()=>t(()=>import("./field-renderer-CvC9UdC0.js"),__vite__mapDeps([22,1,2,3,23,13,16,15,17,18,24,20,10,25,26,27,28,19,21,29,30,31,32,33,8,9,34,35,36,37]),import.meta.url),"../components/form.tsx":()=>t(()=>import("./form-XjYeizmY.js"),__vite__mapDeps([58,1,2,6,7,3,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40]),import.meta.url),"../components/geo-json.tsx":()=>t(()=>import("./geo-json-BVpmaj6P.js"),__vite__mapDeps([59,1,2,3,8,9,10,26,25,60]),import.meta.url),"../components/handsontable.tsx":()=>t(()=>import("./handsontable-D_wNwOhu.js"),__vite__mapDeps([61,1,2,5,3]),import.meta.url),"../components/icon.tsx":()=>t(()=>import("./icon-CgDnRol2.js"),__vite__mapDeps([11,1,2,3,10]),import.meta.url),"../components/input-error.tsx":()=>t(()=>import("./input-error-Dt30bqav.js"),__vite__mapDeps([38,1,2,3,10]),import.meta.url),"../components/list-table.tsx":()=>t(()=>import("./list-table-CJgy5FsP.js"),__vite__mapDeps([62,1,2,8,3,9,10,11,26,32,36,55,49,15,13,16,17,18,28,20,19,29,63,35,60,27,24,21,30,25,64,57,47]),import.meta.url),"../components/material-icon.tsx":()=>t(()=>import("./material-icon-DpKyAc3Z.js"),__vite__mapDeps([55,1,2,3,10]),import.meta.url),"../components/monaco-editor.tsx":()=>t(()=>import("./monaco-editor-BWdkjOSO.js"),__vite__mapDeps([65,1,2,3,5,66]),import.meta.url),"../components/multi-select.tsx":()=>t(()=>import("./multi-select-CgIsryRX.js"),__vite__mapDeps([33,1,2,3,8,9,10,34,17,29,35,26,13,19,18,36,30,25]),import.meta.url),"../components/nav-footer.tsx":()=>t(()=>import("./nav-footer-BioIOL2n.js"),__vite__mapDeps([67,1,2,3,11,10,44,9,8,35,26,29,14,15,13,16,17,18,19,20,21]),import.meta.url),"../components/nav-main.tsx":()=>t(()=>import("./nav-main-CcQo_Ho4.js").then(E=>E.n),__vite__mapDeps([54,1,2,3,44,9,8,10,35,26,29,14,15,13,16,17,18,19,20,21,55,47]),import.meta.url),"../components/nav-user.tsx":()=>t(()=>import("./nav-user-p58e1wG0.js"),__vite__mapDeps([48,1,2,3,49,15,13,16,17,18,28,20,19,29,10,44,9,8,35,26,14,21,50,51,52]),import.meta.url),"../components/pagination-render.tsx":()=>t(()=>import("./pagination-render-S4EXTE9a.js"),__vite__mapDeps([64,1,2,3,10,8,9,57,26,47]),import.meta.url),"../components/toast-editor.tsx":()=>t(()=>import("./toast-editor-X2U_pFls.js"),__vite__mapDeps([68,1,2,3,4,66,5]),import.meta.url),"../components/user-info.tsx":()=>t(()=>import("./user-info-D89n2REb.js"),__vite__mapDeps([50,1,2,3,16,18,13,10]),import.meta.url),"../components/user-menu-content.tsx":()=>t(()=>import("./user-menu-content-D25M1xxo.js"),__vite__mapDeps([51,1,2,3,49,15,13,16,17,18,28,20,19,29,10,50,26]),import.meta.url)}),`../components/${i}.tsx`,3)).default;_(o.jsx(d,{...p}))},c=async()=>{const{component:i}=n[1],a=(await import(i)).default;s(o.jsx(a,{message:"Hello from Component B"}))};return o.jsxs(o.Fragment,{children:[o.jsx(v,{title:"Home"}),o.jsx("div",{children:o.jsx(L,{href:"/page",children:"Page"})}),o.jsx("div",{children:o.jsx("h1",{children:"Is Home"})}),o.jsxs("div",{children:[o.jsx("button",{onClick:l,children:"Загрузить компонент"}),o.jsx("p",{}),r||o.jsx("p",{children:"Нажмите кнопку, чтобы загрузить компонент"})]}),o.jsx("p",{}),o.jsxs("div",{children:[o.jsx("button",{onClick:c,children:"Загрузить компонент"}),o.jsx("p",{}),e||o.jsx("p",{children:"Нажмите кнопку, чтобы загрузить компонент"})]})]})}export{I as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{r as ie,K as Ke,m as qe,j as i,$ as Ve}from"./app.js";import{c as We}from"./compiler-runtime-tM4jBQ-T.js";import{L as Be}from"./label-BH_NLtVH.js";import{I as Ce}from"./input-coEb8Hta.js";import{Icon as we}from"./icon-CgDnRol2.js";import{B as Ae}from"./button-CcO4Q6h6.js";import{T as Xe,t as Ye}from"./sonner-Dzckw3U3.js";import xe from"./input-error-Dt30bqav.js";import{i as Je}from"./use-appearance-CL_TqHcP.js";import{c as Qe}from"./createLucideIcon-BFG25zNo.js";import{L as Ze}from"./loader-circle-Utah5tGx.js";import"./index-Dv6YbCDH.js";import"./utils-jAU0Cazi.js";import"./index-CNFwBlc7.js";/**
|
|
2
|
+
* @license lucide-react v0.485.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const en=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ne=Qe("user",en),Ee=(e,t,s)=>{let r=1n,n=e%s;for(;t;)t&1n&&(r=r*n%s),n=n*n%s,t=t>>1n;return r};function ae(e,t,s){return typeof e=="bigint"&&typeof t=="bigint"&&typeof s=="bigint"?Ee(e,t,s):Number(Ee(BigInt(e),BigInt(t),BigInt(s)))}const S=crypto,nn=new TextEncoder,tn=new TextDecoder("utf-8",{ignoreBOM:!0}),ee={encode:e=>nn.encode(e),decode:e=>tn.decode(e)},Pe=(()=>{const t=[..."0123456789abcdef"],s=new Array(256);for(let r=0;r<256;r++)s[r]=`${t[r>>>4&15]}${t[r&15]}`;return s})(),sn=(()=>{const e={};for(let t=0;t<256;t++){const s=Pe[t],r=s[0],n=r.toUpperCase(),c=s[1],o=c.toUpperCase();e[s]=t,e[`${r}${o}`]=t,e[`${n}${c}`]=t,e[`${n}${o}`]=t}return e})(),rn=e=>!(e.length%2||!/^[a-fA-F0-9]*$/.test(e)),be={encode:e=>{let t="";for(let s=0,r=e.length;s<r;s++)t+=Pe[e[s]];return t},encodeStr:e=>be.encode(ee.encode(e)),decode:e=>{const t=e.length/2,s=new Uint8Array(t);for(let r=0;r<t;r++)s[r]=sn[e.slice(r*2,r*2+2)];return s},decodeStr:e=>ee.decode(be.decode(e)),is:rn},$e=e=>be.encode(e),Ie=new TextEncoder,le=e=>{const t=async o=>o instanceof Uint8Array?S.subtle.importKey("raw",o,{name:"PBKDF2"},!1,["deriveBits"]):typeof o=="string"?t(Ie.encode(o.normalize())):o,s=(o,l,a,d)=>(l=typeof l=="string"?Ie.encode(l):l,S.subtle.deriveBits({name:"PBKDF2",salt:l,iterations:a,hash:{name:e}},o,d)),r=async(o,l,a,d)=>{const u=await t(o);return await s(u,l,a,d*8)},n=async(o,l,a,d)=>new Uint8Array(await r(o,l,a,d)),c=async(o,l,a,d)=>$e(await n(o,l,a,d));return c.buffer=r,c.hex=c,c.uint8=n,c},Re={sha1:le("SHA-1"),sha256:le("SHA-256"),sha384:le("SHA-384"),sha512:le("SHA-512")},_e=e=>{const t=new Uint8Array(e);return S.getRandomValues(t),t},on=new TextEncoder,de=e=>{const t=n=>(n=typeof n=="string"?on.encode(n):n,S.subtle.digest(e,n)),s=async n=>new Uint8Array(await t(n)),r=async n=>$e(await s(n));return r.buffer=t,r.hex=r,r.uint8=s,r};de("SHA-1");const Fe=de("SHA-256");de("SHA-384");de("SHA-512");const b={encode:e=>{if(e!==e>>0)throw new Error("Invalid 32-bit integer");const t=e>>24&255,s=e>>16&255,r=e>>8&255,n=e>>0&255;return new Uint8Array([t,s,r,n])},decode:e=>{if(e.length!==4)throw new Error("Invalid 32-bit integer");const t=e[0],s=e[1],r=e[2],n=e[3];return(t<<24)+(s<<16)+(r<<8)+(n<<0)}},He=e=>{const t=e.reduce((r,n)=>r+n.byteLength,0),s=new Uint8Array(t);for(let r=0,n=0,c=e.length;n<c;n++)s.set(e[n],r),r+=e[n].byteLength;return s},cn=async(e,t,s,r)=>{e=typeof e=="string"?ee.encode(e):e,s=typeof s=="string"?ee.encode(s):s||_e(32),s=s.length===32?s:await Fe.uint8(s);const n=new Uint8Array([1]),c=Math.max(1,r||0),o=await Re.sha256.uint8(t,s,c,32),l=await S.subtle.importKey("raw",o,"AES-GCM",!1,["encrypt"]),a=_e(16),d=await S.subtle.encrypt({name:"AES-GCM",iv:a,length:256,tagLength:128},l,e),u=new Uint8Array(d);return He([n,s,b.encode(c),a,u])},ln=async(e,t)=>{if(e[0]!==1)throw new Error("Unsupported encrypted archive version");const r=e.subarray(1,33),n=b.decode(e.subarray(33,37)),c=e.subarray(37,53),o=e.subarray(53),l=await Re.sha256.uint8(t,r,n,32),a=await S.subtle.importKey("raw",l,"AES-GCM",!1,["decrypt"]),d=await S.subtle.decrypt({name:"AES-GCM",iv:c,length:256,tagLength:128},a,o);return new Uint8Array(d)},Le=Object.freeze(Object.defineProperty({__proto__:null,decrypt:ln,encrypt:cn},Symbol.toStringTag,{value:"Module"}));function Z(e){let t,s=0;return()=>((!t||s===t.length)&&(t=new e(65536/(e.BYTES_PER_ELEMENT*8)),s=0,S.getRandomValues(t)),t[s++])}function an(e,t){let s=0,r=t;return()=>(r===t&&(s=e(),r=0),s&1<<r++?1:0)}const ne={get1:an(Z(Uint8Array),8),get8:Z(Uint8Array),get16:Z(Uint16Array),get32:Z(Uint32Array),get64:Z(BigUint64Array)},dn=Object.assign(()=>BigInt(ne.get1()),{BITS:1}),fn=Object.assign(()=>BigInt(ne.get8()),{BITS:8}),un=Object.assign(()=>BigInt(ne.get16()),{BITS:16}),pn=Object.assign(()=>BigInt(ne.get32()),{BITS:32}),gn=Object.assign(()=>ne.get64(),{BITS:64}),f=e=>{const t=e<=1?dn:e<=8?fn:e<=16?un:e<=32?pn:gn,s=t.BITS;if(e===s)return t();if(e===128)return t()<<64n|t();if(e===160)return f(128)<<32n|f(32);if(e===192)return f(128)<<64n|f(64);if(e===224)return f(160)<<64n|f(64);if(e===256)return f(128)<<128n|f(128);if(e===384)return f(256)<<128n|f(128);if(e===512)return f(256)<<256n|f(256);if(e===1024)return f(512)<<512n|f(512);if(e===2048)return f(1024)<<1024n|f(1024);let r=0,n=0n;for(;r<e;){const c=Math.min(s,e-r),o=2n**BigInt(c)-1n,a=t()&o;if(e===c)return a;n=r?n|a<<BigInt(r):a,r+=c}return n},Oe=(e,t)=>{if(e=BigInt(e),t=BigInt(t),e<0n||t<0n)throw new Error("Negative ranges are not supported");if(t<=e)throw new Error('"max" must be at least equal to "min" plus 1');const s=t-e-1n,r=s.toString(2).length;for(;;){const n=f(r);if(!(n>s))return n+e}},Te=[2n,3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n,103n,107n,109n,113n,127n,131n,137n,139n,149n,151n,157n,163n,167n,173n,179n,181n,191n,193n,197n,199n,211n,223n,227n,229n,233n,239n,241n,251n,257n,263n,269n,271n,277n,281n,283n,293n,307n,311n,313n,317n,331n,337n,347n,349n,353n,359n,367n,373n,379n,383n,389n,397n,401n,409n,419n,421n,431n,433n,439n,443n,449n,457n,461n,463n,467n,479n,487n,491n,499n,503n,509n,521n,523n,541n,547n,557n,563n,569n,571n,577n,587n,593n,599n,601n,607n,613n,617n,619n,631n,641n,643n,647n,653n,659n,661n,673n,677n,683n,691n,701n,709n,719n,727n,733n,739n,743n,751n,757n,761n,769n,773n,787n,797n,809n,811n,821n,823n,827n,829n,839n,853n,857n,859n,863n,877n,881n,883n,887n,907n,911n,919n,929n,937n,941n,947n,953n,967n,971n,977n,983n,991n,997n],mn=(e,t=8)=>{if(e<=1n)return!1;for(let n=0,c=Te.length;n<c;n++){const o=Te[n];if(e%o===0n)return e===o}if(e<=1000n)return!1;let s=0n,r=e-1n;for(;(r&1n)===0n;)s+=1n,r>>=1n;for(let n=0;n<t;n++){const c=Oe(2n,e-2n);let o=ae(c,r,e),l=0n;for(let a=0;a<s;a++){if(l=ae(o,2n,e),l===1n&&o!==1n&&o!==e-1n)return!1;o=l}if(l!==1n)return!1}return!0},Ue=(e,t=8)=>{let s=f(e);for((s&1n)===0n&&(s+=1n);;){if(mn(s,t))return s;s+=2n}},_={encode:e=>{let t=0n;for(let s=0,r=e.length;s<r;s++)t|=BigInt(e[s])<<(BigInt(r)-BigInt(s)-1n)*8n;return t},decode:e=>{if(e<0n)throw new Error("Negative BigInts are not supported");const t=[];for(;e;)t.push(Number(e&0xffn)),e>>=8n;return new Uint8Array(t.reverse())}},Me={archive:e=>{const[t,s,r,n,c]=e,o=_.decode(t),l=b.encode(o.length),a=_.decode(s),d=b.encode(a.length),u=_.decode(r),m=b.encode(u.length),h=_.decode(n),g=b.encode(h.length);return He([l,o,d,a,m,u,g,h,c])},unarchive:e=>{const s=e.slice(0,4),r=b.decode(s),n=4,c=e.slice(n,n+r),o=_.encode(c),l=n+r,a=e.slice(l,l+4),d=b.decode(a),u=l+4,m=e.slice(u,u+d),h=_.encode(m),g=u+d,A=e.slice(g,g+4),p=b.decode(A),y=g+4,k=e.slice(y,y+p),N=_.encode(k),w=y+p,v=e.slice(w,w+4),E=b.decode(v),x=w+4,j=e.slice(x,x+E),B=_.encode(j),C=x+E,L=e.slice(C);return[o,h,N,B,L]}},hn=(e,t,s)=>{let r=e%s;if(t<=BigInt(Number.MAX_SAFE_INTEGER))for(let n=Number(t);n>0;n--)r=r*r%s;else for(let n=t;n>0n;n--)r=r*r%s;return r%s},yn={generate:async e=>{const t=e.primeBits??100,s=e.primeRounds??20,r=e.opsPerSecond??33e5,n=e.duration??1e3,c=e.message,o=Ue(t,s),l=Ue(t,s),a=o*l,d=(o-1n)*(l-1n),u=r,m=n,h=BigInt(Math.round(Math.max(1,u/1e3)*m)),g=await Fe.uint8(_e(32)),A=c,p=await Le.encrypt(A,g),y=Oe(1n,a-1n),k=ae(2n,h,d),N=ae(y,k,a),w=_.encode(g)+N;return Me.archive([a,y,h,w,p])},solve:async e=>{const[t,s,r,n,c]=Me.unarchive(e),o=hn(s,r,t),l=_.decode(n-o),a=await Le.decrypt(c,l);return ee.decode(a)}};function Un(){const e=We.c(91),[t,s]=ie.useState(!1);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=[],e[0]=r):r=e[0],ie.useEffect(xn,r);const n=Ke(),[c,o]=ie.useState("I'm not a robot"),[l,a]=ie.useState(!1);let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d={login:"",password:"",captchaSolution:""},e[1]=d):d=e[1];const{post:u,data:m,setData:h,processing:g,transform:A,errors:p,clearErrors:y}=qe(d);let k;e[2]!==n.props.captchaTask||e[3]!==n.props.submitLink||e[4]!==u||e[5]!==A?(k=I=>{I.preventDefault(),s(!0),o("Solving CAPTCHA..."),a(!1),(async()=>{try{await function(De){return new Promise(Ge=>setTimeout(Ge,De))}(100);const ke=new Uint8Array(n.props.captchaTask),ze=await yn.solve(ke);o("Verification complete!"),s(!1),a(!0),A(je=>({...je,captchaSolution:ze})),u(n.props.submitLink,{onError:wn})}catch(Se){console.error("Error solving CAPTCHA:",Se),o("Error solving CAPTCHA. Try again.")}})()},e[2]=n.props.captchaTask,e[3]=n.props.submitLink,e[4]=u,e[5]=A,e[6]=k):k=e[6];const N=k;let w;e[7]!==y||e[8]!==h?(w=(I,ve)=>{y(),h(I,ve)},e[7]=y,e[8]=h,e[9]=w):w=e[9];const v=w;let E;e[10]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(Xe,{position:"top-center",richColors:!0,closeButton:!0}),e[10]=E):E=e[10];let x;e[11]!==n.props.title?(x=i.jsx("h1",{className:"font-medium mb-6 text-xl",children:n.props.title}),e[11]=n.props.title,e[12]=x):x=e[12];let j;e[13]!==n.props.description?(j=n.props.description&&i.jsx("p",{className:"font-thin mb-6 text-xs pb-10",children:n.props.description}),e[13]=n.props.description,e[14]=j):j=e[14];let B;e[15]!==p.captchaSolution?(B=i.jsx(xe,{message:p.captchaSolution}),e[15]=p.captchaSolution,e[16]=B):B=e[16];let C;e[17]!==n.props.login?(C=i.jsx(Be,{htmlFor:"login",children:n.props.login}),e[17]=n.props.login,e[18]=C):C=e[18];let L;e[19]===Symbol.for("react.memo_cache_sentinel")?(L=i.jsx(we,{iconNode:Ne,className:"size-5 absolute inset-2"}),e[19]=L):L=e[19];const fe=`pl-10 ${p.login?"border-red-500":""}`,ue=g||t;let T;e[20]!==v?(T=I=>{v("login",I.target.value)},e[20]=v,e[21]=T):T=e[21];let U;e[22]!==m.login||e[23]!==n.props.login||e[24]!==fe||e[25]!==ue||e[26]!==T?(U=i.jsx(Ce,{id:"login",className:fe,type:"text",required:!0,tabIndex:1,autoComplete:"username",value:m.login,disabled:ue,onChange:T,placeholder:n.props.login}),e[22]=m.login,e[23]=n.props.login,e[24]=fe,e[25]=ue,e[26]=T,e[27]=U):U=e[27];let M;e[28]!==p.login?(M=i.jsx(xe,{message:p.login}),e[28]=p.login,e[29]=M):M=e[29];let P;e[30]!==U||e[31]!==M?(P=i.jsxs("div",{className:"relative",children:[L,U,M]}),e[30]=U,e[31]=M,e[32]=P):P=e[32];let $;e[33]!==P||e[34]!==C?($=i.jsxs("div",{className:"grid gap-4",children:[C,P]}),e[33]=P,e[34]=C,e[35]=$):$=e[35];let R;e[36]!==n.props.password?(R=i.jsx(Be,{htmlFor:"login",children:n.props.password}),e[36]=n.props.password,e[37]=R):R=e[37];let te;e[38]===Symbol.for("react.memo_cache_sentinel")?(te=i.jsx(we,{iconNode:Ne,className:"size-5 absolute inset-2"}),e[38]=te):te=e[38];const pe=`pl-10 ${p.password?"border-red-500":""}`,ge=g||t;let F;e[39]!==v?(F=I=>{v("password",I.target.value)},e[39]=v,e[40]=F):F=e[40];let H;e[41]!==m.password||e[42]!==n.props.password||e[43]!==pe||e[44]!==ge||e[45]!==F?(H=i.jsx(Ce,{id:"password",className:pe,type:"password",required:!0,disabled:ge,tabIndex:1,autoComplete:"current-password",value:m.password,onChange:F,placeholder:n.props.password}),e[41]=m.password,e[42]=n.props.password,e[43]=pe,e[44]=ge,e[45]=F,e[46]=H):H=e[46];let O;e[47]!==p.password?(O=i.jsx(xe,{message:p.password}),e[47]=p.password,e[48]=O):O=e[48];let z;e[49]!==H||e[50]!==O?(z=i.jsxs("div",{className:"relative",children:[te,H,O]}),e[49]=H,e[50]=O,e[51]=z):z=e[51];let D;e[52]!==R||e[53]!==z?(D=i.jsxs("div",{className:"grid gap-4",children:[R,z]}),e[52]=R,e[53]=z,e[54]=D):D=e[54];const me=g||t;let G;e[55]!==n.props.submitButton||e[56]!==me?(G=i.jsx(Ae,{type:"submit",className:"w-fit cursor-pointer",disabled:me,children:n.props.submitButton}),e[55]=n.props.submitButton,e[56]=me,e[57]=G):G=e[57];let K;e[58]!==t||e[59]!==n.props.registerLink||e[60]!==g?(K=n.props.registerLink&&i.jsx(Ae,{asChild:!0,variant:"outline",children:i.jsx(Ve,{href:n.props.registerLink.link,className:`${g||t} ? 'pointer-events-none opacity-50' : ''`,children:n.props.registerLink.title})}),e[58]=t,e[59]=n.props.registerLink,e[60]=g,e[61]=K):K=e[61];let q;e[62]!==G||e[63]!==K?(q=i.jsxs("div",{className:"flex gap-4",children:[G,K]}),e[62]=G,e[63]=K,e[64]=q):q=e[64];let V;e[65]!==$||e[66]!==D||e[67]!==q||e[68]!==B?(V=i.jsxs("div",{className:"grid gap-5",children:[B,$,D,q]}),e[65]=$,e[66]=D,e[67]=q,e[68]=B,e[69]=V):V=e[69];let se;e[70]===Symbol.for("react.memo_cache_sentinel")?(se=i.jsx("div",{className:"w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z"})})}),e[70]=se):se=e[70];const he=`${t?"":"hidden"}`;let re;e[71]===Symbol.for("react.memo_cache_sentinel")?(re=i.jsx(we,{iconNode:Ze,className:"animate-spin size-6 absolute inset-0 m-auto !text-gray-600"}),e[71]=re):re=e[71];let W;e[72]!==he?(W=i.jsxs("div",{className:"relative",children:[se,i.jsx("div",{className:he,children:re})]}),e[72]=he,e[73]=W):W=e[73];let X;e[74]!==c?(X=i.jsx("div",{className:"text-gray-600 font-semibold",children:c}),e[74]=c,e[75]=X):X=e[75];const ye=`transition-opacity ${l?"opacity-100 visible":"opacity-0 invisible"}`;let oe;e[76]===Symbol.for("react.memo_cache_sentinel")?(oe=i.jsx("svg",{id:"checkmark",xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-green-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:i.jsx("path",{className:"checkmark",strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),e[76]=oe):oe=e[76];let Y;e[77]!==ye?(Y=i.jsx("div",{className:ye,children:oe}),e[77]=ye,e[78]=Y):Y=e[78];let J;e[79]!==W||e[80]!==X||e[81]!==Y?(J=i.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-4 mt-6 flex items-center space-x-4",children:[W,X,Y]}),e[79]=W,e[80]=X,e[81]=Y,e[82]=J):J=e[82];let Q;e[83]!==N||e[84]!==V||e[85]!==J?(Q=i.jsxs("form",{onSubmit:N,children:[V,J]}),e[83]=N,e[84]=V,e[85]=J,e[86]=Q):Q=e[86];let ce;return e[87]!==Q||e[88]!==x||e[89]!==j?(ce=i.jsxs("div",{className:"bg-sidebar flex min-h-svh w-full justify-center",children:[E,i.jsxs("div",{className:"rounded-xl border bg-card text-card-foreground shadow p-6 max-w-sm w-full h-fit mt-[15%]",children:[x,j,Q]})]}),e[87]=Q,e[88]=x,e[89]=j,e[90]=ce):ce=e[90],ce}function wn(e){for(const t of Object.keys(e))Ye.error(e[t])}function xn(){Je()}export{Un as default};
|
package/assets/manifest.json
CHANGED
|
@@ -434,7 +434,7 @@
|
|
|
434
434
|
"src/assets/js/pages/welcome.tsx"
|
|
435
435
|
],
|
|
436
436
|
"css": [
|
|
437
|
-
"app-
|
|
437
|
+
"app-C4A2HUBD.css"
|
|
438
438
|
],
|
|
439
439
|
"assets": [
|
|
440
440
|
"material-icons-kAwBdRge.woff2",
|
|
@@ -1445,7 +1445,7 @@
|
|
|
1445
1445
|
]
|
|
1446
1446
|
},
|
|
1447
1447
|
"src/assets/js/pages/login.tsx": {
|
|
1448
|
-
"file": "login-
|
|
1448
|
+
"file": "login-Bg7ZQrZc.js",
|
|
1449
1449
|
"name": "login",
|
|
1450
1450
|
"src": "src/assets/js/pages/login.tsx",
|
|
1451
1451
|
"isDynamicEntry": true,
|
package/controllers/add.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function add(req: ReqType, res: ResType): Promise<
|
|
1
|
+
export default function add(req: ReqType, res: ResType): Promise<import("express").Response<any, Record<string, any>>>;
|
package/controllers/add.js
CHANGED
|
@@ -13,7 +13,7 @@ export default async function add(req, res) {
|
|
|
13
13
|
if (!entity.config?.add) {
|
|
14
14
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/${entity.uri}`);
|
|
15
15
|
}
|
|
16
|
-
if (req.adminizer.config.auth) {
|
|
16
|
+
if (req.adminizer.config.auth.enable) {
|
|
17
17
|
if (!req.session.UserAP) {
|
|
18
18
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
19
19
|
}
|
|
@@ -94,8 +94,6 @@ export default async function add(req, res) {
|
|
|
94
94
|
return res.json({ record: record });
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
|
-
// req.session.messages.adminSuccess.push('Your record was created !');
|
|
98
|
-
// return res.redirect(`${req.adminizer.config.routePrefix}/model/${entity.name}`);
|
|
99
97
|
req.flash.setFlashMessage('success', 'Your record was created !');
|
|
100
98
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/${entity.name}`);
|
|
101
99
|
}
|
|
@@ -107,22 +105,14 @@ export default async function add(req, res) {
|
|
|
107
105
|
}
|
|
108
106
|
}
|
|
109
107
|
if (req.query?.without_layout) {
|
|
110
|
-
return res.viewAdmin("./../ejs/partials/content/addPopup.ejs", {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
});
|
|
108
|
+
// return res.viewAdmin("./../ejs/partials/content/addPopup.ejs", {
|
|
109
|
+
// entity: entity,
|
|
110
|
+
// fields: fields,
|
|
111
|
+
// data: data
|
|
112
|
+
// });
|
|
113
|
+
return null;
|
|
115
114
|
}
|
|
116
115
|
else {
|
|
117
|
-
// return res.viewAdmin(null,{
|
|
118
|
-
// entity: entity,
|
|
119
|
-
// fields: fields,
|
|
120
|
-
// data: data
|
|
121
|
-
// });
|
|
122
|
-
// const sleep = (ms: number) => {
|
|
123
|
-
// return new Promise(resolve => setTimeout(resolve, ms));
|
|
124
|
-
// }
|
|
125
|
-
// await sleep(2000);
|
|
126
116
|
const props = inertiaAddHelper(req, entity, fields);
|
|
127
117
|
return req.Inertia.render({
|
|
128
118
|
component: 'add',
|
package/controllers/addGroup.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Adminizer } from "../lib/Adminizer";
|
|
|
3
3
|
import { inertiaGroupHelper } from "../helpers/inertiaGroupHelper";
|
|
4
4
|
export default async function addGroup(req, res) {
|
|
5
5
|
let entity = ControllerHelper.findEntityObject(req);
|
|
6
|
-
if (req.adminizer.config.auth) {
|
|
6
|
+
if (req.adminizer.config.auth.enable) {
|
|
7
7
|
if (!req.session.UserAP) {
|
|
8
8
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
9
9
|
}
|
|
@@ -53,8 +53,6 @@ export default async function addGroup(req, res) {
|
|
|
53
53
|
users: usersInThisGroup, tokens: tokensOfThisGroup
|
|
54
54
|
});
|
|
55
55
|
Adminizer.log.debug(`A new group was created: `, group);
|
|
56
|
-
// req.session.messages.adminSuccess.push('A new group was created !');
|
|
57
|
-
// return res.redirect(`${req.adminizer.config.routePrefix}/model/groupap`);
|
|
58
56
|
req.flash.setFlashMessage('success', 'A new group was created !');
|
|
59
57
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/groupap`);
|
|
60
58
|
}
|
|
@@ -69,6 +67,5 @@ export default async function addGroup(req, res) {
|
|
|
69
67
|
component: 'add-group',
|
|
70
68
|
props: props
|
|
71
69
|
});
|
|
72
|
-
// return res.viewAdmin("addGroup", {entity: entity, users: users, groupedTokens: groupedTokens});
|
|
73
70
|
}
|
|
74
71
|
;
|
package/controllers/addUser.js
CHANGED
|
@@ -4,7 +4,7 @@ import { generate } from 'password-hash';
|
|
|
4
4
|
import { inertiaUserHelper } from "../helpers/inertiaUserHelper";
|
|
5
5
|
export default async function (req, res) {
|
|
6
6
|
let entity = ControllerHelper.findEntityObject(req);
|
|
7
|
-
if (req.adminizer.config.auth) {
|
|
7
|
+
if (req.adminizer.config.auth.enable) {
|
|
8
8
|
if (!req.session.UserAP) {
|
|
9
9
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
10
10
|
}
|
|
@@ -49,8 +49,6 @@ export default async function (req, res) {
|
|
|
49
49
|
locale: locale, isAdministrator: isAdministrator, isConfirmed: isConfirmed, groups: userGroups
|
|
50
50
|
});
|
|
51
51
|
Adminizer.log.debug(`A new user was created: `, user);
|
|
52
|
-
// req.session.messages.adminSuccess.push('A new user was created !');
|
|
53
|
-
// return res.redirect(`${req.adminizer.config.routePrefix}/model/userap`);
|
|
54
52
|
req.flash.setFlashMessage('success', 'A new user was created !');
|
|
55
53
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/userap`);
|
|
56
54
|
}
|
|
@@ -60,7 +58,6 @@ export default async function (req, res) {
|
|
|
60
58
|
}
|
|
61
59
|
// console.log(user)
|
|
62
60
|
}
|
|
63
|
-
// return res.viewAdmin("addUser", {entity: entity, groups: groups});
|
|
64
61
|
const props = inertiaUserHelper(entity, req, groups);
|
|
65
62
|
return req.Inertia.render({
|
|
66
63
|
component: 'add-user',
|
|
@@ -5,7 +5,7 @@ export async function catalogController(req, res) {
|
|
|
5
5
|
const slug = req.params.slug;
|
|
6
6
|
let id = req.params.id ? req.params.id : '';
|
|
7
7
|
const postfix = id ? `${slug}-${id}` : `${slug}`;
|
|
8
|
-
if (req.adminizer.config.auth) {
|
|
8
|
+
if (req.adminizer.config.auth.enable) {
|
|
9
9
|
if (!req.session.UserAP) {
|
|
10
10
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
11
11
|
}
|
|
@@ -4,7 +4,7 @@ import { Adminizer } from "../lib/Adminizer";
|
|
|
4
4
|
export default function upload(req, res) {
|
|
5
5
|
//console.log('admin > CK-upload');
|
|
6
6
|
let entity = ControllerHelper.findEntityObject(req);
|
|
7
|
-
if (req.adminizer.config.auth) {
|
|
7
|
+
if (req.adminizer.config.auth.enable) {
|
|
8
8
|
if (!req.session.UserAP) {
|
|
9
9
|
res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
10
10
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function (req: ReqType, res: ResType):
|
|
1
|
+
export default function (req: ReqType, res: ResType): void | Promise<import("express").Response<any, Record<string, any>>>;
|
package/controllers/dashboard.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
export default function (req, res) {
|
|
2
|
-
if (req.adminizer.config.auth && !req.session.UserAP) {
|
|
3
|
-
|
|
4
|
-
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
2
|
+
if (req.adminizer.config.auth.enable && !req.session.UserAP) {
|
|
3
|
+
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
5
4
|
}
|
|
6
|
-
// return res.viewAdmin('dashboard', {entity: "entity"});
|
|
7
5
|
return req.Inertia.render({
|
|
8
6
|
component: 'dashboard',
|
|
9
7
|
props: null
|
package/controllers/edit.js
CHANGED
|
@@ -18,7 +18,7 @@ export default async function edit(req, res) {
|
|
|
18
18
|
if (!entity.config.edit) {
|
|
19
19
|
return res.redirect(`${req.adminizer.config.routePrefix}/${entity.uri}`);
|
|
20
20
|
}
|
|
21
|
-
if (req.adminizer.config.auth) {
|
|
21
|
+
if (req.adminizer.config.auth.enable) {
|
|
22
22
|
if (!req.session.UserAP) {
|
|
23
23
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
24
24
|
}
|
|
@@ -128,8 +128,6 @@ export default async function edit(req, res) {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
// req.session.messages.adminSuccess.push('Your record was updated !');
|
|
132
|
-
// return res.redirect(`${req.adminizer.config.routePrefix}/model/${entity.name}`);
|
|
133
131
|
req.flash.setFlashMessage('success', 'Your record was updated !');
|
|
134
132
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/${entity.name}`);
|
|
135
133
|
}
|
|
@@ -156,18 +154,14 @@ export default async function edit(req, res) {
|
|
|
156
154
|
}
|
|
157
155
|
}
|
|
158
156
|
if (req.query.without_layout) {
|
|
159
|
-
return res.viewAdmin("./../ejs/partials/content/editPopup.ejs", {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
});
|
|
157
|
+
// return res.viewAdmin("./../ejs/partials/content/editPopup.ejs", {
|
|
158
|
+
// entity: entity,
|
|
159
|
+
// record: record,
|
|
160
|
+
// fields: fields
|
|
161
|
+
// });
|
|
162
|
+
return null;
|
|
164
163
|
}
|
|
165
164
|
else {
|
|
166
|
-
// return res.viewAdmin(null,{
|
|
167
|
-
// entity: entity,
|
|
168
|
-
// record: record,
|
|
169
|
-
// fields: fields
|
|
170
|
-
// });
|
|
171
165
|
const props = inertiaAddHelper(req, entity, fields, record);
|
|
172
166
|
return req.Inertia.render({
|
|
173
167
|
component: 'add',
|
package/controllers/editGroup.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Adminizer } from "../lib/Adminizer";
|
|
|
3
3
|
import { inertiaGroupHelper } from "../helpers/inertiaGroupHelper";
|
|
4
4
|
export default async function editGroup(req, res) {
|
|
5
5
|
let entity = ControllerHelper.findEntityObject(req);
|
|
6
|
-
if (req.adminizer.config.auth) {
|
|
6
|
+
if (req.adminizer.config.auth.enable) {
|
|
7
7
|
if (!req.session.UserAP) {
|
|
8
8
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
9
9
|
}
|
|
@@ -68,7 +68,6 @@ export default async function editGroup(req, res) {
|
|
|
68
68
|
users: usersInThisGroup, tokens: tokensOfThisGroup
|
|
69
69
|
});
|
|
70
70
|
Adminizer.log.debug(`Group was updated: `, updatedGroup);
|
|
71
|
-
// req.session.messages.adminSuccess.push('Group was updated !');
|
|
72
71
|
req.flash.setFlashMessage('success', 'Group was updated !');
|
|
73
72
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/groupap`);
|
|
74
73
|
}
|
|
@@ -97,7 +96,6 @@ export default async function editGroup(req, res) {
|
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
// console.log("GROUP", group)
|
|
100
|
-
// return res.viewAdmin("editGroup", {entity: entity, group: group, users: users, groupedTokens: groupedTokens});
|
|
101
99
|
const props = inertiaGroupHelper(entity, req, users, groupedTokens, group);
|
|
102
100
|
return req.Inertia.render({
|
|
103
101
|
component: 'add-group',
|
package/controllers/editUser.js
CHANGED
|
@@ -4,7 +4,7 @@ import { generate } from "password-hash";
|
|
|
4
4
|
import { inertiaUserHelper } from "../helpers/inertiaUserHelper";
|
|
5
5
|
export default async function (req, res) {
|
|
6
6
|
let entity = ControllerHelper.findEntityObject(req);
|
|
7
|
-
if (req.adminizer.config.auth) {
|
|
7
|
+
if (req.adminizer.config.auth.enable) {
|
|
8
8
|
if (!req.session.UserAP) {
|
|
9
9
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
10
10
|
}
|
|
@@ -72,7 +72,6 @@ export default async function (req, res) {
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
Adminizer.log.debug(`User was updated: `, updatedUser);
|
|
75
|
-
// req.session.messages.adminSuccess.push('User was updated !');
|
|
76
75
|
req.flash.setFlashMessage('success', 'User was updated !');
|
|
77
76
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/userap`);
|
|
78
77
|
}
|
|
@@ -100,7 +99,6 @@ export default async function (req, res) {
|
|
|
100
99
|
Adminizer.log.error(e);
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
|
-
// return res.viewAdmin("editUser", {entity: entity, user: user, groups: groups});
|
|
104
102
|
const props = inertiaUserHelper(entity, req, groups, user);
|
|
105
103
|
return req.Inertia.render({
|
|
106
104
|
component: 'add-user',
|
package/controllers/form.js
CHANGED
|
@@ -7,7 +7,7 @@ export default async function form(req, res) {
|
|
|
7
7
|
if (!slug) {
|
|
8
8
|
return res.status(404).send({ error: 'Not Found' });
|
|
9
9
|
}
|
|
10
|
-
if (req.adminizer.config.auth) {
|
|
10
|
+
if (req.adminizer.config.auth.enable) {
|
|
11
11
|
if (!req.session.UserAP) {
|
|
12
12
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
13
13
|
}
|
|
@@ -59,7 +59,6 @@ export default async function form(req, res) {
|
|
|
59
59
|
Adminizer.log.silly(`'${slug}' property was not found in storage, using source file`);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
// res.viewAdmin("form", {formData: form, slug: slug});
|
|
63
62
|
const props = inertiaFormHelper(req, `${req.adminizer.config.routePrefix}/form/${slug}`, form);
|
|
64
63
|
// console.log(props)
|
|
65
64
|
return req.Inertia.render({
|
package/controllers/initUser.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Adminizer } from "../lib/Adminizer";
|
|
|
2
2
|
import { generate } from "password-hash";
|
|
3
3
|
import { inertiaInitUserHelper } from "../helpers/inertiaAutHelper";
|
|
4
4
|
export default async function initUser(req, res) {
|
|
5
|
-
if (!req.adminizer.config.auth) {
|
|
5
|
+
if (!req.adminizer.config.auth.enable) {
|
|
6
6
|
return res.redirect(`${req.adminizer.config.routePrefix}/`);
|
|
7
7
|
}
|
|
8
8
|
// TODO refactor CRUD functions for DataAccessor usage
|
package/controllers/list.js
CHANGED
|
@@ -8,7 +8,7 @@ export default async function list(req, res) {
|
|
|
8
8
|
if (!entity.model) {
|
|
9
9
|
return res.status(404).send({ error: 'Not Found' });
|
|
10
10
|
}
|
|
11
|
-
if (req.adminizer.config.auth) {
|
|
11
|
+
if (req.adminizer.config.auth.enable) {
|
|
12
12
|
if (!req.session.UserAP) {
|
|
13
13
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
14
14
|
}
|
package/controllers/login.js
CHANGED
|
@@ -4,7 +4,7 @@ import { inertiaLoginHelper } from "../helpers/inertiaAutHelper";
|
|
|
4
4
|
export default async function login(req, res) {
|
|
5
5
|
const powCaptcha = new POWCaptcha();
|
|
6
6
|
if (req.originalUrl.indexOf("login") >= 0) {
|
|
7
|
-
if (!req.adminizer.config.auth) {
|
|
7
|
+
if (!req.adminizer.config.auth.enable) {
|
|
8
8
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/`);
|
|
9
9
|
}
|
|
10
10
|
if (req.method.toUpperCase() === "POST") {
|
|
@@ -58,10 +58,10 @@ export default async function login(req, res) {
|
|
|
58
58
|
if (req.method.toUpperCase() === "GET") {
|
|
59
59
|
// Generate new CAPTCHA job
|
|
60
60
|
const captchaTask = await powCaptcha.getJob(`login:${req.ip}`);
|
|
61
|
-
// return res.viewAdmin("login", {captchaTask: captchaTask});
|
|
62
61
|
return req.Inertia.render({
|
|
63
62
|
component: 'login',
|
|
64
63
|
props: {
|
|
64
|
+
description: req.adminizer.config.auth.description,
|
|
65
65
|
captchaTask: captchaTask,
|
|
66
66
|
...inertiaLoginHelper(req),
|
|
67
67
|
}
|
|
@@ -82,13 +82,12 @@ export default async function login(req, res) {
|
|
|
82
82
|
async function inertiaAdminMessage(req, message, messageType) {
|
|
83
83
|
const powCaptcha = new POWCaptcha();
|
|
84
84
|
const captchaTask = await powCaptcha.getJob(`login:${req.ip}`);
|
|
85
|
-
// req.session.messages.adminError.push(message);
|
|
86
|
-
// return res.viewAdmin("login", {captchaTask: captchaTask});
|
|
87
85
|
let errors = {};
|
|
88
86
|
errors[messageType] = message;
|
|
89
87
|
return req.Inertia.render({
|
|
90
88
|
component: 'login',
|
|
91
89
|
props: {
|
|
90
|
+
description: req.adminizer.config.auth.description,
|
|
92
91
|
captchaTask: captchaTask,
|
|
93
92
|
errors: errors,
|
|
94
93
|
...inertiaLoginHelper(req),
|
|
@@ -3,7 +3,7 @@ import { MediaManagerAdapter } from "./mediaManagerAdapter";
|
|
|
3
3
|
export async function mediaManagerController(req, res) {
|
|
4
4
|
const method = req.method.toUpperCase();
|
|
5
5
|
let id = req.params.id ? req.params.id : '';
|
|
6
|
-
if (req.adminizer.config.auth) {
|
|
6
|
+
if (req.adminizer.config.auth.enable) {
|
|
7
7
|
if (!req.session.UserAP) {
|
|
8
8
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
9
9
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ControllerHelper } from "../../helpers/controllerHelper";
|
|
2
2
|
import { DataAccessor } from "../../lib/v4/DataAccessor";
|
|
3
3
|
export default async function edit(req, res) {
|
|
4
|
-
if (req.adminizer.config.auth) {
|
|
4
|
+
if (req.adminizer.config.auth.enable) {
|
|
5
5
|
if (!req.session.UserAP) {
|
|
6
6
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import { InstallStepper } from "../lib/installStepper/installStepper";
|
|
|
2
2
|
import { Adminizer } from "../lib/Adminizer";
|
|
3
3
|
let installStepper = InstallStepper.getInstance();
|
|
4
4
|
export default async function processInstallFinalize(req, res) {
|
|
5
|
-
if (req.adminizer.config.auth) {
|
|
5
|
+
if (req.adminizer.config.auth.enable) {
|
|
6
6
|
if (!req.session.UserAP) {
|
|
7
7
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import { InstallStepper } from "../lib/installStepper/installStepper";
|
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { Adminizer } from "../lib/Adminizer";
|
|
4
4
|
export default async function processInstallStep(req, res) {
|
|
5
|
-
if (req.adminizer.config.auth) {
|
|
5
|
+
if (req.adminizer.config.auth.enable) {
|
|
6
6
|
if (!req.session.UserAP) {
|
|
7
7
|
res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
8
8
|
return;
|
package/controllers/register.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { generate } from "password-hash";
|
|
2
2
|
import { inertiaRegisterHelper } from "../helpers/inertiaAutHelper";
|
|
3
3
|
export default async function register(req, res) {
|
|
4
|
-
if (!req.adminizer.config.auth || req.adminizer.config.registration?.enable !== true) {
|
|
4
|
+
if (!req.adminizer.config.auth.enable || req.adminizer.config.registration?.enable !== true) {
|
|
5
5
|
return res.redirect(`${req.adminizer.config.routePrefix}/`);
|
|
6
6
|
}
|
|
7
7
|
if (req.method.toUpperCase() === "POST") {
|
|
8
8
|
// console.log("req.body", req.body);
|
|
9
|
-
// if (!req.body.login || !req.body.fullName || !req.body.password) {
|
|
10
|
-
// return res.status(400).send({error: 'Missing required parameters'});
|
|
11
|
-
// }
|
|
12
9
|
for (const key of ["login", "fullName", "password"]) {
|
|
13
10
|
if (!req.body[key]) {
|
|
14
11
|
let errors = {};
|
|
@@ -69,7 +66,6 @@ export default async function register(req, res) {
|
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
68
|
if (req.method.toUpperCase() === "GET") {
|
|
72
|
-
// return res.viewAdmin("register");
|
|
73
69
|
return req.Inertia.render({
|
|
74
70
|
component: "register",
|
|
75
71
|
props: inertiaRegisterHelper(req),
|
package/controllers/remove.js
CHANGED
|
@@ -17,7 +17,7 @@ export default async function remove(req, res) {
|
|
|
17
17
|
if (!entity.config.remove) {
|
|
18
18
|
return res.redirect(`${req.adminizer.config.routePrefix}/${entity.uri}`);
|
|
19
19
|
}
|
|
20
|
-
if (req.adminizer.config.auth) {
|
|
20
|
+
if (req.adminizer.config.auth.enable) {
|
|
21
21
|
if (!req.session.UserAP) {
|
|
22
22
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
23
23
|
}
|
|
@@ -67,15 +67,12 @@ export default async function remove(req, res) {
|
|
|
67
67
|
Adminizer.log.error('adminpanel > error', e);
|
|
68
68
|
}
|
|
69
69
|
if (destroyedRecord) {
|
|
70
|
-
// req.session.messages.adminSuccess.push('Record was removed successfully');
|
|
71
70
|
req.flash.setFlashMessage('success', 'Record was removed successfully !');
|
|
72
71
|
}
|
|
73
72
|
else {
|
|
74
|
-
// req.session.messages.adminError.push('Record was not removed');
|
|
75
73
|
req.flash.setFlashMessage('success', 'Record was not removed');
|
|
76
74
|
}
|
|
77
75
|
let referToUrl = referTo ? `${entity.uri}${referTo}` : `${entity.uri}`;
|
|
78
76
|
return req.Inertia.redirect(`${referToUrl}`);
|
|
79
|
-
// res.redirect(`${req.adminizer.config.routePrefix}/${entity.uri}`);
|
|
80
77
|
}
|
|
81
78
|
;
|
package/controllers/timezones.js
CHANGED
package/controllers/view.js
CHANGED
|
@@ -17,7 +17,7 @@ export default async function view(req, res) {
|
|
|
17
17
|
if (!entity.model) {
|
|
18
18
|
return res.status(404).send({ error: 'Not Found' });
|
|
19
19
|
}
|
|
20
|
-
if (req.adminizer.config.auth) {
|
|
20
|
+
if (req.adminizer.config.auth.enable) {
|
|
21
21
|
if (!req.session.UserAP) {
|
|
22
22
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
23
23
|
}
|
|
@@ -36,11 +36,6 @@ export default async function view(req, res) {
|
|
|
36
36
|
Adminizer.log.error(e);
|
|
37
37
|
return res.status(500).send({ error: 'Internal Server Error' });
|
|
38
38
|
}
|
|
39
|
-
// res.viewAdmin(null, {
|
|
40
|
-
// entity: entity,
|
|
41
|
-
// record: record,
|
|
42
|
-
// fields: fields
|
|
43
|
-
// });
|
|
44
39
|
switch (entity.config.model) {
|
|
45
40
|
case 'userap':
|
|
46
41
|
let groups;
|
package/controllers/welcome.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Welcome text
|
|
3
3
|
*/
|
|
4
4
|
export default function welcome(req, res) {
|
|
5
|
-
if (req.adminizer.config.auth && !req.session.UserAP) {
|
|
5
|
+
if (req.adminizer.config.auth.enable && !req.session.UserAP) {
|
|
6
6
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
7
7
|
}
|
|
8
8
|
let text = '';
|
|
@@ -3,7 +3,7 @@ export async function widgetActionController(req, res) {
|
|
|
3
3
|
if (!widgetId) {
|
|
4
4
|
return res.status(404).send({ error: 'Not Found' });
|
|
5
5
|
}
|
|
6
|
-
if (req.adminizer.config.auth) {
|
|
6
|
+
if (req.adminizer.config.auth.enable) {
|
|
7
7
|
if (!req.session.UserAP) {
|
|
8
8
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ export async function widgetCustomController(req, res) {
|
|
|
3
3
|
if (!widgetId) {
|
|
4
4
|
return res.status(404).send({ error: 'Not Found' });
|
|
5
5
|
}
|
|
6
|
-
if (req.adminizer.config.auth) {
|
|
6
|
+
if (req.adminizer.config.auth.enable) {
|
|
7
7
|
if (!req.session.UserAP) {
|
|
8
8
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ export async function widgetInfoController(req, res) {
|
|
|
3
3
|
if (!widgetId) {
|
|
4
4
|
return res.status(404).send({ error: 'Not Found' });
|
|
5
5
|
}
|
|
6
|
-
if (req.adminizer.config.auth) {
|
|
6
|
+
if (req.adminizer.config.auth.enable) {
|
|
7
7
|
if (!req.session.UserAP) {
|
|
8
8
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ export async function widgetSwitchController(req, res) {
|
|
|
3
3
|
if (!widgetId) {
|
|
4
4
|
return res.status(404).send({ error: 'Not Found' });
|
|
5
5
|
}
|
|
6
|
-
if (req.adminizer.config.auth) {
|
|
6
|
+
if (req.adminizer.config.auth.enable) {
|
|
7
7
|
if (!req.session.UserAP) {
|
|
8
8
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
9
9
|
}
|