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,Ct as t,G as n,J as r,K as i,M as a,T as o,g as s,ht as c,it as l,nt as u,t as d,w as f}from"./i18n.store-B4krJCIS.js";import{t as p}from"./_plugin-vue_export-helper-67n0yneU.js";import{t as m}from"./VTextField-C3PCrz6s.js";import{t as h}from"./redis-state.store-DPDs81ZS.js";import{i as g}from"./index-CBO402jT.js";import{t as _}from"./P3xrAccordion-5b82nQm5.js";import{c as v,p as y,r as b,s as x}from"./monitoring-data-ChGoxjQz.js";var S={class:`p3xr-pubsub-pattern`},C=66,w=p(a({__name:`PubSubPage`,setup(a){let p=d(),w=h(),T=y(),E=()=>p.strings,D=c(),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>C;)t.removeChild(t.firstChild);t.scrollTop=t.scrollHeight}function P(){let e=D.value;if(!e)return;let t=T.pubsubEntries,n=Math.max(0,t.length-C);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`}u(()=>w.consoleDrawerOpen,()=>{setTimeout(()=>F(),160)});function I(){b(),O=0,D.value&&(D.value.innerHTML=``)}function L(){let e=w.connection?.name,t=T.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 v()}return n(()=>{document.body.classList.add(`p3xr-no-main-scroll`),setTimeout(()=>{P(),k=x(N)}),A=()=>F(),window.addEventListener(`resize`,A),setTimeout(()=>{F();let e=D.value;e&&(e.scrollTop=e.scrollHeight)},50)}),i(()=>{document.body.classList.remove(`p3xr-no-main-scroll`),k?.(),A&&window.removeEventListener(`resize`,A)}),(n,i)=>(r(),o(_,{title:``,"accordion-key":`profiler-pubsub`,collapsible:!1},{actions:l(()=>[e(g,{onClick:i[0]||=e=>{I(),e.stopPropagation()},label:E()?.intention?.clear,icon:`mdi-backspace`},null,8,[`label`]),e(g,{onClick:i[1]||=e=>{L(),e.stopPropagation()},label:E()?.intention?.export,icon:`mdi-download`},null,8,[`label`])]),default:l(()=>[f(`div`,S,[e(m,{modelValue:t(T).pubsubPattern,"onUpdate:modelValue":i[2]||=e=>t(T).pubsubPattern=e,label:`Pattern`,placeholder:`*`,"hide-details":``,onKeydown:i[3]||=s(e=>R(),[`enter`])},null,8,[`modelValue`])]),f(`div`,{ref_key:`pubsubOutputEl`,ref:D,class:`p3xr-pubsub-output`},null,512)]),_:1}))}}),[[`__scopeId`,`data-v-eff416ba`]]);export{w as default};