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

12 lines • 53 kB
import {O as Oe$1}from'./chunk-BITan0Uq.js';import {X as Xe$1,f as fQ,b as bi,G as It,L as uc,V as N,a9 as q,Q,_ as _e$1,m as mb,aJ as jn,cO as kn,cP as Tn,cQ as pt,bd as On,be as tn,y as yt,w as wt,e as aY,i as Qt$1,j as gt,a as f,u,Y as Yt,W as Wt$1,Z as Zt$1,bc as Ut,ba as qe$1,cp as q$1,ck as Ve$1,cl as Be$1,aM as lt,cR as FM,n as no,r as ro,c as In,a$ as rc,b0 as Df,b1 as Ef,B as Ba,I as IS,v as vf,J as JT,R as Rv,x as YT,k as bv,z as fm,A as pm,h as hv,cK as FS,H as HT,p as pv,aN as Ov,t as If,cS as BS,U as UT,cr as Lv,cu as AS,bj as Mx,cs as Fv,bk as Nx,cT as Pv,cU as kv}from'./chunk-BwlFOdbx.js';import {X}from'./chunk-DeaQoucA.js';import {L}from'./main-HNF44SV3.js';var Qt=["memoryChart"],Zt=["opsChart"],Gt=["clientsChart"],Jt=["networkChart"],qt=(o,m)=>m.id,Xt=(o,m)=>m.db,te=(o,m)=>m.name,ee=(o,m)=>m.key,ie=(o,m)=>m.slot,ne=(o,m)=>m.master.id;function oe(o,m){if(o&1&&(Ba(0,"div",4)(1,"mat-icon"),IS(2,"hourglass_empty"),vf(),Ba(3,"span"),IS(4),vf()()),o&2){let t=JT();In(4),Rv(t.strings().label?.loading);}}function re(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",11)(2,"div",12),IS(3),vf(),Ba(4,"div",13),IS(5),vf()()(),hv(6,"mat-divider")),o&2){let t=JT(3);In(3),Rv(t.strings().page?.monitor?.os),In(2),Rv(t.serverInfo.os);}}function ae(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",11)(2,"div",12),IS(3),vf(),Ba(4,"div",13),IS(5),vf()()(),hv(6,"mat-divider")),o&2){let t=JT(3);In(3),Rv(t.strings().page?.monitor?.port),In(2),Rv(t.serverInfo.port);}}function se(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",11)(2,"div",12),IS(3),vf(),Ba(4,"div",13),IS(5),vf()()(),hv(6,"mat-divider")),o&2){let t=JT(3);In(3),Rv(t.strings().page?.monitor?.pid),In(2),Rv(t.serverInfo.pid);}}function le(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",11)(2,"div",12),IS(3),vf(),Ba(4,"div",13),IS(5),vf()()(),hv(6,"mat-divider")),o&2){let t=JT(3);In(3),Rv(t.strings().page?.monitor?.configFile),In(2),Rv(t.serverInfo.configFile);}}function ce(o,m){if(o&1){let t=YT();hv(0,"br"),Ba(1,"p3xr-ng-accordion",27)(2,"div",6)(3,"p3xr-ng-button",8),bv("click",function(i){return fm(t),JT(2).exportServerInfo(),pm(i.stopPropagation())}),vf()(),Ba(4,"div",10)(5,"mat-list"),no(6,re,7,2),no(7,ae,7,2),no(8,se,7,2),no(9,le,7,2),Ba(10,"mat-list-item")(11,"div",11)(12,"div",12),IS(13),vf(),Ba(14,"div",13),IS(15),vf()()(),hv(16,"mat-divider"),Ba(17,"mat-list-item")(18,"div",11)(19,"div",12),IS(20),vf(),Ba(21,"div",13),IS(22),vf()()()()()();}if(o&2){let t=JT(2);In(),pv("title",t.strings().page?.monitor?.serverInfo),In(2),pv("label",t.strings().intention?.export),In(3),ro(t.serverInfo.os?6:-1),In(),ro(t.serverInfo.port?7:-1),In(),ro(t.serverInfo.pid?8:-1),In(),ro(t.serverInfo.configFile?9:-1),In(4),If("",t.strings().page?.monitor?.cpuSys," CPU"),In(2),Rv(t.serverInfo.cpuSys),In(5),If("",t.strings().page?.monitor?.cpuUser," CPU"),In(2),Rv(t.serverInfo.cpuUser);}}function de(o,m){if(o&1&&(hv(0,"mat-divider"),Ba(1,"mat-list-item")(2,"div",11)(3,"div",12),IS(4),vf(),Ba(5,"div",13),IS(6),vf()()()),o&2){let t=JT(3);In(4),Rv(t.strings().page?.monitor?.aofSize),In(2),Rv(t.persistenceInfo.aofSize);}}function me(o,m){if(o&1){let t=YT();hv(0,"br"),Ba(1,"p3xr-ng-accordion",28)(2,"div",6)(3,"p3xr-ng-button",8),bv("click",function(i){return fm(t),JT(2).exportPersistence(),pm(i.stopPropagation())}),vf()(),Ba(4,"div",10)(5,"mat-list")(6,"mat-list-item")(7,"div",11)(8,"div",12),IS(9),vf(),Ba(10,"div",13),IS(11),vf()()(),hv(12,"mat-divider"),Ba(13,"mat-list-item")(14,"div",11)(15,"div",12),IS(16),vf(),Ba(17,"div",13),IS(18),vf()()(),hv(19,"mat-divider"),Ba(20,"mat-list-item")(21,"div",11)(22,"div",12),IS(23),vf(),Ba(24,"div",13),IS(25),vf()()(),hv(26,"mat-divider"),Ba(27,"mat-list-item")(28,"div",11)(29,"div",12),IS(30),vf(),Ba(31,"div",13),IS(32),vf()()(),no(33,de,7,2),vf()()();}if(o&2){let t=JT(2);In(),pv("title",t.strings().page?.monitor?.persistence),In(2),pv("label",t.strings().intention?.export),In(6),Rv(t.strings().page?.monitor?.rdbLastSave),In(2),Rv(t.persistenceInfo.rdbLastSave),In(5),Rv(t.strings().page?.monitor?.rdbStatus),In(2),Rv(t.persistenceInfo.rdbStatus),In(5),Rv(t.strings().page?.monitor?.rdbChanges),In(2),Rv(t.persistenceInfo.rdbChanges),In(5),Rv(t.strings().page?.monitor?.aofEnabled),In(2),Rv(t.persistenceInfo.aofEnabled),In(),ro(t.persistenceInfo.aofSize?33:-1);}}function pe(o,m){if(o&1&&(hv(0,"mat-divider"),Ba(1,"mat-list-item")(2,"div",11)(3,"div",12),IS(4),vf(),Ba(5,"div",13),IS(6),vf()()()),o&2){let t=JT(3);In(4),Rv(t.strings().page?.monitor?.replicas),In(2),Rv(t.replicationInfo.replicas);}}function xe(o,m){if(o&1&&(hv(0,"mat-divider"),Ba(1,"mat-list-item")(2,"div",11)(3,"div",12),IS(4),vf(),Ba(5,"div",13),IS(6),vf()()()),o&2){let t=JT(3);In(4),Rv(t.strings().page?.monitor?.masterHost),In(2),Ov("",t.replicationInfo.masterHost,":",t.replicationInfo.masterPort);}}function he(o,m){if(o&1&&(hv(0,"mat-divider"),Ba(1,"mat-list-item")(2,"div",11)(3,"div",12),IS(4),vf(),Ba(5,"div",13),IS(6),vf()()()),o&2){let t=JT(3);In(4),Rv(t.strings().page?.monitor?.linkStatus),In(2),Rv(t.replicationInfo.linkStatus);}}function ue(o,m){if(o&1){let t=YT();hv(0,"br"),Ba(1,"p3xr-ng-accordion",29)(2,"div",6)(3,"p3xr-ng-button",8),bv("click",function(i){return fm(t),JT(2).exportReplication(),pm(i.stopPropagation())}),vf()(),Ba(4,"div",10)(5,"mat-list")(6,"mat-list-item")(7,"div",11)(8,"div",12),IS(9),vf(),Ba(10,"div",13),IS(11),vf()()(),no(12,pe,7,2),no(13,xe,7,3),no(14,he,7,2),vf()()();}if(o&2){let t=JT(2);In(),pv("title",t.strings().page?.monitor?.replication),In(2),pv("label",t.strings().intention?.export),In(6),Rv(t.strings().page?.monitor?.role),In(2),Rv(t.replicationInfo.role),In(),ro(t.replicationInfo.replicas!==void 0?12:-1),In(),ro(t.replicationInfo.masterHost?13:-1),In(),ro(t.replicationInfo.linkStatus?14:-1);}}function _e(o,m){o&1&&hv(0,"mat-divider");}function ge(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",11)(2,"div",12),IS(3),vf(),Ba(4,"div",13),IS(5),vf()()(),no(6,_e,1,0,"mat-divider")),o&2){let t=m.$implicit,e=m.$index,i=m.$count,s=JT(3);In(3),Rv(t.db),In(2),Pv("",s.strings().page?.monitor?.keys,": ",t.keys," \xB7 ",s.strings().page?.monitor?.expires,": ",t.expires),In(),ro(e!==i-1?6:-1);}}function fe(o,m){if(o&1){let t=YT();hv(0,"br"),Ba(1,"p3xr-ng-accordion",30)(2,"div",6)(3,"p3xr-ng-button",8),bv("click",function(i){return fm(t),JT(2).exportKeyspace(),pm(i.stopPropagation())}),vf()(),Ba(4,"div",10)(5,"mat-list"),HT(6,ge,7,6,null,null,Xt),vf()()();}if(o&2){let t=JT(2);In(),pv("title",t.strings().page?.monitor?.keyspace),In(2),pv("label",t.strings().intention?.export),In(3),UT(t.keyspaceEntries);}}function Ce(o,m){if(o&1&&(Ba(0,"div",15),IS(1),vf()),o&2){let t=JT(2);In(),Rv(t.strings().page?.monitor?.noModules);}}function ve(o,m){o&1&&hv(0,"mat-divider");}function ye(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",11)(2,"div",12),IS(3),vf(),Ba(4,"div",13),IS(5),vf()()(),no(6,ve,1,0,"mat-divider")),o&2){let t=m.$implicit,e=m.$index,i=m.$count;In(3),Rv(t.name),In(2),If("v",t.ver),In(),ro(e!==i-1?6:-1);}}function be(o,m){if(o&1&&(Ba(0,"mat-list"),HT(1,ye,7,3,null,null,te),vf()),o&2){let t=JT(2);In(),UT(t.modulesList);}}function Se(o,m){if(o&1){let t=YT();Ba(0,"p3xr-ng-button",31),bv("click",function(i){return fm(t),JT(2).resetSlowLog(),pm(i.stopPropagation())}),vf();}}function $e(o,m){if(o&1&&(Ba(0,"div",23),IS(1),vf()),o&2){let t=JT(2);In(),If(" ",t.strings().page?.monitor?.noSlowQueries," ");}}function we(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",32)(2,"kbd",33),IS(3),vf(),Ba(4,"span",34),IS(5),vf()()(),hv(6,"mat-divider")),o&2){let t=m.$implicit;In(3),If("",t.duration,"\xB5s"),In(2),Rv(t.command);}}function ke(o,m){if(o&1){let t=YT();Ba(0,"p3xr-ng-button",35),bv("click",function(i){return fm(t),JT(2).loadClientList(),pm(i.stopPropagation())}),vf();}if(o&2){let t=JT(2);pv("label",t.strings().intention?.refresh);}}function Ie(o,m){if(o&1&&(Ba(0,"div",15),IS(1),vf()),o&2){let t=JT(2);In(),Rv(t.strings().page?.monitor?.noClients);}}function Ee(o,m){if(o&1&&(Ba(0,"div",15),IS(1),vf()),o&2){let t=JT(2);In(),Rv(t.strings().label?.loading);}}function Te(o,m){if(o&1&&(Ba(0,"span",38),IS(1),vf()),o&2){let t=JT().$implicit;In(),If("(",t.name,")");}}function Me(o,m){if(o&1){let t=YT();Ba(0,"mat-icon",41),bv("click",function(i){fm(t);let s=JT().$implicit,l=JT(3);return pm(l.killClient(s.id,i))}),IS(1,"close"),vf();}if(o&2){let t=JT(4);pv("matTooltip",t.strings().page?.monitor?.killClient);}}function Re(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",36)(2,"span",37),IS(3),vf(),no(4,Te,2,1,"span",38),Ba(5,"span",39),IS(6),vf(),no(7,Me,2,1,"mat-icon",40),vf()(),hv(8,"mat-divider")),o&2){let t=m.$implicit,e=JT(3);In(3),Rv(t.addr),In(),ro(t.name?4:-1),In(2),kv(" db",t.db," \xB7 ",t.cmd," \xB7 ",t.idle,"s "),In(),ro(e.isReadonly?-1:7);}}function Pe(o,m){if(o&1&&(Ba(0,"mat-list"),HT(1,Re,9,6,null,null,qt),vf()),o&2){let t=JT(2);In(),UT(t.clientList);}}function Le(o,m){if(o&1){let t=YT();Ba(0,"p3xr-ng-button",35),bv("click",function(i){return fm(t),JT(2).loadTopKeys(),pm(i.stopPropagation())}),vf();}if(o&2){let t=JT(2);pv("label",t.strings().intention?.refresh);}}function Ke(o,m){if(o&1&&(Ba(0,"div",15),IS(1),vf()),o&2){let t=JT(2);In(),Rv(t.strings().page?.monitor?.noKeys);}}function Ve(o,m){if(o&1&&(Ba(0,"div",15),IS(1),vf()),o&2){let t=JT(2);In(),Rv(t.strings().label?.loading);}}function Fe(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",11)(2,"div",12)(3,"span",42),IS(4),vf(),Ba(5,"span",43),IS(6),vf()(),Ba(7,"div",13),IS(8),vf()()(),hv(9,"mat-divider")),o&2){let t=m.$implicit,e=m.$index,i=JT(3);In(4),If("#",e+1),In(2),Rv(t.key),In(2),Rv(i.formatBytes(t.bytes));}}function Be(o,m){if(o&1&&(Ba(0,"mat-list"),HT(1,Fe,10,3,null,null,ee),vf()),o&2){let t=JT(2);In(),UT(t.topKeys);}}function ze(o,m){o&1&&(Ba(0,"div",15),IS(1,"No slot data"),vf());}function De(o,m){if(o&1&&IS(0),o&2){let t=JT().$implicit;If(" ",t["key-count"]," keys ");}}function He(o,m){if(o&1&&IS(0),o&2){let t=JT().$implicit;If(" ",t["cpu-usec"]," \u03BCs ");}}function Oe(o,m){if(o&1&&IS(0),o&2){let t=JT().$implicit,e=JT(4);If(" ",e.formatBytes(t["memory-bytes"])," ");}}function Ue(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",11)(2,"div",12)(3,"span",42),IS(4),vf(),Ba(5,"span",51),IS(6),vf()(),Ba(7,"div",13),no(8,De,1,1),no(9,He,1,1),no(10,Oe,1,1),vf()()(),hv(11,"mat-divider")),o&2){let t=m.$implicit,e=m.$index,i=JT(4);In(4),If("#",e+1),In(2),If("Slot ",t.slot),In(2),ro(i.slotStatsMetric==="KEY-COUNT"?8:-1),In(),ro(i.slotStatsMetric==="CPU-USEC"?9:-1),In(),ro(i.slotStatsMetric==="MEMORY-BYTES"?10:-1);}}function Ae(o,m){if(o&1&&(Ba(0,"mat-list"),HT(1,Ue,12,5,null,null,ie),vf()),o&2){let t=JT(3);In(),UT(t.slotStats);}}function je(o,m){if(o&1){let t=YT();hv(0,"br"),Ba(1,"p3xr-ng-accordion",44)(2,"div",6)(3,"p3xr-ng-button",35),bv("click",function(i){return fm(t),JT(2).loadSlotStats(),pm(i.stopPropagation())}),vf()(),Ba(4,"div",10)(5,"div",45)(6,"mat-form-field",46)(7,"mat-label"),IS(8,"Metric"),vf(),Ba(9,"select",47),Lv("ngModelChange",function(i){fm(t);let s=JT(2);return AS(s.slotStatsMetric,i)||(s.slotStatsMetric=i),pm(i)}),bv("change",function(){fm(t);let i=JT(2);return pm(i.loadSlotStats())}),Ba(10,"option",48),IS(11,"Key Count"),vf(),Ba(12,"option",49),IS(13,"CPU (\u03BCs)"),vf(),Ba(14,"option",50),IS(15,"Memory (bytes)"),vf()(),Mx(),vf()(),no(16,ze,2,0,"div",15),no(17,Ae,3,0,"mat-list"),vf()();}if(o&2){let t=JT(2);In(),pv("title",t.strings().page?.monitor?.slotStats),In(2),pv("label",t.strings().intention?.refresh),In(6),Fv("ngModel",t.slotStatsMetric),Nx(),In(7),ro(t.slotStats.length===0&&t.slotStatsLoaded?16:-1),In(),ro(t.slotStats.length>0?17:-1);}}function Ne(o,m){if(o&1){let t=YT();Ba(0,"p3xr-ng-button",35),bv("click",function(i){return fm(t),JT(3).loadClusterShards(),pm(i.stopPropagation())}),vf();}if(o&2){let t=JT(3);pv("label",t.strings().intention?.refresh);}}function We(o,m){if(o&1&&(Ba(0,"div",23),IS(1),vf()),o&2){let t=JT(3);In(),If(" ",t.strings().page?.monitor?.noClusterData," ");}}function qe(o,m){if(o&1&&(Ba(0,"span",56),IS(1),vf()),o&2){let t=JT().$implicit,e=JT(4);In(),If("(",e.formatReplicas(t),")");}}function Ye(o,m){if(o&1&&(Ba(0,"mat-list-item")(1,"div",11)(2,"div",12)(3,"span",54),IS(4),vf(),Ba(5,"span",55),IS(6),vf()(),Ba(7,"div",13),IS(8),no(9,qe,2,1,"span",56),vf()()(),hv(10,"mat-divider")),o&2){let t=m.$implicit,e=JT(4);In(4),Ov("",t.master.host,":",t.master.port),In(2),If(" ",e.formatSlotRanges(t)," "),In(2),Ov(" ",e.getSlotCount(t)," ",e.strings().page?.monitor?.totalSlots," "),In(),ro(t.replicas.length>0?9:-1);}}function Qe(o,m){if(o&1&&(Ba(0,"mat-list"),HT(1,Ye,11,6,null,null,ne),vf(),Ba(3,"div",53),IS(4),vf()),o&2){let t=JT(3);In(),UT(t.clusterShards),In(3),If(" 16384 slots across ",t.clusterShards.length," masters ");}}function Ze(o,m){if(o&1){let t=YT();hv(0,"br"),Ba(1,"p3xr-ng-accordion",52)(2,"div",6)(3,"p3xr-ng-button",7),bv("click",function(i){return fm(t),JT(2).toggleAutoRefreshShards(),pm(i.stopPropagation())}),vf(),no(4,Ne,1,1,"p3xr-ng-button",25),Ba(5,"p3xr-ng-button",8),bv("click",function(i){return fm(t),JT(2).exportClusterSlots(),pm(i.stopPropagation())}),vf()(),Ba(6,"div",10),no(7,We,2,1,"div",23)(8,Qe,5,1),vf()();}if(o&2){let t=JT(2);In(),pv("title",t.strings().page?.monitor?.clusterSlotMap),In(2),pv("label",t.strings().label?.autoRefresh)("mdIcon",t.autoRefreshShards?"check_box":"check_box_outline_blank"),In(),ro(t.autoRefreshShards?-1:4),In(),pv("label",t.strings().intention?.export),In(2),ro(t.clusterShards?8:7);}}function Ge(o,m){if(o&1){let t=YT();Ba(0,"p3xr-ng-accordion",5)(1,"div",6)(2,"p3xr-ng-button",7),bv("click",function(i){return fm(t),JT().togglePause(),pm(i.stopPropagation())}),vf(),Ba(3,"p3xr-ng-button",8),bv("click",function(i){return fm(t),JT().exportOverview(),pm(i.stopPropagation())}),vf(),Ba(4,"p3xr-ng-button",9),bv("click",function(i){return fm(t),JT().exportAll(),pm(i.stopPropagation())}),vf()(),Ba(5,"div",10)(6,"mat-list")(7,"mat-list-item")(8,"div",11)(9,"div",12),IS(10),vf(),Ba(11,"div",13),IS(12),vf()()(),hv(13,"mat-divider"),Ba(14,"mat-list-item")(15,"div",11)(16,"div",12),IS(17),vf(),Ba(18,"div",13),IS(19),vf()()(),hv(20,"mat-divider"),Ba(21,"mat-list-item")(22,"div",11)(23,"div",12),IS(24),vf(),Ba(25,"div",13),IS(26),vf()()(),hv(27,"mat-divider"),Ba(28,"mat-list-item")(29,"div",11)(30,"div",12),IS(31),vf(),Ba(32,"div",13),IS(33),vf()()(),hv(34,"mat-divider"),Ba(35,"mat-list-item")(36,"div",11)(37,"div",12),IS(38),vf(),Ba(39,"div",13),IS(40),vf()()(),hv(41,"mat-divider"),Ba(42,"mat-list-item")(43,"div",11)(44,"div",12),IS(45),vf(),Ba(46,"div",13),IS(47),vf()()(),hv(48,"mat-divider"),Ba(49,"mat-list-item")(50,"div",11)(51,"div",12),IS(52),vf(),Ba(53,"div",13),IS(54),vf()()(),hv(55,"mat-divider"),Ba(56,"mat-list-item")(57,"div",11)(58,"div",12),IS(59),vf(),Ba(60,"div",13),IS(61),vf()()(),hv(62,"mat-divider"),Ba(63,"mat-list-item")(64,"div",11)(65,"div",12),IS(66),vf(),Ba(67,"div",13),IS(68),vf()()(),hv(69,"mat-divider"),Ba(70,"mat-list-item")(71,"div",11)(72,"div",12),IS(73),vf(),Ba(74,"div",13),IS(75),vf()()(),hv(76,"mat-divider"),Ba(77,"mat-list-item")(78,"div",11)(79,"div",12),IS(80),vf(),Ba(81,"div",13),IS(82),vf()()(),hv(83,"mat-divider"),Ba(84,"mat-list-item")(85,"div",11)(86,"div",12),IS(87),vf(),Ba(88,"div",13),IS(89),FS(90,"number"),FS(91,"number"),vf()()(),hv(92,"mat-divider"),Ba(93,"mat-list-item")(94,"div",11)(95,"div",12),IS(96),vf(),Ba(97,"div",13),IS(98),vf()()(),hv(99,"mat-divider"),Ba(100,"mat-list-item")(101,"div",11)(102,"div",12),IS(103),vf(),Ba(104,"div",13),IS(105),vf()()()()()(),no(106,ce,23,10),no(107,me,34,11),no(108,ue,15,7),no(109,fe,8,2),hv(110,"br"),Ba(111,"p3xr-ng-accordion",14)(112,"div",6)(113,"p3xr-ng-button",8),bv("click",function(i){return fm(t),JT().exportModules(),pm(i.stopPropagation())}),vf()(),Ba(114,"div",10),no(115,Ce,2,1,"div",15),no(116,be,3,0,"mat-list"),vf()(),hv(117,"br"),Ba(118,"p3xr-ng-accordion",16)(119,"div",6)(120,"p3xr-ng-button",8),bv("click",function(i){fm(t);let s=JT();return s.exportChart(s.memoryChartRef,"memory"),pm(i.stopPropagation())}),vf()(),Ba(121,"div",10),hv(122,"div",17,0),vf()(),hv(124,"br"),Ba(125,"p3xr-ng-accordion",18)(126,"div",6)(127,"p3xr-ng-button",8),bv("click",function(i){fm(t);let s=JT();return s.exportChart(s.opsChartRef,"ops"),pm(i.stopPropagation())}),vf()(),Ba(128,"div",10),hv(129,"div",17,1),vf()(),hv(131,"br"),Ba(132,"p3xr-ng-accordion",19)(133,"div",6)(134,"p3xr-ng-button",8),bv("click",function(i){fm(t);let s=JT();return s.exportChart(s.clientsChartRef,"clients"),pm(i.stopPropagation())}),vf()(),Ba(135,"div",10),hv(136,"div",17,2),vf()(),hv(138,"br"),Ba(139,"p3xr-ng-accordion",20)(140,"div",6)(141,"p3xr-ng-button",8),bv("click",function(i){fm(t);let s=JT();return s.exportChart(s.networkChartRef,"network"),pm(i.stopPropagation())}),vf()(),Ba(142,"div",10),hv(143,"div",17,3),vf()(),hv(145,"br"),Ba(146,"p3xr-ng-accordion",21)(147,"div",6),no(148,Se,1,0,"p3xr-ng-button",22),Ba(149,"p3xr-ng-button",8),bv("click",function(i){return fm(t),JT().exportSlowLog(),pm(i.stopPropagation())}),vf()(),Ba(150,"div",10),no(151,$e,2,1,"div",23),Ba(152,"mat-list"),HT(153,we,7,2,null,null,qt),vf()()(),hv(155,"br"),Ba(156,"p3xr-ng-accordion",24)(157,"div",6)(158,"p3xr-ng-button",7),bv("click",function(i){return fm(t),JT().toggleAutoRefreshClients(),pm(i.stopPropagation())}),vf(),no(159,ke,1,1,"p3xr-ng-button",25),Ba(160,"p3xr-ng-button",8),bv("click",function(i){return fm(t),JT().exportClientList(),pm(i.stopPropagation())}),vf()(),Ba(161,"div",10),no(162,Ie,2,1,"div",15),no(163,Ee,2,1,"div",15),no(164,Pe,3,0,"mat-list"),vf()(),hv(165,"br"),Ba(166,"p3xr-ng-accordion",26)(167,"div",6)(168,"p3xr-ng-button",7),bv("click",function(i){return fm(t),JT().toggleAutoRefreshTopKeys(),pm(i.stopPropagation())}),vf(),no(169,Le,1,1,"p3xr-ng-button",25),Ba(170,"p3xr-ng-button",8),bv("click",function(i){return fm(t),JT().exportTopKeys(),pm(i.stopPropagation())}),vf()(),Ba(171,"div",10),no(172,Ke,2,1,"div",15),no(173,Ve,2,1,"div",15),no(174,Be,3,0,"mat-list"),vf()(),no(175,je,18,5),no(176,Ze,9,6);}if(o&2){let t=JT();pv("title",t.strings().page?.monitor?.title),In(2),pv("label",t.paused?t.strings().intention?.resume:t.strings().intention?.pause)("mdIcon",t.paused?"play_arrow":"pause"),In(),pv("label",t.strings().intention?.export),In(),pv("label",t.strings().page?.analysis?.exportAll),In(6),Ov("Redis ",t.current.server.version," \xB7 ",t.current.server.mode),In(2),Rv(t.uptimeFormatted),In(5),Rv(t.strings().page?.monitor?.memory),In(2),Rv(t.current.memory.usedHuman),In(5),Rv(t.strings().page?.monitor?.rss),In(2),Rv(t.current.memory.rssHuman),In(5),Rv(t.strings().page?.monitor?.peak),In(2),Rv(t.current.memory.peakHuman),In(5),Rv(t.strings().page?.monitor?.fragmentation),In(2),If("",t.current.memory.fragRatio,"x"),In(5),Rv(t.strings().page?.monitor?.opsPerSec),In(2),Rv(t.current.stats.opsPerSec),In(5),Rv(t.strings().page?.monitor?.totalCommands),In(2),Rv(t.current.stats.totalCommands),In(5),Rv(t.strings().page?.monitor?.clients),In(2),Rv(t.current.clients.connected),In(5),Rv(t.strings().page?.monitor?.blocked),In(2),Rv(t.current.clients.blocked),In(5),Rv(t.strings().page?.monitor?.hitsMisses),In(2),If("",t.current.stats.hitRate,"%"),In(5),Rv(t.strings().page?.monitor?.hitsAndMisses),In(2),Ov("",t.current.stats.hits," / ",t.current.stats.misses),In(5),Rv(t.strings().page?.monitor?.networkIo),In(2),Ov("",BS(90,74,t.current.stats.inputKbps,"1.1-1")," / ",BS(91,77,t.current.stats.outputKbps,"1.1-1")," KB/s"),In(7),Rv(t.strings().page?.monitor?.expired),In(2),Rv(t.current.stats.expiredKeys),In(5),Rv(t.strings().page?.monitor?.evicted),In(2),Rv(t.current.stats.evictedKeys),In(),ro(t.serverInfo?106:-1),In(),ro(t.persistenceInfo?107:-1),In(),ro(t.replicationInfo?108:-1),In(),ro(t.keyspaceEntries.length>0?109:-1),In(2),pv("title",t.strings().page?.monitor?.modules),In(2),pv("label",t.strings().intention?.export),In(2),ro(t.modulesList.length===0?115:-1),In(),ro(t.modulesList.length>0?116:-1),In(2),pv("title",t.strings().page?.monitor?.memory+" (MB)"),In(2),pv("label",t.strings().intention?.export),In(5),pv("title",t.strings().page?.monitor?.opsPerSec),In(2),pv("label",t.strings().intention?.export),In(5),pv("title",t.strings().page?.monitor?.clients),In(2),pv("label",t.strings().intention?.export),In(5),pv("title",t.strings().page?.monitor?.networkIo+" (KB/s)"),In(2),pv("label",t.strings().intention?.export),In(5),pv("title",t.strings().page?.monitor?.slowLog),In(2),ro(t.isReadonly?-1:148),In(),pv("label",t.strings().intention?.export),In(2),ro(t.current.slowlog.length===0?151:-1),In(2),UT(t.current.slowlog),In(3),pv("title",t.strings().page?.monitor?.clientList),In(2),pv("label",t.strings().label?.autoRefresh)("mdIcon",t.autoRefreshClients?"check_box":"check_box_outline_blank"),In(),ro(t.autoRefreshClients?-1:159),In(),pv("label",t.strings().intention?.export),In(2),ro(t.clientList.length===0&&t.clientListLoaded?162:-1),In(),ro(t.clientList.length===0&&!t.clientListLoaded?163:-1),In(),ro(t.clientList.length>0?164:-1),In(2),pv("title",t.strings().page?.monitor?.topKeys),In(2),pv("label",t.strings().label?.autoRefresh)("mdIcon",t.autoRefreshTopKeys?"check_box":"check_box_outline_blank"),In(),ro(t.autoRefreshTopKeys?-1:169),In(),pv("label",t.strings().intention?.export),In(2),ro(t.topKeys.length===0&&t.topKeysLoaded?172:-1),In(),ro(t.topKeys.length===0&&!t.topKeysLoaded?173:-1),In(),ro(t.topKeys.length>0?174:-1),In(),ro(t.isCluster&&t.state.redisVersion().isAtLeast(8,2)?175:-1),In(),ro(t.isCluster?176:-1);}}var Je=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:false}),Wt=o=>Je.format(new Date(o)),Xe=120,Mi=(()=>{class o{i18n;socket;common;cdr;ngZone;elementRef;state;monitorData;strings;current=null;history=[];paused=false;clientList=[];topKeys=[];isReadonly=false;autoRefreshClients=localStorage.getItem("p3xr-monitor-auto-clients")==="true";autoRefreshTopKeys=localStorage.getItem("p3xr-monitor-auto-topkeys")==="true";clientListLoaded=false;topKeysLoaded=false;slotStats=[];slotStatsMetric="KEY-COUNT";slotStatsLoaded=false;isCluster=false;clusterShards=null;autoRefreshShards=localStorage.getItem("p3xr-monitor-auto-shards")==="true";shardsInterval=null;memoryChartRef;opsChartRef;clientsChartRef;networkChartRef;intervalId;uPlot;memoryPlot;opsPlot;clientsPlot;networkPlot;chartsInitialized=false;resizeObserver=null;themeObserver=null;unsubFns=[];boundRecalcHost=null;constructor(t,e,i,s,l,h,b,E){this.i18n=t,this.socket=e,this.common=i,this.cdr=s,this.ngZone=l,this.elementRef=h,this.state=b,this.monitorData=E,this.strings=this.i18n.strings;}ngOnInit(){this.isReadonly=this.state.connection()?.readonly===true,this.isCluster=this.state.connection()?.cluster===true,this.fetchData(),this.loadClientList(),this.loadTopKeys(),this.isCluster&&this.state.redisVersion().isAtLeast(8,2)&&this.loadSlotStats();let t=this.socket.stateChanged$.subscribe(()=>{this.isReadonly=this.state.connection()?.readonly===true,this.isCluster=this.state.connection()?.cluster===true,this.history=[],this.chartsInitialized=false,this.memoryPlot?.destroy(),this.opsPlot?.destroy(),this.clientsPlot?.destroy(),this.networkPlot?.destroy(),this.fetchData(),this.loadClientList(),this.loadTopKeys();});this.unsubFns.push(()=>t.unsubscribe()),this.ngZone.runOutsideAngular(()=>{this.intervalId=setInterval(()=>{this.paused||(this.fetchData(),this.autoRefreshClients&&this.loadClientList(),this.autoRefreshTopKeys&&this.loadTopKeys());},2e3),this.themeObserver=new MutationObserver(()=>{this.chartsInitialized&&setTimeout(()=>this.reinitCharts(),100);}),this.themeObserver.observe(document.body,{attributes:true,attributeFilter:["class"]});let e=this.i18n.currentLang(),i=setInterval(()=>{let s=this.i18n.currentLang();s!==e&&(e=s,this.chartsInitialized&&setTimeout(()=>this.reinitCharts(),100));},500);this.unsubFns.push(()=>clearInterval(i));});}ngAfterViewInit(){setTimeout(()=>this.loadUPlot(),500);}ngOnDestroy(){this.intervalId&&clearInterval(this.intervalId),this.shardsInterval&&clearInterval(this.shardsInterval),this.unsubFns.forEach(t=>t()),this.themeObserver?.disconnect(),this.resizeObserver?.disconnect(),this.memoryPlot?.destroy(),this.opsPlot?.destroy(),this.clientsPlot?.destroy(),this.networkPlot?.destroy();}serverInfoLabel(){if(!this.current)return "";let t=this.current.server,e=this.paused?this.strings().intention?.resume:this.strings().intention?.pause;return `Redis ${t.version} \xB7 ${t.mode} \xB7 ${this.uptimeFormatted} \xB7 ${e}`}toggleAutoRefreshClients(){this.autoRefreshClients=!this.autoRefreshClients;try{localStorage.setItem("p3xr-monitor-auto-clients",String(this.autoRefreshClients));}catch(t){}}toggleAutoRefreshTopKeys(){this.autoRefreshTopKeys=!this.autoRefreshTopKeys;try{localStorage.setItem("p3xr-monitor-auto-topkeys",String(this.autoRefreshTopKeys));}catch(t){}}loadClientList(){return L(this,null,function*(){try{let t=yield this.socket.request({action:"client/list",payload:{}});this.clientList=t.data,this.clientListLoaded=!0,this.safeDetectChanges();}catch(t){this.clientListLoaded=true;}})}killClient(t,e){return L(this,null,function*(){e.stopPropagation();try{yield this.common.confirm({message:this.strings().page?.monitor?.confirmKillClient}),yield this.socket.request({action:"client/kill",payload:{id:t}}),this.common.toast({message:this.strings().page?.monitor?.clientKilled}),yield this.loadClientList();}catch(i){i!==void 0&&this.common.generalHandleError(i);}})}loadSlotStats(){return L(this,null,function*(){try{let t=yield this.socket.request({action:"cluster/slot-stats",payload:{metric:this.slotStatsMetric,limit:20}});this.slotStats=t.slots||[],this.slotStatsLoaded=!0,this.safeDetectChanges();}catch(t){this.slotStatsLoaded=true,this.slotStats=[];}})}loadTopKeys(){return L(this,null,function*(){try{let t=yield this.socket.request({action:"memory/top-keys",payload:{topN:20}});this.topKeys=t.data,this.topKeysLoaded=!0,this.safeDetectChanges();}catch(t){this.topKeysLoaded=true;}})}safeDetectChanges(){this.ngZone.run(()=>{let t=document.getElementById("p3xr-database-content-container")||document.querySelector(".p3xr-layout-content"),e=t?.scrollTop??window.scrollY;try{this.cdr.detectChanges();}catch(i){}requestAnimationFrame(()=>{t?t.scrollTop=e:window.scrollTo(0,e);});});}formatBytes(t){return t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/(1024*1024)).toFixed(1)+" MB"}togglePause(){this.paused=!this.paused;}get serverInfo(){let t=this.state.info();if(!t)return null;let e=t.server||{},i=t.cpu||{};return {os:e.os||"",port:e.tcp_port||"",pid:e.process_id||"",configFile:e.config_file||"",cpuSys:i.used_cpu_sys||"0",cpuUser:i.used_cpu_user||"0"}}get persistenceInfo(){let t=this.state.info();if(!t?.persistence)return null;let e=t.persistence,i=parseInt(e.rdb_last_save_time,10);return {rdbLastSave:i?new Date(i*1e3).toLocaleString():"N/A",rdbStatus:e.rdb_last_bgsave_status||"N/A",rdbChanges:e.rdb_changes_since_last_save??"N/A",aofEnabled:e.aof_enabled==="1"?"Yes":"No",aofSize:e.aof_enabled==="1"?this.formatBytes(parseInt(e.aof_current_size,10)||0):""}}get replicationInfo(){let t=this.state.info();if(!t?.replication)return null;let e=t.replication,i={role:e.role||"unknown"};return e.role==="master"?i.replicas=e.connected_slaves??"0":e.role==="slave"&&(i.masterHost=e.master_host,i.masterPort=e.master_port,i.linkStatus=e.master_link_status),i}get keyspaceEntries(){let t=this.state.info();return t?.keyspace?Object.keys(t.keyspace).filter(e=>e.startsWith("db")).sort((e,i)=>parseInt(e.slice(2),10)-parseInt(i.slice(2),10)).map(e=>{let i=t.keyspace[e];return {db:e,keys:typeof i=="object"&&i.keys||"0",expires:typeof i=="object"&&i.expires||"0"}}):[]}get modulesList(){return (this.state.modules()||[]).map(t=>({name:t.name||"unknown",ver:String(t.ver??t.version??"")}))}exportServerInfo(){let t=this.serverInfo;if(!t)return;let e=this.strings().page?.monitor||{},i=[`${e.os}: ${t.os}`,`${e.port}: ${t.port}`,`${e.pid}: ${t.pid}`,`${e.configFile}: ${t.configFile}`,`${e.cpuSys} CPU: ${t.cpuSys}`,`${e.cpuUser} CPU: ${t.cpuUser}`];this.downloadText(i.join(` `),`${this.connName}-server-info.txt`);}exportPersistence(){let t=this.persistenceInfo;if(!t)return;let e=this.strings().page?.monitor||{},i=[`${e.rdbLastSave}: ${t.rdbLastSave}`,`${e.rdbStatus}: ${t.rdbStatus}`,`${e.rdbChanges}: ${t.rdbChanges}`,`${e.aofEnabled}: ${t.aofEnabled}`];t.aofSize&&i.push(`${e.aofSize}: ${t.aofSize}`),this.downloadText(i.join(` `),`${this.connName}-persistence.txt`);}exportReplication(){let t=this.replicationInfo;if(!t)return;let e=this.strings().page?.monitor||{},i=[`${e.role}: ${t.role}`];t.replicas!==void 0&&i.push(`${e.replicas}: ${t.replicas}`),t.masterHost&&i.push(`${e.masterHost}: ${t.masterHost}:${t.masterPort}`),t.linkStatus&&i.push(`${e.linkStatus}: ${t.linkStatus}`),this.downloadText(i.join(` `),`${this.connName}-replication.txt`);}exportKeyspace(){let t=this.keyspaceEntries;if(t.length===0)return;let e=this.strings().page?.monitor||{},i=t.map(s=>`${s.db}: ${e.keys}: ${s.keys}, ${e.expires}: ${s.expires}`);this.downloadText(i.join(` `),`${this.connName}-keyspace.txt`);}exportModules(){let t=this.modulesList,e=this.strings().page?.monitor||{};if(t.length===0){this.downloadText(e.noModules,`${this.connName}-modules.txt`);return}let i=t.map(s=>`${s.name} v${s.ver}`);this.downloadText(i.join(` `),`${this.connName}-modules.txt`);}get connName(){return this.state.connection()?.name||"redis"}exportOverview(){if(!this.current)return;let t=this.current,e=this.strings().page?.monitor||{},i=[`${e.memory}: ${t.memory.usedHuman}`,`${e.rss}: ${t.memory.rssHuman}`,`${e.peak}: ${t.memory.peakHuman}`,`${e.fragmentation}: ${t.memory.fragRatio}x`,`${e.opsPerSec}: ${t.stats.opsPerSec}`,`${e.totalCommands}: ${t.stats.totalCommands}`,`${e.clients}: ${t.clients.connected}`,`${e.blocked}: ${t.clients.blocked}`,`${e.hitsMisses}: ${t.stats.hitRate}%`,`${e.hitsAndMisses}: ${t.stats.hits} / ${t.stats.misses}`,`${e.networkIo}: ${t.stats.inputKbps.toFixed(1)} / ${t.stats.outputKbps.toFixed(1)} KB/s`,`${e.expired}: ${t.stats.expiredKeys}`,`${e.evicted}: ${t.stats.evictedKeys}`];this.downloadText(i.join(` `),`${this.connName}-overview.txt`);}exportChart(t,e){let i=t?.nativeElement?.querySelector("canvas");if(!i)return;let s=document.createElement("canvas");s.width=i.width,s.height=i.height;let l=s.getContext("2d");l.fillStyle=getComputedStyle(document.body).getPropertyValue("--p3xr-body-bg").trim()||"#ffffff",l.fillRect(0,0,s.width,s.height),l.drawImage(i,0,0);let h=s.toDataURL("image/png"),b=document.createElement("a");b.href=h,b.download=`${this.connName}-${e}.png`,b.click();}resetSlowLog(){return L(this,null,function*(){try{yield this.common.confirm({message:this.strings().page?.monitor?.confirmSlowLogReset}),yield this.socket.request({action:"monitor/slowlog-reset"}),this.common.toast({message:this.strings().page?.monitor?.slowLogResetDone});}catch(t){}})}exportSlowLog(){if(!this.current)return;let t=this.current.slowlog.map(e=>`${e.duration}\xB5s ${e.command}`);this.downloadText(t.join(` `),`${this.connName}-slowlog.txt`);}loadClusterShards(){return L(this,null,function*(){try{let t=yield this.socket.request({action:"cluster/shards"});this.clusterShards=t.data.shards,this.safeDetectChanges();}catch(t){this.common.generalHandleError(t);}})}toggleAutoRefreshShards(){this.autoRefreshShards=!this.autoRefreshShards,localStorage.setItem("p3xr-monitor-auto-shards",String(this.autoRefreshShards)),this.autoRefreshShards?(this.loadClusterShards(),this.shardsInterval=setInterval(()=>this.loadClusterShards(),2e3)):(clearInterval(this.shardsInterval),this.shardsInterval=null);}getSlotCount(t){return t.slotRanges.reduce((e,[i,s])=>e+(s-i+1),0)}formatSlotRanges(t){return t.slotRanges.map(([e,i])=>`${e}-${i}`).join(", ")}formatReplicas(t){return t.replicas.map(e=>`${e.host}:${e.port}`).join(", ")}exportClusterSlots(){if(!this.clusterShards)return;let t=this.clusterShards.map(e=>{let i=e.slotRanges.map(([h,b])=>`${h}-${b}`).join(", "),s=this.getSlotCount(e),l=e.replicas.map(h=>`${h.host}:${h.port}`).join(", ");return `${e.master.host}:${e.master.port} | ${i} | ${s} slots | replicas: ${l||"none"}`});this.downloadText(t.join(` `),`${this.connName}-cluster-slots.txt`);}exportClientList(){let t=this.clientList.map(e=>`${e.addr} ${e.name||""} db${e.db} ${e.cmd} idle:${e.idle}s`);this.downloadText(t.join(` `),`${this.connName}-clients.txt`);}exportTopKeys(){let t=this.topKeys.map((e,i)=>`#${i+1} ${e.key} ${this.formatBytes(e.bytes)}`);this.downloadText(t.join(` `),`${this.connName}-topkeys.txt`);}exportAll(){return L(this,null,function*(){if(this.current)try{let t=(yield import('./chunk-iIq26jJR.js')).default,e=new t,i=this.current,s=[],l=this.strings().page?.monitor||{},h=this.strings().page?.analysis||{};s.push("============================"," PULSE","============================","",`--- ${l.title} ---`,`Redis ${i.server.version} \xB7 ${i.server.mode} \xB7 Uptime: ${this.uptimeFormatted}`,`${l.memory}: ${i.memory.usedHuman}`,`${l.rss}: ${i.memory.rssHuman}`,`${l.peak}: ${i.memory.peakHuman}`,`${l.fragmentation}: ${i.memory.fragRatio}x`,`${l.opsPerSec}: ${i.stats.opsPerSec}`,`${l.totalCommands}: ${i.stats.totalCommands}`,`${l.clients}: ${i.clients.connected}`,`${l.blocked}: ${i.clients.blocked}`,`${l.hitsMisses}: ${i.stats.hitRate}%`,`${l.hitsAndMisses}: ${i.stats.hits} / ${i.stats.misses}`,`${l.networkIo}: ${i.stats.inputKbps.toFixed(1)} / ${i.stats.outputKbps.toFixed(1)} KB/s`,`${l.expired}: ${i.stats.expiredKeys}`,`${l.evicted}: ${i.stats.evictedKeys}`);let b=this.serverInfo;b&&(s.push("",`--- ${l.serverInfo} ---`),s.push(`${l.os}: ${b.os}`,`${l.port}: ${b.port}`,`${l.pid}: ${b.pid}`),b.configFile&&s.push(`${l.configFile}: ${b.configFile}`),s.push(`${l.cpuSys} CPU: ${b.cpuSys}`,`${l.cpuUser} CPU: ${b.cpuUser}`));let E=this.persistenceInfo;E&&(s.push("",`--- ${l.persistence} ---`),s.push(`${l.rdbLastSave}: ${E.rdbLastSave}`,`${l.rdbStatus}: ${E.rdbStatus}`),s.push(`${l.rdbChanges}: ${E.rdbChanges}`,`${l.aofEnabled}: ${E.aofEnabled}`),E.aofSize&&s.push(`${l.aofSize}: ${E.aofSize}`));let V=this.replicationInfo;V&&(s.push("",`--- ${l.replication} ---`),s.push(`${l.role}: ${V.role}`),V.replicas!==void 0&&s.push(`${l.replicas}: ${V.replicas}`),V.masterHost&&s.push(`${l.masterHost}: ${V.masterHost}:${V.masterPort}`),V.linkStatus&&s.push(`${l.linkStatus}: ${V.linkStatus}`));let B=this.keyspaceEntries;B.length>0&&(s.push("",`--- ${l.keyspace} ---`),s.push(...B.map(_=>`${_.db}: ${l.keys}: ${_.keys}, ${l.expires}: ${_.expires}`)));let f=this.modulesList;f.length>0?(s.push("",`--- ${l.modules} ---`),s.push(...f.map(_=>`${_.name} v${_.ver}`))):s.push("",`--- ${l.modules} ---`,l.noModules),i.slowlog.length>0&&(s.push("",`--- ${l.slowLog} ---`),s.push(...i.slowlog.map(_=>`${_.duration}\xB5s ${_.command}`))),this.clientList.length>0&&(s.push("",`--- ${l.clientList} ---`),s.push(...this.clientList.map(_=>`${_.addr} ${_.name||""} db${_.db} ${_.cmd} idle:${_.idle}s`))),this.topKeys.length>0&&(s.push("",`--- ${l.topKeys} ---`),s.push(...this.topKeys.map((_,P)=>`#${P+1} ${_.key} ${this.formatBytes(_.bytes)}`)));let R=[];try{let P=(yield this.socket.request({action:"memory/analysis",payload:{topN:20,maxScanKeys:5e3}})).data;if(P){let H=P.memoryInfo,Y=P.expirationOverview,J=Object.keys(P.typeDistribution||{}).map(L=>({type:L,count:P.typeDistribution[L],bytes:P.typeMemory?.[L]||0})).sort((L,w)=>w.bytes-L.bytes);s.push("","","============================"," ANALYSIS","============================"),s.push("",`--- ${h.keysScanned} ---`,`${h.keysScanned}: ${P.totalScanned} / ${P.dbSize}`),s.push("",`--- ${h.memoryBreakdown} ---`),s.push(`${h.totalMemory}: ${H.usedHuman}`,`${h.rssMemory}: ${H.rssHuman}`,`${h.peakMemory}: ${H.peakHuman}`),s.push(`${h.overheadMemory}: ${this.formatBytes(H.overhead)}`,`${h.datasetMemory}: ${this.formatBytes(H.dataset)}`),s.push(`${h.luaMemory}: ${this.formatBytes(H.lua)}`,`${h.fragmentation}: ${H.fragRatio}x`,`${h.allocator}: ${H.allocator}`),s.push("",`--- ${h.typeDistribution} ---`),s.push(...J.map(L=>`${L.type}: ${L.count} ${h.keyCount}, ${this.formatBytes(L.bytes)}`)),P.prefixMemory?.length>0&&(s.push("",`--- ${h.prefixMemory} ---`),s.push(...P.prefixMemory.map((L,w)=>`#${w+1} ${L.prefix} \u2014 ${L.keyCount} ${h.keyCount}, ${this.formatBytes(L.totalBytes)}`))),s.push("",`--- ${h.expirationOverview} ---`),s.push(`${h.withTTL}: ${Y.withTTL}`,`${h.persistent}: ${Y.persistent}`,`${h.avgTTL}: ${Y.avgTTL}s`),R=[{name:h.typeDistribution,items:J.map(L=>({label:L.type,value:L.bytes}))},{name:h.prefixMemory,items:(P.prefixMemory||[]).slice(0,20).map(L=>({label:L.prefix,value:L.totalBytes}))}];}}catch(_){}let z=_=>_.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,""),$=[];this.monitorData.profilerEntries.length>0&&($.push("","","============================"," PROFILER","============================",""),$.push(...this.monitorData.profilerEntries.map(_=>z(`${_.fullTimestamp} [${_.database} ${_.source}] ${_.command}`)))),this.monitorData.pubsubEntries.length>0&&($.push("","","============================"," PUBSUB","============================",""),$.push(...this.monitorData.pubsubEntries.map(_=>z(`${_.fullTimestamp} ${_.channel} ${_.message}`))));let u=[...s,...$].join(` `),x=new TextEncoder().encode(u),D=new Uint8Array([239,187,191]),M=new Uint8Array(D.length+x.length);M.set(D),M.set(x,D.length),e.file("monitoring.txt",M);let S=[];S.push(...this.renderPulseChartsForExport());for(let _ of R){if(_.items.length===0)continue;let P=this.renderBarChart(_.items);P&&S.push({label:_.name,canvas:P});}if(S.length>0){let _=yield this.stitchCharts(S);_&&e.file("charts.png",_);}try{let _=yield this.generatePdf(s,S,$);_&&e.file("monitoring.pdf",_);}catch(_){}let O=yield e.generateAsync({type:"blob"}),N=URL.createObjectURL(O),U=document.createElement("a");U.href=N,U.download=`${this.connName}-monitoring.zip`,U.click(),URL.revokeObjectURL(N);}catch(t){this.common.generalHandleError(t);}})}stitchCharts(t){return L(this,null,function*(){let l=Math.max(2400,...t.map(R=>R.canvas.width)),h=32;for(let R of t){let z=R.canvas.height*(l/R.canvas.width);h+=60+z+40;}h+=32;let b=document.createElement("canvas");b.width=l,b.height=h;let E=b.getContext("2d"),V=getComputedStyle(document.body).getPropertyValue("--p3xr-body-bg").trim()||"#ffffff",B=this.getChartColors();E.fillStyle=V,E.fillRect(0,0,l,h);let f=32;for(let R of t){E.fillStyle=B.text,E.font="bold 28px Roboto, sans-serif",E.textAlign="left",E.textBaseline="top",E.fillText(R.label,32,f),f+=60;let z=l-64,$=R.canvas.height*(z/R.canvas.width);E.drawImage(R.canvas,32,f,z,$),f+=$+40;}return new Promise(R=>b.toBlob(z=>R(z),"image/png"))})}renderPulseChartsForExport(){let t;if(this.history.length>=2)t=this.buildChartData();else if(this.current){let l=this.current,h=Date.now()/1e3;t={timestamps:[h-1,h],memUsed:[l.memory.used/(1024*1024),l.memory.used/(1024*1024)],memRss:[l.memory.rss/(1024*1024),l.memory.rss/(1024*1024)],ops:[l.stats.opsPerSec,l.stats.opsPerSec],connected:[l.clients.connected,l.clients.connected],blocked:[l.clients.blocked,l.clients.blocked],netIn:[l.stats.inputKbps,l.stats.inputKbps],netOut:[l.stats.outputKbps,l.stats.outputKbps]};}else return [];let e=this.getChartColors(),i=this.strings().page?.monitor||{};return [{label:i.memory+" (MB)",series:[{label:i.memory,color:e.primary,values:t.memUsed,fill:true},{label:"RSS",color:e.accent,values:t.memRss}]},{label:i.opsPerSec,series:[{label:i.opsPerSec,color:e.primary,values:t.ops,fill:true}]},{label:i.clients,series:[{label:i.clients,color:e.primary,values:t.connected},{label:i.blocked,color:e.warn,values:t.blocked}]},{label:i.networkIo+" (KB/s)",series:[{label:"\u2193 In",color:e.primary,values:t.netIn,fill:true},{label:"\u2191 Out",color:e.accent,values:t.netOut}]}].map(l=>({label:l.label,canvas:this.renderLineChart(t.timestamps,l.series,e)}))}renderLineChart(t,e,i){let $=document.createElement("canvas");$.width=900*2,$.height=260*2;let u=$.getContext("2d");u.scale(2,2),u.fillStyle=getComputedStyle(document.body).getPropertyValue("--p3xr-body-bg").trim()||"#ffffff",u.fillRect(0,0,900,260);let x=t.length;if(x<2)return $;let D=1/0,M=-1/0;for(let w of e)for(let K of w.values)K<D&&(D=K),K>M&&(M=K);D===M&&(D-=1,M+=1);let S=M-D,O=t[0],U=t[x-1]-O||1,_=w=>60+(w-O)/U*824,P=w=>200-(w-D)/S*168;u.strokeStyle=i.grid,u.lineWidth=1;let H=5;for(let w=0;w<=H;w++){let K=32+168/H*w;u.beginPath(),u.moveTo(60,K),u.lineTo(884,K),u.stroke();let W=M-S/H*w;u.fillStyle=i.text,u.font="10px Roboto Mono, monospace",u.textAlign="right",u.textBaseline="middle",u.fillText(W>=1e3?(W/1e3).toFixed(1)+"k":W.toFixed(1),54,K);}let Y=Math.min(6,x);u.font="10px Roboto, sans-serif",u.textAlign="center",u.textBaseline="top",u.fillStyle=i.text;for(let w=0;w<Y;w++){let K=Math.round(w/(Y-1)*(x-1)),W=t[K],X=new Date(W*1e3),Yt=`${String(X.getHours()).padStart(2,"0")}:${String(X.getMinutes()).padStart(2,"0")}:${String(X.getSeconds()).padStart(2,"0")}`;u.fillText(Yt,_(W),206);}for(let w of e){u.strokeStyle=w.color,u.lineWidth=2,u.lineJoin="round",u.beginPath();for(let K=0;K<x;K++){let W=_(t[K]),X=P(w.values[K]);K===0?u.moveTo(W,X):u.lineTo(W,X);}if(u.stroke(),w.fill){u.fillStyle=w.color+"20",u.beginPath(),u.moveTo(_(t[0]),P(w.values[0]));for(let K=1;K<x;K++)u.lineTo(_(t[K]),P(w.values[K]));u.lineTo(_(t[x-1]),200),u.lineTo(_(t[0]),200),u.closePath(),u.fill();}}let J=60,L=244;u.font="11px Roboto, sans-serif",u.textAlign="left",u.textBaseline="middle";for(let w of e)u.fillStyle=w.color,u.fillRect(J,L-4,12,8),u.fillStyle=i.text,u.fillText(w.label,J+16,L),J+=u.measureText(w.label).width+32;return $}renderBarChart(t){if(t.length===0)return null;let e=this.getChartColors(),i=e.text.includes("255"),s=[e.primary,e.accent,e.warn,i?"#ffb74d":"#ff9800",i?"#81c784":"#4caf50",i?"#4dd0e1":"#00bcd4",i?"#a1887f":"#795548",i?"#90a4ae":"#607d8b"],l=2,h=800,b=24,E=120,V=80,B=E+8,f=h-V-8,R=f-B,z=8,$=z+t.length*(b+4)+8,u=document.createElement("canvas");u.width=h*l,u.height=$*l;let x=u.getContext("2d");x.scale(l,l),x.fillStyle=getComputedStyle(document.body).getPropertyValue("--p3xr-body-bg").trim()||"#ffffff",x.fillRect(0,0,h,$);let D=Math.max(...t.map(M=>M.value),1);return t.forEach((M,S)=>{let O=z+S*(b+4);x.fillStyle=e.text,x.font="12px Roboto, sans-serif",x.textAlign="right",x.textBaseline="middle",x.fillText(M.label.length>15?M.label.substring(0,14)+"\u2026":M.label,E,O+b/2),x.fillStyle=e.grid,x.fillRect(B,O,R,b),x.fillStyle=s[S%s.length],x.fillRect(B,O,M.value/D*R,b),x.fillStyle=e.text,x.font="11px Roboto Mono, monospace",x.textAlign="left",x.fillText(this.formatBytes(M.value),f+8,O+b/2);}),u}generatePdf(s,l){return L(this,arguments,function*(t,e,i=[]){let{jsPDF:h}=yield import('./chunk-DpvZrTqS.js').then(function(n){return n.c}),b=document.body.classList.contains("p3xr-theme-dark"),E=getComputedStyle(document.body).getPropertyValue("--p3xr-body-bg").trim()||"#ffffff",V=b?"#e0e0e0":"#212121",B=b?"#90caf9":"#1565c0",f=new h({orientation:"portrait",unit:"mm",format:"a4"}),R=f.internal.pageSize.getWidth(),z=f.internal.pageSize.getHeight(),$=12,u=R-$*2,x=$,D=()=>{f.setFillColor(E),f.rect(0,0,R,z,"F");};D();let M=S=>{x+S>z-$&&(f.addPage(),D(),x=$);};for(let S of t){if(S.startsWith("===="))continue;if(S.trim()==="PULSE"||S.trim()==="PROFILER"||S.trim()==="PUBSUB"||S.trim()==="ANALYSIS"){M(14),x+=4,f.setFontSize(14),f.setTextColor(B),f.text(S.trim(),$,x),x+=8;continue}if(S.startsWith("---")&&S.endsWith("---")){M(8);let U=S.replace(/^-+\s*/,"").replace(/\s*-+$/,"");x+=2,f.setFontSize(10),f.setTextColor(B),f.text(U,$,x),x+=5;continue}if(S===""){x+=2;continue}M(4),f.setTextColor(V),f.setFontSize(8);let N=f.splitTextToSize(S,u);for(let U of N)M(4),f.text(U,$,x),x+=3.5;}for(let S of e){f.addPage(),D(),x=$,f.setFontSize(12),f.setTextColor(B),f.text(S.label,$,x),x+=8;let O=S.canvas.toDataURL("image/png"),N=S.canvas.height/S.canvas.width,U=z-x-$,_=u,P=_*N;if(P>U){let H=U,Y=H/N;f.addImage(O,"PNG",$,x,Y,H),x+=H;}else f.addImage(O,"PNG",$,x,_,P),x+=P;}i.length>0&&e.length>0&&(f.addPage(),D(),x=$);for(let S of i){if(S.startsWith("===="))continue;if(S.trim()==="PROFILER"||S.trim()==="PUBSUB"){M(14),x+=4,f.setFontSize(14),f.setTextColor(B),f.text(S.trim(),$,x),x+=8;continue}if(S===""){x+=2;continue}M(4),f.setTextColor(V),f.setFontSize(8);let N=f.splitTextToSize(S,u);for(let U of N)M(4),f.text(U,$,x),x+=3.5;}return f.output("blob")})}downloadText(t,e){let i=new Blob([t],{type:"text/plain"}),s=URL.createObjectURL(i),l=document.createElement("a");l.href=s,l.download=e,l.click(),URL.revokeObjectURL(s);}get uptimeFormatted(){if(!this.current)return "-";let t=this.current.server.uptime,e=Math.floor(t/86400),i=Math.floor(t%86400/3600),s=Math.floor(t%3600/60);return e>0?`${e}d ${i}h ${s}m`:i>0?`${i}h ${s}m`:`${s}m`}fetchData(){return L(this,null,function*(){try{let e=(yield this.socket.request({action:"monitor/info",payload:{}})).data;this.current=e,this.isCluster=this.state.connection()?.cluster===!0,this.history.push(e),this.history.length>Xe&&this.history.shift(),this.chartsInitialized?this.updateCharts():this.uPlot&&this.history.length>=2&&this.initCharts(),this.safeDetectChanges();}catch(t){}})}loadUPlot(){return L(this,null,function*(){let t=yield import('./chunk-DgN4yhTJ.js');this.uPlot=t.default,this.history.length>=2&&this.initCharts();})}getChartColors(){let t=document.body.classList.contains("p3xr-theme-dark"),e=getComputedStyle(document.body),i=e.getPropertyValue("--p3xr-btn-primary-bg").trim(),s=e.getPropertyValue("--p3xr-btn-accent-bg").trim(),l=e.getPropertyValue("--p3xr-btn-warn-bg").trim();return {primary:i||(t?"#90caf9":"#1976d2"),accent:s||(t?"#ce93d8":"#9c27b0"),warn:l||(t?"#ef9a9a":"#f44336"),text:t?"rgba(255,255,255,0.87)":"rgba(0,0,0,0.87)",grid:t?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.08)"}}reinitCharts(){this.memoryPlot?.destroy(),this.opsPlot?.destroy(),this.clientsPlot?.destroy(),this.networkPlot?.destroy(),this.chartsInitialized=false,this.history.length>=2&&this.initCharts();}getChartWidth(t){return t?.offsetWidth||500}createOpts(t,e){let i=this.getChartColors();return {width:t,height:180,cursor:{show:true,drag:{x:false,y:false}},legend:{show:true,live:false},scales:{x:{time:true}},axes:[{stroke:i.text,grid:{stroke:i.grid,width:1},ticks:{stroke:i.grid},font:"11px Roboto",values:(s,l)=>l.map(h=>Wt(h*1e3))},{stroke:i.text,grid:{stroke:i.grid,width:1},ticks:{stroke:i.grid},font:"11px Roboto Mono",size:55}],series:[{label:this.strings().label?.time,value:(s,l)=>l?Wt(l*1e3):""},...e]}}initCharts(){if(!this.uPlot||this.chartsInitialized)return;let t=this.getChartColors(),e=this.buildChartData(),i=this.memoryChartRef?.nativeElement,s=this.opsChartRef?.nativeElement,l=this.clientsChartRef?.nativeElement,h=this.networkChartRef?.nativeElement;if(!i||!s||!l||!h)return;let b=this.strings().page?.monitor||{};this.memoryPlot=new this.uPlot(this.createOpts(this.getChartWidth(i),[{label:b.memory,stroke:t.primary,width:2,fill:t.primary+"15"},{label:"RSS",stroke:t.accent,width:2}]),[e.timestamps,e.memUsed,e.memRss],i),this.opsPlot=new this.uPlot(this.createOpts(this.getChartWidth(s),[{label:b.opsPerSec,stroke:t.primary,width:2,fill:t.primary+"20"}]),[e.timestamps,e.ops],s),this.clientsPlot=new this.uPlot(this.createOpts(this.getChartWidth(l),[{label:b.clients,stroke:t.primary,width:2},{label:b.blocked,stroke:t.warn,width:2}]),[e.timestamps,e.connected,e.blocked],l),this.networkPlot=new this.uPlot(this.createOpts(this.getChartWidth(h),[{label:"\u2193 In",stroke:t.primary,width:2,fill:t.primary+"15"},{label:"\u2191 Out",stroke:t.accent,width:2}]),[e.timestamps,e.netIn,e.netOut],h),this.chartsInitialized=true;let E;this.resizeObserver=new ResizeObserver(()=>{clearTimeout(E),E=setTimeout(()=>{let V=this.getChartWidth(i),B=this.getChartWidth(s),f=this.getChartWidth(l),R=this.getChartWidth(h);V>0&&this.memoryPlot?.setSize({width:V,height:180}),B>0&&this.opsPlot?.setSize({width:B,height:180}),f>0&&this.clientsPlot?.setSize({width:f,height:180}),R>0&&this.networkPlot?.setSize({width:R,height:180});},50);}),this.resizeObserver.observe(i),this.resizeObserver.observe(s),this.resizeObserver.observe(l),this.resizeObserver.observe(h);}buildChartData(){return {timestamps:this.history.map(t=>t.timestamp/1e3),memUsed:this.history.map(t=>t.memory.used/(1024*1024)),memRss:this.history.map(t=>t.memory.rss/(1024*1024)),ops:this.history.map(t=>t.stats.opsPerSec),connected:this.history.map(t=>t.clients.connected),blocked:this.history.map(t=>t.clients.blocked),netIn:this.history.map(t=>t.stats.inputKbps),netOut:this.history.map(t=>t.stats.outputKbps)}}updateCharts(){if(!this.chartsInitialized)return;let t=this.buildChartData();this.memoryPlot?.setData([t.timestamps,t.memUsed,t.memRss]),this.opsPlot?.setData([t.timestamps,t.ops]),this.clientsPlot?.setData([t.timestamps,t.connected,t.blocked]),this.networkPlot?.setData([t.timestamps,t.netIn,t.netOut]);}static \u0275fac=function(e){return new(e||o)(Xe$1(fQ),Xe$1(bi),Xe$1(It),Xe$1(uc),Xe$1(N),Xe$1(q),Xe$1(Q),Xe$1(Oe$1))};static \u0275cmp=_e$1({type:o,selectors:[["p3xr-monitoring"]],viewQuery:function(e,i){if(e&1&&rc(Qt,5)(Zt,5)(Gt,5)(Jt,5),e&2){let s;Df(s=Ef())&&(i.memoryChartRef=s.first),Df(s=Ef())&&(i.opsChartRef=s.first),Df(s=Ef())&&(i.clientsChartRef=s.first),Df(s=Ef())&&(i.networkChartRef=s.first);}},decls:2,vars:2,consts:[["memoryChart",""],["opsChart",""],["clientsChart",""],["networkChart",""],[1,"p3xr-monitoring-loading"],["accordionKey","monitor-overview",3,"title"],["actions",""],[3,"click","label","mdIcon"],["mdIcon","download",3,"click","label"],["mdIcon","archive",3,"click","label"],["content",""],[1,"p3xr-settings-pair-row"],[1,"p3xr-settings-row-label"],[1,"p3xr-settings-row-value","p3xr-mono"],["accordionKey","monitor-modules",3,"title"],[2,"padding","16px","opacity","0.5"],["accordionKey","monitor-chart-memory",3,"title"],[1,"p3xr-monitoring-chart"],["accordionKey","monitor-chart-ops",3,"title"],["accordionKey","monitor-chart-clients",3,"title"],["accordionKey","monitor-chart-network",3,"title"],["accordionKey","monitor-slowlog",3,"title"],["label","Reset","mdIcon","delete_sweep"],[2,"padding","12px 16px","opacity","0.6"],["accordionKey","monitor-clients-list",3,"title"],["mdIcon","re