@abtnode/webapp 1.16.27-beta-426c1690 → 1.16.27-beta-d27e19fa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/build/asset-manifest.json +35 -36
  4. package/build/index.html +1 -1
  5. package/build/service-worker.js +1 -1
  6. package/build/static/js/1667.0305ed57.chunk.js +1 -0
  7. package/build/static/js/1685.7e872f73.chunk.js +2 -0
  8. package/build/static/js/1794.ff8418be.chunk.js +1 -0
  9. package/build/static/js/1869.958bc1ed.chunk.js +1 -0
  10. package/build/static/js/2226.183fdd58.chunk.js +1 -0
  11. package/build/static/js/2355.ed718f0c.chunk.js +1 -0
  12. package/build/static/js/2536.2c1f5173.chunk.js +1 -0
  13. package/build/static/js/2646.0f064d37.chunk.js +1 -0
  14. package/build/static/js/{5526.d2a1b8f0.chunk.js → 3047.2530c08d.chunk.js} +2 -2
  15. package/build/static/js/3108.ce45067a.chunk.js +1 -0
  16. package/build/static/js/3217.0647b52d.chunk.js +1 -0
  17. package/build/static/js/3595.f18b855e.chunk.js +1 -0
  18. package/build/static/js/3646.656a10a6.chunk.js +1 -0
  19. package/build/static/js/3815.bb373a04.chunk.js +1 -0
  20. package/build/static/js/3998.be52d2b0.chunk.js +1 -0
  21. package/build/static/js/4542.bf4b1ee9.chunk.js +1 -0
  22. package/build/static/js/{4804.9dc4ff41.chunk.js → 4804.4efecf89.chunk.js} +2 -2
  23. package/build/static/js/4906.ce938f60.chunk.js +1 -0
  24. package/build/static/js/{5083.ecb059e3.chunk.js → 5083.b86f0c1f.chunk.js} +2 -2
  25. package/build/static/js/5433.2b6a887c.chunk.js +1 -0
  26. package/build/static/js/5515.b6a25364.chunk.js +1 -0
  27. package/build/static/js/5760.4f263e0c.chunk.js +1 -0
  28. package/build/static/js/{592.c99306f8.chunk.js → 592.4624a4d2.chunk.js} +2 -2
  29. package/build/static/js/6129.bafd3307.chunk.js +1 -0
  30. package/build/static/js/{6234.42a5a205.chunk.js → 6234.93acfe87.chunk.js} +1 -1
  31. package/build/static/js/6399.d5c8f353.chunk.js +1 -0
  32. package/build/static/js/7702.059ea71f.chunk.js +1 -0
  33. package/build/static/js/8110.9889f226.chunk.js +1 -0
  34. package/build/static/js/8299.854a15c8.chunk.js +1 -0
  35. package/build/static/js/833.aaaf3519.chunk.js +1 -0
  36. package/build/static/js/8399.77b6358a.chunk.js +1 -0
  37. package/build/static/js/{9713.0f0a2355.chunk.js → 9713.6f7c47cb.chunk.js} +1 -1
  38. package/build/static/js/9779.7c1f5592.chunk.js +1 -0
  39. package/build/static/js/main.774f6320.js +2 -0
  40. package/package.json +1 -1
  41. package/build/static/js/1667.a0c1bd62.chunk.js +0 -1
  42. package/build/static/js/1685.8aa7ded2.chunk.js +0 -2
  43. package/build/static/js/1794.7f151439.chunk.js +0 -1
  44. package/build/static/js/1869.ca76ad10.chunk.js +0 -1
  45. package/build/static/js/2294.9e37053f.chunk.js +0 -1
  46. package/build/static/js/2355.fe9e5eaf.chunk.js +0 -1
  47. package/build/static/js/2646.7e958bf1.chunk.js +0 -1
  48. package/build/static/js/3108.430b8b4e.chunk.js +0 -1
  49. package/build/static/js/3217.1d7bfa2b.chunk.js +0 -1
  50. package/build/static/js/3351.be676eac.chunk.js +0 -1
  51. package/build/static/js/3595.763ef502.chunk.js +0 -1
  52. package/build/static/js/3646.97713153.chunk.js +0 -1
  53. package/build/static/js/3815.fa2cf47f.chunk.js +0 -1
  54. package/build/static/js/3998.505c54b8.chunk.js +0 -1
  55. package/build/static/js/4542.61cf3cd5.chunk.js +0 -1
  56. package/build/static/js/4906.fc570676.chunk.js +0 -1
  57. package/build/static/js/5433.56888945.chunk.js +0 -1
  58. package/build/static/js/5760.b43b20af.chunk.js +0 -1
  59. package/build/static/js/6129.b538b033.chunk.js +0 -1
  60. package/build/static/js/7702.65c33107.chunk.js +0 -1
  61. package/build/static/js/8110.446170f9.chunk.js +0 -1
  62. package/build/static/js/8139.b91619d0.chunk.js +0 -1
  63. package/build/static/js/8299.99b06bd6.chunk.js +0 -1
  64. package/build/static/js/833.ae2cf030.chunk.js +0 -1
  65. package/build/static/js/8399.d74f7fac.chunk.js +0 -1
  66. package/build/static/js/9085.2eba86ab.chunk.js +0 -1
  67. package/build/static/js/9733.35499d50.chunk.js +0 -1
  68. package/build/static/js/9779.c840728c.chunk.js +0 -1
  69. package/build/static/js/main.f04637c6.js +0 -2
  70. /package/build/static/js/{1685.8aa7ded2.chunk.js.LICENSE.txt → 1685.7e872f73.chunk.js.LICENSE.txt} +0 -0
  71. /package/build/static/js/{5526.d2a1b8f0.chunk.js.LICENSE.txt → 3047.2530c08d.chunk.js.LICENSE.txt} +0 -0
  72. /package/build/static/js/{4804.9dc4ff41.chunk.js.LICENSE.txt → 4804.4efecf89.chunk.js.LICENSE.txt} +0 -0
  73. /package/build/static/js/{5083.ecb059e3.chunk.js.LICENSE.txt → 5083.b86f0c1f.chunk.js.LICENSE.txt} +0 -0
  74. /package/build/static/js/{592.c99306f8.chunk.js.LICENSE.txt → 592.4624a4d2.chunk.js.LICENSE.txt} +0 -0
  75. /package/build/static/js/{main.f04637c6.js.LICENSE.txt → main.774f6320.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6234],{36955:(e,t,n)=>{n.d(t,{Z:()=>m});var r,o=n(71171),i=n(55898),s=n.n(i),l=n(33518),a=n(38763),c=n(75392),u=n(11750),d=n(39948),p=n(96266);function m(e){let{style:t,title:n,value:r,graph:o,description:i}=e;return(0,p.jsx)(h,{children:(0,p.jsxs)(c.Z,{style:{...t},children:[(0,p.jsx)(u.Z,{sx:{fontSize:14},color:"text.secondary",children:n}),(0,p.jsx)(u.Z,{variant:"h5",component:"div",mt:1,children:r}),o,!!i&&(0,p.jsx)(d.Z,{display:"flex",sx:{fontSize:12,marginTop:3},color:"text.secondary",children:i})]})})}m.propTypes={style:s().object,title:s().node,value:s().node,graph:s().node,description:s().any},m.defaultProps={style:{},title:null,value:null,graph:null,description:null};const h=(0,l.Z)(a.Z)(r||(r=(0,o.Z)(["\n .card-content {\n height: 150px;\n }\n\n .card-sparkline {\n flex: 2;\n display: flex;\n position: relative;\n *[hidden] {\n display: none;\n }\n }\n .sparkline {\n stroke: ",";\n fill: ","1A;\n }\n .tooltip {\n position: absolute;\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n padding: 2px 5px;\n font-size: 12px;\n white-space: nowrap;\n z-index: 9999;\n }\n .sparkline--cursor {\n stroke: orange;\n }\n\n .sparkline--spot {\n fill: red;\n stroke: red;\n }\n"])),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.primary.main))},70823:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(5057),o=n(55898),i=n.n(o),s=n(12673),l=n(28563),a=n(26089),c=n(36955),u=n(96266);function d(e){let{id:t,title:n,current:o,description:i,data:d,dateFn:p,valueFn:m}=e;const h=(0,r.useRef)(null),y=(0,r.useRef)(null),f=(0,s.Z)({style:{top:0,left:0},hidden:!0,textContent:""}),[b,v]=(0,r.useState)(null),g=(0,l.Z)(b),x={onmousemove(e,t){const{date:n,value:r}=t;f.textContent="".concat(p(n),": ").concat(m(r)),f.style.top=-30,f.style.left=80,f.hidden=!1},onmouseout(){f.hidden=!0}};return(0,r.useEffect)((()=>{setTimeout((()=>{v(document.querySelector(".".concat(t))),setTimeout((()=>{h.current&&(0,a.Z)(h.current,d||[],x)}),400)}))}),[d]),(0,u.jsx)(c.Z,{title:n,value:o,graph:(0,u.jsxs)("div",{className:"card-sparkline ".concat(t),style:{marginTop:16},children:[(0,u.jsx)("svg",{ref:h,className:"sparkline",width:(null===g||void 0===g?void 0:g.width)||100,height:30,strokeWidth:"2"}),(0,u.jsx)("span",{className:"tooltip",ref:y,hidden:f.hidden,style:{...f.style},children:f.textContent})]}),description:i})}d.propTypes={id:i().string.isRequired,title:i().string.isRequired,current:i().any.isRequired,description:i().any,data:i().array,dateFn:i().func,valueFn:i().func},d.defaultProps={description:null,data:[],dateFn:e=>e,valueFn:e=>e}},5863:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(5057),o=n(55898),i=n.n(o),s=n(68420),l=n(70823),a=n(64387),c=n(96266);const u=e=>"".concat(e,"%");function d(e){let{cpus:t,currentLoad:n,history:o}=e;const{t:i,locale:d}=(0,r.useContext)(s.RD);return(0,c.jsx)(l.Z,{id:"cpu-sparkline",title:i("common.cpu"),current:"".concat(Math.floor(n||0),"%"),data:o,description:"".concat(i("system.cores"),": ").concat((null===t||void 0===t?void 0:t.length)||0),dateFn:e=>(0,a.mr)(e,"HH:mm:ss",d),valueFn:u})}d.propTypes={cpus:i().array,currentLoad:i().number,history:i().array},d.defaultProps={cpus:[],currentLoad:0,history:[]}},38003:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(55898),o=n.n(r),i=n(39948),s=n(68420),l=n(70823),a=n(64387),c=n(96266);function u(e){let{instanceCount:t,title:n,total:r,used:o,history:u}=e;const{t:d,locale:p}=(0,s.PE)(),m=!!r,h=r-o,y=m?"(".concat(Math.floor(o/r*100),"%)"):"",f=[];return t&&f.push({title:d("system.instances"),metric:t}),f.push({title:d("system.used"),metric:(0,a.Gw)(o)}),m&&f.push({title:d("system.free"),metric:(0,a.Gw)(h)},{title:d("system.total"),metric:(0,a.Gw)(r)}),(0,c.jsx)(l.Z,{id:"mem-sparkline",title:n||d("common.memory"),current:"".concat((0,a.Gw)(Math.floor(o||0))," ").concat(y),data:u,description:f.map(((e,t)=>(0,c.jsxs)(i.Z,{sx:{marginLeft:0===t?0:2},children:[e.title,": ",e.metric]},e.title))),dateFn:e=>(0,a.mr)(e,"HH:mm:ss",p),valueFn:a.Gw})}u.propTypes={title:o().string,instanceCount:o().number,total:o().number,used:o().number,history:o().array},u.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[]}},46182:(e,t,n)=>{n.r(t),n.d(t,{default:()=>O});var r,o=n(71171),i=n(5057),s=n(33518),l=n(45603),a=n.n(l),c=n(39948),u=n(75760),d=n(11750),p=n(38242),m=n(68420),h=n(33650),y=n(64387),f=n(55898),b=n.n(f),v=n(55402),g=n(5863),x=n(38003),j=n(96266);function k(e){let{blocklet:t,cpuHistory:n,memoryHistory:r,...o}=e;const i=t.appRuntimeInfo||{};return(0,j.jsx)(Z,{component:"div",...o,children:(0,j.jsxs)(v.ZP,{className:"page-metrics",container:!0,spacing:5,children:[(0,j.jsx)(v.ZP,{item:!0,lg:4,md:6,sm:6,xs:12,children:!!n.length&&(0,j.jsx)(g.Z,{currentLoad:i.cpuUsage||0,history:n,style:{height:150}})},"cpu"),(0,j.jsx)(v.ZP,{item:!0,lg:4,md:6,sm:6,xs:12,children:!!r.length&&(0,j.jsx)(x.Z,{used:i.memoryUsage||0,history:r,style:{height:150}})},"memory")]})})}k.propTypes={blocklet:b().object.isRequired,cpuHistory:b().arrayOf(b().shape({date:b().number,value:b().number})),memoryHistory:b().arrayOf(b().shape({date:b().number,value:b().number}))},k.defaultProps={cpuHistory:[],memoryHistory:[]};const Z=(0,s.Z)(d.Z)(r||(r=(0,o.Z)([""])));var w,P=n(26362);function O(){const{t:e,locale:t}=(0,m.PE)(),{blocklet:n,runtimeHistory:r,actions:{refreshBlocklet:o}}=(0,h.y0)(),s=(0,i.useMemo)((()=>{const e=[];return(0,p.forEachBlockletSync)(n,((t,r)=>{let{ancestors:o,id:i,level:s}=r;t.runtimeInfo&&e.push({type:"blocklet",groupId:n.meta.did,groupName:(0,p.getDisplayName)(n),id:i,name:(0,p.getDisplayName)(t,!0),blocklet:n,component:t,level:s-1>=0?s-1:0,runtimeInfo:t.runtimeInfo,ancestors:o})})),e}),[n]);(0,i.useEffect)((()=>{const e=setInterval((()=>{o()}),1e4);return()=>{clearInterval(e)}}),[]);const l=[{label:e("common.name"),name:"name",options:{customBodyRenderLite(e){const{name:t,component:n,level:r,ancestors:o}=s[e];return(0,j.jsxs)(c.Z,{display:"flex",alignItems:"center",pl:2*r,children:[(0,j.jsx)(P.Z,{size:14,blocklet:n,ancestors:o}),(0,j.jsx)(c.Z,{ml:1,children:t})]})}}},{label:e("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(e){const{runtimeInfo:n}=s[e];return r=n.uptime,a()(Number(r||0),{locale:(0,y.FF)(t)});var r}}},{label:e("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t}=s[e];return(0,y.Gw)((null===t||void 0===t?void 0:t.memoryUsage)||0)}}},{label:e("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t}=s[e];return"".concat((t.cpuUsage||0).toFixed(1),"%")}}},{label:e("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid"},{label:e("blocklet.runtimeInfo.port"),name:"runtimeInfo.port"}];return(0,j.jsxs)(I,{component:"div",children:[(0,j.jsx)(d.Z,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:e("analytics.trend")}),"running"===n.status?[(0,j.jsx)(c.Z,{children:(0,j.jsx)(k,{blocklet:n,cpuHistory:r.cpu,memoryHistory:r.memory})}),(0,j.jsx)(c.Z,{mt:3,children:(0,j.jsx)(u.Z,{title:e("analytics.detail"),className:"monitor-table",locale:t,data:s,columns:l,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]:(0,j.jsx)(d.Z,{children:e("blocklet.runtimeInfo.noRunning")})]})}O.propTypes={};const I=(0,s.Z)(d.Z)(w||(w=(0,o.Z)([""])))},26362:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(55898),o=n.n(r),i=n(62681),s=n(72333),l=n(6352),a=n.n(l),c=n(35432),u=n(22324),d=n(64387);var p=n(96266);function m(e){let{blocklet:t,style:n,size:r,ancestors:o,...l}=e;const m=(0,u.h6)(),{logoUrl:h,inService:y}=function(e){var t;let{blocklet:n,ancestors:r=[]}=e;const o=(0,u.h6)(),{inService:i}=o,s="?v=".concat(null===n||void 0===n||null===(t=n.meta)||void 0===t?void 0:t.version).concat((0,d.XN)(null===n||void 0===n?void 0:n.status)?"~":"");let l=i?a()(d.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",s):a()(o.imgPrefix,"blocklet.png");if("registry"===n.source&&n.deployedFrom&&n.meta.logo)l=a()(n.deployedFrom,(0,d.lk)(n.meta.bundleDid,n.meta.logo),s);else{const e=window.env.apiPrefix||"/",t=r.concat(n),o=i?t.slice(1):t;l=a()(e,"/blocklet/logo-bundle".concat(o.map((e=>"/".concat(e.meta.did))).join("")),s)}return{logoUrl:l,inService:i}}({blocklet:t,ancestors:o}),{variant:f}=l,b=y?()=>{}:e=>{e.target.src="".concat(m.imgPrefix,"/blocklet.png")};let v=(0,p.jsx)("img",{src:h,onError:b,alt:t.meta.name,style:{width:r}});return t.meta.logo||(v=(0,p.jsx)(s.Z,{did:t.meta.did||"",responsive:!0})),(0,p.jsx)(i.Z,{variant:f||"square",style:Object.assign({backgroundColor:"transparent",width:r,height:r,borderRadius:10},n),...l,children:v})}m.propTypes={blocklet:o().object.isRequired,style:o().object,size:o().oneOfType([o().number,o().string]),ancestors:o().array},m.defaultProps={style:{},size:40,ancestors:[]}},35701:(e,t,n)=>{t.Z=void 0;(r=n(5057))&&r.__esModule;var r,o=n(96266);function i(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=function(e){return(0,o.jsx)("svg",s(s({},e),{},{children:(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.361 2.4a.8.8 0 0 0-.728.469L.873 15.54a.8.8 0 0 0-.072.33V27.393a.8.8 0 0 0 .8.8h28.8a.8.8 0 0 0 .8-.8v-11.52a.8.8 0 0 0-.072-.331L25.37 2.869a.8.8 0 0 0-.728-.47H7.361zm-4.96 14.4v9.792h27.2v-9.799a.814.814 0 0 1-.104.007h-7.098l-2.066 3.1a.8.8 0 0 1-.666.356h-8.064a.8.8 0 0 1-.665-.356L8.87 16.8h-6.47zm26.816-1.6H21.97a.8.8 0 0 0-.665.356l-2.067 3.1h-7.208l-2.066-3.1a.8.8 0 0 0-.666-.356H2.785L7.876 4h16.25l5.09 11.2z",fill:"currentColor"})}))};a.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.displayName="empty";t.Z=a},25710:(e,t,n)=>{n.d(t,{Z:()=>m});var r,o=n(71171),i=n(55898),s=n.n(i),l=n(39948),a=n(35701),c=n(47685),u=n(96266);const d=(0,c.zo)(l.Z)(r||(r=(0,o.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n height: 100%;\n min-height: 100px;\n color: #999;\n .empty-icon {\n margin: 10px 0;\n }\n"])));function p(e){let{color:t,size:n,children:r,...o}=e;return(0,u.jsxs)(d,{...o,children:[(0,u.jsx)(a.Z,{style:{width:n,height:n,color:t},className:"empty-icon"}),(0,u.jsx)(l.Z,{className:"empty-content",children:r})]})}p.propTypes={color:s().string,size:s().number,children:s().any},p.defaultProps={color:"inherit",size:36,children:null};const m=p},26089:(e,t,n)=>{function r(e,t,n,r){return parseFloat((t-r*t/e+n).toFixed(2))}function o(e){return e.value}function i(e,t){const n=document.createElementNS("http://www.w3.org/2000/svg",e);for(const r in t)n.setAttribute(r,t[r]);return n}function s(e,t,n){if(function(e){[...e.querySelectorAll("*")].forEach((t=>e.removeChild(t)))}(e),t.length<=1)return;n=n||{},"number"===typeof t[0]&&(t=t.map((e=>({value:e}))));const{onmousemove:s}=n,{onmouseout:l}=n,a="interactive"in n?n.interactive:!!s,c=n.spotRadius||2,u=2*c,d=n.cursorWidth||2,p=parseFloat(e.attributes["stroke-width"].value),m=n.fetch||o,h=t.map((e=>m(e))),y=parseFloat(e.attributes.width.value)-2*u,f=parseFloat(e.attributes.height.value),b=f-2*p-u,v=0===Math.max(...h)?1:Math.max(...h),g=-1e3,x=h.length-1,j=y/x,k=[],Z=r(v,b,p+c,h[0]);let w="M".concat(u," ").concat(Z);h.forEach(((e,n)=>{const o=n*j+u,i=r(v,b,p+c,e);k.push(Object.assign({},t[n],{index:n,x:o,y:i})),w+=" L ".concat(o," ").concat(i)}));const P=i("path",{class:"sparkline--line",d:w,fill:"none"}),O=i("path",{class:"sparkline--fill",d:"".concat(w," V ").concat(f," L ").concat(u," ").concat(f," Z"),stroke:"none"});if(e.appendChild(O),e.appendChild(P),!a)return;const I=i("line",{class:"sparkline--cursor",x1:g,x2:g,y1:0,y2:f,"stroke-width":d}),F=i("circle",{class:"sparkline--spot",cx:g,cy:g,r:c});e.appendChild(I),e.appendChild(F);const R=i("rect",{width:e.attributes.width.value,height:e.attributes.height.value,style:"fill: transparent; stroke: transparent",class:"sparkline--interaction-layer"});e.appendChild(R),R.addEventListener("mouseout",(e=>{I.setAttribute("x1",g),I.setAttribute("x2",g),F.setAttribute("cx",g),l&&l(e)})),R.addEventListener("mousemove",(e=>{const t=e.offsetX;let n=k.find((e=>e.x>=t));n||(n=k[x]);const r=k[k.indexOf(n)-1];let o,i;r?(i=r.x+(n.x-r.x)/2,o=t>=i?n:r):o=n;const{x:l}=o,{y:a}=o;F.setAttribute("cx",l),F.setAttribute("cy",a),I.setAttribute("x1",l),I.setAttribute("x2",l),s&&s(e,o)}))}n.d(t,{Z:()=>s})}}]);
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6234],{36955:(e,t,n)=>{n.d(t,{Z:()=>m});var r,o=n(71171),i=n(55898),s=n.n(i),l=n(33518),a=n(38763),c=n(75392),u=n(11750),d=n(39948),p=n(96266);function m(e){let{style:t,title:n,value:r,graph:o,description:i}=e;return(0,p.jsx)(h,{children:(0,p.jsxs)(c.Z,{style:{...t},children:[(0,p.jsx)(u.Z,{sx:{fontSize:14},color:"text.secondary",children:n}),(0,p.jsx)(u.Z,{variant:"h5",component:"div",mt:1,children:r}),o,!!i&&(0,p.jsx)(d.Z,{display:"flex",sx:{fontSize:12,marginTop:3},color:"text.secondary",children:i})]})})}m.propTypes={style:s().object,title:s().node,value:s().node,graph:s().node,description:s().any},m.defaultProps={style:{},title:null,value:null,graph:null,description:null};const h=(0,l.Z)(a.Z)(r||(r=(0,o.Z)(["\n .card-content {\n height: 150px;\n }\n\n .card-sparkline {\n flex: 2;\n display: flex;\n position: relative;\n *[hidden] {\n display: none;\n }\n }\n .sparkline {\n stroke: ",";\n fill: ","1A;\n }\n .tooltip {\n position: absolute;\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n padding: 2px 5px;\n font-size: 12px;\n white-space: nowrap;\n z-index: 9999;\n }\n .sparkline--cursor {\n stroke: orange;\n }\n\n .sparkline--spot {\n fill: red;\n stroke: red;\n }\n"])),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.primary.main))},70823:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(5057),o=n(55898),i=n.n(o),s=n(12673),l=n(28563),a=n(26089),c=n(36955),u=n(96266);function d(e){let{id:t,title:n,current:o,description:i,data:d,dateFn:p,valueFn:m}=e;const h=(0,r.useRef)(null),y=(0,r.useRef)(null),f=(0,s.Z)({style:{top:0,left:0},hidden:!0,textContent:""}),[v,b]=(0,r.useState)(null),g=(0,l.Z)(v),x={onmousemove(e,t){const{date:n,value:r}=t;f.textContent="".concat(p(n),": ").concat(m(r)),f.style.top=-30,f.style.left=80,f.hidden=!1},onmouseout(){f.hidden=!0}};return(0,r.useEffect)((()=>{setTimeout((()=>{b(document.querySelector(".".concat(t))),setTimeout((()=>{h.current&&(0,a.Z)(h.current,d||[],x)}),400)}))}),[d]),(0,u.jsx)(c.Z,{title:n,value:o,graph:(0,u.jsxs)("div",{className:"card-sparkline ".concat(t),style:{marginTop:16},children:[(0,u.jsx)("svg",{ref:h,className:"sparkline",width:(null===g||void 0===g?void 0:g.width)||100,height:30,strokeWidth:"2"}),(0,u.jsx)("span",{className:"tooltip",ref:y,hidden:f.hidden,style:{...f.style},children:f.textContent})]}),description:i})}d.propTypes={id:i().string.isRequired,title:i().string.isRequired,current:i().any.isRequired,description:i().any,data:i().array,dateFn:i().func,valueFn:i().func},d.defaultProps={description:null,data:[],dateFn:e=>e,valueFn:e=>e}},5863:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(5057),o=n(55898),i=n.n(o),s=n(68420),l=n(70823),a=n(64387),c=n(96266);const u=e=>"".concat(e,"%");function d(e){let{cpus:t,currentLoad:n,history:o}=e;const{t:i,locale:d}=(0,r.useContext)(s.RD);return(0,c.jsx)(l.Z,{id:"cpu-sparkline",title:i("common.cpu"),current:"".concat(Math.floor(n||0),"%"),data:o,description:"".concat(i("system.cores"),": ").concat((null===t||void 0===t?void 0:t.length)||0),dateFn:e=>(0,a.mr)(e,"HH:mm:ss",d),valueFn:u})}d.propTypes={cpus:i().array,currentLoad:i().number,history:i().array},d.defaultProps={cpus:[],currentLoad:0,history:[]}},38003:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(55898),o=n.n(r),i=n(39948),s=n(68420),l=n(70823),a=n(64387),c=n(96266);function u(e){let{instanceCount:t,title:n,total:r,used:o,history:u}=e;const{t:d,locale:p}=(0,s.PE)(),m=!!r,h=r-o,y=m?"(".concat(Math.floor(o/r*100),"%)"):"",f=[];return t&&f.push({title:d("system.instances"),metric:t}),f.push({title:d("system.used"),metric:(0,a.Gw)(o)}),m&&f.push({title:d("system.free"),metric:(0,a.Gw)(h)},{title:d("system.total"),metric:(0,a.Gw)(r)}),(0,c.jsx)(l.Z,{id:"mem-sparkline",title:n||d("common.memory"),current:"".concat((0,a.Gw)(Math.floor(o||0))," ").concat(y),data:u,description:f.map(((e,t)=>(0,c.jsxs)(i.Z,{sx:{marginLeft:0===t?0:2},children:[e.title,": ",e.metric]},e.title))),dateFn:e=>(0,a.mr)(e,"HH:mm:ss",p),valueFn:a.Gw})}u.propTypes={title:o().string,instanceCount:o().number,total:o().number,used:o().number,history:o().array},u.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[]}},46182:(e,t,n)=>{n.r(t),n.d(t,{default:()=>O});var r,o=n(71171),i=n(5057),s=n(33518),l=n(45603),a=n.n(l),c=n(39948),u=n(75760),d=n(11750),p=n(38242),m=n(68420),h=n(33650),y=n(64387),f=n(55898),v=n.n(f),b=n(55402),g=n(5863),x=n(38003),j=n(96266);function k(e){let{blocklet:t,cpuHistory:n,memoryHistory:r,...o}=e;const i=t.appRuntimeInfo||{};return(0,j.jsx)(Z,{component:"div",...o,children:(0,j.jsxs)(b.ZP,{className:"page-metrics",container:!0,spacing:5,children:[(0,j.jsx)(b.ZP,{item:!0,lg:4,md:6,sm:6,xs:12,children:!!n.length&&(0,j.jsx)(g.Z,{currentLoad:i.cpuUsage||0,history:n,style:{height:150}})},"cpu"),(0,j.jsx)(b.ZP,{item:!0,lg:4,md:6,sm:6,xs:12,children:!!r.length&&(0,j.jsx)(x.Z,{used:i.memoryUsage||0,history:r,style:{height:150}})},"memory")]})})}k.propTypes={blocklet:v().object.isRequired,cpuHistory:v().arrayOf(v().shape({date:v().number,value:v().number})),memoryHistory:v().arrayOf(v().shape({date:v().number,value:v().number}))},k.defaultProps={cpuHistory:[],memoryHistory:[]};const Z=(0,s.Z)(d.Z)(r||(r=(0,o.Z)([""])));var w,P=n(26362);function O(){const{t:e,locale:t}=(0,m.PE)(),{blocklet:n,runtimeHistory:r,actions:{refreshBlocklet:o}}=(0,h.y0)(),s=(0,i.useMemo)((()=>{const e=[];return(0,p.forEachBlockletSync)(n,((t,r)=>{let{ancestors:o,id:i,level:s}=r;t.runtimeInfo&&e.push({type:"blocklet",groupId:n.meta.did,groupName:(0,p.getDisplayName)(n),id:i,name:(0,p.getDisplayName)(t,!0),blocklet:n,component:t,level:s-1>=0?s-1:0,runtimeInfo:t.runtimeInfo,ancestors:o})})),e}),[n]);(0,i.useEffect)((()=>{const e=setInterval((()=>{o()}),1e4);return()=>{clearInterval(e)}}),[]);const l=[{label:e("common.name"),name:"name",options:{customBodyRenderLite(e){const{name:t,component:n,level:r,ancestors:o}=s[e];return(0,j.jsxs)(c.Z,{display:"flex",alignItems:"center",pl:2*r,children:[(0,j.jsx)(P.Z,{size:14,blocklet:n,ancestors:o}),(0,j.jsx)(c.Z,{ml:1,children:t})]})}}},{label:e("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(e){const{runtimeInfo:n}=s[e];return r=n.uptime,a()(Number(r||0),{locale:(0,y.FF)(t)});var r}}},{label:e("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t}=s[e];return(0,y.Gw)((null===t||void 0===t?void 0:t.memoryUsage)||0)}}},{label:e("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t}=s[e];return"".concat((t.cpuUsage||0).toFixed(1),"%")}}},{label:e("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid"},{label:e("blocklet.runtimeInfo.port"),name:"runtimeInfo.port"}];return(0,j.jsxs)(I,{component:"div",children:[(0,j.jsx)(d.Z,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:e("analytics.trend")}),"running"===n.status?[(0,j.jsx)(c.Z,{children:(0,j.jsx)(k,{blocklet:n,cpuHistory:r.cpu,memoryHistory:r.memory})}),(0,j.jsx)(c.Z,{mt:3,children:(0,j.jsx)(u.Z,{title:e("analytics.detail"),className:"monitor-table",locale:t,data:s,columns:l,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]:(0,j.jsx)(d.Z,{children:e("blocklet.runtimeInfo.noRunning")})]})}O.propTypes={};const I=(0,s.Z)(d.Z)(w||(w=(0,o.Z)([""])))},26362:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(55898),o=n.n(r),i=n(62681),s=n(72333),l=n(6352),a=n.n(l),c=n(35432),u=n(22324),d=n(64387);var p=n(96266);function m(e){let{blocklet:t,style:n,size:r,ancestors:o,...l}=e;const m=(0,u.h6)(),{logoUrl:h,inService:y}=function(e){var t;let{blocklet:n,ancestors:r=[]}=e;const o=(0,u.h6)(),{inService:i}=o,s=(0,d.XN)(null===n||void 0===n?void 0:n.status)||(0,d.tv)(null===n||void 0===n?void 0:n.status),l="?v=".concat(null===n||void 0===n||null===(t=n.meta)||void 0===t?void 0:t.version).concat(s?"~":"");let p=i?a()(d.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",l):a()(o.imgPrefix,"blocklet.png");if("registry"===n.source&&n.deployedFrom&&n.meta.logo)p=a()(n.deployedFrom,(0,d.lk)(n.meta.bundleDid,n.meta.logo),l);else{const e=window.env.apiPrefix||"/",t=r.concat(n),o=i?t.slice(1):t;p=a()(e,"/blocklet/logo-bundle".concat(o.map((e=>"/".concat(e.meta.did))).join("")),l)}return{logoUrl:p,inService:i}}({blocklet:t,ancestors:o}),{variant:f}=l,v=y?()=>{}:e=>{e.target.src="".concat(m.imgPrefix,"/blocklet.png")};let b=(0,p.jsx)("img",{src:h,onError:v,alt:t.meta.name,style:{width:r}});return t.meta.logo||(b=(0,p.jsx)(s.Z,{did:t.meta.did||"",responsive:!0})),(0,p.jsx)(i.Z,{variant:f||"square",style:Object.assign({backgroundColor:"transparent",width:r,height:r,borderRadius:10},n),...l,children:b})}m.propTypes={blocklet:o().object.isRequired,style:o().object,size:o().oneOfType([o().number,o().string]),ancestors:o().array},m.defaultProps={style:{},size:40,ancestors:[]}},35701:(e,t,n)=>{t.Z=void 0;(r=n(5057))&&r.__esModule;var r,o=n(96266);function i(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=function(e){return(0,o.jsx)("svg",s(s({},e),{},{children:(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.361 2.4a.8.8 0 0 0-.728.469L.873 15.54a.8.8 0 0 0-.072.33V27.393a.8.8 0 0 0 .8.8h28.8a.8.8 0 0 0 .8-.8v-11.52a.8.8 0 0 0-.072-.331L25.37 2.869a.8.8 0 0 0-.728-.47H7.361zm-4.96 14.4v9.792h27.2v-9.799a.814.814 0 0 1-.104.007h-7.098l-2.066 3.1a.8.8 0 0 1-.666.356h-8.064a.8.8 0 0 1-.665-.356L8.87 16.8h-6.47zm26.816-1.6H21.97a.8.8 0 0 0-.665.356l-2.067 3.1h-7.208l-2.066-3.1a.8.8 0 0 0-.666-.356H2.785L7.876 4h16.25l5.09 11.2z",fill:"currentColor"})}))};a.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.displayName="empty";t.Z=a},25710:(e,t,n)=>{n.d(t,{Z:()=>m});var r,o=n(71171),i=n(55898),s=n.n(i),l=n(39948),a=n(35701),c=n(47685),u=n(96266);const d=(0,c.zo)(l.Z)(r||(r=(0,o.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n height: 100%;\n min-height: 100px;\n color: #999;\n .empty-icon {\n margin: 10px 0;\n }\n"])));function p(e){let{color:t,size:n,children:r,...o}=e;return(0,u.jsxs)(d,{...o,children:[(0,u.jsx)(a.Z,{style:{width:n,height:n,color:t},className:"empty-icon"}),(0,u.jsx)(l.Z,{className:"empty-content",children:r})]})}p.propTypes={color:s().string,size:s().number,children:s().any},p.defaultProps={color:"inherit",size:36,children:null};const m=p},26089:(e,t,n)=>{function r(e,t,n,r){return parseFloat((t-r*t/e+n).toFixed(2))}function o(e){return e.value}function i(e,t){const n=document.createElementNS("http://www.w3.org/2000/svg",e);for(const r in t)n.setAttribute(r,t[r]);return n}function s(e,t,n){if(function(e){[...e.querySelectorAll("*")].forEach((t=>e.removeChild(t)))}(e),t.length<=1)return;n=n||{},"number"===typeof t[0]&&(t=t.map((e=>({value:e}))));const{onmousemove:s}=n,{onmouseout:l}=n,a="interactive"in n?n.interactive:!!s,c=n.spotRadius||2,u=2*c,d=n.cursorWidth||2,p=parseFloat(e.attributes["stroke-width"].value),m=n.fetch||o,h=t.map((e=>m(e))),y=parseFloat(e.attributes.width.value)-2*u,f=parseFloat(e.attributes.height.value),v=f-2*p-u,b=0===Math.max(...h)?1:Math.max(...h),g=-1e3,x=h.length-1,j=y/x,k=[],Z=r(b,v,p+c,h[0]);let w="M".concat(u," ").concat(Z);h.forEach(((e,n)=>{const o=n*j+u,i=r(b,v,p+c,e);k.push(Object.assign({},t[n],{index:n,x:o,y:i})),w+=" L ".concat(o," ").concat(i)}));const P=i("path",{class:"sparkline--line",d:w,fill:"none"}),O=i("path",{class:"sparkline--fill",d:"".concat(w," V ").concat(f," L ").concat(u," ").concat(f," Z"),stroke:"none"});if(e.appendChild(O),e.appendChild(P),!a)return;const I=i("line",{class:"sparkline--cursor",x1:g,x2:g,y1:0,y2:f,"stroke-width":d}),F=i("circle",{class:"sparkline--spot",cx:g,cy:g,r:c});e.appendChild(I),e.appendChild(F);const R=i("rect",{width:e.attributes.width.value,height:e.attributes.height.value,style:"fill: transparent; stroke: transparent",class:"sparkline--interaction-layer"});e.appendChild(R),R.addEventListener("mouseout",(e=>{I.setAttribute("x1",g),I.setAttribute("x2",g),F.setAttribute("cx",g),l&&l(e)})),R.addEventListener("mousemove",(e=>{const t=e.offsetX;let n=k.find((e=>e.x>=t));n||(n=k[x]);const r=k[k.indexOf(n)-1];let o,i;r?(i=r.x+(n.x-r.x)/2,o=t>=i?n:r):o=n;const{x:l}=o,{y:a}=o;F.setAttribute("cx",l),F.setAttribute("cy",a),I.setAttribute("x1",l),I.setAttribute("x2",l),s&&s(e,o)}))}n.d(t,{Z:()=>s})}}]);