MikroWizard.docker-compose-.../mikrofront/dist/html/435.50aa5b7f2908d6f4.js

1 line
No EOL
30 KiB
JavaScript

"use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[435],{5435:(P,j,d)=>{d.r(j),d.d(j,{MonitoringModule:()=>Xt});var b=d(177),g=d(9417),a=d(8921),I=d(4858),S=d(5248),T=d(7062),m=d(9130),t=d(4438),_=d(9492),E=d(1170),u=d(7673),R=d(3726),w=d(3028),v=d(6354),C=d(8141),f=d(5964),y=d(3386);function $(i,n,e,o){const l=window&&!!window.document&&window.document.documentElement;let r=l&&n?window:e;if(i&&(r=i&&l&&"string"==typeof i?function D(i,n,e){return(e?window.document:n).querySelector(i)}(i,e.nativeElement,o):i,!r))throw new Error("ngx-infinite-scroll {resolveContainerElement()}: selector for");return r}function F(i){return i&&!i.firstChange}const h={clientHeight:"clientHeight",offsetHeight:"offsetHeight",scrollHeight:"scrollHeight",pageYOffset:"pageYOffset",offsetTop:"offsetTop",scrollTop:"scrollTop",top:"top"},U={clientHeight:"clientWidth",offsetHeight:"offsetWidth",scrollHeight:"scrollWidth",pageYOffset:"pageXOffset",offsetTop:"offsetLeft",scrollTop:"scrollLeft",top:"left"};class z{constructor(n=!0){this.vertical=n,this.propsMap=n?h:U}clientHeightKey(){return this.propsMap.clientHeight}offsetHeightKey(){return this.propsMap.offsetHeight}scrollHeightKey(){return this.propsMap.scrollHeight}pageYOffsetKey(){return this.propsMap.pageYOffset}offsetTopKey(){return this.propsMap.offsetTop}scrollTopKey(){return this.propsMap.scrollTop}topKey(){return this.propsMap.top}}function A(i){return["Window","global"].some(e=>Object.prototype.toString.call(i).includes(e))}function G(i,n){return i?n.document.documentElement:null}function W(i,n){const e=function J({container:i,isWindow:n,axis:e}){const{offsetHeightKey:o,clientHeightKey:l}=Y(e);return X(i,n,o,l)}(n);return n.isWindow?function L(i,n,e){const{axis:o,container:l,isWindow:r}=e,{offsetHeightKey:c,clientHeightKey:s}=Y(o),x=i+N(G(r,l),o,r),p=X(n.nativeElement,r,c,s),k=function Q(i,n,e){const o=n.topKey();if(i.getBoundingClientRect)return i.getBoundingClientRect()[o]+N(i,n,e)}(n.nativeElement,o,r)+p;return{height:i,scrolled:x,totalToScroll:k,isWindow:r}}(e,i,n):function Z(i,n,e){const{axis:o,container:l}=e;return{height:i,scrolled:l[o.scrollTopKey()],totalToScroll:l[o.scrollHeightKey()],isWindow:!1}}(e,0,n)}function Y(i){return{offsetHeightKey:i.offsetHeightKey(),clientHeightKey:i.clientHeightKey()}}function X(i,n,e,o){if(isNaN(i[e])){const l=G(n,i);return l?l[o]:0}return i[e]}function N(i,n,e){const o=n.pageYOffsetKey(),l=n.scrollTopKey(),r=n.offsetTopKey();return isNaN(window.pageYOffset)?G(e,i)[l]:i.ownerDocument?i.ownerDocument.defaultView[o]:i[r]}function q(i,n={down:0,up:0},e){let o,l;if(i.totalToScroll<=0)return!1;const r=i.isWindow?i.scrolled:i.height+i.scrolled;return e?(o=(i.totalToScroll-r)/i.totalToScroll,l=(n?.down?n.down:0)/10):(o=i.scrolled/(i.scrolled+(i.totalToScroll-r)),l=(n?.up?n.up:0)/10),o<=l}class ot{constructor(n){this.lastScrollPosition=0,this.lastTotalToScroll=0,this.totalToScroll=0,this.triggered={down:0,up:0},Object.assign(this,n)}updateScrollPosition(n){return this.lastScrollPosition=n}updateTotalToScroll(n){this.lastTotalToScroll!==n&&(this.lastTotalToScroll=this.totalToScroll,this.totalToScroll=n)}updateScroll(n,e){this.updateScrollPosition(n),this.updateTotalToScroll(e)}updateTriggeredFlag(n,e){e?this.triggered.down=n:this.triggered.up=n}isTriggeredScroll(n,e){return e?this.triggered.down===n:this.triggered.up===n}}const O={DOWN:"[NGX_ISE] DOWN",UP:"[NGX_ISE] UP"};function ct(i){const{scrollDown:n,stats:{scrolled:e}}=i;return{type:n?O.DOWN:O.UP,payload:{currentScrollPosition:e}}}let at=(()=>{class i{constructor(e,o){this.element=e,this.zone=o,this.scrolled=new t.bkB,this.scrolledUp=new t.bkB,this.infiniteScrollDistance=2,this.infiniteScrollUpDistance=1.5,this.infiniteScrollThrottle=150,this.infiniteScrollDisabled=!1,this.infiniteScrollContainer=null,this.scrollWindow=!0,this.immediateCheck=!1,this.horizontal=!1,this.alwaysCallback=!1,this.fromRoot=!1}ngAfterViewInit(){this.infiniteScrollDisabled||this.setup()}ngOnChanges({infiniteScrollContainer:e,infiniteScrollDisabled:o,infiniteScrollDistance:l}){const r=F(e),c=F(o),s=F(l),x=!c&&!this.infiniteScrollDisabled||c&&!o.currentValue||s;(r||c||s)&&(this.destroyScroller(),x&&this.setup())}ngOnDestroy(){this.destroyScroller()}setup(){(function M(){return typeof window<"u"})()&&this.zone.runOutsideAngular(()=>{this.disposeScroller=function lt(i){const{scrollContainer:n,scrollWindow:e,element:o,fromRoot:l}=i,r=function B({windowElement:i,axis:n}){return function K(i,n){const e=i.isWindow||n&&!n.nativeElement?n:n.nativeElement;return{...i,container:e}}({axis:n,isWindow:A(i)},i)}({axis:new z(!i.horizontal),windowElement:$(n,e,o,l)}),c=new ot({totalToScroll:W(o,r).totalToScroll}),x={up:i.upDistance,down:i.downDistance};return function rt(i){let n=(0,R.R)(i.container,"scroll");return i.throttle&&(n=n.pipe((0,y.c)(i.throttle,void 0,{leading:!0,trailing:!0}))),n}({container:r.container,throttle:i.throttle}).pipe((0,w.Z)(()=>(0,u.of)(W(o,r))),(0,v.T)(p=>function st(i,n,e){const{scrollDown:o,fire:l}=function et(i,n,e){const o=function tt(i,n){return i<n.scrolled}(i,n);return{fire:q(n,e,o),scrollDown:o}}(i,n,e);return{scrollDown:o,fire:l,stats:n}}(c.lastScrollPosition,p,x)),(0,C.M)(({stats:p})=>c.updateScroll(p.scrolled,p.totalToScroll)),(0,f.p)(({fire:p,scrollDown:k,stats:{totalToScroll:Nt}})=>function V(i,n,e){return!!(i&&n||!e&&n)}(i.alwaysCallback,p,c.isTriggeredScroll(Nt,k))),(0,C.M)(({scrollDown:p,stats:{totalToScroll:k}})=>{c.updateTriggeredFlag(k,p)}),(0,v.T)(ct))}({fromRoot:this.fromRoot,alwaysCallback:this.alwaysCallback,disable:this.infiniteScrollDisabled,downDistance:this.infiniteScrollDistance,element:this.element,horizontal:this.horizontal,scrollContainer:this.infiniteScrollContainer,scrollWindow:this.scrollWindow,throttle:this.infiniteScrollThrottle,upDistance:this.infiniteScrollUpDistance}).subscribe(e=>this.handleOnScroll(e))})}handleOnScroll({type:e,payload:o}){const l=e===O.DOWN?this.scrolled:this.scrolledUp;(function dt(i){return i.observed??i.observers.length>0})(l)&&this.zone.run(()=>l.emit(o))}destroyScroller(){this.disposeScroller&&this.disposeScroller.unsubscribe()}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(t.aKT),t.rXU(t.SKi))};static#e=this.\u0275dir=t.FsC({type:i,selectors:[["","infiniteScroll",""],["","infinite-scroll",""],["","data-infinite-scroll",""]],inputs:{infiniteScrollDistance:"infiniteScrollDistance",infiniteScrollUpDistance:"infiniteScrollUpDistance",infiniteScrollThrottle:"infiniteScrollThrottle",infiniteScrollDisabled:"infiniteScrollDisabled",infiniteScrollContainer:"infiniteScrollContainer",scrollWindow:"scrollWindow",immediateCheck:"immediateCheck",horizontal:"horizontal",alwaysCallback:"alwaysCallback",fromRoot:"fromRoot"},outputs:{scrolled:"scrolled",scrolledUp:"scrolledUp"},standalone:!0,features:[t.OA$]})}return i})(),ft=(()=>{class i{static#t=this.\u0275fac=function(o){return new(o||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({})}return i})();const ut=["scrollable"],pt=["scrollable2"],gt=i=>({"background-color":i}),H=(i,n)=>({"left.px":i,"top.px":n});function ht(i,n){if(1&i&&(t.j41(0,"c-badge",37),t.EFF(1),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.SpI("",e.CCount," Critical")}}function mt(i,n){if(1&i&&(t.j41(0,"c-badge",38),t.EFF(1),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.SpI("",e.ECount," Error")}}function _t(i,n){if(1&i&&(t.j41(0,"c-badge",39),t.EFF(1),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.SpI("",e.WCount," Warning")}}function vt(i,n){if(1&i&&t.nrm(0,"i",45),2&i){const e=t.XpG().$implicit;t.AVh("fa-hard-drive","router"==e.router_type)("fa-satellite-dish","bridge"==e.router_type)("fa-tower-cell","ap-bridge"==e.router_type||"wds-slave"==e.router_type)("fa-house-signal","station"==e.router_type)("fa-tower-broadcast","special"==e.router_type)}}function xt(i,n){if(1&i&&t.nrm(0,"i",46),2&i){const e=t.XpG().$implicit;t.AVh("fa-hard-drive","router"==e.router_type)("fa-satellite-dish","bridge"==e.router_type)("fa-tower-cell","ap-bridge"==e.router_type||"wds-slave"==e.router_type)("fa-house-signal","station"==e.router_type)("fa-tower-broadcast","special"==e.router_type)}}function bt(i,n){if(1&i&&(t.j41(0,"c-badge",37),t.EFF(1),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.SpI("",e.CCount," Critical")}}function Ct(i,n){if(1&i&&(t.j41(0,"c-badge",47),t.EFF(1),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.SpI("",e.ECount," Error")}}function yt(i,n){if(1&i&&(t.j41(0,"c-badge",39),t.EFF(1),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.SpI("",e.WCount," Warning")}}function Ft(i,n){if(1&i){const e=t.RV6();t.j41(0,"li",40),t.bIt("click",function(){const l=t.eBV(e).$implicit,r=t.XpG(2);return t.Njj(r.filter_device(l))})("contextmenu",function(l){const r=t.eBV(e).$implicit,c=t.XpG(2);return t.Njj(c.onrightClick(l,r,!0))}),t.j41(1,"div"),t.DNE(2,vt,1,10,"i",41)(3,xt,1,10,"i",42),t.EFF(4),t.k0s(),t.j41(5,"div",43),t.DNE(6,bt,2,1,"c-badge",33)(7,Ct,2,1,"c-badge",44)(8,yt,2,1,"c-badge",35),t.k0s()()}if(2&i){const e=n.$implicit,o=t.XpG(2);t.Y8G("ngStyle",t.eq3(7,gt,o.selected_devid==e.devid&&"rgb(239 239 239)")),t.R7$(2),t.Y8G("ngIf",e.data),t.R7$(),t.Y8G("ngIf",!e.data),t.R7$(),t.SpI(" | ",e.name," "),t.R7$(2),t.Y8G("ngIf",e.CCount),t.R7$(),t.Y8G("ngIf",e.ECount),t.R7$(),t.Y8G("ngIf",e.WCount)}}function St(i,n){if(1&i){const e=t.RV6();t.j41(0,"c-card-body",20)(1,"ng-scrollbar",27)(2,"div",28),t.bIt("scrolled",function(l){t.eBV(e);const r=t.XpG();return t.Njj(r.onDown(l))}),t.j41(3,"ul",29)(4,"li",30),t.bIt("click",function(){t.eBV(e);const l=t.XpG();return t.Njj(l.filter_device(0))}),t.j41(5,"div"),t.nrm(6,"i",31),t.EFF(7," | All Devices "),t.k0s(),t.j41(8,"div",32),t.DNE(9,ht,2,1,"c-badge",33)(10,mt,2,1,"c-badge",34)(11,_t,2,1,"c-badge",35),t.k0s()(),t.DNE(12,Ft,9,9,"li",36),t.k0s()()()()}if(2&i){const e=t.XpG();t.R7$(2),t.Y8G("scrollWindow",!1)("infiniteScrollDistance",e.scrollDownDistance)("infiniteScrollThrottle",e.throttle),t.R7$(7),t.Y8G("ngIf",e.CCount),t.R7$(),t.Y8G("ngIf",e.ECount),t.R7$(),t.Y8G("ngIf",e.WCount),t.R7$(),t.Y8G("ngForOf",e.devices)}}function Tt(i,n){1&i&&(t.j41(0,"c-badge",54),t.EFF(1,"Event"),t.k0s())}function Et(i,n){1&i&&(t.j41(0,"c-badge",55),t.EFF(1,"Fixed"),t.k0s())}function kt(i,n){if(1&i&&(t.j41(0,"div",51)(1,"span"),t.DNE(2,Tt,2,0,"c-badge",52),t.EFF(3),t.k0s(),t.j41(4,"span"),t.DNE(5,Et,2,0,"c-badge",53),t.EFF(6),t.k0s()()),2&i){const e=t.XpG().$implicit;t.R7$(2),t.Y8G("ngIf",1==e.status),t.R7$(),t.SpI(" ",e.time,""),t.R7$(2),t.Y8G("ngIf",1==e.status),t.R7$(),t.SpI(" ",e.fixtime,"")}}function jt(i,n){if(1&i&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.JRh(e.time)}}function wt(i,n){if(1&i&&(t.j41(0,"tr",49)(1,"th"),t.EFF(2),t.k0s(),t.j41(3,"th"),t.EFF(4),t.k0s(),t.j41(5,"th"),t.EFF(6),t.k0s(),t.j41(7,"th"),t.EFF(8),t.k0s(),t.j41(9,"th"),t.DNE(10,kt,7,4,"div",50)(11,jt,2,1,"span",25),t.k0s(),t.j41(12,"th"),t.EFF(13),t.k0s(),t.j41(14,"th"),t.EFF(15),t.k0s(),t.j41(16,"th"),t.EFF(17),t.k0s(),t.j41(18,"th"),t.EFF(19),t.k0s()()),2&i){const e=n.$implicit,o=t.XpG(2);t.Y8G("cTableColor",o.set_table_color(e)),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.index,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.level," "),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.name,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.devip,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.AVh("fixed_time",e.fixtime),t.R7$(),t.Y8G("ngIf",e.fixtime),t.R7$(),t.Y8G("ngIf",!e.fixtime),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.detail,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.eventtype,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.src,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.comment,"")}}function Mt(i,n){if(1&i&&(t.j41(0,"tbody"),t.DNE(1,wt,20,31,"tr",48),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.Y8G("ngForOf",e.eventsall)}}function It(i,n){if(1&i){const e=t.RV6();t.j41(0,"tr",58),t.bIt("contextmenu",function(l){const r=t.eBV(e).$implicit,c=t.XpG(2);return t.Njj(c.onrightClick(l,r))}),t.j41(1,"th"),t.EFF(2),t.k0s(),t.j41(3,"th"),t.EFF(4),t.k0s(),t.j41(5,"th"),t.EFF(6),t.k0s(),t.j41(7,"th"),t.EFF(8),t.k0s(),t.j41(9,"th"),t.EFF(10),t.k0s(),t.j41(11,"th"),t.EFF(12),t.k0s(),t.j41(13,"th"),t.EFF(14),t.k0s(),t.j41(15,"th"),t.EFF(16),t.k0s(),t.j41(17,"th"),t.EFF(18),t.k0s()()}if(2&i){const e=n.$implicit,o=t.XpG(2);t.Y8G("cTableColor",o.set_table_color(e)),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.index,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.level,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.name,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.devip,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.time,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.detail,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.eventtype,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.src,""),t.R7$(),t.xc7("background-color","Critical"==e.level&&0==e.status&&"#f58c8c"),t.R7$(),t.SpI(" ",e.comment,"")}}function Rt(i,n){if(1&i&&(t.j41(0,"c-card-body",20)(1,"ng-scrollbar",null,2)(3,"table",56)(4,"thead")(5,"tr",23)(6,"th",24),t.EFF(7,"#"),t.k0s(),t.j41(8,"th",24),t.EFF(9,"Level"),t.k0s(),t.j41(10,"th",24),t.EFF(11,"Name"),t.k0s(),t.j41(12,"th",24),t.EFF(13,"IP"),t.k0s(),t.j41(14,"th",24),t.EFF(15,"time"),t.k0s(),t.j41(16,"th",24),t.EFF(17,"event"),t.k0s(),t.j41(18,"th",24),t.EFF(19,"type"),t.k0s(),t.j41(20,"th",24),t.EFF(21,"source"),t.k0s(),t.j41(22,"th",24),t.EFF(23,"comment"),t.k0s()()(),t.j41(24,"tbody"),t.DNE(25,It,19,28,"tr",57),t.k0s()()()()),2&i){const e=t.XpG();t.R7$(25),t.Y8G("ngForOf",e.eventUnfixedsall)}}function $t(i,n){if(1&i){const e=t.RV6();t.j41(0,"div")(1,"div",59)(2,"c-card",60)(3,"small",61),t.EFF(4),t.k0s(),t.j41(5,"button",62),t.bIt("click",function(){t.eBV(e);const l=t.XpG();return t.Njj(l.fix_event())}),t.EFF(6,"Mark as Fixed"),t.k0s()()()()}if(2&i){const e=t.XpG();t.R7$(),t.Y8G("ngStyle",t.l_i(6,H,e.contextmenuX,e.contextmenuY)),t.R7$(2),t.xc7("background-color","Critical"==e.contexItem.level?"#e55353":"Error"==e.contexItem.level?"#f58c8c":"#f9b115"),t.R7$(),t.E5c("",e.contexItem.level," : ",e.contexItem.name," (",e.contexItem.devip,")")}}function Dt(i,n){if(1&i){const e=t.RV6();t.j41(0,"div")(1,"div",59)(2,"c-card",60)(3,"small",63),t.EFF(4,"Device Menu"),t.k0s(),t.j41(5,"button",64),t.bIt("click",function(){t.eBV(e);const l=t.XpG();return t.Njj(l.go_device())}),t.EFF(6,"Device detail"),t.k0s(),t.j41(7,"button",64),t.bIt("click",function(){t.eBV(e);const l=t.XpG();return t.Njj(l.go_logs())}),t.EFF(8,"Device Logs"),t.k0s()()()()}if(2&i){const e=t.XpG();t.R7$(),t.Y8G("ngStyle",t.l_i(1,H,e.contextmenuX,e.contextmenuY))}}function Gt(i,n){1&i&&(t.j41(0,"div",65),t.nrm(1,"i",66),t.EFF(2," : routers"),t.nrm(3,"br")(4,"i",67),t.EFF(5," : Bridge"),t.nrm(6,"br")(7,"i",68),t.EFF(8," : AP Bridge"),t.nrm(9,"br")(10,"i",69),t.EFF(11," : Station"),t.nrm(12,"br")(13,"i",70),t.EFF(14," : special Wireless "),t.k0s())}const Ot=[{path:"",component:(()=>{class i{constructor(e,o,l){this.data_provider=e,this.router=o,this.login_checker=l,this.ispro=!1,this.copy_msg=!1,this.devices=!1,this.devicesearch="",this.eventsall=!1,this.eventUnfixedsall=!1,this.ECount=0,this.WCount=0,this.CCount=0,this.selected_devid=0,this.contexItem=!1,this.throttle=10,this.scrollUpDistance=2,this.devicespage=1,this.scrollDownDistance=2,this.allallertpage=1,this.allowinfinite=!1,this.contextmenu=!1,this.contextmainmenu=!1,this.contextmenuX=0,this.contextmenuY=0,this.AutoScrollTimer=!1,this.trafficRadioGroup=new g.J3({trafficRadio:new g.hs("5m")});var r=this;this.login_checker.isLoggedIn()||setTimeout(function(){r.router.navigate(["login"])},100),this.data_provider.getSessionInfo().then(s=>{r.uid=s.uid,r.uname=s.name,r.ispro=s.ISPRO,r.ispro||setTimeout(function(){r.router.navigate(["dashboard"])},100),r.tz=s.tz})}ngOnInit(){this.initEvents(),this.initAllalerts(),this.initUnfixedalerts(),this.update_tables(),this.auto_scroll()}set_table_color(e,o=!0){return"status"in e&&1==e.status&&o?"light":"Critical"==e.level?"danger":"Warning"==e.level?"warning":"danger"}scroll(){this.scrollable.scrollTo({bottom:0,duration:500})}onrightClick(e,o,l=!1){this.contexItem=o,this.contextmenuX=e.clientX,this.contextmenuY=e.clientY,l?(this.contextmainmenu=!0,this.contextmenu=!1):(this.contextmenu=!0,this.contextmainmenu=!1)}disableContextMenu(){this.contexItem=!1,this.contextmenu=!1,this.contextmainmenu=!1}fix_event(){var e=this;this.contexItem&&this.data_provider.monitoring_events_fix(this.contexItem.id).then(o=>{"status"in o&&"failed"==o.status||e.reload_data()})}initEvents(){var e=this;e.ECount=0,e.WCount=0,e.CCount=0,this.devicespage=1,this.data_provider.monitoring_devices_events(this.devicespage,this.devicesearch).then(o=>{e.devices=o.map(l=>(l.ECount=0,l.WCount=0,l.CCount=0,l.data&&l.data.forEach(r=>{"Error"==r.level?(l.ECount++,e.ECount++):"Warning"==r.level?(l.WCount++,e.WCount++):"Critical"==r.level&&(l.CCount++,e.CCount++)}),l))})}initAllalerts(){var e=this;this.allowinfinite=!1,this.data_provider.monitoring_all_events(e.selected_devid,e.allallertpage).then(o=>{var l=1;e.eventsall=o.map(r=>(r.time=(0,m.qD)(r.eventtime.split(".")[0]+".000Z",e.tz,"yyyy-MM-dd HH:mm:ss"),r.fixtime&&(r.fixtime=(0,m.qD)(r.fixtime.split(".")[0]+".000Z",e.tz,"yyyy-MM-dd HH:mm:ss")),r.index=l++,r)),e.auto_scroll()}),setTimeout(function(){e.allowinfinite=!0,console.dir("allowing infinite")},1500)}auto_scroll(){var e=this;this.AutoScrollTimer=setTimeout(function(){e.scrollable.scrollTo({bottom:0,duration:500})},1e3)}initUnfixedalerts(){var e=this;this.data_provider.monitoring_unfixed_events(e.selected_devid).then(o=>{var l=1;e.eventUnfixedsall=o.map(r=>(r.time=(0,m.qD)(r.eventtime.split(".")[0]+".000Z",e.tz,"yyyy-MM-dd HH:mm:ss XXX"),r.index=l++,r)),setTimeout(function(){e.scrollable2.scrollTo({bottom:0,duration:500})},100)})}timer(e){let o=60*e,l="0",r=60;var c=this;const s=e<10?"0":"";this.timer_interval=setInterval(()=>{o--,0!=r?r--:r=59,l=r<10?"0"+r:r,this.display=`${s}${Math.floor(o/60)}:${l}`,0==o&&clearInterval(c.timer_interval)},1e3)}filter_device(e){0==e?this.selected_devid=0:"devid"in e&&(this.selected_devid=e.devid),this.reload_data()}reload_data(){clearTimeout(this.list_update_timer),clearTimeout(this.timer_interval),console.dir("reloading data"),this.allallertpage=1,this.initEvents(),this.initAllalerts(),this.initUnfixedalerts(),this.update_tables()}go_device(){this.router.navigate(["/device-stats",{id:this.contexItem.devid}])}go_logs(){this.router.navigate(["/devlogs",{devid:this.contexItem.devid}])}update_tables(){var e=this;clearTimeout(this.list_update_timer),clearTimeout(this.timer_interval),this.timer(1),this.list_update_timer=setTimeout(()=>{e.allallertpage=1,e.initEvents(),e.initAllalerts(),e.initUnfixedalerts(),e.update_tables()},6e4)}onUp(e){if(this.allowinfinite){var o=this;this.allallertpage++,this.data_provider.monitoring_all_events(o.selected_devid,o.allallertpage).then(l=>{var c=1;let r=l.map(s=>(s.time=(0,m.qD)(s.eventtime.split(".")[0]+".000Z",o.tz,"yyyy-MM-dd HH:mm:ss"),s.fixtime&&(s.fixtime=(0,m.qD)(s.fixtime.split(".")[0]+".000Z",o.tz,"yyyy-MM-dd HH:mm:ss")),s.index=c++,s));o.eventsall.unshift(...r),c=1,o.eventsall=o.eventsall.map(s=>(s.index=c++,s))})}else console.dir("scroll up not allowed")}onDown(e){var o=this;console.dir("scroll down"),this.devicespage++,this.data_provider.monitoring_devices_events(this.devicespage).then(l=>{let r=l;console.dir(o.devices),console.dir(r),o.devices=o.devices.concat(r),console.dir(o.devices)})}ngOnDestroy(){clearTimeout(this.list_update_timer),clearTimeout(this.timer_interval),this.eventsall=!1,this.eventUnfixedsall=!1,this.scrollable.update()}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(_.C),t.rXU(T.Ix),t.rXU(E.T))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["ng-component"]],viewQuery:function(o,l){if(1&o&&(t.GBs(ut,5),t.GBs(pt,5)),2&o){let r;t.mGM(r=t.lsd())&&(l.scrollable=r.first),t.mGM(r=t.lsd())&&(l.scrollable2=r.first)}},decls:59,vars:11,consts:[["scrollable","ngScrollbar"],["iconstooltip",""],["scrollable2","ngScrollbar"],[2,"height","calc(100vh - 10rem)",3,"click"],["xs","3",2,"height","100%"],[2,"height","100%"],["xl","3","lg","12",2,"padding","0"],["xl","7","lg","12",2,"padding","0"],["type","text","placeholder","search",2,"width","100%","background","transparent","border","1px solid #cdcdcd",3,"ngModelChange","ngModel"],["xl","2","lg","12",2,"text-align","right"],[1,"fa-regular","fa-circle-question",2,"cursor","pointer",3,"cTooltip"],["style","padding: 4px;",4,"ngIf"],["xs","9",2,"padding-left","0",3,"click"],[2,"height","60%"],["md","10"],["md","2",2,"text-align","right"],["color","info",2,"cursor","pointer","font-size","0.85em",3,"click"],[1,"fa-solid","fa-arrows-rotate"],["color","primary",1,"mx-1",2,"font-size","0.85em"],[1,"fa-solid","fa-clock-rotate-left","mx-1"],[2,"padding","4px"],["infiniteScroll","","scrollViewport","",2,"width","100%",3,"scrolledUp","scrollWindow","infiniteScrollUpDistance","infiniteScrollThrottle"],["small","","bordered","","responsive","","hover","","cTable","",1,"alarms24",2,"margin-bottom","0","white-space","nowrap","display","table"],[2,"position","sticky","top","-1px","background","#fff"],["scope","col"],[4,"ngIf"],[2,"height","40%"],["pointerEventsMethod","scrollbar"],["infiniteScroll","","scrollViewport","",2,"width","100%",3,"scrolled","scrollWindow","infiniteScrollDistance","infiniteScrollThrottle"],["cListGroup","","oncontextmenu","return false;","flush",""],["cListGroupItem","",1,"d-flex","justify-content-between","align-items-center",2,"cursor","pointer","padding","5px 8px",3,"click"],[1,"fa-solid","fa-hard-drive",2,"color","rgb(9, 44, 9)"],[1,"d-flex","alerts-badges",2,"min-width","135px","border-left","1px solid #ccc","height","100%","/* text-align","right","*/display","flex","flex-direction","row-reverse"],["color","danger","style","margin: 0 0 0 1px;","size","sm","shape","rounded-pill",4,"ngIf"],["color","danger","size","sm","style","margin: 0 0 0 1px;background-color: #f58c8c !important;","shape","rounded-pill",4,"ngIf"],["color","warning","size","sm","style","margin: 0 0 0 1px;","shape","rounded-pill",4,"ngIf"],["cListGroupItem","","style","cursor: pointer;padding: 5px 8px;","class","d-flex justify-content-between align-items-center",3,"ngStyle","click","contextmenu",4,"ngFor","ngForOf"],["color","danger","size","sm","shape","rounded-pill",2,"margin","0 0 0 1px"],["color","danger","size","sm","shape","rounded-pill",2,"margin","0 0 0 1px","background-color","#f58c8c !important"],["color","warning","size","sm","shape","rounded-pill",2,"margin","0 0 0 1px"],["cListGroupItem","",1,"d-flex","justify-content-between","align-items-center",2,"cursor","pointer","padding","5px 8px",3,"click","contextmenu","ngStyle"],["style","color:red;--fa-animation-duration: 2s;","class","fa-solid fa-beat",3,"fa-hard-drive","fa-satellite-dish","fa-tower-cell","fa-house-signal","fa-tower-broadcast",4,"ngIf"],["style","color:green","class","fa-solid ",3,"fa-hard-drive","fa-satellite-dish","fa-tower-cell","fa-house-signal","fa-tower-broadcast",4,"ngIf"],[1,"d-flex","alerts-badges",2,"min-width","135px","border-left","1px solid #ccc","height","100%","display","flex","flex-direction","row-reverse"],["color","danger","size","sm","style","margin: 0 0 0 1px;background-color:orangered","shape","rounded-pill",4,"ngIf"],[1,"fa-solid","fa-beat",2,"color","red","--fa-animation-duration","2s"],[1,"fa-solid",2,"color","green"],["color","danger","size","sm","shape","rounded-pill",2,"margin","0 0 0 1px","background-color","orangered"],["style","vertical-align: middle",3,"cTableColor",4,"ngFor","ngForOf"],[2,"vertical-align","middle",3,"cTableColor"],["class","fixed_time",4,"ngIf"],[1,"fixed_time"],["color","danger","style","margin: 0;","size","sm","shape","rounded-pill",4,"ngIf"],["color","success","style","margin: 0;","size","sm","shape","rounded-pill",4,"ngIf"],["color","danger","size","sm","shape","rounded-pill",2,"margin","0"],["color","success","size","sm","shape","rounded-pill",2,"margin","0"],["small","","bordered","","responsive","","hover","","cTable","","oncontextmenu","return false;",2,"margin-bottom","0"],[3,"cTableColor","contextmenu",4,"ngFor","ngForOf"],[3,"contextmenu","cTableColor"],[1,"contextmenu",3,"ngStyle"],[2,"padding","1px"],[2,"text-align","center","font-weight","bold","padding","5px 3px","color","#fff"],["cButton","","size","sm","shape","rounded-0","color","light",2,"padding","0px 10px",3,"click"],[2,"text-align","center","font-weight","bold","color","#fff","background-color","#ccc","font-size","100%"],["cButton","","size","sm","shape","rounded-0","color","light",2,"padding","0px 10px","font-size","0.7rem",3,"click"],[2,"text-align","left"],[1,"fa-solid","fa-hard-drive",2,"color","#fff"],[1,"fa-solid","fa-satellite-dish",2,"color","#fff"],[1,"fa-solid","fa-tower-cell",2,"color","#fff"],[1,"fa-solid","fa-house-signal",2,"color","#fff"],[1,"fa-solid","fa-tower-broadcast",2,"color","#fff"]],template:function(o,l){if(1&o){const r=t.RV6();t.j41(0,"c-row",3),t.bIt("click",function(){return t.eBV(r),t.Njj(l.disableContextMenu())}),t.j41(1,"c-col",4)(2,"c-card",5)(3,"c-card-header")(4,"c-row")(5,"c-col",6),t.EFF(6,"Devices"),t.k0s(),t.j41(7,"c-col",7)(8,"input",8),t.mxI("ngModelChange",function(s){return t.eBV(r),t.DH7(l.devicesearch,s)||(l.devicesearch=s),t.Njj(s)}),t.bIt("ngModelChange",function(){return t.eBV(r),t.Njj(l.filter_device(!1))}),t.k0s()(),t.j41(9,"c-col",9),t.nrm(10,"i",10),t.k0s()()(),t.DNE(11,St,13,7,"c-card-body",11),t.k0s()(),t.j41(12,"c-col",12),t.bIt("click",function(){return t.eBV(r),t.Njj(l.disableContextMenu())}),t.j41(13,"c-card",13)(14,"c-card-header")(15,"c-row")(16,"c-col",14),t.EFF(17,"Alerts past 24 hours"),t.k0s(),t.j41(18,"c-col",15)(19,"c-badge",16),t.bIt("click",function(){return t.eBV(r),t.Njj(l.reload_data())}),t.nrm(20,"i",17),t.EFF(21,"reload"),t.k0s(),t.j41(22,"c-badge",18),t.nrm(23,"i",19),t.EFF(24),t.k0s()()()(),t.j41(25,"c-card-body",20)(26,"ng-scrollbar",null,0)(28,"div",21),t.bIt("scrolledUp",function(s){return t.eBV(r),t.Njj(l.onUp(s))}),t.j41(29,"table",22)(30,"thead")(31,"tr",23)(32,"th",24),t.EFF(33,"#"),t.k0s(),t.j41(34,"th",24),t.EFF(35,"Level"),t.k0s(),t.j41(36,"th",24),t.EFF(37,"Name"),t.k0s(),t.j41(38,"th",24),t.EFF(39,"IP"),t.k0s(),t.j41(40,"th",24),t.EFF(41,"fixed/event time"),t.k0s(),t.j41(42,"th",24),t.EFF(43,"event"),t.k0s(),t.j41(44,"th",24),t.EFF(45,"type"),t.k0s(),t.j41(46,"th",24),t.EFF(47,"source"),t.k0s(),t.j41(48,"th",24),t.EFF(49,"comment"),t.k0s()()(),t.DNE(50,Mt,2,1,"tbody",25),t.k0s()()()()(),t.j41(51,"c-card",26)(52,"c-card-header"),t.EFF(53,"All Active Alerts"),t.k0s(),t.DNE(54,Rt,26,1,"c-card-body",11),t.k0s()()(),t.DNE(55,$t,7,9,"div",25)(56,Dt,9,4,"div",25)(57,Gt,15,0,"ng-template",null,1,t.C5r)}if(2&o){const r=t.sdS(58);t.R7$(8),t.R50("ngModel",l.devicesearch),t.R7$(2),t.Y8G("cTooltip",r),t.R7$(),t.Y8G("ngIf",l.devices),t.R7$(13),t.JRh(l.display),t.R7$(4),t.Y8G("scrollWindow",!1)("infiniteScrollUpDistance",l.scrollUpDistance)("infiniteScrollThrottle",l.throttle),t.R7$(22),t.Y8G("ngIf",l.eventsall),t.R7$(4),t.Y8G("ngIf",l.eventUnfixedsall),t.R7$(),t.Y8G("ngIf",l.contextmenu),t.R7$(),t.Y8G("ngIf",l.contextmainmenu)}},dependencies:[a.iby,a.qHy,a.lMi,b.Sq,b.bT,b.B3,a.gLf,a.oMR,g.me,g.BC,a._fv,g.vS,a.nSt,a.D7j,a.YpC,S.Yh,S.Gl,a.sZU,a.VFc,a.dgQ,at],styles:["[_nghost-%COMP%] .legend[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:x-small}.mdc-line-ripple.mdc-line-ripple--deactivating.ng-star-inserted[_ngcontent-%COMP%]{display:none!important} .main-container{padding:0!important;margin-top:-10px} .header{margin-bottom:.9rem!important}.contextmenu[_ngcontent-%COMP%]{position:absolute}.fixed_time[_ngcontent-%COMP%]{display:flex;flex-direction:column-reverse;padding:1px 0}.alarms24[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-weight:400!important}.fixed_time[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-weight:400;line-height:110%}@media only screen and (max-width: 1600px){.alerts-badges[_ngcontent-%COMP%]{flex-direction:column!important;align-items:flex-start;max-width:50px;align-items:left}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-of-type{min-width:50%}}"]})}return i})(),data:{title:$localize`Monitoring Wall`}}];let Wt=(()=>{class i{static#t=this.\u0275fac=function(o){return new(o||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[T.iI.forChild(Ot),T.iI]})}return i})();var Yt=d(3801);let Xt=(()=>{class i{static#t=this.\u0275fac=function(o){return new(o||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[Wt,a.Dw2,a.L7X,b.MD,a.pc9,a.Emn,g.X1,a.tmq,g.YN,a.tmq,a.ayw,I.u,a.RlG,a.EJq,Yt.FQ,a.OeB,S.Id,a.bGq,a.Ss0,a.v29,ft]})}return i})()},3386:(P,j,d)=>{d.d(j,{c:()=>m});var b=d(3236),g=d(9974),a=d(4360),I=d(8750),T=d(1584);function m(t,_=b.E,E){const u=(0,T.O)(t,_);return function S(t,_){return(0,g.N)((E,u)=>{const{leading:R=!0,trailing:w=!1}=_??{};let v=!1,C=null,f=null,y=!1;const $=()=>{f?.unsubscribe(),f=null,w&&(M(),y&&u.complete())},D=()=>{f=null,y&&u.complete()},F=h=>f=(0,I.Tg)(t(h)).subscribe((0,a._)(u,$,D)),M=()=>{if(v){v=!1;const h=C;C=null,u.next(h),!y&&F(h)}};E.subscribe((0,a._)(u,h=>{v=!0,C=h,(!f||f.closed)&&(R?M():F(h))},()=>{y=!0,(!(w&&v&&f)||f.closed)&&u.complete()}))})}(()=>u,E)}}}]);