UNPKG

@topgroup/diginext

Version:

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

1 lines 9.22 kB
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7786],{21084:function(e,n,t){var o=t(27812),r=t(16835),i=t(13923),a=t(64286),s=t(11163),l=t(67294),c=t(85893);n.Z=function(e){var n,t=(0,s.useRouter)(),u=l.useState(!1),d=(0,r.Z)(u,2),m=d[0],p=d[1],v=l.useState(""),f=(0,r.Z)(v,2),h=f[0],x=f[1],g=l.useState([]),j=(0,r.Z)(g,2),S=j[0],Z=j[1],N=S[S.length-1],onNavigate=function(e){t.push(e),p(!1)};return l.useEffect(function(){var down=function(e){"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),p(function(e){return!e}))};return document.addEventListener("keydown",down),function(){return document.removeEventListener("keydown",down)}},[]),(0,c.jsxs)(a.mY.Dialog,{open:m,onOpenChange:p,label:"Global Command Menu",children:[(0,c.jsx)(a.mY.Input,{value:h,onValueChange:x}),(0,c.jsxs)(a.mY.List,{children:[(0,c.jsx)(a.mY.Empty,{children:"No results found."}),null===(n=N?N.children:null==e?void 0:e.commands)||void 0===n?void 0:n.map(function(e,n){return e.children?(0,c.jsx)(a.mY.Group,{heading:e.label,children:e.children.map(function(e,n){return(0,c.jsx)(a.mY.Item,{onSelect:function(){e.children?(x(""),Z([].concat((0,o.Z)(S),[e]))):(p(!1),e.onSelect&&e.onSelect(e.value))},children:e.label},"subcmd-".concat(e.label,"-").concat(n))})},"cmdgroup-".concat(n)):(0,c.jsx)(a.mY.Item,{onSelect:function(){p(!1),e.onSelect&&e.onSelect(e.value)},children:e.label},"cmd-".concat(n))}),N&&(0,c.jsxs)(a.mY.Item,{onSelect:function(){Z([]),x("")},children:[(0,c.jsx)(i.Z,{})," Reset"]}),(0,c.jsx)(a.mY.Separator,{}),(0,c.jsxs)(a.mY.Group,{heading:"Navigation",children:[(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/")},children:"Dashboard"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/project")},children:"Projects & apps"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/build")},children:"Builds & deploys"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/framework")},children:"Frameworks"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/git")},children:"Git Providers"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/cronjob")},children:"Cronjobs"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/monitor/node")},children:"Monitoring ≫ Nodes"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/monitor/namespace")},children:"Monitoring ≫ Namespaces"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/monitor/service")},children:"Monitoring ≫ Services"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/monitor/ingress")},children:"Monitoring ≫ Ingresses"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/monitor/deployment")},children:"Monitoring ≫ Deployments"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/monitor/pod")},children:"Monitoring ≫ Pods"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/infrastructure/cloud-provider")},children:"Infrastructure ≫ Cloud Providers"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/infrastructure/cluster")},children:"Infrastructure ≫ K8S Clusters"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/infrastructure/database")},children:"Infrastructure ≫ Databases"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/infrastructure/registry")},children:"Infrastructure ≫ Container Registries"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/workspace/users")},children:"Workspace ≫ Users"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/workspace/teams")},children:"Workspace ≫ Teams"}),(0,c.jsx)(a.mY.Item,{onSelect:function(){return onNavigate("/workspace/roles")},children:"Workspace ≫ Roles"})]})]})]})}},59322:function(e,n,t){var o=t(50029),r=t(16835),i=t(87794),a=t.n(i),s=t(12119),l=t(88284),c=t(51042),u=t(8232),d=t(39249),m=t(73318);t(67294);var p=t(34187),v=t(85893);n.Z=function(e){var n,t=e.app,i=e.env,f=e.next,h=(0,p.mv)({filter:{slug:t}}),x=(0,r.Z)(h,2),g=x[0],j=x[1],S=(n=(0,o.Z)(a().mark(function _callee(e){var n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Success:",e),n=[e.domain],t.next=4,g({domains:n,env:i});case 4:console.log("response :>> ",t.sent),f&&f();case 7:case"end":return t.stop()}},_callee)})),function(e){return n.apply(this,arguments)});return(0,v.jsxs)(u.Z,{name:"add-domains",style:{maxWidth:600},layout:"vertical",onFinish:S,onFinishFailed:function(e){console.log("Failed:",e)},autoComplete:"off",preserve:!1,children:[(0,v.jsx)(u.Z.Item,{label:"Domain",name:"domain",rules:[{required:!0,message:"Please input your domain."}],children:(0,v.jsx)(d.Z,{prefix:(0,v.jsx)(s.Z,{}),placeholder:"Your domain"})}),(0,v.jsx)(u.Z.Item,{children:(0,v.jsx)(m.ZP,{type:"primary",htmlType:"submit",icon:"success"===j?(0,v.jsx)(l.Z,{}):(0,v.jsx)(c.Z,{}),loading:"loading"===j,children:"Submit"})})]})}},73455:function(e,n,t){var o=t(50029),r=t(16835),i=t(87794),a=t.n(i),s=t(79090),l=t(8751),c=t(73403),u=t(64789),d=t(9361),m=t(8232),p=t(51423),v=t(71471),f=t(73318),h=t(39249),x=t(65217),g=t(11163),j=t(67294),S=t(34187),Z=t(24998),N=t(74040),I=t(61771),b=t(56832),w=t(85893);n.Z=function(e){var n,t,i,Y,C=e.className,k=(0,g.useRouter)();d.Z.useToken().token.colorBgContainer;var y=m.Z.useForm(),F=(0,r.Z)(y,1)[0],P=(0,b.o)(),_=(0,r.Z)(P,2),D=_[0];_[1].setQuery,D.sshUrl,D.branch;var L=(0,j.useState)(),M=L[0],q=L[1],z=(0,I.Zz)({populate:"owner",pagination:{page:1,size:100}}),E=z.data,R=(E=void 0===E?{}:E).list,T=void 0===R?[]:R;z.status;var G=(0,N.y3)(),W=G.data,B=(W=void 0===W?{}:W).list;G.status;var O=(0,Z.Dh)(),V=O.data,K=(V=void 0===V?{}:V).list;O.status;var U=(0,S.TW)(),A=(0,r.Z)(U,2),Q=A[0],H=A[1],J=(n=(0,o.Z)(a().mark(function _callee(n){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:console.log("Submit:",n),Q({name:n.name,project:n.project,gitProvider:n.gitProvider,framework:M,shouldCreateGitRepo:!0}).then(function(n){console.log("res.data :>> ",n.data),null!=e&&e.onDone&&e.onDone(),n.status?null!=e&&e.onSuccess&&(null==e||e.onSuccess(n.data)):null!=e&&e.onFailure&&(null==e||e.onFailure(n.messages.join(".")))}).catch(function(n){null!=e&&e.onFailure&&(null==e||e.onFailure("Unable to create new app: ".concat(n,".")))});case 2:case"end":return t.stop()}},_callee)})),function(e){return n.apply(this,arguments)});return(0,w.jsxs)(p.Z,{bordered:!1,className:"min-w-[350px]",title:(0,w.jsx)(v.Z.Title,{level:4,className:"!mb-0 text-center",children:"success"===H?"Congrats!":"loading"===H?"Processing...":"Create new app"}),children:["loading"===H&&(0,w.jsx)("div",{className:"p-4 text-center",children:(0,w.jsx)(s.Z,{})}),"success"===H&&(0,w.jsxs)("div",{className:"text-center",children:[(0,w.jsx)("div",{className:"mb-5 text-center text-3xl text-green-500",children:(0,w.jsx)(l.Z,{})}),(0,w.jsx)(f.ZP,{icon:(0,w.jsx)(c.Z,{}),size:"large",shape:"round",onClick:function(){return null!=e&&e.onClose?e.onClose():k.push("/project")},children:"Back to projects & apps"})]}),"success"!==H&&"loading"!==H?(0,w.jsxs)(m.Z,{className:["h-full","overflow-x-hidden",void 0===C?"":C].join(" "),layout:"vertical",form:F,onFinish:J,onFinishFailed:function(e){console.log("Failed:",e)},autoComplete:"off",preserve:!1,children:[(0,w.jsx)(m.Z.Item,{name:"name",rules:[{required:!0,message:"App's name is required."}],children:(0,w.jsx)(h.Z,{placeholder:"App's name",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",size:"large",tabIndex:0,autoFocus:!0})}),(0,w.jsx)(m.Z.Item,{name:"project",rules:[{required:!0,message:"Please select project."}],className:"mb-2",initialValue:null===(t=(T||[])[0])||void 0===t?void 0:t._id,children:(0,w.jsx)(x.Z,{placeholder:"Select parent project",showSearch:!0,filterOption:function(e,n){var t;return(null!==(t=null==n?void 0:n.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:null==T?void 0:T.map(function(e){return{label:e.name,value:e._id}})})}),(0,w.jsx)(m.Z.Item,{name:"gitProvider",rules:[{required:!0,message:"Please select git provider."}],className:"mb-2",initialValue:null===(i=(B||[])[0])||void 0===i?void 0:i._id,children:(0,w.jsx)(x.Z,{placeholder:"Select git provider for this app",showSearch:!0,filterOption:function(e,n){var t;return(null!==(t=null==n?void 0:n.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:null==B?void 0:B.map(function(e){return{label:e.name,value:e._id}})})}),(0,w.jsx)(m.Z.Item,{name:"framework",rules:[{required:!0,message:"Please select framework."}],className:"mb-2",initialValue:null===(Y=(K||[])[0])||void 0===Y?void 0:Y._id,children:(0,w.jsx)(x.Z,{placeholder:"Select git provider for this app",showSearch:!0,filterOption:function(e,n){var t;return(null!==(t=null==n?void 0:n.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:null==K?void 0:K.map(function(e){return{label:e.name,value:e._id}}),onSelect:function(e){return q(null==K?void 0:K.find(function(n){return n._id===e}))}})}),(0,w.jsx)(m.Z.Item,{style:{marginBottom:0},className:"text-center",children:(0,w.jsx)(f.ZP,{type:"primary",htmlType:"submit",icon:(0,w.jsx)(u.Z,{}),size:"large",shape:"round",children:"Create"})})]}):(0,w.jsx)(w.Fragment,{})]})}}}]);