You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
12 KiB
1 line
12 KiB
9 months ago
|
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[17],{82456:function(e,t,n){var l=n(85893),r=n(67294),a=n(67645),o=n(56211),u=n(41247),i=n(63071),s=n(6903),c=n(32576),d=n(7576),h=n(67978);let reduceHeader=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];return"function"==typeof e?e(...n):e};t.Z=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let[f]=t,{addHeader:g,editHeader:v,entriesUrl:p,getAddLoading:y,getDeleteErrorMessage:m,getDeleteHeader:b,getDeletePromiseChain:k=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];return e(...n)},getDeleteSuccessMessage:Z,getEditLoading:C=e=>e,listEmpty:E,listProps:j,onItemClick:x=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];return e(...n)},refreshInterval:S=5e3,renderAddForm:A,renderDeleteItem:M,renderEditForm:w,renderListItem:P,entryUrlPrefix:O=p}=f,V=(0,r.useRef)(null),W=(0,r.useRef)(null),{confirmDialog:_,finishConfirm:L,setConfirmDialogLoading:B,setConfirmDialogOpen:F,setConfirmDialogProps:I}=(0,d.Z)({initial:{scrollContent:!0}}),[T,D]=(0,r.useState)(!1),[H,R]=(0,r.useState)(),{data:J,mutate:U,loading:$}=(0,h.Z)(p,{refreshInterval:S}),{fetch:q,loading:N}=(0,s.Z)({onData:e=>R(e),url:O}),K=(0,r.useMemo)(()=>reduceHeader(g),[g]),z=(0,r.useMemo)(()=>reduceHeader(v,H),[H,v]),X=(0,r.useMemo)(()=>({add:{open:function(){var e;let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return null==V?void 0:null===(e=V.current)||void 0===e?void 0:e.setOpen(t)}},confirm:{finish:L,loading:B,open:function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return F(e)},prepare:I},edit:{open:function(){var e;let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return null==W?void 0:null===(e=W.current)||void 0===e?void 0:e.setOpen(t)}}}),[L,B,F,I]),{buildDeleteDialogProps:G,checks:Q,getCheck:Y,hasAllChecks:ee,hasChecks:et,multipleItems:en,resetChecks:el,setAllChecks:er,setCheck:ea}=(0,c.Z)({list:J});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.Z,{allowCheckAll:en,allowEdit:!0,allowItemButton:T,disableDelete:!et,edit:T,getListCheckboxProps:()=>({checked:ee,onChange:(e,t)=>er(t)}),getListItemCheckboxProps:e=>({checked:Y(e),onChange:(t,n)=>ea(e,n)}),header:!0,listEmpty:E,listItems:J,loading:$,onAdd:()=>{var e;return null==V?void 0:null===(e=V.current)||void 0===e?void 0:e.setOpen(!0)},onDelete:()=>{I(G({onProceedAppend:()=>{B(!0),Promise.all(k((e,t)=>e.map(e=>a.Z.delete("".concat(t,"/").concat(e))),Q,p)).then(()=>{L("Success",Z()),U()}).catch(e=>{let t=(0,u.Z)(e);L("Error",m(t))}).finally(()=>{el()})},getConfirmDialogTitle:b,renderEntry:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return M(J,...t)}})),F(!0)},onEdit:()=>D(e=>!e),onItemClick:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return x((e,t)=>{var n;null==W||null===(n=W.current)||void 0===n||n.setOpen(!0),q("/".concat(t))},...t)},renderListItem:P,...j}),(0,l.jsx)(o.Js,{header:K,loading:null==y?void 0:y.call(null),ref:V,showClose:!0,children:A(X)}),(0,l.jsx)(o.Js,{header:z,loading:C(N),ref:W,showClose:!0,children:w(X,H)}),_]})}},15079:function(e,t,n){var l=n(85893),r=n(5616),a=n(97212),o=n(78462),u=n(65939),i=n(5744),s=n(55238),c=n(84154);let renderEntryValueWithMono=e=>{let{entry:t}=e;return(0,l.jsx)(c.$_,{whiteSpace:"nowrap",children:String(t)})},renderEntryValueWithPassword=e=>{let{entry:t,key:n}=e;return u.JW.test(n)?(0,l.jsx)(c.PJ,{monospaced:!0,children:String(t)}):renderEntryValueWithMono(e)},renderEntryValueBase=e=>{let{entry:t,hasPassword:n}=e;return["",null,void 0].some(e=>t===e)?(0,l.jsx)(c.Ac,{children:"none"}):n?renderEntryValueWithPassword(e):renderEntryValueWithMono(e)},renderEntryBase=e=>{let{depth:t,entry:n,getLabel:a,hasPassword:o,key:u,nest:d,renderValue:h}=e;return(0,l.jsxs)(s.Z,{fullWidth:!0,growFirst:!0,row:!0,maxWidth:"100%",children:[(0,l.jsx)(c.Ac,{children:a({cap:i.Z,depth:t,entry:n,hasPassword:o,key:u})}),(0,l.jsx)(r.Z,{sx:{maxWidth
|