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 • 7.72 kB
import {X as Xe,f as fQ,Q,L as uc,cV as z,_ as _e,m as mb,aJ as jn,cj as He,bd as On,be as tn,cW as zt,cX as jt,cY as Vt,cZ as Nt,bc as Ut,ba as qe,c_ as bt,ck as Ve,cl as Be,e as aY,aK as iY,g as _A,y as yt,w as wt,d as ae,s as se$1,i as Qt,B as Ba,I as IS,v as vf,h as hv,k as bv,n as no,cr as Lv,bj as Mx,H as HT,c as In,t as If,r as ro,cs as Fv,p as pv,bk as Nx,U as UT,R as Rv,J as JT,bt as VT,x as YT,z as fm,A as pm,cu as AS}from'./chunk-BwlFOdbx.js';import'./main-HNF44SV3.js';var se=(t,c)=>c.key;function le(t,c){if(t&1&&(Ba(0,"div",6),IS(1),vf()),t&2){let e=JT();In(),If(" ",e.strings().label?.cheatsheet?.subtitle," ");}}function pe(t,c){if(t&1&&(Ba(0,"div",7),IS(1),vf()),t&2){let e=JT();In(),If(" ",e.strings().label?.cheatsheet?.footerHint," ");}}function ce(t,c){if(t&1&&(Ba(0,"div",19),IS(1),vf()),t&2){let e=JT().$implicit;In(),Rv(e.description);}}function me(t,c){if(t&1){let e=YT();Ba(0,"button",22),bv("click",function(){let i=fm(e).$implicit,p=JT(2);return pm(p.pick(i))}),IS(1),vf();}if(t&2){let e=c.$implicit;In(),If(" ",e," ");}}function de(t,c){if(t&1&&(Ba(0,"div",13)(1,"div",18),IS(2),vf(),no(3,ce,2,1,"div",19),Ba(4,"div",20),HT(5,me,2,1,"button",21,VT),vf()()),t&2){let e=c.$implicit,n=JT();In(2),Rv(e.name),In(),ro(e.description?3:-1),In(2),UT(n.filteredPrompts(e.prompts));}}function he(t,c){if(t&1&&(Ba(0,"div",14),IS(1),vf()),t&2){let e=JT();In(),If(" ",e.strings().label?.cheatsheet?.empty," ");}}var Pe=(()=>{class t{i18n;state;cdr;dialogRef;strings;filter="";constructor(e,n,i,p){this.i18n=e,this.state=n,this.cdr=i,this.dialogRef=p,this.strings=this.i18n.strings;}visibleGroups(){let e=this.strings()?.label?.cheatsheet?.groups;if(!e)return [];let n=(this.state.modules()||[]).map(h=>(h?.name||"").toLowerCase()),i=h=>{let m=this.state.redisVersion?.();return m?.isAtLeast?m.isAtLeast(h,0):false},p=this.state.info()?.server?.redis_mode==="cluster",d=[],s=(h,m)=>{!m||!Array.isArray(m.prompts)||m.prompts.length===0||d.push({key:h,name:m.name,description:m.description,prompts:m.prompts});};if(s("diagnostics",e.diagnostics),s("keys",e.keys),s("dataTypes",e.dataTypes),(n.includes("rejson")||n.includes("rejson-rl")||n.includes("json"))&&s("json",e.json),(n.includes("search")||n.includes("searchlight"))&&s("search",e.search),n.includes("timeseries")&&s("timeseries",e.timeseries),n.includes("bf")&&s("bloom",e.bloom),i(8)){s("vectorSet",e.vectorSet),s("redis8",e.redis8);let h=this.state.redisVersion?.();h?.isAtLeast&&h.isAtLeast(8,8)&&s("array",e.array);}return s("scripting",e.scripting),p&&s("cluster",e.cluster),i(6)&&s("acl",e.acl),s("qna",e.qna),s("translate",e.translate),d}filteredPrompts(e){let n=this.filter.trim().toLowerCase();return n?e.filter(i=>i.toLowerCase().includes(n)):e}emptyResults(){return this.visibleGroups().every(e=>this.filteredPrompts(e.prompts).length===0)}pick(e){this.dialogRef.close("ai: "+e);}openOfficialDocs(){window.open("https://redis.io/docs/latest/commands/","_blank");}close(){this.dialogRef.close(void 0);}static \u0275fac=function(n){return new(n||t)(Xe(fQ),Xe(Q),Xe(uc),Xe(z))};static \u0275cmp=_e({type:t,selectors:[["p3xr-ai-cheatsheet-dialog"]],decls:32,vars:8,consts:[[1,"p3xr-dialog-toolbar","p3xr-mat-layout-strong"],["mat-dialog-title","",1,"p3xr-dialog-title"],[2,"flex","1 1 auto"],["mat-icon-button","","type","button",3,"click"],[1,"p3xr-dialog-content","p3xr-cheatsheet-content"],[1,"p3xr-cheatsheet-sticky"],[1,"p3xr-cheatsheet-sub"],[1,"p3xr-cheatsheet-tip"],[1,"p3xr-cheatsheet-search"],["subscriptSizing","dynamic","appearance","fill",2,"width","100%"],["matPrefix",""],["matInput","",3,"ngModelChange","keydown","ngModel","placeholder"],[1,"p3xr-cheatsheet-groups"],[1,"p3xr-cheatsheet-group"],[1,"p3xr-cheatsheet-empty"],[1,"p3xr-dialog-actions","p3xr-cheatsheet-footer"],["mat-raised-button","","type","button",1,"btn-primary",3,"click"],["mat-flat-button","","type","button",1,"btn-primary",3,"click"],[1,"p3xr-cheatsheet-group-name"],[1,"p3xr-cheatsheet-group-desc"],[1,"p3xr-cheatsheet-prompts"],["type","button",1,"p3xr-cheatsheet-prompt"],["type","button",1,"p3xr-cheatsheet-prompt",3,"click"]],template:function(n,i){n&1&&(Ba(0,"mat-toolbar",0)(1,"span",1),IS(2),vf(),hv(3,"span",2),Ba(4,"button",3),bv("click",function(){return i.close()}),Ba(5,"mat-icon"),IS(6,"close"),vf()()(),Ba(7,"mat-dialog-content",4)(8,"div",5),no(9,le,2,1,"div",6),no(10,pe,2,1,"div",7),Ba(11,"div",8)(12,"mat-form-field",9)(13,"mat-icon",10),IS(14,"search"),vf(),Ba(15,"input",11),Lv("ngModelChange",function(d){return AS(i.filter,d)||(i.filter=d),d}),bv("keydown",function(d){return d.stopPropagation()}),vf(),Mx(),vf()()(),Ba(16,"div",12),HT(17,de,7,2,"div",13,se),no(19,he,2,1,"div",14),vf()(),Ba(20,"mat-dialog-actions",15),hv(21,"span",2),Ba(22,"button",16),bv("click",function(){return i.openOfficialDocs()}),Ba(23,"mat-icon"),IS(24,"menu_book"),vf(),Ba(25,"span"),IS(26),vf()(),Ba(27,"button",17),bv("click",function(){return i.close()}),Ba(28,"mat-icon"),IS(29,"close"),vf(),Ba(30,"span"),IS(31),vf()()()),n&2&&(In(2),If(" ",i.strings().label?.cheatsheet?.title," "),In(7),ro(i.strings().label?.cheatsheet?.subtitle?9:-1),In(),ro(i.strings().label?.cheatsheet?.footerHint?10:-1),In(5),Fv("ngModel",i.filter),pv("placeholder",i.strings().label?.cheatsheet?.searchPlaceholder??""),Nx(),In(2),UT(i.visibleGroups()),In(2),ro(i.emptyResults()?19:-1),In(7),Rv(i.strings().label?.cheatsheet?.openOfficialDocs),In(5),Rv(i.strings().intention?.close));},dependencies:[mb,jn,He,On,tn,zt,jt,Vt,Nt,Ut,qe,bt,Ve,Be,aY,iY,_A,yt,wt,ae,se$1,Qt],styles:[`.p3xr-cheatsheet-content.mat-mdc-dialog-content{padding:0!important}.p3xr-cheatsheet-sticky{position:sticky;top:0;z-index:2;background:var(--mat-app-background-color, inherit);border-bottom:1px solid var(--p3xr-content-border-color, rgba(255, 255, 255, .08));padding:12px 16px}.p3xr-cheatsheet-sub,.p3xr-cheatsheet-tip{font-size:13px;opacity:.8;line-height:1.4;padding-bottom:4px}.p3xr-cheatsheet-search{margin:0;padding:4px 0 0}.p3xr-cheatsheet-search .mat-mdc-form-field-subscript-wrapper,.p3xr-cheatsheet-search .mat-mdc-form-field-bottom-align{display:none!important;height:0!important;min-height:0!important}.p3xr-cheatsheet-search .mat-mdc-text-field-wrapper,.p3xr-cheatsheet-search .mat-mdc-form-field{margin:0!important}.p3xr-cheatsheet-groups{padding:12px 16px}.p3xr-cheatsheet-group:first-child .p3xr-cheatsheet-group-name{margin-top:0}.p3xr-cheatsheet-groups{padding:0 16px 16px}.p3xr-cheatsheet-group{margin-bottom:18px}.p3xr-cheatsheet-group-name{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;margin-top:6px;margin-bottom:4px;opacity:.85}.p3xr-cheatsheet-group-desc{font-size:12px;opacity:.65;margin-bottom:8px}.p3xr-cheatsheet-prompts{display:flex;flex-direction:column;gap:4px}.p3xr-cheatsheet-prompt{display:block;width:100%;text-align:left;font-family:Roboto Mono,monospace;font-size:12px;line-height:1.5;padding:8px 12px;border:1px solid var(--p3xr-content-border-color, rgba(127, 127, 127, .3));border-radius:4px;background:transparent;color:inherit;cursor:pointer;white-space:normal;word-break:break-word;overflow-wrap:anywhere;transition:background .1s ease,border-color .1s ease}.p3xr-cheatsheet-prompt:hover{background:var(--p3xr-accordion-bg, rgba(127, 127, 127, .12));border-color:var(--mat-sys-primary, currentColor)}.p3xr-cheatsheet-prompt:focus-visible{outline:2px solid var(--mat-sys-primary, currentColor);outline-offset:-1px}.p3xr-cheatsheet-empty{padding:24px;text-align:center;opacity:.6;font-size:13px}.p3xr-cheatsheet-footer{padding:10px 16px!important;min-height:auto!important}.p3xr-cheatsheet-footer-hint{font-size:11px;opacity:.7;line-height:1.4} `],encapsulation:2})}return t})();export{Pe as AiCheatsheetDialogComponent};