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.97 kB
JavaScript
import{A as e,G as t,J as n,K as r,M as i,T as a,ht as o,it as s,nt as c,t as l,w as u}from"./i18n.store-Bbsc3Bab.js";import{t as d}from"./_plugin-vue_export-helper-D1H5elb2.js";import{t as f}from"./redis-state.store-Bg6EmgAE.js";import"./redis-state-DodmMOrr.js";import{t as p}from"./P3xrButton-ChR905DO.js";import{t as m}from"./P3xrAccordion-Ch6mG6NP.js";import{n as h,o as g,p as _}from"./monitoring-data-D8pJVO5q.js";var v=66,y=d(i({__name:`ProfilerPage`,setup(i){let d=l(),y=f(),b=_(),x=()=>d.strings,S=o(),C=0,w=null,T=null;function E(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}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>v;)t.removeChild(t.firstChild);t.scrollTop=t.scrollHeight}function k(){let e=S.value;if(!e)return;let t=b.profilerEntries,n=Math.max(0,t.length-v);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`}c(()=>y.consoleDrawerOpen,()=>{setTimeout(()=>A(),160)});function j(){h(),C=0,S.value&&(S.value.innerHTML=``)}function M(){let e=y.connection?.name,t=b.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 t(()=>{document.body.classList.add(`p3xr-no-main-scroll`),setTimeout(()=>{k(),w=g(O)}),T=()=>A(),window.addEventListener(`resize`,T),setTimeout(()=>{A();let e=S.value;e&&(e.scrollTop=e.scrollHeight)},50)}),r(()=>{document.body.classList.remove(`p3xr-no-main-scroll`),w?.(),T&&window.removeEventListener(`resize`,T)}),(t,r)=>(n(),a(m,{title:``,"accordion-key":`profiler-monitor`,collapsible:!1},{actions:s(()=>[e(p,{onClick:r[0]||=e=>{j(),e.stopPropagation()},label:x()?.intention?.clear,icon:`mdi-backspace`},null,8,[`label`]),e(p,{onClick:r[1]||=e=>{M(),e.stopPropagation()},label:x()?.intention?.export,icon:`mdi-download`},null,8,[`label`])]),default:s(()=>[u(`div`,{ref_key:`profilerOutputEl`,ref:S,class:`p3xr-profiler-output`},null,512)]),_:1}))}}),[[`__scopeId`,`data-v-20b80a45`]]);export{y as default};