You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
26 KiB
JavaScript

4 years ago
(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{"1QHZ":function(l,n,u){"use strict";u.r(n);var t=u("CcnG"),e=u("K9Ia"),s=function(){function l(){this.ngUnsubscribe=new e.a}return l.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},l}(),a=function(){return function(){}}(),r=u("pMnS"),o=u("A7o+"),i=u("Ip0R"),b=u("gI3B"),c=u("ny24"),d=u("Vx+w"),p=u("+3se"),g=u("CPDd"),f=u("iIpO"),h=u("t2rx"),y=u("jGGy"),m=u("+NEN"),v=function(){function l(l,n){this.ubusService=l,this.authService=n}return l.prototype.getSystemInfo=function(){var l=[[this.authService.getSid(),"system.management","version",{}],[this.authService.getSid(),"system","info",{}],[this.authService.getSid(),"uci","get",{config:"system",section:"@system[0]"}],[this.authService.getSid(),"system.date","get",{}],[this.authService.getSid(),"uci","get",{config:"system",section:"ntp"}],[this.authService.getSid(),"uci","state",{config:"delos",section:"baptization",option:"SerialNumber"}]];return l.push(d.a.ghn?[this.authService.getSid(),"network.ghntool","version",{}]:[this.authService.getSid(),"network.plctool","fw_version",{}]),this.ubusService.call({data:l})},l.prototype.getSystemStatus=function(){return this.ubusService.call({data:[this.authService.getSid(),"system","info",{}]})},l}(),I=function(){function l(l,n,u,t){this.statusService=l,this.formatTimeService=n,this.addressCheckService=u,this.pageLoadingService=t,this.statusInfo={sysName:null,sysLocation:null,sysContact:null,remoteSysLog:null,sysLogIpPort:null},this.updatingSysInfoDisplay=!1,this.ngUnsubscribe=new e.a,this.Config=d.a,this.refresh=1e3,this.updatingSysInfo=!1,this.deviceFirmwareVersion="",this.isPlc=!1,this.isPlc=Object(p.e)(d.a,"plc"),this.pageLoadingService.register(["updateSysInfo","displayStatusInfo"])}return l.prototype.ngOnInit=function(){var l=this;this.displayStatusInfo(),Object(b.a)(0,this.refresh).pipe(Object(c.a)(this.ngUnsubscribe)).subscribe(function(){l.updateSysInfo()})},l.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},l.prototype.displayStatusInfo=function(){var l=this;this.updatingSysInfoDisplay||(this.updatingSysInfoDisplay=!0,this.statusService.getSystemInfo().pipe(Object(c.a)(this.ngUnsubscribe)).subscribe(function(n){l.pageLoadingService.ready("displayStatusInfo");var u=n.result[2][1].values,t=u.log_ip||"",e=u.log_port||"";l.statusInfo.sysName=u.hostname,l.statusInfo.sysLocation=u.location||"",l.statusInfo.sysContact=u.contact||"",l.statusInfo.remoteSysLog=u.log_remote||"0",l.statusInfo.sysLogIpPort=t+":"+e,l.timeZone=u.zonename||"UTC";var s=n.result[3][1].value.split("-");l.localtime=new Date(s[0],s[1]-1,s[2],s[3],s[4],s[5]),l.statusInfoTotalMemory=(n.result[1][1].memory.total/1048576).toFixed(2),l.statusInfoFreeMemory=(n.result[1][1].memory.free/1048576).toFixed(2);var a=n.result[1][1].load;l.loadOneMin=(a[0]/65535).toFixed(2),l.loadFiveMin=(a[1]/65535).toFixed(2),l.loadFifteenMin=(a[2]/65535).toFixed(2),l.servers=(n.result[4][1].values.server||[]).map(l.addressCheckService.toUnicode),l.serialNumber=n.result[5][1].value,n.result[6]&&(l.deviceFirmwareVersion=l.isPlc?n.result[6][1].stdout?l.extractPlcFW(n.result[6][1].stdout):Object(p.b)("n/a"):n.result[6][1].fw_version),l.updatingSysInfoDisplay=!1},function(n){console.log(n),l.pageLoadingService.ready("displayStatusInfo")}))},l.prototype.updateSysInfo=function(){var l=this;if(++this.uptime,this.formatTimeService.toDays(this.uptime).subscribe(function(n){l.statusInfoUptime=n,l.pageLoadingService.ready("updateSysInfo")}),this.refresh-=1e3,this.refresh<=0){if(this.updatingSysInfo)return;this.updatingSysInfo=!0,this.refresh=d.a.system.status.sysinfo.refresh,this.statusService.getSystemStatus().pipe(Object(c.a)(this.ngUnsubscribe)).subscribe(function(n){l.uptime=n.result[1].uptime,l.updatingSysInfo=!1,l.displayStatusInfo()})}},l.prototype.extractPlcFW=function(l){var n;return(n=l.split(" ").splice(-1)[0].split("-"))[2].substr(0,n[2].lastIndexOf(".")+1)+n[3]},l}(),S=t.ob({encapsulation:2,styles:[],data:{}});function q(l){return t.Kb(0,[(l()(),t.qb(