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 • 54.6 kB
JavaScript
import{a as qt}from"./chunk-6B7LFLHT.js";import{a as Wt}from"./chunk-5MKOZDXN.js";import{a as Nt}from"./chunk-IKY2Z6UX.js";import{a as Kt,b as Vt,c as Ft}from"./chunk-G3XOKGOC.js";import{a as Pt,b as Lt}from"./chunk-2IWVZCK2.js";import"./chunk-NBRXTOBF.js";import"./chunk-HWCHBMC4.js";import"./chunk-CVKYB7DC.js";import{c as Ot}from"./chunk-VQTCYUQY.js";import{e as jt}from"./chunk-TKRAWHQA.js";import{b as Ht}from"./chunk-W32HPWBA.js";import{c as Ut,d as At}from"./chunk-MDGU2XDP.js";import{a as yt,i as bt,j as St}from"./chunk-JCH63A4N.js";import"./chunk-NZJKKTDQ.js";import{f as kt,j as It,o as Et,p as Tt,q as Mt,v as Rt}from"./chunk-5LJPHUK2.js";import"./chunk-YA4NX3C4.js";import{b as $t,c as wt}from"./chunk-53CQV6LZ.js";import{b as Bt,c as zt}from"./chunk-4GIODJCK.js";import"./chunk-PFG3GPGC.js";import{$a as J,Bb as c,Cb as u,Da as G,Db as O,Eb as tt,Fb as pt,Gb as ut,Hb as _t,Ia as dt,Ib as xt,Jb as ht,Nb as ot,Pb as lt,Pd as vt,Rd as Dt,Xa as y,Ya as b,Zb as gt,ab as X,ba as R,bb as $,ca as P,cb as r,db as a,eb as C,jb as N,ka as st,lb as L,nb as m,nc as ft,oc as Ct,ra as ct,rb as mt,sb as it,tb as nt,xa as n}from"./chunk-MHKTEXY5.js";import"./chunk-ENGD2CVB.js";import{h as Y}from"./chunk-O7S4L63H.js";var Zt=["memoryChart"],Gt=["opsChart"],Jt=["clientsChart"],Xt=["networkChart"],Qt=(l,p)=>p.id,te=(l,p)=>p.db,ee=(l,p)=>p.name,ie=(l,p)=>p.key,ne=(l,p)=>p.slot,oe=(l,p)=>p.master.id;function le(l,p){if(l&1&&(r(0,"div",4)(1,"mat-icon"),c(2,"hourglass_empty"),a(),r(3,"span"),c(4),a()()),l&2){let t,e=m();n(4),u((t=e.strings().label)==null?null:t.loading)}}function re(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",11)(2,"div",12),c(3),a(),r(4,"div",13),c(5),a()()(),C(6,"mat-divider")),l&2){let t,e=m(3);n(3),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.os),n(2),u(e.serverInfo.os)}}function ae(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",11)(2,"div",12),c(3),a(),r(4,"div",13),c(5),a()()(),C(6,"mat-divider")),l&2){let t,e=m(3);n(3),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.port),n(2),u(e.serverInfo.port)}}function se(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",11)(2,"div",12),c(3),a(),r(4,"div",13),c(5),a()()(),C(6,"mat-divider")),l&2){let t,e=m(3);n(3),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.pid),n(2),u(e.serverInfo.pid)}}function ce(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",11)(2,"div",12),c(3),a(),r(4,"div",13),c(5),a()()(),C(6,"mat-divider")),l&2){let t,e=m(3);n(3),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.configFile),n(2),u(e.serverInfo.configFile)}}function de(l,p){if(l&1){let t=N();C(0,"br"),r(1,"p3xr-ng-accordion",27)(2,"div",6)(3,"p3xr-ng-button",8),L("click",function(i){return R(t),m(2).exportServerInfo(),P(i.stopPropagation())}),a()(),r(4,"div",10)(5,"mat-list"),y(6,re,7,2),y(7,ae,7,2),y(8,se,7,2),y(9,ce,7,2),r(10,"mat-list-item")(11,"div",11)(12,"div",12),c(13),a(),r(14,"div",13),c(15),a()()(),C(16,"mat-divider"),r(17,"mat-list-item")(18,"div",11)(19,"div",12),c(20),a(),r(21,"div",13),c(22),a()()()()()()}if(l&2){let t,e,i,o,s=m(2);n(),$("title",(t=s.strings().page)==null||t.monitor==null?null:t.monitor.serverInfo),n(2),$("label",(e=s.strings().intention)==null?null:e.export),n(3),b(s.serverInfo.os?6:-1),n(),b(s.serverInfo.port?7:-1),n(),b(s.serverInfo.pid?8:-1),n(),b(s.serverInfo.configFile?9:-1),n(4),O("",(i=s.strings().page)==null||i.monitor==null?null:i.monitor.cpuSys," CPU"),n(2),u(s.serverInfo.cpuSys),n(5),O("",(o=s.strings().page)==null||o.monitor==null?null:o.monitor.cpuUser," CPU"),n(2),u(s.serverInfo.cpuUser)}}function me(l,p){if(l&1&&(C(0,"mat-divider"),r(1,"mat-list-item")(2,"div",11)(3,"div",12),c(4),a(),r(5,"div",13),c(6),a()()()),l&2){let t,e=m(3);n(4),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.aofSize),n(2),u(e.persistenceInfo.aofSize)}}function pe(l,p){if(l&1){let t=N();C(0,"br"),r(1,"p3xr-ng-accordion",28)(2,"div",6)(3,"p3xr-ng-button",8),L("click",function(i){return R(t),m(2).exportPersistence(),P(i.stopPropagation())}),a()(),r(4,"div",10)(5,"mat-list")(6,"mat-list-item")(7,"div",11)(8,"div",12),c(9),a(),r(10,"div",13),c(11),a()()(),C(12,"mat-divider"),r(13,"mat-list-item")(14,"div",11)(15,"div",12),c(16),a(),r(17,"div",13),c(18),a()()(),C(19,"mat-divider"),r(20,"mat-list-item")(21,"div",11)(22,"div",12),c(23),a(),r(24,"div",13),c(25),a()()(),C(26,"mat-divider"),r(27,"mat-list-item")(28,"div",11)(29,"div",12),c(30),a(),r(31,"div",13),c(32),a()()(),y(33,me,7,2),a()()()}if(l&2){let t,e,i,o,s,_,f=m(2);n(),$("title",(t=f.strings().page)==null||t.monitor==null?null:t.monitor.persistence),n(2),$("label",(e=f.strings().intention)==null?null:e.export),n(6),u((i=f.strings().page)==null||i.monitor==null?null:i.monitor.rdbLastSave),n(2),u(f.persistenceInfo.rdbLastSave),n(5),u((o=f.strings().page)==null||o.monitor==null?null:o.monitor.rdbStatus),n(2),u(f.persistenceInfo.rdbStatus),n(5),u((s=f.strings().page)==null||s.monitor==null?null:s.monitor.rdbChanges),n(2),u(f.persistenceInfo.rdbChanges),n(5),u((_=f.strings().page)==null||_.monitor==null?null:_.monitor.aofEnabled),n(2),u(f.persistenceInfo.aofEnabled),n(),b(f.persistenceInfo.aofSize?33:-1)}}function ue(l,p){if(l&1&&(C(0,"mat-divider"),r(1,"mat-list-item")(2,"div",11)(3,"div",12),c(4),a(),r(5,"div",13),c(6),a()()()),l&2){let t,e=m(3);n(4),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.replicas),n(2),u(e.replicationInfo.replicas)}}function _e(l,p){if(l&1&&(C(0,"mat-divider"),r(1,"mat-list-item")(2,"div",11)(3,"div",12),c(4),a(),r(5,"div",13),c(6),a()()()),l&2){let t,e=m(3);n(4),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.masterHost),n(2),tt("",e.replicationInfo.masterHost,":",e.replicationInfo.masterPort)}}function xe(l,p){if(l&1&&(C(0,"mat-divider"),r(1,"mat-list-item")(2,"div",11)(3,"div",12),c(4),a(),r(5,"div",13),c(6),a()()()),l&2){let t,e=m(3);n(4),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.linkStatus),n(2),u(e.replicationInfo.linkStatus)}}function he(l,p){if(l&1){let t=N();C(0,"br"),r(1,"p3xr-ng-accordion",29)(2,"div",6)(3,"p3xr-ng-button",8),L("click",function(i){return R(t),m(2).exportReplication(),P(i.stopPropagation())}),a()(),r(4,"div",10)(5,"mat-list")(6,"mat-list-item")(7,"div",11)(8,"div",12),c(9),a(),r(10,"div",13),c(11),a()()(),y(12,ue,7,2),y(13,_e,7,3),y(14,xe,7,2),a()()()}if(l&2){let t,e,i,o=m(2);n(),$("title",(t=o.strings().page)==null||t.monitor==null?null:t.monitor.replication),n(2),$("label",(e=o.strings().intention)==null?null:e.export),n(6),u((i=o.strings().page)==null||i.monitor==null?null:i.monitor.role),n(2),u(o.replicationInfo.role),n(),b(o.replicationInfo.replicas!==void 0?12:-1),n(),b(o.replicationInfo.masterHost?13:-1),n(),b(o.replicationInfo.linkStatus?14:-1)}}function ge(l,p){l&1&&C(0,"mat-divider")}function fe(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",11)(2,"div",12),c(3),a(),r(4,"div",13),c(5),a()()(),y(6,ge,1,0,"mat-divider")),l&2){let t,e=p.$implicit,i=p.$index,o=p.$count,s=m(3);n(3),u(e.db),n(2),ut("",(t=s.strings().page)==null||t.monitor==null?null:t.monitor.keys,": ",e.keys," \xB7 ",(t=s.strings().page)==null||t.monitor==null?null:t.monitor.expires,": ",e.expires),n(),b(i!==o-1?6:-1)}}function Ce(l,p){if(l&1){let t=N();C(0,"br"),r(1,"p3xr-ng-accordion",30)(2,"div",6)(3,"p3xr-ng-button",8),L("click",function(i){return R(t),m(2).exportKeyspace(),P(i.stopPropagation())}),a()(),r(4,"div",10)(5,"mat-list"),J(6,fe,7,6,null,null,te),a()()()}if(l&2){let t,e,i=m(2);n(),$("title",(t=i.strings().page)==null||t.monitor==null?null:t.monitor.keyspace),n(2),$("label",(e=i.strings().intention)==null?null:e.export),n(3),X(i.keyspaceEntries)}}function ve(l,p){if(l&1&&(r(0,"div",15),c(1),a()),l&2){let t,e=m(2);n(),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.noModules)}}function ye(l,p){l&1&&C(0,"mat-divider")}function be(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",11)(2,"div",12),c(3),a(),r(4,"div",13),c(5),a()()(),y(6,ye,1,0,"mat-divider")),l&2){let t=p.$implicit,e=p.$index,i=p.$count;n(3),u(t.name),n(2),O("v",t.ver),n(),b(e!==i-1?6:-1)}}function Se(l,p){if(l&1&&(r(0,"mat-list"),J(1,be,7,3,null,null,ee),a()),l&2){let t=m(2);n(),X(t.modulesList)}}function $e(l,p){if(l&1){let t=N();r(0,"p3xr-ng-button",31),L("click",function(i){return R(t),m(2).resetSlowLog(),P(i.stopPropagation())}),a()}}function we(l,p){if(l&1&&(r(0,"div",23),c(1),a()),l&2){let t,e=m(2);n(),O(" ",(t=e.strings().page)==null||t.monitor==null?null:t.monitor.noSlowQueries," ")}}function ke(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",32)(2,"kbd",33),c(3),a(),r(4,"span",34),c(5),a()()(),C(6,"mat-divider")),l&2){let t=p.$implicit;n(3),O("",t.duration,"\xB5s"),n(2),u(t.command)}}function Ie(l,p){if(l&1){let t=N();r(0,"p3xr-ng-button",35),L("click",function(i){return R(t),m(2).loadClientList(),P(i.stopPropagation())}),a()}if(l&2){let t,e=m(2);$("label",(t=e.strings().intention)==null?null:t.refresh)}}function Ee(l,p){if(l&1&&(r(0,"div",15),c(1),a()),l&2){let t,e=m(2);n(),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.noClients)}}function Te(l,p){if(l&1&&(r(0,"div",15),c(1),a()),l&2){let t,e=m(2);n(),u((t=e.strings().label)==null?null:t.loading)}}function Me(l,p){if(l&1&&(r(0,"span",38),c(1),a()),l&2){let t=m().$implicit;n(),O("(",t.name,")")}}function Re(l,p){if(l&1){let t=N();r(0,"mat-icon",41),L("click",function(i){R(t);let o=m().$implicit,s=m(3);return P(s.killClient(o.id,i))}),c(1,"close"),a()}if(l&2){let t,e=m(4);$("matTooltip",(t=e.strings().page)==null||t.monitor==null?null:t.monitor.killClient)}}function Pe(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",36)(2,"span",37),c(3),a(),y(4,Me,2,1,"span",38),r(5,"span",39),c(6),a(),y(7,Re,2,1,"mat-icon",40),a()(),C(8,"mat-divider")),l&2){let t=p.$implicit,e=m(3);n(3),u(t.addr),n(),b(t.name?4:-1),n(2),pt(" db",t.db," \xB7 ",t.cmd," \xB7 ",t.idle,"s "),n(),b(e.isReadonly?-1:7)}}function Le(l,p){if(l&1&&(r(0,"mat-list"),J(1,Pe,9,6,null,null,Qt),a()),l&2){let t=m(2);n(),X(t.clientList)}}function Ke(l,p){if(l&1){let t=N();r(0,"p3xr-ng-button",35),L("click",function(i){return R(t),m(2).loadTopKeys(),P(i.stopPropagation())}),a()}if(l&2){let t,e=m(2);$("label",(t=e.strings().intention)==null?null:t.refresh)}}function Ve(l,p){if(l&1&&(r(0,"div",15),c(1),a()),l&2){let t,e=m(2);n(),u((t=e.strings().page)==null||t.monitor==null?null:t.monitor.noKeys)}}function Fe(l,p){if(l&1&&(r(0,"div",15),c(1),a()),l&2){let t,e=m(2);n(),u((t=e.strings().label)==null?null:t.loading)}}function Be(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",11)(2,"div",12)(3,"span",42),c(4),a(),r(5,"span",43),c(6),a()(),r(7,"div",13),c(8),a()()(),C(9,"mat-divider")),l&2){let t=p.$implicit,e=p.$index,i=m(3);n(4),O("#",e+1),n(2),u(t.key),n(2),u(i.formatBytes(t.bytes))}}function ze(l,p){if(l&1&&(r(0,"mat-list"),J(1,Be,10,3,null,null,ie),a()),l&2){let t=m(2);n(),X(t.topKeys)}}function De(l,p){l&1&&(r(0,"div",15),c(1,"No slot data"),a())}function He(l,p){if(l&1&&c(0),l&2){let t=m().$implicit;O(" ",t["key-count"]," keys ")}}function Oe(l,p){if(l&1&&c(0),l&2){let t=m().$implicit;O(" ",t["cpu-usec"]," \u03BCs ")}}function Ue(l,p){if(l&1&&c(0),l&2){let t=m().$implicit,e=m(4);O(" ",e.formatBytes(t["memory-bytes"])," ")}}function Ae(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",11)(2,"div",12)(3,"span",42),c(4),a(),r(5,"span",51),c(6),a()(),r(7,"div",13),y(8,He,1,1),y(9,Oe,1,1),y(10,Ue,1,1),a()()(),C(11,"mat-divider")),l&2){let t=p.$implicit,e=p.$index,i=m(4);n(4),O("#",e+1),n(2),O("Slot ",t.slot),n(2),b(i.slotStatsMetric==="KEY-COUNT"?8:-1),n(),b(i.slotStatsMetric==="CPU-USEC"?9:-1),n(),b(i.slotStatsMetric==="MEMORY-BYTES"?10:-1)}}function je(l,p){if(l&1&&(r(0,"mat-list"),J(1,Ae,12,5,null,null,ne),a()),l&2){let t=m(3);n(),X(t.slotStats)}}function Ne(l,p){if(l&1){let t=N();C(0,"br"),r(1,"p3xr-ng-accordion",44)(2,"div",6)(3,"p3xr-ng-button",35),L("click",function(i){return R(t),m(2).loadSlotStats(),P(i.stopPropagation())}),a()(),r(4,"div",10)(5,"div",45)(6,"mat-form-field",46)(7,"mat-label"),c(8,"Metric"),a(),r(9,"select",47),ht("ngModelChange",function(i){R(t);let o=m(2);return xt(o.slotStatsMetric,i)||(o.slotStatsMetric=i),P(i)}),L("change",function(){R(t);let i=m(2);return P(i.loadSlotStats())}),r(10,"option",48),c(11,"Key Count"),a(),r(12,"option",49),c(13,"CPU (\u03BCs)"),a(),r(14,"option",50),c(15,"Memory (bytes)"),a()()()(),y(16,De,2,0,"div",15),y(17,je,3,0,"mat-list"),a()()}if(l&2){let t,e,i=m(2);n(),$("title",(t=i.strings().page)==null||t.monitor==null?null:t.monitor.slotStats),n(2),$("label",(e=i.strings().intention)==null?null:e.refresh),n(6),_t("ngModel",i.slotStatsMetric),n(7),b(i.slotStats.length===0&&i.slotStatsLoaded?16:-1),n(),b(i.slotStats.length>0?17:-1)}}function We(l,p){if(l&1){let t=N();r(0,"p3xr-ng-button",35),L("click",function(i){return R(t),m(3).loadClusterShards(),P(i.stopPropagation())}),a()}if(l&2){let t,e=m(3);$("label",(t=e.strings().intention)==null?null:t.refresh)}}function qe(l,p){if(l&1&&(r(0,"div",23),c(1),a()),l&2){let t,e=m(3);n(),O(" ",(t=e.strings().page)==null||t.monitor==null?null:t.monitor.noClusterData," ")}}function Ye(l,p){if(l&1&&(r(0,"span",56),c(1),a()),l&2){let t=m().$implicit,e=m(4);n(),O("(",e.formatReplicas(t),")")}}function Qe(l,p){if(l&1&&(r(0,"mat-list-item")(1,"div",11)(2,"div",12)(3,"span",54),c(4),a(),r(5,"span",55),c(6),a()(),r(7,"div",13),c(8),y(9,Ye,2,1,"span",56),a()()(),C(10,"mat-divider")),l&2){let t,e=p.$implicit,i=m(4);n(4),tt("",e.master.host,":",e.master.port),n(2),O(" ",i.formatSlotRanges(e)," "),n(2),tt(" ",i.getSlotCount(e)," ",(t=i.strings().page)==null||t.monitor==null?null:t.monitor.totalSlots," "),n(),b(e.replicas.length>0?9:-1)}}function Ze(l,p){if(l&1&&(r(0,"mat-list"),J(1,Qe,11,6,null,null,oe),a(),r(3,"div",53),c(4),a()),l&2){let t=m(3);n(),X(t.clusterShards),n(3),O(" 16384 slots across ",t.clusterShards.length," masters ")}}function Ge(l,p){if(l&1){let t=N();C(0,"br"),r(1,"p3xr-ng-accordion",52)(2,"div",6)(3,"p3xr-ng-button",7),L("click",function(i){return R(t),m(2).toggleAutoRefreshShards(),P(i.stopPropagation())}),a(),y(4,We,1,1,"p3xr-ng-button",25),r(5,"p3xr-ng-button",8),L("click",function(i){return R(t),m(2).exportClusterSlots(),P(i.stopPropagation())}),a()(),r(6,"div",10),y(7,qe,2,1,"div",23)(8,Ze,5,1),a()()}if(l&2){let t,e,i,o=m(2);n(),$("title",(t=o.strings().page)==null||t.monitor==null?null:t.monitor.clusterSlotMap),n(2),$("label",(e=o.strings().label)==null?null:e.autoRefresh)("mdIcon",o.autoRefreshShards?"check_box":"check_box_outline_blank"),n(),b(o.autoRefreshShards?-1:4),n(),$("label",(i=o.strings().intention)==null?null:i.export),n(2),b(o.clusterShards?8:7)}}function Je(l,p){if(l&1){let t=N();r(0,"p3xr-ng-accordion",5)(1,"div",6)(2,"p3xr-ng-button",7),L("click",function(i){return R(t),m().togglePause(),P(i.stopPropagation())}),a(),r(3,"p3xr-ng-button",8),L("click",function(i){return R(t),m().exportOverview(),P(i.stopPropagation())}),a(),r(4,"p3xr-ng-button",9),L("click",function(i){return R(t),m().exportAll(),P(i.stopPropagation())}),a()(),r(5,"div",10)(6,"mat-list")(7,"mat-list-item")(8,"div",11)(9,"div",12),c(10),a(),r(11,"div",13),c(12),a()()(),C(13,"mat-divider"),r(14,"mat-list-item")(15,"div",11)(16,"div",12),c(17),a(),r(18,"div",13),c(19),a()()(),C(20,"mat-divider"),r(21,"mat-list-item")(22,"div",11)(23,"div",12),c(24),a(),r(25,"div",13),c(26),a()()(),C(27,"mat-divider"),r(28,"mat-list-item")(29,"div",11)(30,"div",12),c(31),a(),r(32,"div",13),c(33),a()()(),C(34,"mat-divider"),r(35,"mat-list-item")(36,"div",11)(37,"div",12),c(38),a(),r(39,"div",13),c(40),a()()(),C(41,"mat-divider"),r(42,"mat-list-item")(43,"div",11)(44,"div",12),c(45),a(),r(46,"div",13),c(47),a()()(),C(48,"mat-divider"),r(49,"mat-list-item")(50,"div",11)(51,"div",12),c(52),a(),r(53,"div",13),c(54),a()()(),C(55,"mat-divider"),r(56,"mat-list-item")(57,"div",11)(58,"div",12),c(59),a(),r(60,"div",13),c(61),a()()(),C(62,"mat-divider"),r(63,"mat-list-item")(64,"div",11)(65,"div",12),c(66),a(),r(67,"div",13),c(68),a()()(),C(69,"mat-divider"),r(70,"mat-list-item")(71,"div",11)(72,"div",12),c(73),a(),r(74,"div",13),c(75),a()()(),C(76,"mat-divider"),r(77,"mat-list-item")(78,"div",11)(79,"div",12),c(80),a(),r(81,"div",13),c(82),a()()(),C(83,"mat-divider"),r(84,"mat-list-item")(85,"div",11)(86,"div",12),c(87),a(),r(88,"div",13),c(89),ot(90,"number"),ot(91,"number"),a()()(),C(92,"mat-divider"),r(93,"mat-list-item")(94,"div",11)(95,"div",12),c(96),a(),r(97,"div",13),c(98),a()()(),C(99,"mat-divider"),r(100,"mat-list-item")(101,"div",11)(102,"div",12),c(103),a(),r(104,"div",13),c(105),a()()()()()(),y(106,de,23,10),y(107,pe,34,11),y(108,he,15,7),y(109,Ce,8,2),C(110,"br"),r(111,"p3xr-ng-accordion",14)(112,"div",6)(113,"p3xr-ng-button",8),L("click",function(i){return R(t),m().exportModules(),P(i.stopPropagation())}),a()(),r(114,"div",10),y(115,ve,2,1,"div",15),y(116,Se,3,0,"mat-list"),a()(),C(117,"br"),r(118,"p3xr-ng-accordion",16)(119,"div",6)(120,"p3xr-ng-button",8),L("click",function(i){R(t);let o=m();return o.exportChart(o.memoryChartRef,"memory"),P(i.stopPropagation())}),a()(),r(121,"div",10),C(122,"div",17,0),a()(),C(124,"br"),r(125,"p3xr-ng-accordion",18)(126,"div",6)(127,"p3xr-ng-button",8),L("click",function(i){R(t);let o=m();return o.exportChart(o.opsChartRef,"ops"),P(i.stopPropagation())}),a()(),r(128,"div",10),C(129,"div",17,1),a()(),C(131,"br"),r(132,"p3xr-ng-accordion",19)(133,"div",6)(134,"p3xr-ng-button",8),L("click",function(i){R(t);let o=m();return o.exportChart(o.clientsChartRef,"clients"),P(i.stopPropagation())}),a()(),r(135,"div",10),C(136,"div",17,2),a()(),C(138,"br"),r(139,"p3xr-ng-accordion",20)(140,"div",6)(141,"p3xr-ng-button",8),L("click",function(i){R(t);let o=m();return o.exportChart(o.networkChartRef,"network"),P(i.stopPropagation())}),a()(),r(142,"div",10),C(143,"div",17,3),a()(),C(145,"br"),r(146,"p3xr-ng-accordion",21)(147,"div",6),y(148,$e,1,0,"p3xr-ng-button",22),r(149,"p3xr-ng-button",8),L("click",function(i){return R(t),m().exportSlowLog(),P(i.stopPropagation())}),a()(),r(150,"div",10),y(151,we,2,1,"div",23),r(152,"mat-list"),J(153,ke,7,2,null,null,Qt),a()()(),C(155,"br"),r(156,"p3xr-ng-accordion",24)(157,"div",6)(158,"p3xr-ng-button",7),L("click",function(i){return R(t),m().toggleAutoRefreshClients(),P(i.stopPropagation())}),a(),y(159,Ie,1,1,"p3xr-ng-button",25),r(160,"p3xr-ng-button",8),L("click",function(i){return R(t),m().exportClientList(),P(i.stopPropagation())}),a()(),r(161,"div",10),y(162,Ee,2,1,"div",15),y(163,Te,2,1,"div",15),y(164,Le,3,0,"mat-list"),a()(),C(165,"br"),r(166,"p3xr-ng-accordion",26)(167,"div",6)(168,"p3xr-ng-button",7),L("click",function(i){return R(t),m().toggleAutoRefreshTopKeys(),P(i.stopPropagation())}),a(),y(169,Ke,1,1,"p3xr-ng-button",25),r(170,"p3xr-ng-button",8),L("click",function(i){return R(t),m().exportTopKeys(),P(i.stopPropagation())}),a()(),r(171,"div",10),y(172,Ve,2,1,"div",15),y(173,Fe,2,1,"div",15),y(174,ze,3,0,"mat-list"),a()(),y(175,Ne,18,5),y(176,Ge,9,6)}if(l&2){let t,e,i,o,s,_,f,I,F,B,v,T,z,w,h,x,D,E,S,U,j,A,g,M,H,W,Q,K,k,V,q,Z,et,rt,at,d=m();$("title",(t=d.strings().page)==null||t.monitor==null?null:t.monitor.title),n(2),$("label",d.paused?(e=d.strings().intention)==null?null:e.resume:(e=d.strings().intention)==null?null:e.pause)("mdIcon",d.paused?"play_arrow":"pause"),n(),$("label",(i=d.strings().intention)==null?null:i.export),n(),$("label",(o=d.strings().page)==null||o.analysis==null?null:o.analysis.exportAll),n(6),tt("Redis ",d.current.server.version," \xB7 ",d.current.server.mode),n(2),u(d.uptimeFormatted),n(5),u((s=d.strings().page)==null||s.monitor==null?null:s.monitor.memory),n(2),u(d.current.memory.usedHuman),n(5),u((_=d.strings().page)==null||_.monitor==null?null:_.monitor.rss),n(2),u(d.current.memory.rssHuman),n(5),u((f=d.strings().page)==null||f.monitor==null?null:f.monitor.peak),n(2),u(d.current.memory.peakHuman),n(5),u((I=d.strings().page)==null||I.monitor==null?null:I.monitor.fragmentation),n(2),O("",d.current.memory.fragRatio,"x"),n(5),u((F=d.strings().page)==null||F.monitor==null?null:F.monitor.opsPerSec),n(2),u(d.current.stats.opsPerSec),n(5),u((B=d.strings().page)==null||B.monitor==null?null:B.monitor.totalCommands),n(2),u(d.current.stats.totalCommands),n(5),u((v=d.strings().page)==null||v.monitor==null?null:v.monitor.clients),n(2),u(d.current.clients.connected),n(5),u((T=d.strings().page)==null||T.monitor==null?null:T.monitor.blocked),n(2),u(d.current.clients.blocked),n(5),u((z=d.strings().page)==null||z.monitor==null?null:z.monitor.hitsMisses),n(2),O("",d.current.stats.hitRate,"%"),n(5),u((w=d.strings().page)==null||w.monitor==null?null:w.monitor.hitsAndMisses),n(2),tt("",d.current.stats.hits," / ",d.current.stats.misses),n(5),u((h=d.strings().page)==null||h.monitor==null?null:h.monitor.networkIo),n(2),tt("",lt(90,74,d.current.stats.inputKbps,"1.1-1")," / ",lt(91,77,d.current.stats.outputKbps,"1.1-1")," KB/s"),n(7),u((x=d.strings().page)==null||x.monitor==null?null:x.monitor.expired),n(2),u(d.current.stats.expiredKeys),n(5),u((D=d.strings().page)==null||D.monitor==null?null:D.monitor.evicted),n(2),u(d.current.stats.evictedKeys),n(),b(d.serverInfo?106:-1),n(),b(d.persistenceInfo?107:-1),n(),b(d.replicationInfo?108:-1),n(),b(d.keyspaceEntries.length>0?109:-1),n(2),$("title",(E=d.strings().page)==null||E.monitor==null?null:E.monitor.modules),n(2),$("label",(S=d.strings().intention)==null?null:S.export),n(2),b(d.modulesList.length===0?115:-1),n(),b(d.modulesList.length>0?116:-1),n(2),$("title",((U=d.strings().page)==null||U.monitor==null?null:U.monitor.memory)+" (MB)"),n(2),$("label",(j=d.strings().intention)==null?null:j.export),n(5),$("title",(A=d.strings().page)==null||A.monitor==null?null:A.monitor.opsPerSec),n(2),$("label",(g=d.strings().intention)==null?null:g.export),n(5),$("title",(M=d.strings().page)==null||M.monitor==null?null:M.monitor.clients),n(2),$("label",(H=d.strings().intention)==null?null:H.export),n(5),$("title",((W=d.strings().page)==null||W.monitor==null?null:W.monitor.networkIo)+" (KB/s)"),n(2),$("label",(Q=d.strings().intention)==null?null:Q.export),n(5),$("title",(K=d.strings().page)==null||K.monitor==null?null:K.monitor.slowLog),n(2),b(d.isReadonly?-1:148),n(),$("label",(k=d.strings().intention)==null?null:k.export),n(2),b(d.current.slowlog.length===0?151:-1),n(2),X(d.current.slowlog),n(3),$("title",(V=d.strings().page)==null||V.monitor==null?null:V.monitor.clientList),n(2),$("label",(q=d.strings().label)==null?null:q.autoRefresh)("mdIcon",d.autoRefreshClients?"check_box":"check_box_outline_blank"),n(),b(d.autoRefreshClients?-1:159),n(),$("label",(Z=d.strings().intention)==null?null:Z.export),n(2),b(d.clientList.length===0&&d.clientListLoaded?162:-1),n(),b(d.clientList.length===0&&!d.clientListLoaded?163:-1),n(),b(d.clientList.length>0?164:-1),n(2),$("title",(et=d.strings().page)==null||et.monitor==null?null:et.monitor.topKeys),n(2),$("label",(rt=d.strings().label)==null?null:rt.autoRefresh)("mdIcon",d.autoRefreshTopKeys?"check_box":"check_box_outline_blank"),n(),b(d.autoRefreshTopKeys?-1:169),n(),$("label",(at=d.strings().intention)==null?null:at.export),n(2),b(d.topKeys.length===0&&d.topKeysLoaded?172:-1),n(),b(d.topKeys.length===0&&!d.topKeysLoaded?173:-1),n(),b(d.topKeys.length>0?174:-1),n(),b(d.isCluster&&d.state.redisVersion().isAtLeast(8,2)?175:-1),n(),b(d.isCluster?176:-1)}}var Xe=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),Yt=l=>Xe.format(new Date(l)),ti=120,Ri=(()=>{class l{i18n;socket;common;cdr;ngZone;elementRef;state;monitorData;strings;current=null;history=[];paused=!1;clientList=[];topKeys=[];isReadonly=!1;autoRefreshClients=localStorage.getItem("p3xr-monitor-auto-clients")==="true";autoRefreshTopKeys=localStorage.getItem("p3xr-monitor-auto-topkeys")==="true";clientListLoaded=!1;topKeysLoaded=!1;slotStats=[];slotStatsMetric="KEY-COUNT";slotStatsLoaded=!1;isCluster=!1;clusterShards=null;autoRefreshShards=localStorage.getItem("p3xr-monitor-auto-shards")==="true";shardsInterval=null;memoryChartRef;opsChartRef;clientsChartRef;networkChartRef;intervalId;uPlot;memoryPlot;opsPlot;clientsPlot;networkPlot;chartsInitialized=!1;resizeObserver=null;themeObserver=null;unsubFns=[];boundRecalcHost=null;constructor(t,e,i,o,s,_,f,I){this.i18n=t,this.socket=e,this.common=i,this.cdr=o,this.ngZone=s,this.elementRef=_,this.state=f,this.monitorData=I,this.strings=this.i18n.strings}ngOnInit(){this.isReadonly=this.state.connection()?.readonly===!0,this.isCluster=this.state.connection()?.cluster===!0,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===!0,this.isCluster=this.state.connection()?.cluster===!0,this.history=[],this.chartsInitialized=!1,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:!0,attributeFilter:["class"]});let e=this.i18n.currentLang(),i=setInterval(()=>{let o=this.i18n.currentLang();o!==e&&(e=o,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 Y(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=!0}})}killClient(t,e){return Y(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 Y(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=!0,this.slotStats=[]}})}loadTopKeys(){return Y(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=!0}})}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(o=>`${o.db}: ${e.keys}: ${o.keys}, ${e.expires}: ${o.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(o=>`${o.name} v${o.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 o=document.createElement("canvas");o.width=i.width,o.height=i.height;let s=o.getContext("2d");s.fillStyle=getComputedStyle(document.body).getPropertyValue("--p3xr-body-bg").trim()||"#ffffff",s.fillRect(0,0,o.width,o.height),s.drawImage(i,0,0);let _=o.toDataURL("image/png"),f=document.createElement("a");f.href=_,f.download=`${this.connName}-${e}.png`,f.click()}resetSlowLog(){return Y(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 Y(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,o])=>e+(o-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(([_,f])=>`${_}-${f}`).join(", "),o=this.getSlotCount(e),s=e.replicas.map(_=>`${_.host}:${_.port}`).join(", ");return`${e.master.host}:${e.master.port} | ${i} | ${o} slots | replicas: ${s||"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 Y(this,null,function*(){if(this.current)try{let t=(yield import("./chunk-FRQ4SGG5.js")).default,e=new t,i=this.current,o=[],s=this.strings().page?.monitor||{},_=this.strings().page?.analysis||{};o.push("============================"," PULSE","============================","",`--- ${s.title} ---`,`Redis ${i.server.version} \xB7 ${i.server.mode} \xB7 Uptime: ${this.uptimeFormatted}`,`${s.memory}: ${i.memory.usedHuman}`,`${s.rss}: ${i.memory.rssHuman}`,`${s.peak}: ${i.memory.peakHuman}`,`${s.fragmentation}: ${i.memory.fragRatio}x`,`${s.opsPerSec}: ${i.stats.opsPerSec}`,`${s.totalCommands}: ${i.stats.totalCommands}`,`${s.clients}: ${i.clients.connected}`,`${s.blocked}: ${i.clients.blocked}`,`${s.hitsMisses}: ${i.stats.hitRate}%`,`${s.hitsAndMisses}: ${i.stats.hits} / ${i.stats.misses}`,`${s.networkIo}: ${i.stats.inputKbps.toFixed(1)} / ${i.stats.outputKbps.toFixed(1)} KB/s`,`${s.expired}: ${i.stats.expiredKeys}`,`${s.evicted}: ${i.stats.evictedKeys}`);let f=this.serverInfo;f&&(o.push("",`--- ${s.serverInfo} ---`),o.push(`${s.os}: ${f.os}`,`${s.port}: ${f.port}`,`${s.pid}: ${f.pid}`),f.configFile&&o.push(`${s.configFile}: ${f.configFile}`),o.push(`${s.cpuSys} CPU: ${f.cpuSys}`,`${s.cpuUser} CPU: ${f.cpuUser}`));let I=this.persistenceInfo;I&&(o.push("",`--- ${s.persistence} ---`),o.push(`${s.rdbLastSave}: ${I.rdbLastSave}`,`${s.rdbStatus}: ${I.rdbStatus}`),o.push(`${s.rdbChanges}: ${I.rdbChanges}`,`${s.aofEnabled}: ${I.aofEnabled}`),I.aofSize&&o.push(`${s.aofSize}: ${I.aofSize}`));let F=this.replicationInfo;F&&(o.push("",`--- ${s.replication} ---`),o.push(`${s.role}: ${F.role}`),F.replicas!==void 0&&o.push(`${s.replicas}: ${F.replicas}`),F.masterHost&&o.push(`${s.masterHost}: ${F.masterHost}:${F.masterPort}`),F.linkStatus&&o.push(`${s.linkStatus}: ${F.linkStatus}`));let B=this.keyspaceEntries;B.length>0&&(o.push("",`--- ${s.keyspace} ---`),o.push(...B.map(g=>`${g.db}: ${s.keys}: ${g.keys}, ${s.expires}: ${g.expires}`)));let v=this.modulesList;v.length>0?(o.push("",`--- ${s.modules} ---`),o.push(...v.map(g=>`${g.name} v${g.ver}`))):o.push("",`--- ${s.modules} ---`,s.noModules),i.slowlog.length>0&&(o.push("",`--- ${s.slowLog} ---`),o.push(...i.slowlog.map(g=>`${g.duration}\xB5s ${g.command}`))),this.clientList.length>0&&(o.push("",`--- ${s.clientList} ---`),o.push(...this.clientList.map(g=>`${g.addr} ${g.name||""} db${g.db} ${g.cmd} idle:${g.idle}s`))),this.topKeys.length>0&&(o.push("",`--- ${s.topKeys} ---`),o.push(...this.topKeys.map((g,M)=>`#${M+1} ${g.key} ${this.formatBytes(g.bytes)}`)));let T=[];try{let M=(yield this.socket.request({action:"memory/analysis",payload:{topN:20,maxScanKeys:5e3}})).data;if(M){let H=M.memoryInfo,W=M.expirationOverview,Q=Object.keys(M.typeDistribution||{}).map(K=>({type:K,count:M.typeDistribution[K],bytes:M.typeMemory?.[K]||0})).sort((K,k)=>k.bytes-K.bytes);o.push("","","============================"," ANALYSIS","============================"),o.push("",`--- ${_.keysScanned} ---`,`${_.keysScanned}: ${M.totalScanned} / ${M.dbSize}`),o.push("",`--- ${_.memoryBreakdown} ---`),o.push(`${_.totalMemory}: ${H.usedHuman}`,`${_.rssMemory}: ${H.rssHuman}`,`${_.peakMemory}: ${H.peakHuman}`),o.push(`${_.overheadMemory}: ${this.formatBytes(H.overhead)}`,`${_.datasetMemory}: ${this.formatBytes(H.dataset)}`),o.push(`${_.luaMemory}: ${this.formatBytes(H.lua)}`,`${_.fragmentation}: ${H.fragRatio}x`,`${_.allocator}: ${H.allocator}`),o.push("",`--- ${_.typeDistribution} ---`),o.push(...Q.map(K=>`${K.type}: ${K.count} ${_.keyCount}, ${this.formatBytes(K.bytes)}`)),M.prefixMemory?.length>0&&(o.push("",`--- ${_.prefixMemory} ---`),o.push(...M.prefixMemory.map((K,k)=>`#${k+1} ${K.prefix} \u2014 ${K.keyCount} ${_.keyCount}, ${this.formatBytes(K.totalBytes)}`))),o.push("",`--- ${_.expirationOverview} ---`),o.push(`${_.withTTL}: ${W.withTTL}`,`${_.persistent}: ${W.persistent}`,`${_.avgTTL}: ${W.avgTTL}s`),T=[{name:_.typeDistribution,items:Q.map(K=>({label:K.type,value:K.bytes}))},{name:_.prefixMemory,items:(M.prefixMemory||[]).slice(0,20).map(K=>({label:K.prefix,value:K.totalBytes}))}]}}catch(g){}let z=g=>g.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,""),w=[];this.monitorData.profilerEntries.length>0&&(w.push("","","============================"," PROFILER","============================",""),w.push(...this.monitorData.profilerEntries.map(g=>z(`${g.fullTimestamp} [${g.database} ${g.source}] ${g.command}`)))),this.monitorData.pubsubEntries.length>0&&(w.push("","","============================"," PUBSUB","============================",""),w.push(...this.monitorData.pubsubEntries.map(g=>z(`${g.fullTimestamp} ${g.channel} ${g.message}`))));let h=[...o,...w].join(`
`),x=new TextEncoder().encode(h),D=new Uint8Array([239,187,191]),E=new Uint8Array(D.length+x.length);E.set(D),E.set(x,D.length),e.file("monitoring.txt",E);let S=[];S.push(...this.renderPulseChartsForExport());for(let g of T){if(g.items.length===0)continue;let M=this.renderBarChart(g.items);M&&S.push({label:g.name,canvas:M})}if(S.length>0){let g=yield this.stitchCharts(S);g&&e.file("charts.png",g)}try{let g=yield this.generatePdf(o,S,w);g&&e.file("monitoring.pdf",g)}catch(g){}let U=yield e.generateAsync({type:"blob"}),j=URL.createObjectURL(U),A=document.createElement("a");A.href=j,A.download=`${this.connName}-monitoring.zip`,A.click(),URL.revokeObjectURL(j)}catch(t){this.common.generalHandleError(t)}})}stitchCharts(t){return Y(this,null,function*(){let s=Math.max(2400,...t.map(T=>T.canvas.width)),_=32;for(let T of t){let z=T.canvas.height*(s/T.canvas.width);_+=60+z+40}_+=32;let f=document.createElement("canvas");f.width=s,f.height=_;let I=f.getContext("2d"),F=getComputedStyle(document.body).getPropertyValue("--p3xr-body-bg").trim()||"#ffffff",B=this.getChartColors();I.fillStyle=F,I.fillRect(0,0,s,_);let v=32;for(let T of t){I.fillStyle=B.text,I.font="bold 28px Roboto, sans-serif",I.textAlign="left",I.textBaseline="top",I.fillText(T.label,32,v),v+=60;let z=s-64,w=T.canvas.height*(z/T.canvas.width);I.drawImage(T.canvas,32,v,z,w),v+=w+40}return new Promise(T=>f.toBlob(z=>T(z),"image/png"))})}renderPulseChartsForExport(){let t;if(this.history.length>=2)t=this.buildChartData();else if(this.current){let s=this.current,_=Date.now()/1e3;t={timestamps:[_-1,_],memUsed:[s.memory.used/(1024*1024),s.memory.used/(1024*1024)],memRss:[s.memory.rss/(1024*1024),s.memory.rss/(1024*1024)],ops:[s.stats.opsPerSec,s.stats.opsPerSec],connected:[s.clients.connected,s.clients.connected],blocked:[s.clients.blocked,s.clients.blocked],netIn:[s.stats.inputKbps,s.stats.inputKbps],netOut:[s.stats.outputKbps,s.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:!0},{label:"RSS",color:e.accent,values:t.memRss}]},{label:i.opsPerSec,series:[{label:i.opsPerSec,color:e.primary,values:t.ops,fill:!0}]},{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:!0},{label:"\u2191 Out",color:e.accent,values:t.netOut}]}].map(s=>({label:s.label,canvas:this.renderLineChart(t.timestamps,s.series,e)}))}renderLineChart(t,e,i){let w=document.createElement("canvas");w.width=900*2,w.height=260*2;let h=w.getContext("2d");h.scale(2,2),h.fillStyle=getComputedStyle(document.body).getPropertyValue("--p3xr-body-bg").trim()||"#ffffff",h.fillRect(0,0,900,260);let x=t.length;if(x<2)return w;let D=1/0,E=-1/0;for(let k of e)for(let V of k.values)V<D&&(D=V),V>E&&(E=V);D===E&&(D-=1,E+=1);let S=E-D,U=t[0],A=t[x-1]-U||1,g=k=>60+(k-U)/A*824,M=k=>200-(k-D)/S*168;h.strokeStyle=i.grid,h.lineWidth=1;let H=5;for(let k=0;k<=H;k++){let V=32+168/H*k;h.beginPath(),h.moveTo(60,V),h.lineTo(884,V),h.stroke();let q=E-S/H*k;h.fillStyle=i.text,h.font="10px Roboto Mono, monospace",h.textAlign="right",h.textBaseline="middle",h.fillText(q>=1e3?(q/1e3).toFixed(1)+"k":q.toFixed(1),54,V)}let W=Math.min(6,x);h.font="10px Roboto, sans-serif",h.textAlign="center",h.textBaseline="top",h.fillStyle=i.text;for(let k=0;k<W;k++){let V=Math.round(k/(W-1)*(x-1)),q=t[V],Z=new Date(q*1e3),et=`${String(Z.getHours()).padStart(2,"0")}:${String(Z.getMinutes()).padStart(2,"0")}:${String(Z.getSeconds()).padStart(2,"0")}`;h.fillText(et,g(q),206)}for(let k of e){h.strokeStyle=k.color,h.lineWidth=2,h.lineJoin="round",h.beginPath();for(let V=0;V<x;V++){let q=g(t[V]),Z=M(k.values[V]);V===0?h.moveTo(q,Z):h.lineTo(q,Z)}if(h.stroke(),k.fill){h.fillStyle=k.color+"20",h.beginPath(),h.moveTo(g(t[0]),M(k.values[0]));for(let V=1;V<x;V++)h.lineTo(g(t[V]),M(k.values[V]));h.lineTo(g(t[x-1]),200),h.lineTo(g(t[0]),200),h.closePath(),h.fill()}}let Q=60,K=244;h.font="11px Roboto, sans-serif",h.textAlign="left",h.textBaseline="middle";for(let k of e)h.fillStyle=k.color,h.fillRect(Q,K-4,12,8),h.fillStyle=i.text,h.fillText(k.label,Q+16,K),Q+=h.measureText(k.label).width+32;return w}renderBarChart(t){if(t.length===0)return null;let e=this.getChartColors(),i=e.text.includes("255"),o=[e.primary,e.accent,e.warn,i?"#ffb74d":"#ff9800",i?"#81c784":"#4caf50",i?"#4dd0e1":"#00bcd4",i?"#a1887f":"#795548",i?"#90a4ae":"#607d8b"],s=2,_=800,f=24,I=120,F=80,B=I+8,v=_-F-8,T=v-B,z=8,w=z+t.length*(f+4)+8,h=document.createElement("canvas");h.width=_*s,h.height=w*s;let x=h.getContext("2d");x.scale(s,s),x.fillStyle=getComputedStyle(document.body).getPropertyValue("--p3xr-body-bg").trim()||"#ffffff",x.fillRect(0,0,_,w);let D=Math.max(...t.map(E=>E.value),1);return t.forEach((E,S)=>{let U=z+S*(f+4);x.fillStyle=e.text,x.font="12px Roboto, sans-serif",x.textAlign="right",x.textBaseline="middle",x.fillText(E.label.length>15?E.label.substring(0,14)+"\u2026":E.label,I,U+f/2),x.fillStyle=e.grid,x.fillRect(B,U,T,f),x.fillStyle=o[S%o.length],x.fillRect(B,U,E.value/D*T,f),x.fillStyle=e.text,x.font="11px Roboto Mono, monospace",x.textAlign="left",x.fillText(this.formatBytes(E.value),v+8,U+f/2)}),h}generatePdf(o,s){return Y(this,arguments,function*(t,e,i=[]){let{jsPDF:_}=yield import("./chunk-VUJRHJL2.js"),f=document.body.classList.contains("p3xr-theme-dark"),I=getComputedStyle(document.body).getPropertyValue("--p3xr-body-bg").trim()||"#ffffff",F=f?"#e0e0e0":"#212121",B=f?"#90caf9":"#1565c0",v=new _({orientation:"portrait",unit:"mm",format:"a4"}),T=v.internal.pageSize.getWidth(),z=v.internal.pageSize.getHeight(),w=12,h=T-w*2,x=w,D=()=>{v.setFillColor(I),v.rect(0,0,T,z,"F")};D();let E=S=>{x+S>z-w&&(v.addPage(),D(),x=w)};for(let S of t){if(S.startsWith("===="))continue;if(S.trim()==="PULSE"||S.trim()==="PROFILER"||S.trim()==="PUBSUB"||S.trim()==="ANALYSIS"){E(14),x+=4,v.setFontSize(14),v.setTextColor(B),v.text(S.trim(),w,x),x+=8;continue}if(S.startsWith("---")&&S.endsWith("---")){E(8);let A=S.replace(/^-+\s*/,"").replace(/\s*-+$/,"");x+=2,v.setFontSize(10),v.setTextColor(B),v.text(A,w,x),x+=5;continue}if(S===""){x+=2;continue}E(4),v.setTextColor(F),v.setFontSize(8);let j=v.splitTextToSize(S,h);for(let A of j)E(4),v.text(A,w,x),x+=3.5}for(let S of e){v.addPage(),D(),x=w,v.setFontSize(12),v.setTextColor(B),v.text(S.label,w,x),x+=8;let U=S.canvas.toDataURL("image/png"),j=S.canvas.height/S.canvas.width,A=z-x-w,g=h,M=g*j;if(M>A){let H=A,W=H/j;v.addImage(U,"PNG",w,x,W,H),x+=H}else v.addImage(U,"PNG",w,x,g,M),x+=M}i.length>0&&e.length>0&&(v.addPage(),D(),x=w);for(let S of i){if(S.startsWith("===="))continue;if(S.trim()==="PROFILER"||S.trim()==="PUBSUB"){E(14),x+=4,v.setFontSize(14),v.setTextColor(B),v.text(S.trim(),w,x),x+=8;continue}if(S===""){x+=2;continue}E(4),v.setTextColor(F),v.setFontSize(8);let j=v.splitTextToSize(S,h);for(let A of j)E(4),v.text(A,w,x),x+=3.5}return v.output("blob")})}downloadText(t,e){let i=new Blob([t],{type:"text/plain"}),o=URL.createObjectURL(i),s=document.createElement("a");s.href=o,s.download=e,s.click(),URL.revokeObjectURL(o)}get uptimeFormatted(){if(!this.current)return"-";let t=this.current.server.uptime,e=Math.floor(t/86400),i=Math.floor(t%86400/3600),o=Math.floor(t%3600/60);return e>0?`${e}d ${i}h ${o}m`:i>0?`${i}h ${o}m`:`${o}m`}fetchData(){return Y(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>ti&&this.history.shift(),this.chartsInitialized?this.updateCharts():this.uPlot&&this.history.length>=2&&this.initCharts(),this.safeDetectChanges()}catch(t){}})}loadUPlot(){return Y(this,null,function*(){let t=yield import("./chunk-RM2ZFJOJ.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(),o=e.getPropertyValue("--p3xr-btn-accent-bg").trim(),s=e.getPropertyValue("--p3xr-btn-warn-bg").trim();return{primary:i||(t?"#90caf9":"#1976d2"),accent:o||(t?"#ce93d8":"#9c27b0"),warn:s||(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=!1,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:!0,drag:{x:!1,y:!1}},legend:{show:!0,live:!1},scales:{x:{time:!0}},axes:[{stroke:i.text,grid:{stroke:i.grid,width:1},ticks:{stroke:i.grid},font:"11px Roboto",values:(o,s)=>s.map(_=>Yt(_*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:(o,s)=>s?Yt(s*1e3):""},...e]}}initCharts(){if(!this.uPlot||this.chartsInitialized)return;let t=this.getChartColors(),e=this.buildChartData(),i=this.memoryChartRef?.nativeElement,o=this.opsChartRef?.nativeElement,s=this.clientsChartRef?.nativeElement,_=this.networkChartRef?.nativeElement;if(!i||!o||!s||!_)return;let f=this.strings().page?.monitor||{};this.memoryPlot=new this.uPlot(this.createOpts(this.getChartWidth(i),[{label:f.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(o),[{label:f.opsPerSec,stroke:t.primary,width:2,fill:t.primary+"20"}]),[e.timestamps,e.ops],o),this.clientsPlot=new this.uPlot(this.createOpts(this.getChartWidth(s),[{label:f.clients,stroke:t.primary,width:2},{label:f.blocked,stroke:t.warn,width:2}]),[e.timestamps,e.connected,e.blocked],s),this.networkPlot=new this.uPlot(this.createOpts(this.getChartWidth(_),[{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],_),this.chartsInitialized=!0;let I;this.resizeObserver=new ResizeObserver(()=>{clearTimeout(I),I=setTimeout(()=>{let F=this.getChartWidth(i),B=this.getChartWidth(o),v=this.getChartWidth(s),T=this.getChartWidth(_);F>0&&this.memoryPlot?.setSize({width:F,height:180}),B>0&&this.opsPlot?.setSize({width:B,height:180}),v>0&&this.clientsPlot?.setSize({width:v,height:180}),T>0&&this.networkPlot?.setSize({width:T,height:180})},50)}),this.resizeObserver.observe(i),this.resizeObserver.observe(o),this.resizeObserver.observe(s),this.resizeObserver.observe(_)}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(