Files
openmaxio-object-browser/web-app/build/static/js/7134.f87a706a.chunk.js
2023-12-29 11:44:01 -06:00

2 lines
2.8 KiB
JavaScript

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