UNPKG

@topgroup/diginext

Version:

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

1 lines 8.87 kB
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3755],{13923:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1413),a=n(67294),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M536.1 273H488c-4.4 0-8 3.6-8 8v275.3c0 2.6 1.2 5 3.3 6.5l165.3 120.7c3.6 2.6 8.6 1.9 11.2-1.7l28.6-39c2.7-3.7 1.9-8.7-1.7-11.2L544.1 528.5V281c0-4.4-3.6-8-8-8zm219.8 75.2l156.8 38.3c5 1.2 9.9-2.6 9.9-7.7l.8-161.5c0-6.7-7.7-10.5-12.9-6.3L752.9 334.1a8 8 0 003 14.1zm167.7 301.1l-56.7-19.5a8 8 0 00-10.1 4.8c-1.9 5.1-3.9 10.1-6 15.1-17.8 42.1-43.3 80-75.9 112.5a353 353 0 01-112.5 75.9 352.18 352.18 0 01-137.7 27.8c-47.8 0-94.1-9.3-137.7-27.8a353 353 0 01-112.5-75.9c-32.5-32.5-58-70.4-75.9-112.5A353.44 353.44 0 01171 512c0-47.8 9.3-94.2 27.8-137.8 17.8-42.1 43.3-80 75.9-112.5a353 353 0 01112.5-75.9C430.6 167.3 477 158 524.8 158s94.1 9.3 137.7 27.8A353 353 0 01775 261.7c10.2 10.3 19.8 21 28.6 32.3l59.8-46.8C784.7 146.6 662.2 81.9 524.6 82 285 82.1 92.6 276.7 95 516.4 97.4 751.9 288.9 942 524.8 942c185.5 0 343.5-117.6 403.7-282.3 1.5-4.2-.7-8.9-4.9-10.4z"}}]},name:"history",theme:"outlined"},i=n(91146),s=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:c}))})},8290:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return database}});var r,a=n(22598),c=n(59499),i=n(50029),s=n(16835),o=n(87794),l=n.n(o),u=n(16596),d=n(1413),f=n(67294),p={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M945 412H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h256c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM811 548H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h122c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM477.3 322.5H434c-6.2 0-11.2 5-11.2 11.2v248c0 3.6 1.7 6.9 4.6 9l148.9 108.6c5 3.6 12 2.6 15.6-2.4l25.7-35.1v-.1c3.6-5 2.5-12-2.5-15.6l-126.7-91.6V333.7c.1-6.2-5-11.2-11.1-11.2z"}},{tag:"path",attrs:{d:"M804.8 673.9H747c-5.6 0-10.9 2.9-13.9 7.7a321 321 0 01-44.5 55.7 317.17 317.17 0 01-101.3 68.3c-39.3 16.6-81 25-124 25-43.1 0-84.8-8.4-124-25-37.9-16-72-39-101.3-68.3s-52.3-63.4-68.3-101.3c-16.6-39.2-25-80.9-25-124 0-43.1 8.4-84.7 25-124 16-37.9 39-72 68.3-101.3 29.3-29.3 63.4-52.3 101.3-68.3 39.2-16.6 81-25 124-25 43.1 0 84.8 8.4 124 25 37.9 16 72 39 101.3 68.3a321 321 0 0144.5 55.7c3 4.8 8.3 7.7 13.9 7.7h57.8c6.9 0 11.3-7.2 8.2-13.3-65.2-129.7-197.4-214-345-215.7-216.1-2.7-395.6 174.2-396 390.1C71.6 727.5 246.9 903 463.2 903c149.5 0 283.9-84.6 349.8-215.8a9.18 9.18 0 00-8.2-13.3z"}}]},name:"field-time",theme:"outlined"},h=n(91146),x=f.forwardRef(function(e,t){return f.createElement(h.Z,(0,d.Z)((0,d.Z)({},e),{},{ref:t,icon:p}))}),b=n(13923),v=n(48689),m=n(51042),j=n(84213),y=n(73318),g=n(66309),w=n(71471),Z=n(26855),k=n(78957),_=n(83062),P=n(86738),O=n(44973),C=n(27484),S=n.n(C),E=n(96486),N=n(91654),z=n(61123),A=n(90447),D=n(56832),T=n(3669),B=n(55611),I=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 L=n(56176),H=n(84110);S().extend(H),S().extend(L);var M=null!==(r=B.XL.tableConfig.defaultPageSize)&&void 0!==r?r:20,DatabaseList=function(){var e,t,n,r=(0,T.Jl)().responsive,a=(0,f.useState)(1),c=a[0],o=a[1],d=(0,N.EF)({populate:"owner,autoBackup",pagination:{page:c,size:M}}),p=d.data,h=d.status,C=p||{},B=C.list,L=(C.pagination||{}).total_items,H=(0,N.QB)(),F=(0,s.Z)(H,1)[0],R=(0,N.Tf)(),V=(0,s.Z)(R,1)[0],K=(0,N.ij)();(0,s.Z)(K,1)[0];var U=(0,N.O2)(),W=(0,s.Z)(U,1)[0],X=(0,D.o)(),Y=(0,s.Z)(X,2),Q=(Y[0],Y[1].setQuery),q=[{title:"Name",width:50,dataIndex:"name",key:"name",render:function(e,t){return(0,I.jsx)(y.ZP,{type:"link",onClick:function(){return Q({lv1:"edit",type:"database",database:t.slug})},style:{overflowWrap:"break-word",whiteSpace:"pre-wrap",textAlign:"left"},children:e})},fixed:null!=r&&r.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:"Type",dataIndex:"type",key:"type",width:20,render:function(e,t){return(0,I.jsx)(g.Z,{children:e})}},{title:"Verified",dataIndex:"verified",key:"verified",width:20,render:function(e,t){return t.verified?(0,I.jsx)(g.Z,{color:"success",children:"YES"}):(0,I.jsx)(g.Z,{color:"error",children:"NO"})}},{title:"Auto-backup",dataIndex:"auto-backup",key:"auto-backup",width:20,render:function(e,t){return(0,E.isEmpty)(t.autoBackup)?(0,I.jsx)(g.Z,{color:"error",children:"NO"}):t.autoBackup.active?(0,I.jsx)(g.Z,{color:"success",children:"YES"}):(0,I.jsx)(g.Z,{color:"volcano",children:"STOPPED"})}},{title:"Created by",dataIndex:"owner",key:"owner",width:30,render:function(e,t){return(0,I.jsx)(I.Fragment,{children:null==t?void 0:t.owner.name})}},{title:"Created at",dataIndex:"createdAt",key:"createdAt",width:25,render:function(e){return(0,I.jsx)(z.q,{date:e})},sorter:function(e,t){return S()(e.createdAt).diff(S()(t.createdAt))}},{title:(0,I.jsx)(w.Z.Text,{className:"text-xs md:text-sm",children:"Action"}),key:"action",fixed:"right",width:null!=r&&r.md?30:26,render:function(e,t){return t.actions}}],J=(e=(0,i.Z)(l().mark(function _callee(e){var t;return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e||Z.ZP.error({message:"Unable to backup."}),n.next=3,V({_id:e});case 3:null!=(t=n.sent)&&t.status&&Z.ZP.success({message:"Starting database back up process in the background, we will notify you when it's done."});case 5:case"end":return n.stop()}},_callee)})),function(t){return e.apply(this,arguments)}),G=(t=(0,i.Z)(l().mark(function _callee3(e){var t;return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e||Z.ZP.error({message:"Unable to auto backup."}),n.next=3,W({_id:e});case 3:null!=(t=n.sent)&&t.status&&Z.ZP.success({message:"This database has been enabled daily auto-backup."});case 5:case"end":return n.stop()}},_callee3)})),function(e){return t.apply(this,arguments)}),$=(n=(0,i.Z)(l().mark(function _callee4(e){var t;return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e||Z.ZP.error({message:"Unable to delete this item."}),n.next=3,F({_id:e});case 3:null!=(t=n.sent)&&t.status&&Z.ZP.success({message:"Item deleted successfully."});case 5:case"end":return n.stop()}},_callee4)})),function(e){return n.apply(this,arguments)}),ee=(null==B?void 0:B.map(function(e,t){return _objectSpread(_objectSpread({},e),{},{actions:(0,I.jsxs)(k.Z.Compact,{children:[(0,I.jsx)(_.Z,{overlay:"Run backup",children:(0,I.jsx)(y.ZP,{icon:(0,I.jsx)(u.Z,{}),onClick:function(){return J(null==e?void 0:e._id)}})}),(0,I.jsx)(_.Z,{overlay:"Enable auto-backup",children:(0,I.jsx)(y.ZP,{icon:(0,I.jsx)(x,{}),onClick:function(){return G(null==e?void 0:e._id)}})}),(0,I.jsx)(_.Z,{overlay:"Backup history",children:(0,I.jsx)(y.ZP,{icon:(0,I.jsx)(b.Z,{}),onClick:function(){return Q({lv1:"db_backups",database:null==e?void 0:e.slug})}})}),(0,I.jsx)(P.Z,{title:"Are you sure to delete this item?",description:(0,I.jsx)("span",{className:"text-red-500",children:"Caution: this is permanent and cannot be rolled back."}),onConfirm:function(){return $(e._id)},okText:"Yes",cancelText:"No",children:(0,I.jsx)(y.ZP,{icon:(0,I.jsx)(v.Z,{})})})]})})}))||[],et=(0,f.useRef)(null),en=(0,j.Z)(et);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(A.V,{title:"Databases (".concat(null!=L?L:"-",")"),breadcrumbs:[{name:"Workspace"}],actions:[(0,I.jsx)(y.ZP,{type:"default",icon:(0,I.jsx)(m.Z,{className:"align-middle"}),onClick:function(){return Q({lv1:"new",type:"database"})},children:"Add"},"workspace-setting-btn")]}),(0,I.jsx)("div",{className:"h-full flex-auto overflow-hidden",ref:et,children:(0,I.jsx)(O.Z,{sticky:!0,size:"small",loading:"loading"===h,columns:q,dataSource:ee,scroll:{x:1e3,y:void 0!==(null==en?void 0:en.height)?en.height-140:void 0},pagination:{pageSize:M,total:L,position:["bottomCenter"]},onChange:function(e){var t=e.current;t&&o(t)}})})]})},F=n(6761),R=n(1071),database=function(){return(0,I.jsx)(a.Wk,{children:(0,I.jsx)(F.o,{meta:(0,I.jsx)(R.h,{title:"Databases",description:"List of cloud databases."}),children:(0,I.jsx)(DatabaseList,{})})})}},47995:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/infrastructure/database",function(){return n(8290)}])}},function(e){e.O(0,[3662,5877,3945,9774,2888,179],function(){return e(e.s=47995)}),_N_E=e.O()}]);