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
2 lines • 3.34 kB
JavaScript
import{d as L}from"./main-OCJB5534.js";import{Di as wf,Dn as _y,Dt as Qe,In as by,It as Sn,Lt as Sy,T as Ee,in as Wa,mn as YQ,wn as _e}from"./chunk-CHqDEyfr.js";import{t as Q}from"./chunk-CyniViPG.js";import{n as bi}from"./chunk-DjVJBOYc.js";import"./chunk-CWEwaFv9.js";import"./chunk-CyaMV1f5.js";import{t as It}from"./chunk-BM0xjj91.js";import"./chunk-CFyh5uM7.js";import{t as Oe}from"./chunk-HfFSBPyS2.js";import{n as dn,r as ke,t as cn}from"./chunk-BGfsWqQT2.js";import{i as gr,r as X,t as $}from"./chunk-CARSOUZ02.js";var N=(()=>{class o{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,m,a,j){this.i18n=t,this.router=n,this.socket=e,this.common=m,this.data=a,this.state=j,this.strings=this.i18n.strings}ngOnInit(){this.syncTab(this.router.url),this.routerSub=this.router.events.pipe(_e(t=>t instanceof $)).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 L(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 ɵfac=function(n){return new(n||o)(Qe(YQ),Qe(X),Qe(bi),Qe(It),Qe(Oe),Qe(Q))};static ɵcmp=Ee({type:o,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){n&1&&(Wa(0,`div`,0)(1,`mat-tab-group`,1),Sy(`selectedIndexChange`,function(a){return e.onTabChange(a)}),_y(2,`mat-tab`,2)(3,`mat-tab`,2)(4,`mat-tab`,2)(5,`mat-tab`,2),wf(),Wa(6,`div`,3),_y(7,`router-outlet`),wf()()),n&2&&(Sn(),by(`selectedIndex`,e.selectedTab),Sn(),by(`label`,e.strings().intention?.pulse),Sn(),by(`label`,e.strings().intention?.profiler),Sn(),by(`label`,e.strings().intention?.pubsubMonitor),Sn(),by(`label`,e.strings().intention?.memoryAnalysis))},dependencies:[gr,cn,ke,dn],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(--%NS%p3xr-content-bg, #303030)!important}.p3xr-monitoring-shell-content{flex:1;overflow-y:auto;min-height:0;padding:5px}
`],encapsulation:2,changeDetection:1})}return o})();export{N as MonitoringShellComponent};