Files
object-browser/portal-ui/build/static/js/1268.819d9108.chunk.js
Alex c31b311b4e Release v0.21.0 (#2389)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-10-14 21:30:21 -07:00

2 lines
4.9 KiB
JavaScript

"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1268],{92217:function(e,n,t){var o=t(1413),r=t(72791),i=t(61889),a=t(30829),c=t(20068),s=t(64554),l=t(11135),u=t(25787),d=t(84570),f=t(23814),p=t(38734),m=t(75952),x=t(78029),h=t.n(x),y=t(90932),b=t(27454),j=t(80184);n.Z=(0,u.Z)((function(e){return(0,l.Z)((0,o.Z)({},f.YI))}))((function(e){var n=e.value,t=e.label,o=void 0===t?"":t,l=e.tooltip,u=void 0===l?"":l,f=e.mode,x=void 0===f?"json":f,Z=e.classes,g=e.onBeforeChange,v=(e.readOnly,e.editorHeight),C=void 0===v?"250px":v;return(0,j.jsxs)(r.Fragment,{children:[(0,j.jsx)(i.ZP,{item:!0,xs:12,sx:{marginBottom:"10px"},children:(0,j.jsxs)(a.Z,{className:Z.inputLabel,children:[(0,j.jsx)("span",{children:o}),""!==u&&(0,j.jsx)("div",{className:Z.tooltipContainer,children:(0,j.jsx)(c.Z,{title:u,placement:"top-start",children:(0,j.jsx)("div",{className:Z.tooltip,children:(0,j.jsx)(d.Z,{})})})})]})}),(0,j.jsx)(i.ZP,{item:!0,xs:12,style:{maxHeight:C,overflow:"auto",border:"1px solid #eaeaea"},children:(0,j.jsx)(y.Z,{value:n,language:x,onChange:function(e){g(null,null,e.target.value)},id:"code_wrapper",padding:15,style:{fontSize:12,backgroundColor:"#fefefe",fontFamily:"ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace",minHeight:C||"initial",color:"#000000"}})}),(0,j.jsx)(i.ZP,{item:!0,xs:12,sx:{background:"#f7f7f7",border:"1px solid #eaeaea",borderTop:0},children:(0,j.jsx)(s.Z,{sx:{display:"flex",alignItems:"center",padding:"2px",paddingRight:"5px",justifyContent:"flex-end","& button":{height:"26px",width:"26px",padding:"2px"," .min-icon":{marginLeft:"0"}}},children:(0,j.jsx)(b.Z,{tooltip:"Copy to Clipboard",children:(0,j.jsx)(h(),{text:n,children:(0,j.jsx)(m.z,{type:"button",id:"copy-code-mirror",icon:(0,j.jsx)(p.TIy,{}),color:"primary",variant:"regular"})})})})})]})}))},82859:function(e,n,t){t.r(n);var o=t(29439),r=t(1413),i=t(72791),a=t(60364),c=t(16871),s=t(40986),l=t(75952),u=t(61889),d=t(11135),f=t(25787),p=t(81207),m=t(23814),x=t(92217),h=t(87995),y=t(25469),b=t(82295),j=t(50896),Z=t(80184);n.default=(0,f.Z)((function(e){return(0,d.Z)((0,r.Z)((0,r.Z)({errorState:{color:"#b53b4b",fontSize:14,fontWeight:"bold"},codeMirrorContainer:{marginBottom:20,paddingLeft:15,"& label":{marginBottom:".5rem"},"& label + div":{display:"none"}}},m.ID),m.YI))}))((function(e){var n=e.classes,t=(0,y.TL)(),r=(0,c.s0)(),d=(0,a.v9)((function(e){return e.tenants.currentTenant})),f=(0,a.v9)((function(e){return e.tenants.currentNamespace})),m=(0,i.useState)(!1),g=(0,o.Z)(m,2),v=g[0],C=g[1],S=(0,i.useState)(!1),P=(0,o.Z)(S,2),w=P[0],T=P[1],k=(0,i.useState)(""),O=(0,o.Z)(k,2),_=O[0],z=O[1],L=(0,i.useState)(""),M=(0,o.Z)(L,2),B=M[0],E=M[1];(0,i.useEffect)((function(){p.Z.invoke("GET","/api/v1/namespaces/".concat(f,"/tenants/").concat(d,"/yaml")).then((function(e){T(!1),z(e.yaml)})).catch((function(e){T(!1),t((0,h.zb)(e))}))}),[d,f,t]),(0,i.useEffect)((function(){}),[]);var F=""!==_.trim();return(0,Z.jsxs)(i.Fragment,{children:[v||w&&(0,Z.jsx)(u.ZP,{item:!0,xs:12,children:(0,Z.jsx)(s.Z,{})}),""!==B&&(0,Z.jsx)("div",{className:n.errorState,children:B}),!w&&(0,Z.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),v||(C(!0),E(""),p.Z.invoke("PUT","/api/v1/namespaces/".concat(f,"/tenants/").concat(d,"/yaml"),{yaml:_}).then((function(e){C(!1),t((0,b.v)()),E(""),r("/namespaces/".concat(f,"/tenants/").concat(d,"/summary"))})).catch((function(e){C(!1),E(e.errorMessage)})))},children:(0,Z.jsxs)(u.ZP,{container:!0,children:[(0,Z.jsx)(u.ZP,{item:!0,xs:12,children:(0,Z.jsx)(j.Z,{children:"Tenant Specification"})}),(0,Z.jsx)(u.ZP,{item:!0,xs:12,children:(0,Z.jsx)(x.Z,{value:_,mode:"yaml",onBeforeChange:function(e,n,t){z(t)},editorHeight:"550px"})}),(0,Z.jsxs)(u.ZP,{item:!0,xs:12,style:{display:"flex",justifyContent:"flex-end",paddingTop:16},children:[(0,Z.jsx)(l.z,{id:"cancel-tenant-yaml",type:"button",variant:"regular",disabled:v,onClick:function(){r("/namespaces/".concat(f,"/tenants/").concat(d,"/summary"))},label:"Cancel"}),(0,Z.jsx)(l.z,{id:"save-tenant-yaml",type:"submit",variant:"callAction",disabled:v||!F,style:{marginLeft:8},label:"Save"})]})]})})]})}))},61120:function(e,n,t){function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}t.d(n,{Z:function(){return o}})},60136:function(e,n,t){t.d(n,{Z:function(){return r}});var o=t(89611);function r(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&(0,o.Z)(e,n)}},82963:function(e,n,t){t.d(n,{Z:function(){return i}});var o=t(71002),r=t(97326);function i(e,n){if(n&&("object"===(0,o.Z)(n)||"function"===typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return(0,r.Z)(e)}}}]);
//# sourceMappingURL=1268.819d9108.chunk.js.map