Files
owncast/static/web/_next/static/chunks/pages/admin/hardware-info-c80989098ff8b437.js
2023-02-02 02:51:46 +00:00

1 line
9.4 KiB
JavaScript
Vendored

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1487],{57838:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(97685),o=n(67294);function i(){var e=o.useReducer(function(e){return e+1},0);return(0,r.Z)(e,2)[1]}},24308:function(e,t,n){"use strict";n.d(t,{c4:function(){return i}});var r=n(4942),o=n(87462),i=["xxl","xl","lg","md","sm","xs"],l={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},a=new Map,s=-1,c={};t.ZP={matchHandlers:{},dispatch:function(e){return c=e,a.forEach(function(e){return e(c)}),a.size>=1},subscribe:function(e){return a.size||this.register(),s+=1,a.set(s,e),e(c),s},unsubscribe:function(e){a.delete(e),a.size||this.unregister()},unregister:function(){var e=this;Object.keys(l).forEach(function(t){var n=l[t],r=e.matchHandlers[n];null==r||r.mql.removeListener(null==r?void 0:r.listener)}),a.clear()},register:function(){var e=this;Object.keys(l).forEach(function(t){var n=l[t],i=function(n){var i=n.matches;e.dispatch((0,o.Z)((0,o.Z)({},c),(0,r.Z)({},t,i)))},a=window.matchMedia(n);a.addListener(i),e.matchHandlers[n]={mql:a,listener:i},i(a)})}}},93645:function(e,t,n){"use strict";n.d(t,{u:function(){return o}});var r={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}};function o(e){return e?r[e]:r.trunc}},59910:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(19013),o=n(13882);function i(e,t){return(0,o.Z)(2,arguments),(0,r.Z)(e).getTime()-(0,r.Z)(t).getTime()}},11699:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(59910),o=n(13882),i=n(93645);function l(e,t,n){(0,o.Z)(2,arguments);var l=(0,r.Z)(e,t)/1e3;return(0,i.u)(null==n?void 0:n.roundingMethod)(l)}},1469:function(e){var t=Array.isArray;e.exports=t},99096:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/hardware-info",function(){return n(91979)}])},36435:function(e,t,n){"use strict";n.d(t,{k:function(){return c}});var r=n(85893),o=n(9085),i=n(86205),l=n(58091),a=n(60727);function s(e){let t={};return e.forEach(e=>{let n=new Date(e.time),r=(0,l.Z)(n,"H:mma");t[r]=e.value}),t}i.Z.use(o.ZP);let c=e=>{let{data:t,title:n,color:o,unit:i,dataCollections:l,yFlipped:c,yLogarithmic:u}=e,d=[];t&&t.length>0&&d.push({name:n,color:o,data:s(t)}),l.forEach(e=>{d.push({name:e.name,data:s(e.data),color:e.color,dataset:e.options})});let f={scales:{y:{reverse:!1,type:"linear"},x:{type:"time"}}};return f.scales.y.reverse=c,f.scales.y.type=u?"logarithmic":"linear",(0,r.jsx)("div",{className:"line-chart-container",children:(0,r.jsx)(a.wW,{xtitle:"Time",ytitle:n,suffix:i,legend:"bottom",color:o,data:d,download:n,library:f})})};c.defaultProps={dataCollections:[],data:[],title:"",yFlipped:!1,yLogarithmic:!1}},23589:function(e,t,n){"use strict";n.d(t,{m:function(){return p}});var r=n(85893),o=n(85818),i=n(97910),l=n(74763),a=n(59652);let{Text:s}=o.Z,c={title:"",value:0,prefix:null,suffix:null,color:"",progress:!1,centered:!1,formatter:null},u=e=>{let{prefix:t,value:n,suffix:o,title:i}=e;return(0,r.jsxs)("div",{children:[t,(0,r.jsx)("div",{children:(0,r.jsx)(s,{type:"secondary",children:i})}),(0,r.jsx)("div",{children:(0,r.jsxs)(s,{type:"secondary",children:[n,o||"%"]})})]})},d=e=>{let{title:t,value:n,prefix:o,suffix:l,color:a}=e,s=(0,r.jsx)(u,{prefix:o,value:n,suffix:l,title:t});return(0,r.jsx)(i.Z,{type:"dashboard",percent:n,width:120,strokeColor:{"0%":a,"90%":n>90?"red":a},format:()=>s})};d.defaultProps=c;let f=e=>{let{title:t,value:n,prefix:o,formatter:i}=e;return(0,r.jsx)(l.Z,{title:t,value:n,prefix:o,formatter:i})};f.defaultProps=c;let p=e=>{let{progress:t,centered:n}=e,o=t?d:f;return(0,r.jsx)(a.Z,{type:"inner",children:(0,r.jsx)("div",{style:n?{display:"flex",alignItems:"center",justifyContent:"center"}:{},children:(0,r.jsx)(o,{...e})})})};p.defaultProps=c},91979:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return g}});var r=n(85893),o=n(85818),i=n(71230),l=n(15746),a=n(67294),s=n(5152),c=n.n(s),u=n(64777),d=n(36435),f=n(23589),p=n(6960);let v=c()(()=>Promise.all([n.e(2074),n.e(8695)]).then(n.t.bind(n,18695,23)),{loadableGenerated:{webpack:()=>[18695]},ssr:!1}),m=c()(()=>Promise.all([n.e(2074),n.e(7061)]).then(n.t.bind(n,77061,23)),{loadableGenerated:{webpack:()=>[77061]},ssr:!1}),h=c()(()=>Promise.all([n.e(2074),n.e(9790)]).then(n.t.bind(n,79790,23)),{loadableGenerated:{webpack:()=>[79790]},ssr:!1});function g(){var e,t,n;let[s,c]=(0,a.useState)({cpu:[],memory:[],disk:[],message:""}),p=async()=>{try{let e=await (0,u.rQ)(u.nx);c({...e})}catch(e){c({...s,message:e.message})}};if((0,a.useEffect)(()=>{let e=null;return p(),e=setInterval(p,u.NE),()=>{clearInterval(e)}},[]),!s.cpu)return null;let g=null===(e=s.cpu[s.cpu.length-1])||void 0===e?void 0:e.value,x=null===(t=s.memory[s.memory.length-1])||void 0===t?void 0:t.value,y=null===(n=s.disk[s.disk.length-1])||void 0===n?void 0:n.value,w=[{name:"CPU",color:"#B63FFF",data:s.cpu},{name:"Memory",color:"#2087E2",data:s.memory},{name:"Disk",color:"#FF7700",data:s.disk}];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z.Title,{children:"Hardware Info"}),(0,r.jsx)("br",{}),(0,r.jsxs)("div",{children:[(0,r.jsxs)(i.Z,{gutter:[16,16],justify:"space-around",children:[(0,r.jsx)(l.Z,{children:(0,r.jsx)(f.m,{title:w[0].name,value:"".concat(Math.round(g)||0),prefix:(0,r.jsx)(m,{style:{color:w[0].color}}),color:w[0].color,progress:!0,centered:!0})}),(0,r.jsx)(l.Z,{children:(0,r.jsx)(f.m,{title:w[1].name,value:"".concat(Math.round(x)||0),prefix:(0,r.jsx)(v,{style:{color:w[1].color}}),color:w[1].color,progress:!0,centered:!0})}),(0,r.jsx)(l.Z,{children:(0,r.jsx)(f.m,{title:w[2].name,value:"".concat(Math.round(y)||0),prefix:(0,r.jsx)(h,{style:{color:w[2].color}}),color:w[2].color,progress:!0,centered:!0})})]}),(0,r.jsx)(d.k,{title:"% used",dataCollections:w,color:"#FF7700",unit:"%"})]})]})}g.getLayout=function(e){return(0,r.jsx)(p.l,{page:e})}},60057:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(4942),o=n(1413),i=n(97685),l=n(45987),a=n(67294),s=n(81263),c=n(94184),u=n.n(c),d={adjustX:1,adjustY:1},f=[0,0],p={topLeft:{points:["bl","tl"],overflow:d,offset:[0,-4],targetOffset:f},topCenter:{points:["bc","tc"],overflow:d,offset:[0,-4],targetOffset:f},topRight:{points:["br","tr"],overflow:d,offset:[0,-4],targetOffset:f},bottomLeft:{points:["tl","bl"],overflow:d,offset:[0,4],targetOffset:f},bottomCenter:{points:["tc","bc"],overflow:d,offset:[0,4],targetOffset:f},bottomRight:{points:["tr","br"],overflow:d,offset:[0,4],targetOffset:f}},v=n(15105),m=n(75164),h=n(88603),g=v.Z.ESC,x=v.Z.TAB,y=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus"],w=a.forwardRef(function(e,t){var n,c,d,f,v,w,b,j,Z,C,k,E,P,N,M,F,O=e.arrow,T=void 0!==O&&O,_=e.prefixCls,A=void 0===_?"rc-dropdown":_,R=e.transitionName,L=e.animation,V=e.align,S=e.placement,H=e.placements,I=e.getPopupContainer,W=e.showAction,z=e.hideAction,D=e.overlayClassName,G=e.overlayStyle,X=e.visible,q=e.trigger,B=void 0===q?["hover"]:q,Q=e.autoFocus,U=(0,l.Z)(e,y),Y=a.useState(),J=(0,i.Z)(Y,2),K=J[0],$=J[1],ee="visible"in e?X:K,et=a.useRef(null);a.useImperativeHandle(t,function(){return et.current}),d=(c={visible:ee,setTriggerVisible:$,triggerRef:et,onVisibleChange:e.onVisibleChange,autoFocus:Q}).visible,f=c.setTriggerVisible,v=c.triggerRef,w=c.onVisibleChange,b=c.autoFocus,j=a.useRef(!1),Z=function(){if(d&&v.current){var e,t,n,r;null===(e=v.current)||void 0===e||null===(t=e.triggerRef)||void 0===t||null===(n=t.current)||void 0===n||null===(r=n.focus)||void 0===r||r.call(n),f(!1),"function"==typeof w&&w(!1)}},C=function(){var e,t,n,r,o=(0,h.tS)(null===(e=v.current)||void 0===e?void 0:null===(t=e.popupRef)||void 0===t?void 0:null===(n=t.current)||void 0===n?void 0:null===(r=n.getElement)||void 0===r?void 0:r.call(n))[0];return null!=o&&!!o.focus&&(o.focus(),j.current=!0,!0)},k=function(e){switch(e.keyCode){case g:Z();break;case x:var t=!1;j.current||(t=C()),t?e.preventDefault():Z()}},a.useEffect(function(){return d?(window.addEventListener("keydown",k),b&&(0,m.Z)(C,3),function(){window.removeEventListener("keydown",k),j.current=!1}):function(){j.current=!1}},[d]);var en=function(){var t=e.overlay;return"function"==typeof t?t():t},er=function(){var e=en();return a.createElement(a.Fragment,null,T&&a.createElement("div",{className:"".concat(A,"-arrow")}),e)},eo=z;return eo||-1===B.indexOf("contextMenu")||(eo=["click"]),a.createElement(s.Z,(0,o.Z)((0,o.Z)({builtinPlacements:void 0===H?p:H},U),{},{prefixCls:A,ref:et,popupClassName:u()(D,(0,r.Z)({},"".concat(A,"-show-arrow"),T)),popupStyle:G,action:B,showAction:W,hideAction:eo||[],popupPlacement:void 0===S?"bottomLeft":S,popupAlign:V,popupTransitionName:R,popupAnimation:L,popupVisible:ee,stretch:(E=e.minOverlayWidthMatchTrigger,P=e.alignPoint,"minOverlayWidthMatchTrigger"in e?E:!P)?"minWidth":"",popup:"function"==typeof e.overlay?er:er(),onPopupVisibleChange:function(t){var n=e.onVisibleChange;$(t),"function"==typeof n&&n(t)},onPopupClick:function(t){var n=e.onOverlayClick;$(!1),n&&n(t)},getPopupContainer:I}),(M=(N=e.children).props?N.props:{},F=u()(M.className,void 0!==(n=e.openClassName)?n:"".concat(A,"-open")),ee&&N?a.cloneElement(N,{className:F}):N))})}},function(e){e.O(0,[2196,173,164,2744,9637,4931,5402,2231,492,5818,7524,9915,8091,6306,5101,7910,4763,2563,180,6960,9774,2888,179],function(){return e(e.s=99096)}),_N_E=e.O()}]);