p3x-redis-ui-material
Version:
💿 P3X Redis UI triple frontend — Angular + React/MUI + Vue/Vuetify with 54 languages, 7 themes, Socket.IO, desktop notifications, and full feature parity
2 lines • 3.21 kB
JavaScript
import{A as e,I as t,K as n,M as r,T as i,Tt as a,Y as o,_t as s,at as c,g as l,lt as u,q as d,rt as f,t as p,u as m,w as h}from"./i18n.store-Bkc9i0ZB.js";import{t as g}from"./_plugin-vue_export-helper-BZ1AqotW.js";import{t as _}from"./redis-state.store-6nwmGrRG.js";import{i as v,x as y}from"./index-BNz7Rlxf.js";import{t as b}from"./P3xrAccordion-HdyTZEnI.js";import{c as x,p as S,r as C,s as w}from"./monitoring-data-Co5q98XD.js";t(),u(),m();var T={class:`p3xr-pubsub-pattern`},E=66,D=g(r({__name:`PubSubPage`,setup(t){let r=p(),u=_(),m=S(),g=()=>r.strings,D=s(),O=0,k=null,A=null;function j(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function M(){return document.body.classList.contains(`p3xr-theme-dark`)?`rgba(255,255,255,0.05)`:`rgba(0,0,0,0.04)`}function N(e){let t=D.value;if(!t)return;let n=O++%2==1?` style="background-color:${M()}"`:``;for(t.insertAdjacentHTML(`beforeend`,`<div class="p3xr-pubsub-entry"${n}><span style="opacity:0.5">${j(e.displayTime)}</span> <strong>${j(e.channel)}</strong> ${j(e.message)}</div>`);t.children.length>E;)t.removeChild(t.firstChild);t.scrollTop=t.scrollHeight}function P(){let e=D.value;if(!e)return;let t=m.pubsubEntries,n=Math.max(0,t.length-E);O=n;for(let e=n;e<t.length;e++)N(t[e]);e.scrollTop=e.scrollHeight}function F(){let e=D.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`}f(()=>u.consoleDrawerOpen,()=>{setTimeout(()=>F(),160)});function I(){C(),O=0,D.value&&(D.value.innerHTML=``)}function L(){let e=u.connection?.name,t=m.pubsubEntries.map(e=>`${e.fullTimestamp} ${e.channel} ${e.message}`),n=new Blob([t.join(`
`)],{type:`text/plain`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${e}-pubsub-export.txt`,i.click(),URL.revokeObjectURL(r)}async function R(){await x()}return n(()=>{document.body.classList.add(`p3xr-no-main-scroll`),setTimeout(()=>{P(),k=w(N)}),A=()=>F(),window.addEventListener(`resize`,A),setTimeout(()=>{F();let e=D.value;e&&(e.scrollTop=e.scrollHeight)},50)}),d(()=>{document.body.classList.remove(`p3xr-no-main-scroll`),k?.(),A&&window.removeEventListener(`resize`,A)}),(t,n)=>(o(),i(b,{title:``,"accordion-key":`profiler-pubsub`,collapsible:!1},{actions:c(()=>[e(v,{onClick:n[0]||=e=>{I(),e.stopPropagation()},label:g()?.intention?.clear,icon:`mdi-backspace`},null,8,[`label`]),e(v,{onClick:n[1]||=e=>{L(),e.stopPropagation()},label:g()?.intention?.export,icon:`mdi-download`},null,8,[`label`])]),default:c(()=>[h(`div`,T,[e(y,{modelValue:a(m).pubsubPattern,"onUpdate:modelValue":n[2]||=e=>a(m).pubsubPattern=e,label:`Pattern`,placeholder:`*`,"hide-details":``,onKeydown:n[3]||=l(e=>R(),[`enter`])},null,8,[`modelValue`])]),h(`div`,{ref_key:`pubsubOutputEl`,ref:D,class:`p3xr-pubsub-output`},null,512)]),_:1}))}}),[[`__scopeId`,`data-v-eff416ba`]]);export{D as default};