Files
openmaxio-object-browser/web-app/build/static/js/7485.bf57295d.chunk.js
Alex 9a3063b7da Release v1.7.4 (#3472)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2024-11-26 14:47:40 -06:00

2 lines
3.4 KiB
JavaScript

"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[7485],{79313:(e,t,n)=>{n.d(t,{A:()=>p});var s=n(65043),i=n(89923),a=n(64159),r=n(21383),l=n(58661),o=n(56629),d=n(53518),c=n(70579);const p=e=>{let{closeDeleteModalAndRefresh:t,deleteOpen:n,idp:p,idpType:u}=e;const f=(0,r.jL)(),[x,j]=(0,s.useState)(!1);if(!p)return null;const A="_"===p?"Default":p;return(0,c.jsx)(l.A,{title:`Delete ${A}`,confirmText:"Delete",isOpen:n,titleIcon:(0,c.jsx)(i.xWY,{}),isLoading:x,onConfirm:()=>{j(!0),o.F.idp.deleteConfiguration(p,u).then((e=>{(e=>{t(!0),f((0,a.YR)(!0===e.restart))})(e.data)})).catch((e=>f((0,a.C9)((0,d.S)(e.error))))).finally((()=>j(!1)))},onClose:()=>t(!1),confirmButtonProps:{disabled:x},confirmationContent:(0,c.jsxs)(s.Fragment,{children:["Are you sure you want to delete IDP ",(0,c.jsx)("b",{children:A})," ","configuration? ",(0,c.jsx)("br",{})]})})}},87485:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var s=n(65043),i=n(89923),a=n(73216),r=n(56629),l=n(53518),o=n(21383),d=n(99161),c=n(77938),p=n(64159),u=n(77403),f=n(6681),x=n(79313),j=n(48793),A=n(88617),C=n(70579);const b=e=>{let{idpType:t}=e;const n=(0,o.jL)(),b=(0,a.Zp)(),[h,m]=(0,s.useState)(!1),[y,D]=(0,s.useState)(""),[_,O]=(0,s.useState)(!1),[g,I]=(0,s.useState)([]),M=(0,c._)(d.Ms,[d.OV.ADMIN_CONFIG_UPDATE]),N=(0,c._)(d.Ms,[d.OV.ADMIN_CONFIG_UPDATE]),F=(0,c._)(d.Ms,[d.OV.ADMIN_CONFIG_UPDATE]);(0,s.useEffect)((()=>{T()}),[]),(0,s.useEffect)((()=>{_&&(F?r.F.idp.listConfigurations(t).then((e=>{O(!1),e.data.results&&I(e.data.results.map((e=>(e.name="_"===e.name?"Default":e.name,e.enabled=!0===e.enabled?"Enabled":"Disabled",e))))})).catch((e=>{O(!1),n((0,p.C9)((0,l.S)(e.error)))})):O(!1))}),[_,O,I,n,F,t]);const T=()=>{O(!0)},E=[{type:"view",onClick:e=>{let n="Default"===e.name?"_":e.name;b(`/identity/idp/${t}/configurations/${n}`)},disableButtonFunction:()=>!N},{type:"delete",onClick:e=>{m(!0),D(e="Default"===e?"_":e)},sendOnlyId:!0,disableButtonFunction:e=>!M||"Default"===e}];return(0,s.useEffect)((()=>{n((0,p.ph)("idp_configs"))}),[]),(0,C.jsxs)(s.Fragment,{children:[h&&(0,C.jsx)(x.A,{deleteOpen:h,idp:y,idpType:t,closeDeleteModalAndRefresh:async e=>{m(!1),e&&T()}}),(0,C.jsx)(j.A,{label:`${t.toUpperCase()} Configurations`,actions:(0,C.jsx)(A.A,{})}),(0,C.jsx)(i.Mxu,{children:(0,C.jsxs)(i.xA9,{container:!0,children:[(0,C.jsxs)(i.xA9,{item:!0,xs:12,sx:{...u._0.actionsTray,justifyContent:"flex-end",gap:8},children:[(0,C.jsx)(c.R,{scopes:[d.OV.ADMIN_CONFIG_UPDATE],resource:d.Ms,errorProps:{disabled:!0},children:(0,C.jsx)(f.A,{tooltip:"Refresh",children:(0,C.jsx)(i.$nd,{id:"refresh-keys",variant:"regular",icon:(0,C.jsx)(i.fNY,{}),onClick:()=>O(!0)})})}),(0,C.jsx)(c.R,{scopes:[d.OV.ADMIN_CONFIG_UPDATE],resource:d.Ms,errorProps:{disabled:!0},children:(0,C.jsx)(f.A,{tooltip:`Create ${t} configuration`,children:(0,C.jsx)(i.$nd,{id:"create-idp",label:"Create Configuration",variant:"callAction",icon:(0,C.jsx)(i.REV,{}),onClick:()=>b(`/identity/idp/${t}/configurations/add-idp`)})})})]}),(0,C.jsx)(i.xA9,{item:!0,xs:12,children:(0,C.jsx)(c.R,{scopes:[d.OV.ADMIN_CONFIG_UPDATE],resource:d.Ms,errorProps:{disabled:!0},children:(0,C.jsx)(i.bQt,{itemActions:E,columns:[{label:"Name",elementKey:"name"},{label:"Type",elementKey:"type"},{label:"Enabled",elementKey:"enabled"}],isLoading:_,records:g,entityName:"Keys",idField:"name"})})})]})})]})},h=()=>(0,C.jsx)(b,{idpType:"openid"})}}]);
//# sourceMappingURL=7485.bf57295d.chunk.js.map