UNPKG

@topgroup/diginext

Version:

A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.

1 lines 8.26 kB
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6074],{57546:function(e,t,o){"use strict";o.d(t,{Z:function(){return l}});var i=o(1413),r=o(67294),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},n=o(91146),l=r.forwardRef(function(e,t){return r.createElement(n.Z,(0,i.Z)((0,i.Z)({},e),{},{ref:t,icon:a}))})},72945:function(e,t,o){"use strict";var i=o(11163),r=o(67294),a=o(79661),n=o(85893);t.Z=function(e){var t=(0,i.useRouter)(),o=(0,a.vs)().isDarkMode,l=(0,r.useState)("".concat(t.basePath,"/assets/images/diginext_logo_white.svg")),s=l[0],c=l[1];return(0,r.useEffect)(function(){c(o?"".concat(t.basePath,"/assets/images/diginext_logo_white.svg"):"".concat(t.basePath,"/assets/images/diginext_logo.svg"))},[o]),(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mx-auto my-5 w-64 text-center ".concat(e.className||""),children:(0,n.jsx)("img",{src:s,alt:"DXUP Logo",className:"inline-block"})}),e.useTagline&&(0,n.jsx)("div",{className:"mb-6",children:"Build faster. Deploy easier. More flexible."})]})}},47420:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return pages_import}});var i=o(41664),r=o.n(i),a=o(22598),n=o(54846),l=o(72945),s=o(50029),c=o(16835),u=o(87794),d=o.n(u),p=o(79090),v=o(1413),m=o(67294),f={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M752 100c-61.8 0-112 50.2-112 112 0 47.7 29.9 88.5 72 104.6v27.6L512 601.4 312 344.2v-27.6c42.1-16.1 72-56.9 72-104.6 0-61.8-50.2-112-112-112s-112 50.2-112 112c0 50.6 33.8 93.5 80 107.3v34.4c0 9.7 3.3 19.3 9.3 27L476 672.3v33.6c-44.2 15-76 56.9-76 106.1 0 61.8 50.2 112 112 112s112-50.2 112-112c0-49.2-31.8-91-76-106.1v-33.6l226.7-291.6c6-7.7 9.3-17.3 9.3-27v-34.4c46.2-13.8 80-56.7 80-107.3 0-61.8-50.2-112-112-112zM224 212a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm336 600a48.01 48.01 0 01-96 0 48.01 48.01 0 0196 0zm192-552a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"fork",theme:"outlined"},h=o(91146),g=m.forwardRef(function(e,t){return m.createElement(h.Z,(0,v.Z)((0,v.Z)({},e),{},{ref:t,icon:f}))}),x=o(57546),j=o(73403),Z=o(9361),w=o(8232),S=o(51423),_=o(71471),b=o(39249),I=o(65217),y=o(73318),N=o(96486),C=o(34187),P=o(74040),D=o(61771),z=o(9449),E=o(56832),k=o(85893),projects_ImportGitModal=function(e){var t,o,i,r=e.className;Z.Z.useToken().token.colorBgContainer;var a=w.Z.useForm(),n=(0,c.Z)(a,1)[0],l=(0,E.o)(),u=(0,c.Z)(l,2),v=u[0];u[1].setQuery;var f=v.sshUrl,h=v.branch,R=(0,m.useState)(),L=R[0],T=R[1],B=(0,m.useState)(f),H=B[0],M=B[1];(0,m.useEffect)(function(){return M(f)},[f]);var F=(0,D.Zz)({populate:"owner",pagination:{page:1,size:100}}),U=F.data,V=(U=void 0===U?{}:U).list,G=void 0===V?[]:V;F.status;var O=(0,P.y3)(),X=O.data,q=(X=void 0===X?{}:X).list;O.status;var A=(0,C.u4)(),Q=(0,c.Z)(A,2),W=Q[0],J=Q[1],K=(0,z.t1)(H),Y=(0,P.Td)(K.repoSlug||"",{enabled:void 0!==K.repoSlug&&void 0!==(null==L?void 0:L._id)&&!(0,N.isEmpty)(H),filter:{_id:null==L?void 0:L._id}}).data,$=(Y=void 0===Y?{}:Y).list;console.log("curSshURL :>> ",H),console.log("gitData :>> ",K),console.log("gitData.repoSlug :>> ",K.repoSlug);var ee=(t=(0,s.Z)(d().mark(function _callee(e){return d().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:console.log("Submit:",e),W({name:e.name,projectID:e.projectID,gitProviderID:e.gitProviderID,sshUrl:H,gitBranch:e.gitBranch}).then(function(e){console.log("res.data :>> ",e.data)});case 2:case"end":return t.stop()}},_callee)})),function(e){return t.apply(this,arguments)});return(0,k.jsxs)(S.Z,{bordered:!1,title:(0,k.jsx)(_.Z.Title,{level:4,className:"!mb-0 text-center",children:"success"===J?"Imported successfully!":"loading"===J?"Importing...":"Import GIT repo"}),children:["loading"===J&&(0,k.jsx)("div",{className:"p-4 text-center",children:(0,k.jsx)(p.Z,{})}),"success"!==J&&"loading"!==J?(0,k.jsxs)(w.Z,{className:["h-full","overflow-x-hidden",void 0===r?"":r].join(" "),layout:"vertical",form:n,onFinish:ee,onFinishFailed:function(e){console.log("Failed:",e)},autoComplete:"off",preserve:!1,children:[(0,k.jsx)(w.Z.Item,{name:"sshUrl",rules:[{required:!0,message:"Please enter the repo SSH url."}],initialValue:H,children:(0,k.jsx)(b.Z,{size:"large",prefix:(0,k.jsx)(g,{}),placeholder:"git@github.com:organization/repo.git",status:"warning",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",onChange:function(e){console.log("e.currentTarget.value :>> ",e.currentTarget.value),M(e.currentTarget.value)}})}),(0,k.jsx)(w.Z.Item,{name:"gitProviderID",rules:[{required:!0,message:"Please select git provider."}],className:"mb-2",initialValue:null===(o=(q||[])[0])||void 0===o?void 0:o._id,children:(0,k.jsx)(I.Z,{placeholder:"Select git provider for this app",showSearch:!0,filterOption:function(e,t){var o;return(null!==(o=null==t?void 0:t.label)&&void 0!==o?o:"").toLowerCase().includes(e.toLowerCase())},options:null==q?void 0:q.map(function(e){return{label:e.name,value:e._id}}),onSelect:function(e){return T(null==q?void 0:q.find(function(t){return t._id===e}))}})}),(0,k.jsx)(w.Z.Item,{name:"projectID",rules:[{required:!0,message:"Please select project."}],className:"mb-2",initialValue:null===(i=(G||[])[0])||void 0===i?void 0:i._id,children:(0,k.jsx)(I.Z,{placeholder:"Select parent project",showSearch:!0,filterOption:function(e,t){var o;return(null!==(o=null==t?void 0:t.label)&&void 0!==o?o:"").toLowerCase().includes(e.toLowerCase())},options:null==G?void 0:G.map(function(e){return{label:e.name,value:e._id}})})}),(0,k.jsx)(w.Z.Item,{name:"name",initialValue:K.repoSlug,children:(0,k.jsx)(b.Z,{placeholder:"App's name (optional)",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})}),(0,k.jsx)(w.Z.Item,{name:"gitBranch",initialValue:h,children:(0,k.jsx)(I.Z,{placeholder:"Git branch (optional)",showSearch:!0,filterOption:function(e,t){var o;return(null!==(o=null==t?void 0:t.label)&&void 0!==o?o:"").toLowerCase().includes(e.toLowerCase())},options:null==$?void 0:$.map(function(e){return{label:e.name,value:e.name}})})}),(0,k.jsx)(w.Z.Item,{style:{marginBottom:0},className:"text-center",children:(0,k.jsx)(y.ZP,{type:"primary",htmlType:"submit",icon:(0,k.jsx)(x.Z,{}),size:"large",shape:"round",children:"Import Now"})})]}):(0,k.jsx)("div",{className:"text-center",children:(0,k.jsx)(y.ZP,{href:"/project",icon:(0,k.jsx)(j.Z,{}),size:"large",shape:"round",children:"Back to projects & apps"})})]})},R=o(6761),L=o(1071),pages_import=function(){return(0,k.jsx)(a.Wk,{children:(0,k.jsx)(R.o,{useSidebar:!1,meta:(0,k.jsx)(L.h,{title:"Import to DXUP",description:"Import a git repo to DXUP platform."}),children:(0,k.jsxs)(n.Z,{className:"max-w-md ",children:[(0,k.jsx)(r(),{href:"/",children:(0,k.jsx)(l.Z,{})}),(0,k.jsx)(projects_ImportGitModal,{})]})})})}},9449:function(e,t,o){"use strict";function parseGitRepoDataFromRepoSSH(e){if(!e)return{};try{t=null===(a=e.split(":")[1])||void 0===a?void 0:a.split("/")[0]}catch(t){throw Error("Repository SSH (".concat(e,") is invalid"))}try{o=null===(n=e.split(":")[1])||void 0===n?void 0:null===(l=n.split("/")[1])||void 0===l?void 0:l.split(".")[0]}catch(t){throw Error("Repository SSH (".concat(e,") is invalid"))}try{i=null===(s=e.split(":")[0])||void 0===s?void 0:s.split("@")[1]}catch(t){throw Error("Repository SSH (".concat(e,") is invalid"))}try{r=null===(c=i)||void 0===c?void 0:c.split(".")[0]}catch(t){throw Error("Repository SSH (".concat(e,") is invalid"))}var t,o,i,r,a,n,l,s,c,u="".concat(t,"/").concat(o);return{namespace:t,repoSlug:o,fullSlug:u,gitDomain:i,gitProvider:r}}o.d(t,{t1:function(){return parseGitRepoDataFromRepoSSH}}),o(96486)},34776:function(e,t,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/import",function(){return o(47420)}])}},function(e){e.O(0,[3662,5877,3945,9774,2888,179],function(){return e(e.s=34776)}),_N_E=e.O()}]);