"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[7134],{17134:function(e,t,s){s.r(t);var n=s(29439),r=s(1413),i=s(61889),c=s(11135),a=s(25787),l=s(29945),o=s(72791),u=s(57689),d=s(81207),f=s(38442),x=s(56087),p=s(81551),K=s(87995),h=s(75578),S=s(23814),m=s(59114),j=s(92983),y=s(27454),k=s(47974),C=s(99670),Z=s(80184),_=(0,h.Z)(o.lazy((function(){return Promise.all([s.e(1715),s.e(5994),s.e(7391),s.e(2032)]).then(s.bind(s,62032))})));t.default=(0,a.Z)((function(e){return(0,c.Z)((0,r.Z)((0,r.Z)({},S.qg),S.Bz))}))((function(e){var t=e.classes,s=(0,p.TL)(),r=(0,u.s0)(),c=(0,o.useState)(""),a=(0,n.Z)(c,2),h=a[0],S=a[1],E=(0,o.useState)(!1),b=(0,n.Z)(E,2),g=b[0],M=b[1],v=(0,o.useState)(""),F=(0,n.Z)(v,2),P=F[0],I=F[1],T=(0,o.useState)(!1),A=(0,n.Z)(T,2),Y=A[0],L=A[1],z=(0,o.useState)([]),B=(0,n.Z)(z,2),D=B[0],R=B[1],N=(0,f.F)(x.C3,[x.Ft.KMS_DELETE_KEY]),O=(0,f.F)(x.C3,[x.Ft.KMS_LIST_KEYS]);(0,o.useEffect)((function(){w()}),[]),(0,o.useEffect)((function(){L(!0)}),[h]),(0,o.useEffect)((function(){if(Y)if(O){var e=""===h.trim()?"*":h.trim();d.Z.invoke("GET","/api/v1/kms/keys?pattern=".concat(e)).then((function(e){L(!1),R(e.results)})).catch((function(e){L(!1),s((0,K.Ih)(e))}))}else L(!1)}),[Y,L,R,s,O,h]);var w=function(){L(!0)},G=[{type:"delete",onClick:function(e){M(!0),I(e)},sendOnlyId:!0,disableButtonFunction:function(){return!N}}];return(0,o.useEffect)((function(){s((0,K.Sc)("list_keys"))}),[s]),(0,Z.jsxs)(o.Fragment,{children:[g&&(0,Z.jsx)(_,{deleteOpen:g,selectedItem:P,endpoint:"/api/v1/kms/keys/",element:"Key",closeDeleteModalAndRefresh:function(e){M(!1),e&&w()}}),(0,Z.jsx)(k.Z,{label:"Key Management Service Keys",actions:(0,Z.jsx)(C.Z,{})}),(0,Z.jsx)(l.Xgh,{className:t.pageContainer,children:(0,Z.jsxs)(i.ZP,{container:!0,spacing:1,children:[(0,Z.jsxs)(i.ZP,{item:!0,xs:12,display:"flex",alignItems:"center",justifyContent:"flex-end",sx:{"& button":{marginLeft:"8px"}},children:[(0,Z.jsx)(f.s,{scopes:[x.Ft.KMS_LIST_KEYS],resource:x.C3,errorProps:{disabled:!0},children:(0,Z.jsx)(m.Z,{onChange:S,placeholder:"Search Keys with pattern",value:h})}),(0,Z.jsx)(f.s,{scopes:[x.Ft.KMS_LIST_KEYS],resource:x.C3,errorProps:{disabled:!0},children:(0,Z.jsx)(y.Z,{tooltip:"Refresh",children:(0,Z.jsx)(l.zxk,{id:"refresh-keys",variant:"regular",icon:(0,Z.jsx)(l.DuK,{}),onClick:function(){return L(!0)}})})}),(0,Z.jsx)(f.s,{scopes:[x.Ft.KMS_IMPORT_KEY],resource:x.C3,errorProps:{disabled:!0},children:(0,Z.jsx)(y.Z,{tooltip:"Import Key",children:(0,Z.jsx)(l.zxk,{id:"import-key",variant:"regular",icon:(0,Z.jsx)(l.rG2,{}),onClick:function(){r(x.gA.KMS_KEYS_IMPORT)}})})}),(0,Z.jsx)(f.s,{scopes:[x.Ft.KMS_CREATE_KEY],resource:x.C3,errorProps:{disabled:!0},children:(0,Z.jsx)(y.Z,{tooltip:"Create Key",children:(0,Z.jsx)(l.zxk,{id:"create-key",label:"Create Key",variant:"callAction",icon:(0,Z.jsx)(l.dtP,{}),onClick:function(){return r(x.gA.KMS_KEYS_ADD)}})})})]}),(0,Z.jsx)(i.ZP,{item:!0,xs:12,className:t.tableBlock,children:(0,Z.jsx)(f.s,{scopes:[x.Ft.KMS_LIST_KEYS],resource:x.C3,errorProps:{disabled:!0},children:(0,Z.jsx)(j.Z,{itemActions:G,columns:[{label:"Name",elementKey:"name"},{label:"Created By",elementKey:"createdBy"},{label:"Created At",elementKey:"createdAt"}],isLoading:Y,records:D,entityName:"Keys",idField:"name"})})})]})})]})}))}}]);
//# sourceMappingURL=7134.5516568a.chunk.js.map