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

2 lines • 2.96 kB
import{A as e,I as t,K as n,M as r,T as i,Y as a,_t as o,at as s,lt as c,q as l,rt as u,t as d,w as f}from"./i18n.store-Bkc9i0ZB.js";import{t as p}from"./_plugin-vue_export-helper-BZ1AqotW.js";import{t as m}from"./redis-state.store-6nwmGrRG.js";import{i as h}from"./index-BNz7Rlxf.js";import{t as g}from"./P3xrAccordion-HdyTZEnI.js";import{n as _,o as v,p as y}from"./monitoring-data-Co5q98XD.js";t(),c();var b=66,x=p(r({__name:`ProfilerPage`,setup(t){let r=d(),c=m(),p=y(),x=()=>r.strings,S=o(),C=0,w=null,T=null;function E(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function D(){return document.body.classList.contains(`p3xr-theme-dark`)?`rgba(255,255,255,0.05)`:`rgba(0,0,0,0.04)`}function O(e){let t=S.value;if(!t)return;let n=C++%2==1?` style="background-color:${D()}"`:``;for(t.insertAdjacentHTML(`beforeend`,`<div class="p3xr-profiler-entry"${n}><span style="opacity:0.5">${E(e.displayTime)}</span> <span style="opacity:0.7">[${E(e.database)} ${E(e.source)}]</span> ${E(e.command)}</div>`);t.children.length>b;)t.removeChild(t.firstChild);t.scrollTop=t.scrollHeight}function k(){let e=S.value;if(!e)return;let t=p.profilerEntries,n=Math.max(0,t.length-b);C=n;for(let e=n;e<t.length;e++)O(t[e]);e.scrollTop=e.scrollHeight}function A(){let e=S.value;if(!e)return;let t=e.getBoundingClientRect(),n=document.getElementById(`p3xr-layout-footer-container`)?.offsetHeight||48,r=getComputedStyle(document.documentElement).getPropertyValue(`--p3xr-console-drawer-height-active`).trim(),i=0;r.endsWith(`vh`)?i=Math.round(parseFloat(r)/100*window.innerHeight):r.endsWith(`px`)&&(i=parseFloat(r));let a=window.innerHeight-t.top-n-i-8;e.style.height=Math.max(a,100)+`px`}u(()=>c.consoleDrawerOpen,()=>{setTimeout(()=>A(),160)});function j(){_(),C=0,S.value&&(S.value.innerHTML=``)}function M(){let e=c.connection?.name,t=p.profilerEntries.map(e=>`${e.fullTimestamp} [${e.database} ${e.source}] ${e.command}`),n=new Blob([t.join(` `)],{type:`text/plain`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${e}-profiler-export.txt`,i.click(),URL.revokeObjectURL(r)}return n(()=>{document.body.classList.add(`p3xr-no-main-scroll`),setTimeout(()=>{k(),w=v(O)}),T=()=>A(),window.addEventListener(`resize`,T),setTimeout(()=>{A();let e=S.value;e&&(e.scrollTop=e.scrollHeight)},50)}),l(()=>{document.body.classList.remove(`p3xr-no-main-scroll`),w?.(),T&&window.removeEventListener(`resize`,T)}),(t,n)=>(a(),i(g,{title:``,"accordion-key":`profiler-monitor`,collapsible:!1},{actions:s(()=>[e(h,{onClick:n[0]||=e=>{j(),e.stopPropagation()},label:x()?.intention?.clear,icon:`mdi-backspace`},null,8,[`label`]),e(h,{onClick:n[1]||=e=>{M(),e.stopPropagation()},label:x()?.intention?.export,icon:`mdi-download`},null,8,[`label`])]),default:s(()=>[f(`div`,{ref_key:`profilerOutputEl`,ref:S,class:`p3xr-profiler-output`},null,512)]),_:1}))}}),[[`__scopeId`,`data-v-20b80a45`]]);export{x as default};