UNPKG

p3x-redis-ui-material

Version:

💿 P3X Redis UI triple frontend — Angular + React/MUI + Vue/Vuetify with 54 languages, 7 themes, Socket.IO, desktop notifications, and full feature parity

3 lines (2 loc) • 3.38 kB
import{a as j}from"./chunk-6B7LFLHT.js";import{a as C,b as M,c as k}from"./chunk-7WXMB5WL.js";import{a as v,c as S,d as y}from"./chunk-DET2MY23.js";import{c as _}from"./chunk-VQTCYUQY.js";import{e as I}from"./chunk-TKRAWHQA.js";import{b as x}from"./chunk-W32HPWBA.js";import"./chunk-NZJKKTDQ.js";import"./chunk-YA4NX3C4.js";import"./chunk-PFG3GPGC.js";import{Da as i,Ia as g,Rd as T,bb as o,cb as m,db as h,eb as p,lb as f,x as b,xa as s}from"./chunk-MHKTEXY5.js";import"./chunk-ENGD2CVB.js";import{h as d}from"./chunk-O7S4L63H.js";var F=(()=>{class l{i18n;router;socket;common;data;state;strings;selectedTab=0;routes=["/monitoring","/monitoring/profiler","/monitoring/pubsub","/monitoring/analysis"];routerSub;subs=[];servicesStarted=!1;constructor(t,n,e,a,r,c){this.i18n=t,this.router=n,this.socket=e,this.common=a,this.data=r,this.state=c,this.strings=this.i18n.strings}ngOnInit(){this.syncTab(this.router.url),this.routerSub=this.router.events.pipe(b(t=>t instanceof v)).subscribe(t=>this.syncTab(t.urlAfterRedirects)),this.subs.push(this.socket.redisDisconnected$.subscribe(()=>{this.router.navigate(["/settings"])})),this.state.connection()?this.initServices():this.subs.push(this.socket.stateChanged$.subscribe(()=>{this.state.connection()&&!this.servicesStarted&&this.initServices()}))}ngOnDestroy(){this.data.stopProfiler(),this.data.stopPubSub(),this.data.destroy(),this.routerSub?.unsubscribe(),this.subs.forEach(t=>t.unsubscribe())}initServices(){this.servicesStarted=!0,this.data.init(this.socket,()=>this.i18n.currentLang()),this.startServices()}startServices(){return d(this,null,function*(){try{yield this.data.startProfiler()}catch(t){this.common.generalHandleError(t)}try{yield this.data.startPubSub()}catch(t){this.common.generalHandleError(t)}})}onTabChange(t){t>=0&&t<this.routes.length&&this.router.navigate([this.routes[t]])}syncTab(t){t.startsWith("/monitoring/profiler")?this.selectedTab=1:t.startsWith("/monitoring/pubsub")?this.selectedTab=2:t.startsWith("/monitoring/analysis")?this.selectedTab=3:this.selectedTab=0}static \u0275fac=function(n){return new(n||l)(i(T),i(y),i(_),i(I),i(j),i(x))};static \u0275cmp=g({type:l,selectors:[["p3xr-monitoring-shell"]],decls:8,vars:5,consts:[[1,"p3xr-monitoring-shell-container"],[1,"p3xr-monitoring-tabs",3,"selectedIndexChange","selectedIndex"],[3,"label"],[1,"p3xr-monitoring-shell-content"]],template:function(n,e){if(n&1&&(m(0,"div",0)(1,"mat-tab-group",1),f("selectedIndexChange",function(r){return e.onTabChange(r)}),p(2,"mat-tab",2)(3,"mat-tab",2)(4,"mat-tab",2)(5,"mat-tab",2),h(),m(6,"div",3),p(7,"router-outlet"),h()()),n&2){let a,r,c,u;s(),o("selectedIndex",e.selectedTab),s(),o("label",(a=e.strings().intention)==null?null:a.pulse),s(),o("label",(r=e.strings().intention)==null?null:r.profiler),s(),o("label",(c=e.strings().intention)==null?null:c.pubsubMonitor),s(),o("label",(u=e.strings().intention)==null?null:u.memoryAnalysis)}},dependencies:[S,k,C,M],styles:[`p3xr-monitoring-shell{display:block;height:100%}.p3xr-monitoring-shell-container{display:flex;flex-direction:column;height:100%;margin:-5px}.p3xr-monitoring-tabs{flex-shrink:0}.p3xr-monitoring-tabs>.mat-mdc-tab-header{background-color:var(--p3xr-content-bg, #303030)!important}.p3xr-monitoring-shell-content{flex:1;overflow-y:auto;min-height:0;padding:5px} `],encapsulation:2})}return l})();export{F as MonitoringShellComponent};