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 • 14.9 kB
JavaScript
import"./main-OCJB5534.js";import{Bi as ym,Di as wf,Dr as lo,Dt as Qe,Et as QT,F as HY,Gn as dT,In as by,It as Sn,Lt as Sy,P as HT,Pi as xf,Pn as bm,Qr as qC,Rn as co,T as Ee$1,Xt as Uy,_ as Cf,ei as qT,er as gT,in as Wa,k as G0,mn as YQ,pt as Nf,rn as WC,s as $y,t as $Y,un as XT,vr as jy,w as Eb,wi as vt,wr as lc}from"./chunk-CHqDEyfr.js";import"./chunk-BRxf0Wo1.js";import{n as x,t as Q}from"./chunk-CyniViPG.js";import{n as bi}from"./chunk-DjVJBOYc.js";import"./chunk-CWEwaFv9.js";import{a as jt,i as Vt,o as z,s as zt,t as Bt}from"./chunk-CyaMV1f5.js";import{a as je,t as It}from"./chunk-BM0xjj91.js";import{C as xn,a as He,c as Rn,f as an,g as kn,i as Gn,o as Jt,x as st,y as on}from"./chunk-B_FU7ynV.js";import{a as se,n as ae}from"./chunk-CNSP-oVC.js";import{n as wt,r as yt}from"./chunk-CGgWGJ3E.js";import{t as Q$1}from"./chunk-D56BNEWf.js";import"./chunk-CFyh5uM7.js";import{d as qe,i as Qt,o as U}from"./chunk-CLjqwtZV.js";import{i as ze,t as Oe}from"./chunk-BYtjyP-K.js";import"./chunk-CARSOUZ02.js";import{t as P}from"./chunk-BTZfv3-Q.js";import{n as we$1,t as te}from"./chunk-C3kuP7Oy.js";var _e=[`settingsForm`];var xe=a=>({keyCount:a});var ve=(a,x)=>({count:a,maxLightKeysCount:x});var be=a=>({maxLightKeysCount:a});function Me(a,x){if(a&1&&(Wa(0,`div`,7)(1,`div`),HT(2),wf(),Wa(3,`div`,33),HT(4),wf()()),a&2){let t=gT();Sn(2),jy(t.strings().form?.treeSettings?.keyCount?.(XT(2,xe,t.keysRawLength))),Sn(2),Nf(` `,t.strings().label?.tooManyKeys?.(QT(4,ve,t.keysRawLength,t.settings.maxLightKeysCount)),` `)}}function we(a,x){if(a&1&&(Wa(0,`div`,15),HT(1),wf()),a&2){let t=gT();Sn(),jy(t.strings().form?.treeSettings?.error?.page)}}function ke(a,x){if(a&1&&(Wa(0,`div`,15),HT(1),wf()),a&2){let t=gT();Sn(),jy(t.strings().form?.treeSettings?.error?.keyPageCount)}}function Ie(a,x){if(a&1&&(Wa(0,`div`,15),HT(1),wf()),a&2){let t=gT();Sn(),jy(t.strings().form?.treeSettings?.error?.maxValueDisplay)}}function Ee(a,x){if(a&1&&(Wa(0,`div`,11),HT(1),wf()),a&2){let t=gT();Sn(),jy(t.strings().form?.treeSettings?.maxValueDisplayInfo)}}function Te(a,x){if(a&1&&(Wa(0,`div`,15),HT(1),wf()),a&2){let t=gT();Sn(),jy(t.strings().form?.treeSettings?.error?.maxKeys)}}function De(a,x){if(a&1&&(Wa(0,`div`,11),HT(1),wf()),a&2){let t=gT();Sn(),jy(t.strings().form?.treeSettings?.maxKeysInfo)}}function Fe(a,x){if(a&1&&(Wa(0,`div`,38),HT(1),wf()),a&2){let t=gT(2);Sn(),Nf(` `,t.strings().page?.treeControls?.search?.largeSetInfo,` `)}}function Ve(a,x){if(a&1){let t=dT();Wa(0,`div`,34)(1,`mat-slide-toggle`,35),$y(`ngModelChange`,function(e){ym(t);let l=gT();return qT(l.model.keysSort,e)||(l.model.keysSort=e),bm(e)}),HT(2),wf(),WC(),Wa(3,`div`,11),HT(4),wf()(),Wa(5,`div`,36)(6,`mat-slide-toggle`,37),$y(`ngModelChange`,function(e){ym(t);let l=gT();return qT(l.model.searchClientSide,e)||(l.model.searchClientSide=e),bm(e)}),HT(7),wf(),WC(),Wa(8,`div`,11),HT(9),co(10,Fe,2,1,`div`,38),wf()()}if(a&2){let t=gT();Sn(),Uy(`ngModel`,t.model.keysSort),qC(),Sn(),Nf(` `,t.model.keysSort?t.strings().label?.keysSort?.on:t.strings().label?.keysSort?.off,` `),Sn(2),Nf(` `,t.strings().label?.treeKeyStore,` `),Sn(2),Uy(`ngModel`,t.model.searchClientSide),by(`disabled`,t.dbsize>t.settings.maxLightKeysCount),qC(),Sn(),Nf(` `,t.model.searchClientSide?t.strings().form?.treeSettings?.label?.searchModeClient:t.strings().form?.treeSettings?.label?.searchModeServer,` `),Sn(2),Nf(` `,t.strings().page?.treeControls?.search?.info?.(XT(8,be,t.settings.maxLightKeysCount)),` `),Sn(),lo(t.dbsize>t.settings.maxLightKeysCount?10:-1)}}var rt=(()=>{class a{dialogRef;i18n;settings;state;common;cmd;socket;treeBuilder;formRef;model={};reducedFunctions=!1;keysRawLength=0;dbsize=0;strings;constructor(t,d,e,l,m,o,Ce,ye){this.dialogRef=t,this.i18n=d,this.settings=e,this.state=l,this.common=m,this.cmd=o,this.socket=Ce,this.treeBuilder=ye,this.strings=this.i18n.strings}ngOnInit(){this.model={treeSeparator:this.settings.redisTreeDivider(),pageCount:this.settings.pageCount(),keyPageCount:this.settings.keyPageCount(),keysSort:this.settings.keysSort(),searchClientSide:this.settings.searchClientSide(),searchStartsWith:this.settings.searchStartsWith(),maxValueDisplay:this.settings.maxValueDisplay(),maxKeys:this.settings.maxKeys(),jsonFormat:this.settings.jsonFormat()===2,animation:this.settings.animation(),undoEnabled:this.settings.undoEnabled(),showDiffBeforeSave:this.settings.showDiffBeforeSave()},this.reducedFunctions=this.state.reducedFunctions()??!1,this.keysRawLength=this.state.keysRaw()?.length??0,this.dbsize=this.state.dbsize()??0}ngAfterViewInit(){setTimeout(()=>this.validateAllFields())}isFieldInvalid(t,d,e){let l=this.model[t];if(l==null||l===``)return!0;let m=Number(l);return isNaN(m)||!Number.isInteger(m)||m<d||m>e}validateField(t,d,e){let l=this.formRef?.controls[t];l&&(this.isFieldInvalid(t,d,e)?(l.setErrors({range:!0}),l.markAsTouched()):l.setErrors(null))}onFieldChange(t,d,e){setTimeout(()=>this.validateField(t,d,e))}validateAllFields(){this.validateField(`pageCount`,10,5e3),this.validateField(`keyPageCount`,5,100),this.validateField(`maxValueDisplay`,-1,32768),this.validateField(`maxKeys`,5,1e5)}showFieldError(t){let d=this.formRef?.controls[t];return!!d&&d.invalid&&(d.touched||this.formRef?.submitted)}markAllControlsTouched(){this.formRef&&Object.values(this.formRef.controls).forEach(t=>{t.markAsTouched(),t.updateValueAndValidity()})}handleInvalidForm(){return this.formRef?.invalid?(this.common.toast({message:this.strings().form?.error?.invalid}),!1):!0}submit(){if(this.markAllControlsTouched(),this.isFieldInvalid(`pageCount`,10,5e3)||this.isFieldInvalid(`keyPageCount`,5,100)||this.isFieldInvalid(`maxValueDisplay`,-1,32768)||this.isFieldInvalid(`maxKeys`,5,1e5)||!this.handleInvalidForm()){this.common.toast({message:this.strings().form?.error?.invalid});return}this.settings.redisTreeDivider.set(this.model.treeSeparator),this.settings.pageCount.set(this.model.pageCount),this.settings.keyPageCount.set(this.model.keyPageCount),this.settings.keysSort.set(this.model.keysSort),this.settings.searchClientSide.set(this.model.searchClientSide),this.settings.searchStartsWith.set(this.model.searchStartsWith),this.settings.maxValueDisplay.set(this.model.maxValueDisplay),this.settings.maxKeys.set(this.model.maxKeys),this.settings.jsonFormat.set(this.model.jsonFormat?2:4),this.settings.animation.set(this.model.animation),this.settings.undoEnabled.set(this.model.undoEnabled),this.settings.showDiffBeforeSave.set(this.model.showDiffBeforeSave),this.state.page.set(1),this.state.redisChanged.set(!0),this.cmd.refresh().then(()=>{this.socket.stateChanged$.next(),this.socket.tick()}),this.dialogRef.close()}cancel(){this.dialogRef.close()}static ɵfac=function(d){return new(d||a)(Qe(z),Qe(YQ),Qe(x),Qe(Q),Qe(It),Qe(P),Qe(bi),Qe(je))};static ɵcmp=Ee$1({type:a,selectors:[[`p3xr-treecontrol-settings-dialog`]],viewQuery:function(d,e){if(d&1&&lc(_e,5),d&2){let l;Cf(l=xf())&&(e.formRef=l.first)}},decls:68,vars:38,consts:[[`settingsForm`,`ngForm`],[`novalidate`,``,3,`ngSubmit`],[1,`p3xr-dialog-toolbar`,`p3xr-tree-settings-dialog-toolbar`,`p3xr-mat-layout-strong`],[`mat-dialog-title`,``,1,`p3xr-dialog-title`],[`mat-icon-button`,``,`type`,`button`,3,`click`],[1,`p3xr-dialog-content`,`p3xr-tree-settings-dialog-content`],[1,`p3xr-padding`],[1,`p3xr-tree-settings-reduced-functions`],[1,`p3xr-tree-settings-field-block`,`p3xr-tree-settings-field-block-tree-separator`],[`subscriptSizing`,`dynamic`,1,`md-block`,`p3xr-md-input-container-no-bottom`],[`matInput`,``,`name`,`treeSeparator`,3,`ngModelChange`,`ngModel`],[1,`p3xr-md-input-container-bottom-info`],[1,`p3xr-tree-settings-field-block`,`p3xr-tree-settings-field-block-page-count`],[1,`md-block`],[`matInput`,``,`type`,`number`,`required`,``,`step`,`1`,`name`,`pageCount`,3,`ngModelChange`,`ngModel`],[1,`p3xr-field-error-text`],[1,`p3xr-tree-settings-field-block`,`p3xr-tree-settings-field-block-key-page-count`],[`matInput`,``,`type`,`number`,`required`,``,`step`,`1`,`name`,`keyPageCount`,3,`ngModelChange`,`ngModel`],[1,`p3xr-tree-settings-field-block`,`p3xr-tree-settings-field-block-max-value-display`],[`matInput`,``,`type`,`number`,`required`,``,`step`,`1`,`name`,`maxValueDisplay`,3,`ngModelChange`,`ngModel`],[1,`p3xr-tree-settings-field-block`,`p3xr-tree-settings-field-block-max-keys`],[`matInput`,``,`type`,`number`,`required`,``,`step`,`1`,`name`,`maxKeys`,3,`ngModelChange`,`ngModel`],[1,`p3xr-tree-settings-toggle-block`],[`name`,`searchStartsWith`,3,`ngModelChange`,`ngModel`],[`name`,`jsonFormat`,3,`ngModelChange`,`ngModel`],[`name`,`animation`,3,`ngModelChange`,`ngModel`],[`name`,`undoEnabled`,3,`ngModelChange`,`ngModel`],[2,`font-size`,`12px`,`opacity`,`0.7`,`margin-top`,`4px`],[1,`p3xr-tree-settings-toggle-block`,`p3xr-tree-settings-toggle-block-last`],[`name`,`showDiffBeforeSave`,3,`ngModelChange`,`ngModel`],[1,`p3xr-dialog-actions`],[3,`cancel`],[`mat-raised-button`,``,`type`,`submit`,1,`btn-primary`],[1,`p3xr-tree-settings-reduced-functions-note`],[1,`p3xr-tree-settings-toggle-block`,`p3xr-tree-settings-toggle-block-with-info`,`p3xr-tree-settings-toggle-block-keys-sort`],[`name`,`keysSort`,3,`ngModelChange`,`ngModel`],[1,`p3xr-tree-settings-toggle-block`,`p3xr-tree-settings-toggle-block-with-info`,`p3xr-tree-settings-toggle-block-search-client`],[`name`,`searchClientSide`,3,`ngModelChange`,`ngModel`,`disabled`],[1,`p3xr-tree-settings-extra-info`]],template:function(d,e){if(d&1){let l=dT();Wa(0,`form`,1,0),Sy(`ngSubmit`,function(){return e.submit()}),Wa(2,`mat-toolbar`,2)(3,`span`,3),HT(4),wf(),Wa(5,`button`,4),Sy(`click`,function(){return e.cancel()}),Wa(6,`mat-icon`),HT(7,`close`),wf()()(),Wa(8,`mat-dialog-content`,5)(9,`div`,6),co(10,Me,5,7,`div`,7),Wa(11,`div`,8)(12,`mat-form-field`,9)(13,`mat-label`),HT(14),wf(),Wa(15,`input`,10),$y(`ngModelChange`,function(o){return ym(l),qT(e.model.treeSeparator,o)||(e.model.treeSeparator=o),bm(o)}),wf(),WC(),wf(),Wa(16,`div`,11),HT(17),wf()(),Wa(18,`div`,12)(19,`mat-form-field`,13)(20,`mat-label`),HT(21),wf(),Wa(22,`input`,14),$y(`ngModelChange`,function(o){return ym(l),qT(e.model.pageCount,o)||(e.model.pageCount=o),bm(o)}),wf(),WC(),wf(),co(23,we,2,1,`div`,15),wf(),Wa(24,`div`,16)(25,`mat-form-field`,13)(26,`mat-label`),HT(27),wf(),Wa(28,`input`,17),$y(`ngModelChange`,function(o){return ym(l),qT(e.model.keyPageCount,o)||(e.model.keyPageCount=o),bm(o)}),wf(),WC(),wf(),co(29,ke,2,1,`div`,15),wf(),Wa(30,`div`,18)(31,`mat-form-field`,9)(32,`mat-label`),HT(33),wf(),Wa(34,`input`,19),$y(`ngModelChange`,function(o){return ym(l),qT(e.model.maxValueDisplay,o)||(e.model.maxValueDisplay=o),bm(o)}),wf(),WC(),wf(),co(35,Ie,2,1,`div`,15)(36,Ee,2,1,`div`,11),wf(),Wa(37,`div`,20)(38,`mat-form-field`,9)(39,`mat-label`),HT(40),wf(),Wa(41,`input`,21),$y(`ngModelChange`,function(o){return ym(l),qT(e.model.maxKeys,o)||(e.model.maxKeys=o),bm(o)}),wf(),WC(),wf(),co(42,Te,2,1,`div`,15)(43,De,2,1,`div`,11),wf(),co(44,Ve,11,10),Wa(45,`div`,22)(46,`mat-slide-toggle`,23),$y(`ngModelChange`,function(o){return ym(l),qT(e.model.searchStartsWith,o)||(e.model.searchStartsWith=o),bm(o)}),HT(47),wf(),WC(),wf(),Wa(48,`div`,22)(49,`mat-slide-toggle`,24),$y(`ngModelChange`,function(o){return ym(l),qT(e.model.jsonFormat,o)||(e.model.jsonFormat=o),bm(o)}),HT(50),wf(),WC(),wf(),Wa(51,`div`,22)(52,`mat-slide-toggle`,25),$y(`ngModelChange`,function(o){return ym(l),qT(e.model.animation,o)||(e.model.animation=o),bm(o)}),HT(53),wf(),WC(),wf(),Wa(54,`div`,22)(55,`mat-slide-toggle`,26),$y(`ngModelChange`,function(o){return ym(l),qT(e.model.undoEnabled,o)||(e.model.undoEnabled=o),bm(o)}),HT(56),wf(),WC(),Wa(57,`div`,27),HT(58),wf()(),Wa(59,`div`,28)(60,`mat-slide-toggle`,29),$y(`ngModelChange`,function(o){return ym(l),qT(e.model.showDiffBeforeSave,o)||(e.model.showDiffBeforeSave=o),bm(o)}),HT(61),wf(),WC(),wf()()(),Wa(62,`mat-dialog-actions`,30)(63,`p3xr-dialog-cancel`,31),Sy(`cancel`,function(){return e.cancel()}),wf(),Wa(64,`button`,32)(65,`mat-icon`),HT(66,`save`),wf(),HT(67),wf()()()}d&2&&(Sn(4),Nf(` `,e.strings().form?.treeSettings?.label?.formName,` `),Sn(6),lo(e.reducedFunctions?10:-1),Sn(4),jy(e.strings().form?.treeSettings?.field?.treeSeparator),Sn(),Uy(`ngModel`,e.model.treeSeparator),qC(),Sn(2),Nf(` `,e.strings().label?.treeSeparatorEmpty,` `),Sn(2),vt(`p3xr-field-error`,e.isFieldInvalid(`pageCount`,10,5e3)),Sn(2),jy(e.strings().form?.treeSettings?.field?.page),Sn(),Uy(`ngModel`,e.model.pageCount),qC(),Sn(),lo(e.isFieldInvalid(`pageCount`,10,5e3)?23:-1),Sn(2),vt(`p3xr-field-error`,e.isFieldInvalid(`keyPageCount`,5,100)),Sn(2),jy(e.strings().form?.treeSettings?.field?.keyPageCount),Sn(),Uy(`ngModel`,e.model.keyPageCount),qC(),Sn(),lo(e.isFieldInvalid(`keyPageCount`,5,100)?29:-1),Sn(2),vt(`p3xr-field-error`,e.isFieldInvalid(`maxValueDisplay`,-1,32768)),Sn(2),jy(e.strings().form?.treeSettings?.maxValueDisplay),Sn(),Uy(`ngModel`,e.model.maxValueDisplay),qC(),Sn(),lo(e.isFieldInvalid(`maxValueDisplay`,-1,32768)?35:36),Sn(3),vt(`p3xr-field-error`,e.isFieldInvalid(`maxKeys`,5,1e5)),Sn(2),jy(e.strings().form?.treeSettings?.maxKeys),Sn(),Uy(`ngModel`,e.model.maxKeys),qC(),Sn(),lo(e.isFieldInvalid(`maxKeys`,5,1e5)?42:43),Sn(2),lo(e.reducedFunctions?-1:44),Sn(2),Uy(`ngModel`,e.model.searchStartsWith),qC(),Sn(),Nf(` `,e.model.searchStartsWith?e.strings().form?.treeSettings?.label?.searchModeStartsWith:e.strings().form?.treeSettings?.label?.searchModeIncludes,` `),Sn(2),Uy(`ngModel`,e.model.jsonFormat),qC(),Sn(),Nf(` `,e.model.jsonFormat?e.strings().form?.treeSettings?.label?.jsonFormatTwoSpace:e.strings().form?.treeSettings?.label?.jsonFormatFourSpace,` `),Sn(2),Uy(`ngModel`,e.model.animation),qC(),Sn(),Nf(` `,e.model.animation?e.strings().form?.treeSettings?.label?.animation:e.strings().form?.treeSettings?.label?.noAnimation,` `),Sn(2),Uy(`ngModel`,e.model.undoEnabled),qC(),Sn(),Nf(` `,e.model.undoEnabled?e.strings().form?.treeSettings?.label?.undoEnabled:e.strings().form?.treeSettings?.label?.undoDisabled,` `),Sn(2),jy(e.strings().form?.treeSettings?.undoHint),Sn(2),Uy(`ngModel`,e.model.showDiffBeforeSave),qC(),Sn(),Nf(` `,e.model.showDiffBeforeSave?e.strings().form?.treeSettings?.label?.diffEnabled:e.strings().form?.treeSettings?.label?.diffDisabled,` `),Sn(6),Nf(` `,e.strings().intention?.save,` `))},dependencies:[Eb,Gn,kn,He,an,xn,Rn,st,on,Jt,zt,Bt,Vt,jt,Qt,qe,U,Oe,ze,we$1,te,$Y,HY,G0,yt,wt,ae,se,Q$1],styles:[`.md-block{width:100%}.p3xr-field-error .mdc-line-ripple:before,.p3xr-field-error .mdc-line-ripple:after{border-bottom-color:#f44336!important}.p3xr-field-error .mdc-floating-label,.p3xr-field-error .mat-mdc-form-field-required-marker{color:#f44336!important}.p3xr-field-error-text{color:#f44336;font-size:12px;margin-top:-16px;padding-left:16px}.p3xr-field-hint-text{color:var(--%NS%mat-app-text-color, rgba(0, 0, 0, .6));opacity:.7;font-size:12px;margin-top:-16px;padding-left:16px}
`],encapsulation:2,changeDetection:1})}return a})();export{rt as TreecontrolSettingsDialogComponent};