@topgroup/diginext
Version:
A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.
1 lines • 5.13 kB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6648],{47389:function(e,t,n){"use strict";var r=n(1413),i=n(67294),o=n(27363),s=n(91146),a=i.forwardRef(function(e,t){return i.createElement(s.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:o.Z}))});t.Z=a},4751:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return cluster}});var r,i=n(16835),o=n(51042),s=n(73318),a=n(11163),c=n(22598),u=n(90447),d=n(59499),l=n(50029),f=n(87794),p=n.n(f),h=n(47389),x=n(48689),m=n(84213),y=n(78957),g=n(86738),j=n(44973),w=n(27484),v=n.n(w),b=n(96486),k=n(67294),O=n(47859),Z=n(61123),_=n(56832),C=n(3669),N=n(55611),P=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,d.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 S=n(56176),A=n(84110);v().extend(A),v().extend(S);var E=null!==(r=N.XL.tableConfig.defaultPageSize)&&void 0!==r?r:20,ClusterList=function(){var e,t=(0,C.Jl)().responsive,n=[{title:"Name",width:70,dataIndex:"name",key:"name",fixed:null!=t&&t.md?"left":void 0,filterSearch:!0,filters:[{text:"goon",value:"goon"}],onFilter:function(e,t){return!t.name||t.name.indexOf(e.toString())>-1}},{title:"Short name",width:60,dataIndex:"shortName",key:"shortName",render:function(e){return(0,P.jsx)(s.ZP,{type:"link",style:{padding:0},children:e})},filterSearch:!0,filters:[{text:"goon",value:"goon"}],onFilter:function(e,t){return!t.shortName||t.shortName.indexOf(e.toString())>-1}},{title:"Provider",dataIndex:"provider",key:"provider",width:40,render:function(e,t){return(0,P.jsx)(P.Fragment,{children:t.providerShortName})}},{title:"Verified",dataIndex:"isVerified",key:"isVerified",width:30,render:function(e,t){return(0,P.jsx)(P.Fragment,{children:t.isVerified?"YES":"NO"})}},{title:"Created by",dataIndex:"owner",key:"owner",width:50,render:function(e,t){return(0,P.jsx)(P.Fragment,{children:(0,b.isEmpty)(t.owner)?"DXUP System":t.owner.name})}},{title:"Created at",dataIndex:"createdAt",key:"createdAt",width:50,render:function(e){return(0,P.jsx)(Z.q,{date:e})},sorter:function(e,t){return v()(e.createdAt).diff(v()(t.createdAt))}},{title:"Updated at",dataIndex:"updatedAt",key:"updatedAt",width:50,render:function(e){return(0,P.jsx)(Z.q,{date:e})},sorter:function(e,t){return v()(e.updatedAt).diff(v()(t.updatedAt))}},{title:"Action",key:"action",width:50,fixed:"right",render:function(e,t){return t.actions}}],r=(0,k.useState)(1),o=r[0],a=r[1],c=(0,O.Qq)({populate:"owner",pagination:{page:o,size:E}}),u=c.data,d=c.status,f=u||{},w=f.list,N=(f.pagination||{}).total_items;console.log("clusters :>> ",w);var S=(0,O.An)(),A=(0,i.Z)(S,1)[0],I=(0,_.o)(),D=(0,i.Z)(I,2),F=(D[0],D[1].setQuery),V=(e=(0,l.Z)(p().mark(function _callee(e){return p().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,A({_id:e});case 2:console.log("deleteCluster :>> ",t.sent);case 4:case"end":return t.stop()}},_callee)})),function(t){return e.apply(this,arguments)}),z=(null==w?void 0:w.map(function(e){return _objectSpread(_objectSpread({},e),{},{actions:(0,b.isEmpty)(e.workspace)?null:(0,P.jsxs)(y.Z.Compact,{children:[(0,P.jsx)(s.ZP,{icon:(0,P.jsx)(h.Z,{}),onClick:function(){return F({lv1:"edit",type:"cluster",cluster_slug:e.slug})}}),(0,P.jsx)(g.Z,{title:"Are you sure to delete this cluster?",description:(0,P.jsx)("span",{className:"text-red-500",children:"Caution: this is permanent and cannot be rolled back."}),onConfirm:function(){return V(e._id)},okText:"Yes",cancelText:"No",children:(0,P.jsx)(s.ZP,{icon:(0,P.jsx)(x.Z,{})})})]})})}))||[],K=(0,k.useRef)(null),L=(0,m.Z)(K);return(0,P.jsx)("div",{className:"h-full flex-auto overflow-hidden",ref:K,children:(0,P.jsx)(j.Z,{sticky:!0,size:"small",loading:"loading"===d,columns:n,dataSource:z,scroll:{x:1e3,y:void 0!==(null==L?void 0:L.height)?L.height-140:void 0},pagination:{pageSize:E,total:N,position:["bottomCenter"]},onChange:function(e){var t=e.current;t&&a(t)}})})},I=n(6761),D=n(1071),cluster=function(){(0,a.useRouter)();var e=(0,_.o)(),t=(0,i.Z)(e,2),n=(t[0],t[1].setQuery);return(0,P.jsx)(c.Wk,{children:(0,P.jsxs)(I.o,{meta:(0,P.jsx)(D.h,{title:"Clusters",description:"List of your cloud providers."}),children:[(0,P.jsx)(u.V,{title:"Kubernetes Clusters",breadcrumbs:[{name:"Infrastructure"}],actions:[(0,P.jsx)(s.ZP,{type:"default",icon:(0,P.jsx)(o.Z,{className:"align-middle"}),onClick:function(){return n({lv1:"new",type:"cluster"})},children:"New"},"workspace-setting-btn")]}),(0,P.jsx)(ClusterList,{})]})})}},48281:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/infrastructure/cluster",function(){return n(4751)}])}},function(e){e.O(0,[3662,5877,3945,9774,2888,179],function(){return e(e.s=48281)}),_N_E=e.O()}]);