"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[5072],{5072:(e,s,t)=>{t.r(s),t.d(s,{default:()=>j});var r=t(69060),c=t(66152),i=t(51560),l=t(50900),n=t(3992),a=t(21124),o=t(66156),d=t(95705),K=t(99748),p=t(86116),x=t(84612),u=t(3428),S=t(48504),h=t(82496);const y=(0,K.c)(r.lazy((()=>t.e(9740).then(t.bind(t,9740))))),j=()=>{const e=(0,o.Ab)(),s=(0,i.i6)(),[t,K]=(0,r.useState)(""),[j,_]=(0,r.useState)(!1),[m,f]=(0,r.useState)(""),[E,b]=(0,r.useState)(!1),[k,C]=(0,r.useState)([]),M=(0,n.i)(a.Gc,[a.Oi.KMS_DELETE_KEY]),O=(0,n.i)(a.Gc,[a.Oi.KMS_LIST_KEYS]);(0,r.useEffect)((()=>{I()}),[]),(0,r.useEffect)((()=>{b(!0)}),[t]),(0,r.useEffect)((()=>{if(E)if(O){let s=""===t.trim()?"*":t.trim();l.c.invoke("GET","/api/v1/kms/keys?pattern=".concat(s)).then((e=>{b(!1),C(e.results)})).catch((s=>{b(!1),e((0,d.aW)(s))}))}else b(!1)}),[E,b,C,e,O,t]);const I=()=>{b(!0)},g=[{type:"delete",onClick:e=>{_(!0),f(e)},sendOnlyId:!0,disableButtonFunction:()=>!M}];return(0,r.useEffect)((()=>{e((0,d.i8)("list_keys"))}),[e]),(0,h.jsxs)(r.Fragment,{children:[j&&(0,h.jsx)(y,{deleteOpen:j,selectedItem:m,closeDeleteModalAndRefresh:e=>{_(!1),e&&I()}}),(0,h.jsx)(u.c,{label:"Key Management Service Keys",actions:(0,h.jsx)(S.c,{})}),(0,h.jsx)(c._al,{children:(0,h.jsxs)(c.yeN,{container:!0,children:[(0,h.jsxs)(c.yeN,{item:!0,xs:12,sx:{display:"flex",alignItems:"center",justifyContent:"flex-end","& button":{marginLeft:"8px"}},children:[(0,h.jsx)(n.K,{scopes:[a.Oi.KMS_LIST_KEYS],resource:a.Gc,errorProps:{disabled:!0},children:(0,h.jsx)(p.c,{onChange:K,placeholder:"Search Keys with pattern",value:t})}),(0,h.jsx)(n.K,{scopes:[a.Oi.KMS_LIST_KEYS],resource:a.Gc,errorProps:{disabled:!0},children:(0,h.jsx)(x.c,{tooltip:"Refresh",children:(0,h.jsx)(c.qaq,{id:"refresh-keys",variant:"regular",icon:(0,h.jsx)(c.W5k,{}),onClick:()=>b(!0)})})}),(0,h.jsx)(n.K,{scopes:[a.Oi.KMS_IMPORT_KEY],resource:a.Gc,errorProps:{disabled:!0},children:(0,h.jsx)(x.c,{tooltip:"Import Key",children:(0,h.jsx)(c.qaq,{id:"import-key",variant:"regular",icon:(0,h.jsx)(c.OKe,{}),onClick:()=>{s(a.Ks.KMS_KEYS_IMPORT)}})})}),(0,h.jsx)(n.K,{scopes:[a.Oi.KMS_CREATE_KEY],resource:a.Gc,errorProps:{disabled:!0},children:(0,h.jsx)(x.c,{tooltip:"Create Key",children:(0,h.jsx)(c.qaq,{id:"create-key",label:"Create Key",variant:"callAction",icon:(0,h.jsx)(c.EgV,{}),onClick:()=>s(a.Ks.KMS_KEYS_ADD)})})})]}),(0,h.jsx)(c.yeN,{item:!0,xs:12,children:(0,h.jsx)(n.K,{scopes:[a.Oi.KMS_LIST_KEYS],resource:a.Gc,errorProps:{disabled:!0},children:(0,h.jsx)(c.iSL,{itemActions:g,columns:[{label:"Name",elementKey:"name"},{label:"Created By",elementKey:"createdBy"},{label:"Created At",elementKey:"createdAt"}],isLoading:E,records:k,entityName:"Keys",idField:"name"})})})]})})]})}}}]);
//# sourceMappingURL=5072.61e61192.chunk.js.map