@topgroup/diginext
Version:
A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.
1 lines • 22.4 kB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8512],{56466:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(1413),o=n(67294),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}}]},name:"appstore-add",theme:"outlined"},l=n(91146),a=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:c}))})},47389:function(e,t,n){"use strict";var r=n(1413),o=n(67294),c=n(27363),l=n(91146),a=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:c.Z}))});t.Z=a},28280:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(1413),o=n(67294),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"}}]},name:"poweroff",theme:"outlined"},l=n(91146),a=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:c}))})},71466:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return project}});var r,o=n(22598),c=n(59499),l=n(50029),a=n(16835),i=n(87794),s=n.n(i),d=n(45605),u=n(76971),p=n(48689),v=n(1413),h=n(67294),f={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},m=n(91146),x=h.forwardRef(function(e,t){return h.createElement(m.Z,(0,v.Z)((0,v.Z)({},e),{},{ref:t,icon:f}))}),g=n(55287),j=n(67841),y=n(54811),Z={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},b=h.forwardRef(function(e,t){return h.createElement(m.Z,(0,v.Z)((0,v.Z)({},e),{},{ref:t,icon:Z}))}),k=n(50067),w={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zm-392 88c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm376 116c-119.3 0-216 96.7-216 216s96.7 216 216 216 216-96.7 216-216-96.7-216-216-216zm107.5 323.5C750.8 868.2 712.6 884 672 884s-78.8-15.8-107.5-44.5C535.8 810.8 520 772.6 520 732s15.8-78.8 44.5-107.5C593.2 595.8 631.4 580 672 580s78.8 15.8 107.5 44.5C808.2 653.2 824 691.4 824 732s-15.8 78.8-44.5 107.5zM761 656h-44.3c-2.6 0-5 1.2-6.5 3.3l-63.5 87.8-23.1-31.9a7.92 7.92 0 00-6.5-3.3H573c-6.5 0-10.3 7.4-6.5 12.7l73.8 102.1c3.2 4.4 9.7 4.4 12.9 0l114.2-158c3.9-5.3.1-12.7-6.4-12.7zM440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"file-done",theme:"outlined"},z=h.forwardRef(function(e,t){return h.createElement(m.Z,(0,v.Z)((0,v.Z)({},e),{},{ref:t,icon:w}))}),C={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M468 128H160c-17.7 0-32 14.3-32 32v308c0 4.4 3.6 8 8 8h332c4.4 0 8-3.6 8-8V136c0-4.4-3.6-8-8-8zm-56 284H192V192h220v220zm-138-74h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm194 210H136c-4.4 0-8 3.6-8 8v308c0 17.7 14.3 32 32 32h308c4.4 0 8-3.6 8-8V556c0-4.4-3.6-8-8-8zm-56 284H192V612h220v220zm-138-74h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm590-630H556c-4.4 0-8 3.6-8 8v332c0 4.4 3.6 8 8 8h332c4.4 0 8-3.6 8-8V160c0-17.7-14.3-32-32-32zm-32 284H612V192h220v220zm-138-74h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm194 210h-48c-4.4 0-8 3.6-8 8v134h-78V556c0-4.4-3.6-8-8-8H556c-4.4 0-8 3.6-8 8v332c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h78v102c0 4.4 3.6 8 8 8h190c4.4 0 8-3.6 8-8V556c0-4.4-3.6-8-8-8zM746 832h-48c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm142 0h-48c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}}]},name:"qrcode",theme:"outlined"},_=h.forwardRef(function(e,t){return h.createElement(m.Z,(0,v.Z)((0,v.Z)({},e),{},{ref:t,icon:C}))}),S=n(56466),P=n(13520),V=n(10038),E={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M193 796c0 17.7 14.3 32 32 32h574c17.7 0 32-14.3 32-32V563c0-176.2-142.8-319-319-319S193 386.8 193 563v233zm72-233c0-136.4 110.6-247 247-247s247 110.6 247 247v193H404V585c0-5.5-4.5-10-10-10h-44c-5.5 0-10 4.5-10 10v171h-75V563zm-48.1-252.5l39.6-39.6c3.1-3.1 3.1-8.2 0-11.3l-67.9-67.9a8.03 8.03 0 00-11.3 0l-39.6 39.6a8.03 8.03 0 000 11.3l67.9 67.9c3.1 3.1 8.1 3.1 11.3 0zm669.6-79.2l-39.6-39.6a8.03 8.03 0 00-11.3 0l-67.9 67.9a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l67.9-67.9c3.1-3.2 3.1-8.2 0-11.3zM832 892H192c-17.7 0-32 14.3-32 32v24c0 4.4 3.6 8 8 8h688c4.4 0 8-3.6 8-8v-24c0-17.7-14.3-32-32-32zM484 180h56c4.4 0 8-3.6 8-8V76c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v96c0 4.4 3.6 8 8 8z"}}]},name:"alert",theme:"outlined"},A=h.forwardRef(function(e,t){return h.createElement(m.Z,(0,v.Z)((0,v.Z)({},e),{},{ref:t,icon:E}))}),H=n(28280),O={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},N=h.forwardRef(function(e,t){return h.createElement(m.Z,(0,v.Z)((0,v.Z)({},e),{},{ref:t,icon:O}))}),M=n(47389),L=n(16596),D=n(52645),R=n(13179),T=n(57546),B=n(51042),I=n(85945),F=n(84213),U=n(66309),K=n(73318),q=n(71471),Y=n(26855),Q=n(78957),W=n(86738),X=n(83062),G=n(85418),J=n(44973),$=n(27484),ee=n.n($),et=n(96486),en=n(41664),er=n.n(en),eo=n(11163),ec=n(34187),el=n(23907),ea=n(47859),ei=n(4400),es=n(61771),ed=n(61123),eu=n(90447),ep=n(21084),ev=n(56832),eh=n(3669),ef=n(55240),em=n(55611),ex=n(59322),eg=n(73455),ej=n(53072),ey=n(85893);function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){(0,c.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var eZ=n(56176),eb=n(84110);ee().extend(eb),ee().extend(eZ);var ek=null!==(r=em.XL.tableConfig.defaultPageSize)&&void 0!==r?r:20,ProjectList=function(){var e,t,n,r=(0,eo.useRouter)(),o=(0,ev.o)(),c=(0,a.Z)(o,2),i=c[0],v=c[1].setQuery,f=(0,eh.Jl)().responsive,m=(0,ef.f9)().modal,Z=(0,h.useState)(i.page?parseInt(i.page,10):1),w=Z[0],C=Z[1],E=(0,I.NL)(),O=(0,es.BT)({populate:"owner",pagination:{page:w,size:ek}}),$=O.data,en=O.status,em=O.refetch,eZ=$||{},eb=eZ.list,ew=eZ.pagination||{},ez=(ew.total_pages,ew.total_items),eC=(0,ea.x7)({pagination:{page:w,size:50}}),e_=eC.data;eC.status,(e_||{}).list;var eS=[{title:"Projects",width:null!=f&&f.md?60:40,dataIndex:"name",key:"name",fixed:null!=f&&f.md?"left":void 0,filterSearch:!0,filters:null==eb?void 0:eb.map(function(e){return{text:(null==e?void 0:e.slug)||"",value:(null==e?void 0:e.slug)||""}}),onFilter:function(e,t){return null==t||!t.slug||(null==t?void 0:t.slug.indexOf(e.toString()))>-1},render:function(e,t){var n,r;return"project"===t.type?(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)(er(),{href:"/apps?project=".concat(t.slug),children:(0,ey.jsx)("strong",{children:t.name})})," ",(0,ey.jsx)(U.Z,{children:t.slug})]}):"app"===t.type?(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)("span",{className:"cursor-pointer text-purple-300 transition-colors hover:text-purple-500 hover:transition-colors",onClick:function(){return v({lv1:"edit",type:"app",app:t.slug})},children:t.name})," ",(0,ey.jsx)(U.Z,{children:t.slug}),(0,ey.jsx)(er(),{href:(null===(n=t.git)||void 0===n?void 0:n.repoURL)||"#",target:"_blank",children:(0,ey.jsx)(U.Z,{color:"cyan",children:null===(r=t.git)||void 0===r?void 0:r.provider})})]}):e}},{title:"Cluster",width:30,dataIndex:"cluster",key:"cluster",render:function(e){return(0,ey.jsx)(K.ZP,{type:"link",style:{padding:0},children:e})}},{title:"Status",dataIndex:"status",key:"status",width:null!=f&&f.md?20:15,filters:[{text:"archived",value:"archived"},{text:"healthy",value:"healthy"},{text:"undeployed",value:"undeployed"},{text:"partial_healthy",value:"partial_healthy"},{text:"failed",value:"failed"},{text:"crashed",value:"crashed"},{text:"unknown",value:"unknown"}],filterSearch:!0,onFilter:function(e,t){return"archived"===e?void 0!==t.archivedAt:"project"===t.type||"app"===t.type||(console.log("record.status === value :>> ",t.status,e),!!t.status&&t.status===e)},render:function(e,t){var n=e;return t.type,null!=t&&t.archivedAt&&(n="archived"),(0,ey.jsx)(U.Z,{color:"healthy"===e?"success":"undeployed"===e?"pink":"default",icon:(0,ey.jsx)(d.Z,{className:"align-middle"}),children:n})}},{title:"Last updated by",dataIndex:"lastUpdatedBy",key:"lastUpdatedBy",width:35,filterSearch:!0,render:function(e,t){var n;return(0,ey.jsx)(ey.Fragment,{children:e||(null===(n=t.owner)||void 0===n?void 0:n.name)})}},{title:"Last updated",dataIndex:"updatedAt",key:"updatedAt",width:30,render:function(e){return(0,ey.jsx)(ed.q,{date:e})},sorter:function(e,t){return ee()(e.updatedAt).diff(ee()(t.updatedAt))}},{title:"Created at",dataIndex:"createdAt",key:"createdAt",width:30,render:function(e){return(0,ey.jsx)(ed.q,{date:e})},sorter:function(e,t){return ee()(e.createdAt).diff(ee()(t.createdAt))}},{title:(0,ey.jsx)(q.Z.Text,{className:"text-xs md:text-sm",children:"Action"}),key:"action",fixed:"right",width:null!=f&&f.md?18:13,dataIndex:"action",render:function(e,t){return t.actions}}],eP=(0,es.E_)(),eV=(0,a.Z)(eP,2),eE=eV[0];eV[1];var eA=(0,ec._M)(),eH=(0,a.Z)(eA,2),eO=eH[0];eH[1];var eN=(0,ec.rg)(),eM=(0,a.Z)(eN,2),eL=eM[0];eM[1];var eD=(0,ec.WK)(),eR=(0,a.Z)(eD,2),eT=eR[0];eR[1];var eB=(0,ec.md)(),eI=(0,a.Z)(eB,2),eF=eI[0];eI[1];var eU=(0,el.rA)(),eK=(0,a.Z)(eU,2);eK[0],eK[1];var eq=(0,el.fg)(),eY=(0,a.Z)(eq,2);eY[0],eY[1];var eQ=(0,ei.GD)(),eW=(0,a.Z)(eQ,2);eW[0],eW[1];var eX=(0,ec.yq)(),eG=(0,a.Z)(eX,2),eJ=eG[0];eG[1];var e$=(0,ec.wt)(),e0=(0,a.Z)(e$,2),e8=e0[0];e0[1];var e1=(0,ec.kK)(),e6=(0,a.Z)(e1,2),e4=e6[0];e6[1];var openAddDomains=function(e,t){console.log("env :>> ",t);var n=null==m?void 0:m.info({title:"Add new domains",icon:(0,ey.jsx)(u.Z,{}),content:(0,ey.jsx)(ex.Z,{app:e,env:t,next:function(){null==n||n.destroy(),Y.ZP.success({message:"Congrats!",description:"New domain was added successfully!"})}}),footer:null,closable:!0,maskClosable:!0,onOk:function(){}})},openNewApp=function(){var e=null==m?void 0:m.info({className:"!p-0",style:{padding:0},bodyStyle:{padding:0},icon:null,content:(0,ey.jsx)(eg.Z,{onClose:function(){return null==e?void 0:e.destroy()}}),footer:null,closable:!0,maskClosable:!0,onOk:function(){}})},openPromoteDeployEnvironmentModal=function(e,t,n,r){var o=null==m?void 0:m.info({title:(0,ey.jsx)(q.Z.Title,{level:3,children:(null==r?void 0:r.title)||"Promote to ".concat(n?n.toUpperCase():"another"," deploy environment")}),icon:null,content:(0,ey.jsx)(ej.Z,{app:e,fromEnv:t,toEnv:n,next:function(){null==o||o.destroy(),em()}}),footer:null,closable:!0,maskClosable:!0,width:500,styles:{body:{margin:0,width:"100%",justifyContent:"stretch"}},onOk:function(){}})},openBuildList=function(e,t,n){v({lv1:"build",project:e,app:t})},openReleaseList=function(e,t,n){v({lv1:"release",project:e,app:t,env:n})},openEnvVarsEdit=function(e,t,n){v({lv1:"env_vars",project:e,app:t,env:n})},e3=(e=(0,l.Z)(s().mark(function _callee(e){return s().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,eE({_id:e});case 2:console.log("[deleteProject] result :>> ",t.sent);case 4:case"end":return t.stop()}},_callee)})),function(t){return e.apply(this,arguments)}),e2=(t=(0,l.Z)(s().mark(function _callee2(e){var t;return s().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,eO({_id:e});case 2:t=n.sent,em(),console.log("[deleteApp] result :>> ",t);case 5:case"end":return n.stop()}},_callee2)})),function(e){return t.apply(this,arguments)}),e5=(n=(0,l.Z)(s().mark(function _callee3(e,t){return s().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,eL({_id:e,env:t});case 2:console.log("[deleteEnvironment] result :>> ",n.sent),E.invalidateQueries({queryKey:["projects","list"]}),E.invalidateQueries({queryKey:["apps","list"]});case 6:case"end":return n.stop()}},_callee3)})),function(e,t){return n.apply(this,arguments)});(0,h.useEffect)(function(){r.isReady&&C(i.page?parseInt(i.page.toString(),10):1)},[i.page]);var e7=null==eb?void 0:eb.map(function(e){return _objectSpread(_objectSpread({},e),{},{type:"project",actions:(0,ey.jsx)(Q.Z.Compact,{children:(0,ey.jsx)(W.Z,{title:"Are you sure to delete this project?",description:(0,ey.jsx)("span",{className:"text-red-500",children:"Caution: all of the related apps & deployed environments will be also deleted."}),onConfirm:function(){return e3(e._id)},okText:"Yes",cancelText:"No",children:(0,ey.jsx)(K.ZP,{icon:(0,ey.jsx)(p.Z,{})})})}),key:e._id,id:e._id,status:"N/A",children:e.apps?e.apps.map(function(t){var n,o=Object.keys(null!==(n=t.deployEnvironment)&&void 0!==n?n:{}).map(function(n){var o,c,l=(t.deployEnvironment||{})[n]||{},a="https://".concat(null===(o=l.domains)||void 0===o?void 0:o[0]),i=_objectSpread({name:(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)(X.Z,{title:(null===(c=l.domains)||void 0===c?void 0:c.map(function(e){return(0,ey.jsx)("ul",{style:{listStyleType:"disc"},children:(0,ey.jsx)("li",{style:{listStyleType:"disc",display:"list-item"},children:(0,ey.jsxs)(er(),{href:"https://".concat(e),target:"_blank",children:["https://",e]})})},e)}))||"No domains",children:(0,ey.jsx)(er(),{href:a,target:"_blank",children:(0,ey.jsx)(x,{})},a)}),(0,ey.jsx)(K.ZP,{type:"link",onClick:function(){return v({lv1:"deploy_environment",project:e.slug,app:t.slug,env:n})},children:n.toUpperCase()}),(0,ey.jsxs)(U.Z,{color:"green",children:["Namespace: ",l.namespace]})]}),key:"".concat(e.slug,"-").concat(t.slug,"-").concat(n),id:n,slug:n,projectSlug:e.slug,appSlug:t.slug,type:"prod"!==n?"env":"env-prod",url:l.domains?"https://".concat(l.domains[0]):""},l);return i.actions=(0,ey.jsxs)(Q.Z.Compact,{children:[(0,ey.jsx)(X.Z,{title:"View website",children:(0,ey.jsx)(K.ZP,{icon:(0,ey.jsx)(g.Z,{}),href:i.url,target:"_blank",disabled:(0,et.isEmpty)(i.url)})}),(0,ey.jsx)(G.Z,{menu:{items:[{label:(0,ey.jsx)(X.Z,{title:"Build & deploy from latest git source",children:"Deploy now"}),key:"deploy-now",icon:(0,ey.jsx)(j.Z,{}),onClick:function(){return r.push("/deploy?app=".concat(t.slug,"&env=").concat(n,"®istry=").concat(l.registry,"&cluster=").concat(l.cluster))}},{label:(0,ey.jsx)(X.Z,{title:"Deploy current build of this environment to production",children:"Promote to PRODUCTION"}),key:"promote-to-production",icon:(0,ey.jsx)(y.Z,{}),onClick:function(){openPromoteDeployEnvironmentModal(t,n,"prod")}},{label:(0,ey.jsx)(X.Z,{title:"Deploy current build of this environment to production",children:"Promote to another"}),key:"promote-to-another",icon:(0,ey.jsx)(y.Z,{}),onClick:function(){openPromoteDeployEnvironmentModal(t,n)}},{label:"List of releases",key:"list-of-releases",icon:(0,ey.jsx)(b,{}),onClick:function(){return openReleaseList(i.projectSlug,i.appSlug,n)}},{label:"List of builds",key:"list-of-builds",icon:(0,ey.jsx)(k.Z,{}),onClick:function(){return openBuildList(i.projectSlug,i.appSlug,i.id)}},{label:"Deployment YAML",key:"deployment-yaml",icon:(0,ey.jsx)(z,{}),onClick:function(){return v({lv1:"deployment_yaml",project:i.projectSlug,app:i.appSlug,env:n})}},{label:"Environment variables",key:"env-vars",icon:(0,ey.jsx)(_,{}),onClick:function(){return openEnvVarsEdit(i.projectSlug,i.appSlug,n)}},{label:"Add domains",key:"add-domains",icon:(0,ey.jsx)(S.Z,{}),onClick:function(){return openAddDomains(i.appSlug,n)}},{label:"Change cluster",key:"change-cluster",icon:(0,ey.jsx)(P.Z,{}),onClick:function(){return openPromoteDeployEnvironmentModal(t,n,n,{title:"Change to another cluster"})}},{label:"Sleep",key:"sleep",icon:(0,ey.jsx)(V.Z,{}),onClick:function(){return eJ({slug:i.appSlug,env:n})}},{label:"Awake",key:"awake",icon:(0,ey.jsx)(A,{}),onClick:function(){return e8({slug:i.appSlug,env:n})}},{label:"Take down",key:"take-down",icon:(0,ey.jsx)(H.Z,{}),onClick:function(){return e4({slug:i.appSlug,env:n})}}]},children:(0,ey.jsx)(K.ZP,{style:{padding:"4px 4px"},children:(0,ey.jsx)(N,{})})}),(0,ey.jsx)(W.Z,{title:"Are you sure to delete this environment?",description:(0,ey.jsx)("span",{className:"text-red-500",children:"Caution: this is permanent and cannot be rolled back (excepts re-deploying)."}),onConfirm:function(){return e5(t._id,n)},okText:"Yes",cancelText:"No",children:(0,ey.jsx)(K.ZP,{icon:(0,ey.jsx)(p.Z,{})})})]}),i});return _objectSpread(_objectSpread({},t),{},{key:t._id,id:t._id,type:"app",children:o,actions:(0,ey.jsxs)(Q.Z.Compact,{children:[(0,ey.jsx)(X.Z,{title:"Edit app",children:(0,ey.jsx)(K.ZP,{icon:(0,ey.jsx)(M.Z,{}),onClick:function(){return v({lv1:"edit",type:"app",app:t.slug})}})}),(0,ey.jsx)(X.Z,{title:void 0!==t.archiveAt?"Unarchive":"Archive",children:(0,ey.jsx)(K.ZP,{icon:void 0!==t.archiveAt?(0,ey.jsx)(L.Z,{}):(0,ey.jsx)(D.Z,{}),onClick:function(){var e,n;return void 0!==t.archiveAt?null===(e=eF({_id:t._id}))||void 0===e?void 0:e.then(function(){return em()}):null===(n=eT({_id:t._id}))||void 0===n?void 0:n.then(function(){return em()})}})}),(0,ey.jsx)(W.Z,{title:"Are you sure to delete this app?",description:(0,ey.jsx)("span",{className:"text-red-500",children:"Caution: all of the related deployed environments will be also deleted."}),onConfirm:function(){return e2(t._id)},okText:"Yes",cancelText:"No",children:(0,ey.jsx)(K.ZP,{icon:(0,ey.jsx)(p.Z,{})})})]})})}):[]})}),e9=(0,h.useRef)(null),te=(0,F.Z)(e9);return(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)(ep.Z,{commands:null==eb?void 0:eb.map(function(e){var t;return{label:"".concat(e.name," (").concat(e.slug,")"),value:e,children:null===(t=e.apps)||void 0===t?void 0:t.filter(function(e){return!e.deletedAt}).map(function(t){return{value:t,label:(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)(U.Z,{children:e.slug}),"≫",(0,ey.jsx)(U.Z,{children:t.slug})]}),children:Object.keys(t.deployEnvironment||{}).map(function(n){return{label:(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)(R.Z,{}),"Deploy environment ≫ ".concat(n.toUpperCase())]}),value:(t.deployEnvironment||{})[n],onSelect:function(r){return v({lv1:"deploy_environment",project:e.slug,app:t.slug,env:n})}}})}})}})}),(0,ey.jsx)(eu.V,{title:"Projects & apps",breadcrumbs:[{name:"Workspace"}],actions:[(0,ey.jsx)(K.ZP,{icon:(0,ey.jsx)(T.Z,{className:"align-middle"}),href:"/import",children:"Import"},"import-btn"),(0,ey.jsx)(K.ZP,{icon:(0,ey.jsx)(B.Z,{className:"align-middle"}),onClick:function(){return openNewApp()},children:"Create app"},"create-app-btn")]}),(0,ey.jsx)("div",{className:"h-full flex-auto overflow-hidden",ref:e9,children:(0,ey.jsx)(J.Z,{size:"small",loading:"loading"===en,columns:eS,dataSource:e7,scroll:{x:null!=f&&f.md?1600:1200,y:void 0!==(null==te?void 0:te.height)?te.height-120:void 0},sticky:{offsetHeader:0},pagination:{showSizeChanger:!0,current:w,defaultPageSize:ek,total:ez,position:["bottomCenter"]},onChange:function(e){console.log("Table changed!");var t=e.current;v({page:null!=t?t:1})}})})]})},ew=n(6761),ez=n(1071),project=function(){return(0,ey.jsx)(o.Wk,{children:(0,ey.jsx)(ew.o,{meta:(0,ey.jsx)(ez.h,{title:"Projects",description:"Manage builds & deployments of your projects / apps "}),children:(0,ey.jsx)(ProjectList,{})})})}},6647:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/project",function(){return n(71466)}])}},function(e){e.O(0,[3662,5877,6043,3945,7786,9774,2888,179],function(){return e(e.s=6647)}),_N_E=e.O()}]);