Local modifications to ClusterLabs/Anvil by Alteeve
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 lines
12 KiB

"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:"100%",overflowX:"scroll"},children:!d&&h(renderEntryValueBase,{depth:t,entry:n,hasPassword:o,key:u})})]})},skipBase=e=>{let{key:t}=e;return!/confirm|uuid/i.test(t)},buildEntryList=e=>{let{depth:t=0,entries:n,getEntryLabel:r,getListProps:u,getListItemProps:i,hasPassword:s,listKey:c,maxDepth:d,renderEntry:h,renderEntryValue:f,skip:g}=e,v=[];Object.entries(n).forEach(e=>{let[n,o]=e,u="form-summary-entry-".concat(n),c=null!==o&&"object"==typeof o,p=c?null:o,y={depth:t,entry:p,hasPassword:s,key:n};g(skipBase,y)&&v.push((0,l.jsx)(a.ZP,{sx:{paddingLeft:"".concat(t,"em")},...null==i?void 0:i.call(null,y),children:h({depth:t,entry:p,getLabel:r,hasPassword:s,key:n,nest:c,renderValue:f})},u)),c&&t<d&&v.push(buildEntryList({depth:t+1,entries:o,getEntryLabel:r,hasPassword:s,listKey:n,maxDepth:d,renderEntry:h,renderEntryValue:f,skip:g}))});let p="form-summary-list-".concat(null!=c?c:"root");return(0,l.jsx)(o.Z,{dense:!0,disablePadding:!0,...null==u?void 0:u.call(null,{depth:t,entries:n,key:c}),children:v},p)};t.Z=e=>{let{entries:t,getEntryLabel:n=e=>{let{cap:t,key:n}=e;return t(n)},getListProps:l,getListItemProps:r,hasPassword:a=!1,maxDepth:o=3,renderEntry:u=renderEntryBase,renderEntryValue:i=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)},skip:s=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)}}=e;return buildEntryList({entries:t,getEntryLabel:n,getListProps:l,getListItemProps:r,hasPassword:a,maxDepth:o,renderEntry:u,renderEntryValue:i,skip:s})}},88468:function(e,t,n){var l=n(67294),r=n(94121),a=n(591);let o=(0,l.forwardRef)((e,t)=>{let{input:n,onChange:o=function(e){let{handlers:{base:t,origin:n}}=e;for(var l=arguments.length,r=Array(l>1?l-1:0),a=1;a<l;a++)r[a-1]=arguments[a];null==t||t.call(null,...r),null==n||n.call(null,...r)},onMount:u,onUnmount:i}=e,{props:s}=n,{valueKey:c,valueType:d}=(0,l.useMemo)(()=>{let{type:e}=s,t="value",n="string";return e===r.Z.checkbox&&(t="checked",n="boolean"),{valueKey:t,valueType:n}},[s]),{onChange:h,[c]:f,...g}=s,[v,p]=(0,l.useState)(f),y=(0,l.useCallback)(e=>{let{target:{[c]:t}}=e,n=a.Z[d](t);p(n)},[c,d]),m=(0,l.useCallback)(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return null==o?void 0:o.call(null,{handlers:{base:y,origin:h}},...t)},[y,h,o]);return(0,l.useEffect)(()=>(null==u||u.call(null),i),[]),(0,l.useImperativeHandle)(t,()=>({get:()=>v,set:p}),[v]),(0,l.cloneElement)(n,{...g,onChange:m,[c]:v})});o.displayName="UncontrolledInput",t.Z=o},6903:function(e,t,n){var l=n(67294),r=n(67645),a=n(41247);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{config:t,onError:n,onData:o,url:u=""}=e,[i,s]=(0,l.useState)(!1),c=(0,l.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",l=arguments.length>1?arguments[1]:void 0,i="".concat(u).concat(e);i&&(s(!0),r.Z.get(i,{...t,...l}).then(e=>{let{data:t}=e;null==o||o.call(null,t)}).catch(e=>{let t=(0,a.Z)(e);null==n||n.call(null,t)}).finally(()=>{s(!1)}))},[u,t,o,n]);return{fetch:c,loading:i}}},32576:function(e,t,n){var l=n(85893),r=n(67294),a=n(84070),o=n(15079);t.Z=e=>{let{list:t={}}=e,[n,u]=(0,r.useState)({}),i=(0,r.useMemo)(()=>Object.keys(t),[t]),s=(0,r.useMemo)(()=>Object.keys(n),[n]),c=(0,r.useMemo)(()=>s.length===i.length,[s.length,i.length]),d=(0,r.useMemo)(()=>s.length>0,[s.length]),h=(0,r.useMemo)(()=>i.length>1,[i.length]),f=(0,r.useCallback)(e=>{let{confirmDialogProps:t={},formSummaryProps:r={},getConfirmDialogTitle:a,onProceedAppend:u,renderEntry:i}=e;return{actionProceedText:"Delete",content:(0,l.jsx)(o.Z,{entries:n,maxDepth:0,renderEntry:i,...r}),onProceedAppend:u,proceedColour:"red",titleText:a(s.length),...t}},[n,s.length]),g=(0,r.useCallback)(e=>!!n[e],[n]),v=(0,r.useCallback)(()=>u({}),[]),p=(0,r.useCallback)(e=>u(i.reduce((t,n)=>(e&&(t[n]=e),t),{})),[i]),y=(0,r.useCallback)((e,t)=>u((0,a.ZP)(e,t||void 0)),[]);return{buildDeleteDialogProps:f,checklist:n,checks:s,getCheck:g,hasAllChecks:c,hasChecks:d,multipleItems:h,resetChecks:v,setAllChecks:p,setCheck:y}}},7576:function(e,t,n){var l=n(85893),r=n(67294),a=n(56597),o=n(68917);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{initial:{actionProceedText:t="",content:n="",titleText:u="",...i}={}}=e,s=(0,r.useRef)(null),[c,d]=(0,r.useState)({actionProceedText:t,content:n,titleText:u}),h=(0,r.useCallback)(e=>d(t=>{let{loading:n,...l}=t;return{...l,loading:e}}),[]),f=(0,r.useCallback)(e=>{var t,n;return null==s?void 0:null===(n=s.current)||void 0===n?void 0:null===(t=n.setOpen)||void 0===t?void 0:t.call(null,e)},[]),g=(0,r.useCallback)((e,t)=>d({actionProceedText:"",content:(0,l.jsx)(o.Z,{...t}),showActionArea:!1,showClose:!0,titleText:e}),[]),v=(0,r.useMemo)(()=>(0,l.jsx)(a.Z,{...i,...c,ref:s}),[c,i]);return{confirmDialog:v,confirmDialogRef:s,setConfirmDialogLoading:h,setConfirmDialogOpen:f,setConfirmDialogProps:d,finishConfirm:g}}},67978:function(e,t,n){var l=n(67294),r=n(8100),a=n(98436),o=n(96262);t.Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{baseUrl:n=a.Z,fetcher:u=o.Z,mod:i,...s}=t,{data:c,error:d,mutate:h}=(0,r.ZP)("".concat(n).concat(e),u,s),f=(0,l.useMemo)(()=>i&&c&&i(c),[c,i]),g=!d&&!c;return{altData:f,data:c,error:d,mutate:h,loading:g}}},21197:function(e,t,n){n.d(t,{Z:function(){return hooks_useFormikUtils}});var l=n(82175),r=n(18446),a=n.n(r),o=n(13218),u=n.n(o),i=n(67294),s=n(23279),c=n.n(s),lib_debounce=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{wait:n=500,...l}=t;return c()(e,n,l)},d=n(43799);let isChainEqual=(e,t,n)=>{let[l,...r]=e;if(!(l in t))return!1;let o=t[l],i=n[l];return u()(o)&&u()(i)&&r.length?isChainEqual(r,o,i):!a()(o,i)};var hooks_useFormikUtils=e=>{let[t,n]=(0,i.useState)(!1),r=(0,l.TA)({...e}),a=(0,i.useCallback)(e=>{let t=e.split(".");return isChainEqual(t,r.values,r.initialValues)},[r.initialValues,r.values]),o=(0,i.useMemo)(()=>{let e=lib_debounce(function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];r.handleChange(...t),n(!1)});return function(){for(var t=arguments.length,l=Array(t),r=0;r<t;r++)l[r]=arguments[r];n(!0),e(...l)}},[r.handleChange]),u=(0,i.useMemo)(()=>t||!r.dirty||!r.isValid||r.isValidating||r.isSubmitting,[t,r.dirty,r.isSubmitting,r.isValid,r.isValidating]),s=(0,i.useMemo)(()=>(0,d.Z)(r.errors,{skip:e=>!a(e)}),[r.errors,a]);return{disabledSubmit:u,formik:r,formikErrors:s,handleChange:o}}},84070:function(e,t,n){n.d(t,{Um:function(){return buildRegExpObjectStateSetterCallback}});let defaultObjectStatePropSetter=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let[,l,r,a]=t;void 0!==a&&(l[r]=a)},buildRegExpObjectStateSetterCallback=function(e,t){let{set:n=defaultObjectStatePropSetter}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l=>{let r={};return Object.keys(l).forEach(a=>{e.test(a)?n(l,r,a,t):r[a]=l[a]}),r}};t.ZP=function(e,t){let{guard:n=()=>!0,set:l=defaultObjectStatePropSetter}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=>{let{[e]:a,...o}=r,u={...o};return n(r,e,t)&&l(r,u,e,t),u}}},5744:function(e,t,n){var l=n(48403),r=n.n(l);t.Z=e=>{let t=e.replace(/([a-z\d])([A-Z])/g,"$1 $2");return r()(t)}},43799:function(e,t,n){var l=n(5744);let getFormikErrorMessages=function(e){let{build:t=(e,t)=>{let n=t;if("string"==typeof n){let[e,...t]=n.split(/\s+/),r=(0,l.Z)(e.replace(/^[^\s]+\.([^.]+)/,"$1"));n=[r,...t].join(" ")}return{children:n,type:"warning"}},chain:n="",skip:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.entries(e).reduce((e,l)=>{let[a,o]=l,u=[n,a].filter(e=>!!e).join(".");return null!==o&&"object"==typeof o?{...e,...getFormikErrorMessages(o,{build:t,chain:u,skip:r})}:((null==r?void 0:r.call(null,u))||(e[u]=t(u,o)),e)},{})};t.Z=getFormikErrorMessages}}]);