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
1 lines • 27.2 kB
JavaScript
import {X as Xe$1,cV as z,d1 as Ue,f as fQ,b as bi,G as It,dd as u,V as N,Q,F as x,b7 as _t$1,_ as _e,m as mb,aJ as jn,c$ as Pn,cj as He,co as rn,bd as On,d0 as xn,d3 as ot$1,de as Tt,df as Pt,be as tn,bE as Jt,cn as X,cm as ve,cW as zt,cX as jt,cY as Vt,cZ as Nt,bc as Ut,ba as qe,cp as q,d4 as xt$1,dg as _t$2,ck as Ve,cl as Be,bb as q$1,e as aY,aK as iY,aL as sY,g as _A,y as yt$1,w as wt$1,d as ae,s as se,i as Qt,j as gt$1,d9 as mi,da as di,dc as bt,x as YT,B as Ba,k as bv,n as no,v as vf,I as IS,cr as Lv,bj as Mx,H as HT,bt as VT,h as hv,aY as rS,c as In,r as ro,R as Rv,cs as Fv,p as pv,bk as Nx,U as UT,t as If,a$ as rc,b0 as Df,b1 as Ef,J as JT,z as fm,A as pm,cu as AS}from'./chunk-BwlFOdbx.js';import {L as Lt}from'./chunk-ClozYWD6.js';import {w as we,t as te}from'./chunk-B8YlgrW9.js';import'./chunk-BqyDblvT.js';import {F,E,L}from'./main-HNF44SV3.js';import {Q as Q$1}from'./chunk-BnyV8OX_.js';var Oe=["p3xrConnectionForm"],Ge=(l,_)=>_.id;function Qe(l,_){if(l&1&&IS(0),l&2){let t=JT();If(" ",t.strings().label?.connectiondView," ");}}function Ze(l,_){if(l&1&&IS(0),l&2){let t=JT();If(" ",t.strings().label?.connectiondAdd," ");}}function Je(l,_){if(l&1&&IS(0),l&2){let t=JT();If(" ",t.strings().label?.connectiondEdit," ");}}function Xe(l,_){if(l&1){let t=YT();Ba(0,"mat-form-field",24)(1,"mat-label"),IS(2),vf(),Ba(3,"input",35),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.id,e)||(o.model.id=e),pm(e)}),vf(),Mx(),vf(),Ba(4,"div",36),IS(5),vf();}if(l&2){let t=JT();In(2),Rv(t.strings().label?.id?.id),In(),Fv("ngModel",t.model.id),Nx(),In(2),If(" ",t.strings().label?.id?.info," ");}}function Ye(l,_){if(l&1&&(Ba(0,"mat-error"),IS(1),vf()),l&2){let t=JT();In(),Rv(t.strings().form?.error?.required);}}function $e(l,_){if(l&1&&(Ba(0,"mat-option",11),IS(1),vf()),l&2){let t=_.$implicit;pv("value",t),In(),Rv(t);}}function et(l,_){if(l&1&&(Ba(0,"mat-error"),IS(1),vf()),l&2){let t=JT(2);In(),Rv(t.strings().form?.error?.required);}}function tt(l,_){if(l&1&&(Ba(0,"mat-error"),IS(1),vf()),l&2){let t=JT(2);In(),Rv(t.strings().form?.error?.required);}}function nt(l,_){if(l&1&&(Ba(0,"mat-error"),IS(1),vf()),l&2){let t=JT(2);In(),Rv(t.strings().form?.error?.required);}}function it(l,_){if(l&1){let t=YT();Ba(0,"button",43),bv("click",function(){fm(t);let e=JT(2);return pm(e.sshPasswordVisible=!e.sshPasswordVisible)}),Ba(1,"mat-icon"),IS(2),vf()();}if(l&2){let t=JT(2);In(2),Rv(t.sshPasswordVisible?"visibility_off":"visibility");}}function ot(l,_){if(l&1){let t=YT();Ba(0,"fieldset")(1,"legend"),IS(2,"SSH"),vf(),Ba(3,"mat-form-field",8)(4,"mat-label"),IS(5),vf(),Ba(6,"input",37),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.sshHost,e)||(o.model.sshHost=e),pm(e)}),vf(),Mx(),no(7,et,2,1,"mat-error"),vf(),Ba(8,"mat-form-field",8)(9,"mat-label"),IS(10),vf(),Ba(11,"input",38),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.sshPort,e)||(o.model.sshPort=e),pm(e)}),vf(),Mx(),no(12,tt,2,1,"mat-error"),vf(),Ba(13,"mat-form-field",8)(14,"mat-label"),IS(15),vf(),Ba(16,"input",39),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.sshUsername,e)||(o.model.sshUsername=e),pm(e)}),vf(),Mx(),no(17,nt,2,1,"mat-error"),vf(),Ba(18,"mat-form-field",24)(19,"mat-label"),IS(20),vf(),Ba(21,"input",40),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.sshPassword,e)||(o.model.sshPassword=e),pm(e)}),vf(),Mx(),no(22,it,3,1,"button",41),vf(),Ba(23,"div",36),IS(24),vf(),Ba(25,"mat-form-field",24)(26,"mat-label"),IS(27),vf(),Ba(28,"textarea",42),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.sshPrivateKey,e)||(o.model.sshPrivateKey=e),pm(e)}),vf(),Mx(),vf(),Ba(29,"div",36),IS(30),vf(),hv(31,"br"),vf();}if(l&2){let t=JT(),r=rS(1);In(5),Rv(t.strings().label?.ssh?.sshHost),In(),Fv("ngModel",t.model.sshHost),pv("disabled",t.readonlyConnections),Nx(),In(),ro(r.controls.sshHost?.hasError("required")&&r.controls.sshHost?.touched?7:-1),In(3),Rv(t.strings().label?.ssh?.sshPort),In(),Fv("ngModel",t.model.sshPort),pv("disabled",t.readonlyConnections),Nx(),In(),ro(r.controls.sshPort?.hasError("required")&&r.controls.sshPort?.touched?12:-1),In(3),Rv(t.strings().label?.ssh?.sshUsername),In(),Fv("ngModel",t.model.sshUsername),pv("disabled",t.readonlyConnections),Nx(),In(),ro(r.controls.sshUsername?.hasError("required")&&r.controls.sshUsername?.touched?17:-1),In(3),Rv(t.strings().label?.ssh?.sshPassword),In(),pv("type",t.sshPasswordVisible?"text":"password"),Fv("ngModel",t.model.sshPassword),pv("disabled",t.readonlyConnections),Nx(),In(),ro(t.readonlyConnections?-1:22),In(2),If(" ",t.strings().label?.passwordSecure," "),In(3),Rv(t.strings().label?.ssh?.sshPrivateKey),In(),Fv("ngModel",t.model.sshPrivateKey),pv("disabled",t.readonlyConnections),Nx(),In(2),If(" ",t.strings().label?.secureFeature," ");}}function at(l,_){if(l&1&&(Ba(0,"mat-error"),IS(1),vf()),l&2){let t=JT();In(),Rv(t.strings().form?.error?.port);}}function rt(l,_){if(l&1&&(Ba(0,"div",16),IS(1),vf()),l&2){let t=JT();In(),If(" ",t.strings().label?.aclAuthHint," ");}}function lt(l,_){if(l&1){let t=YT();Ba(0,"button",43),bv("click",function(){fm(t);let e=JT(2);return pm(e.passwordVisible=!e.passwordVisible)}),Ba(1,"mat-icon"),IS(2),vf()();}if(l&2){let t=JT(2);In(2),Rv(t.passwordVisible?"visibility_off":"visibility");}}function dt(l,_){if(l&1){let t=YT();Ba(0,"span")(1,"div",44),IS(2),vf(),Ba(3,"mat-form-field",8)(4,"mat-label"),IS(5),vf(),Ba(6,"input",45),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.username,e)||(o.model.username=e),pm(e)}),vf(),Mx(),vf(),Ba(7,"mat-form-field",24)(8,"mat-label"),IS(9),vf(),Ba(10,"input",46),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.password,e)||(o.model.password=e),pm(e)}),vf(),Mx(),no(11,lt,3,1,"button",41),vf(),Ba(12,"div",36),IS(13),vf(),hv(14,"br"),vf();}if(l&2){let t=JT();In(2),If(" ",t.strings().label?.aclAuthHint," "),In(3),Rv(t.strings().form?.connection?.label?.username),In(),Fv("ngModel",t.model.username),pv("disabled",t.readonlyConnections),Nx(),In(3),Rv(t.strings().form?.connection?.label?.password),In(),pv("type",t.passwordVisible?"text":"password"),Fv("ngModel",t.model.password),pv("disabled",t.readonlyConnections),Nx(),In(),ro(t.readonlyConnections?-1:11),In(2),If(" ",t.strings().label?.passwordSecure," ");}}function st(l,_){if(l&1){let t=YT();Ba(0,"div",47),bv("click",function(){fm(t);let e=JT();return pm(e.addNode())}),IS(1),Ba(2,"button",48)(3,"mat-icon"),IS(4,"add"),vf()()();}if(l&2){let t=JT();In(),If(" ",t.strings().label?.addNode," ");}}function mt(l,_){if(l&1&&(Ba(0,"mat-error"),IS(1),vf()),l&2){let t=JT(2);In(),Rv(t.strings().form?.error?.required);}}function ct(l,_){if(l&1){let t=YT();Ba(0,"mat-form-field",24)(1,"mat-label"),IS(2),vf(),Ba(3,"input",49),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.sentinelName,e)||(o.model.sentinelName=e),pm(e)}),vf(),Mx(),no(4,mt,2,1,"mat-error"),vf();}if(l&2){let t=JT(),r=rS(1);In(2),Rv(t.strings().label?.sentinel?.name),In(),Fv("ngModel",t.model.sentinelName),pv("disabled",t.readonlyConnections),Nx(),In(),ro(r.controls.sentinelName?.hasError("required")&&r.controls.sentinelName?.touched?4:-1);}}function pt(l,_){if(l&1){let t=YT();Ba(0,"div",50)(1,"button",57),bv("click",function(e){fm(t);let o=JT().$index,u=JT(2);return pm(u.removeNode(e,o))}),Ba(2,"mat-icon"),IS(3,"delete"),vf()(),Ba(4,"button",58),bv("click",function(){fm(t);let e=JT().$index,o=JT(2);return pm(o.addNode(e))}),Ba(5,"mat-icon"),IS(6,"add"),vf()()();}if(l&2){let t=JT(3);In(),pv("matTooltip",t.strings().confirm?.deleteConnectionText),In(3),pv("matTooltip",t.strings().label?.addNode);}}function gt(l,_){if(l&1&&(Ba(0,"mat-form-field",24)(1,"mat-label"),IS(2),vf(),hv(3,"input",59),Mx(),vf(),Ba(4,"div",36),IS(5),vf()),l&2){let t=JT(),r=t.$implicit,e=t.$index,o=JT(2);In(2),Rv(o.strings().label?.id?.nodeId),In(),pv("ngModel",r.id)("name","nodeId"+e),Nx(),In(2),If(" ",o.strings().label?.id?.info," ");}}function _t(l,_){if(l&1&&(Ba(0,"mat-error"),IS(1),vf()),l&2){let t=JT(3);In(),Rv(t.strings().form?.error?.port);}}function Ct(l,_){if(l&1&&(Ba(0,"mat-error"),IS(1),vf()),l&2){let t=JT(3);In(),Rv(t.strings().form?.error?.required);}}function ut(l,_){if(l&1){let t=YT();Ba(0,"button",43),bv("click",function(){fm(t);let e=JT().$index,o=JT(2);return pm(o.nodePasswordVisible[e]=!o.nodePasswordVisible[e])}),Ba(1,"mat-icon"),IS(2),vf()();}if(l&2){let t=JT().$index,r=JT(2);In(2),Rv(r.nodePasswordVisible[t]?"visibility_off":"visibility");}}function ft(l,_){l&1&&(Ba(0,"div",55),IS(1,"\xA0"),vf());}function ht(l,_){if(l&1){let t=YT();Ba(0,"fieldset")(1,"legend"),IS(2),vf(),no(3,pt,7,2,"div",50),hv(4,"br"),no(5,gt,6,4),Ba(6,"mat-form-field",8)(7,"mat-label"),IS(8),vf(),Ba(9,"input",51),Lv("ngModelChange",function(e){let o=fm(t).$implicit;return AS(o.host,e)||(o.host=e),pm(e)}),vf(),Mx(),vf(),Ba(10,"mat-form-field",8)(11,"mat-label"),IS(12),vf(),Ba(13,"input",52),Lv("ngModelChange",function(e){let o=fm(t).$implicit;return AS(o.port,e)||(o.port=e),pm(e)}),vf(),Mx(),no(14,_t,2,1,"mat-error"),no(15,Ct,2,1,"mat-error"),vf(),Ba(16,"mat-form-field",8)(17,"mat-label"),IS(18),vf(),Ba(19,"input",53),Lv("ngModelChange",function(e){let o=fm(t).$implicit;return AS(o.username,e)||(o.username=e),pm(e)}),vf(),Mx(),vf(),Ba(20,"mat-form-field",24)(21,"mat-label"),IS(22),vf(),Ba(23,"input",54),Lv("ngModelChange",function(e){let o=fm(t).$implicit;return AS(o.password,e)||(o.password=e),pm(e)}),vf(),Mx(),no(24,ut,3,1,"button",41),vf(),Ba(25,"div",36),IS(26),vf()(),no(27,ft,2,0,"div",55),hv(28,"div",56);}if(l&2){let t=_.$implicit,r=_.$index,e=_.$count,o=JT(2),u=rS(1);In(2),If("Node ",r+2),In(),ro(o.readonlyConnections?-1:3),In(2),ro(t.id?5:-1),In(3),Rv(o.strings().form?.connection?.label?.host),In(),pv("name","nodeHost"+r),Fv("ngModel",t.host),pv("disabled",o.readonlyConnections),Nx(),In(3),Rv(o.strings().form?.connection?.label?.port),In(),pv("name","nodePort"+r),Fv("ngModel",t.port),pv("disabled",o.readonlyConnections),Nx(),In(),ro(u.controls["nodePort"+r]?.hasError("min")||u.controls["nodePort"+r]?.hasError("max")?14:-1),In(),ro(u.controls["nodePort"+r]?.hasError("required")&&u.controls["nodePort"+r]?.touched?15:-1),In(3),Rv(o.strings().form?.connection?.label?.username),In(),pv("name","nodeUsername"+r),Fv("ngModel",t.username),pv("disabled",o.readonlyConnections),Nx(),In(3),Rv(o.strings().form?.connection?.label?.password),In(),pv("name","nodePassword"+r)("type",o.nodePasswordVisible[r]?"text":"password"),Fv("ngModel",t.password),pv("disabled",o.readonlyConnections),Nx(),In(),ro(o.readonlyConnections?-1:24),In(2),If(" ",o.strings().label?.passwordSecure," "),In(),ro(r!==e-1?27:-1);}}function xt(l,_){if(l&1&&(Ba(0,"div"),HT(1,ht,29,25,null,null,Ge),vf()),l&2){let t=JT();In(),UT(t.model.nodes);}}function yt(l,_){if(l&1){let t=YT();Ba(0,"div",28)(1,"fieldset")(2,"legend"),IS(3,"TLS"),vf(),Ba(4,"mat-form-field",24)(5,"mat-label"),IS(6,"TLS (redis.crt)"),vf(),Ba(7,"textarea",60),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.tlsCrt,e)||(o.model.tlsCrt=e),pm(e)}),vf(),Mx(),vf(),Ba(8,"div",36),IS(9),vf(),hv(10,"br"),Ba(11,"mat-form-field",24)(12,"mat-label"),IS(13,"TLS (redis.key)"),vf(),Ba(14,"textarea",61),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.tlsKey,e)||(o.model.tlsKey=e),pm(e)}),vf(),Mx(),vf(),Ba(15,"div",36),IS(16),vf(),hv(17,"br"),Ba(18,"mat-form-field",24)(19,"mat-label"),IS(20,"TLS (ca.crt)"),vf(),Ba(21,"textarea",62),Lv("ngModelChange",function(e){fm(t);let o=JT();return AS(o.model.tlsCa,e)||(o.model.tlsCa=e),pm(e)}),vf(),Mx(),vf(),Ba(22,"div",36),IS(23),vf(),hv(24,"br"),vf()();}if(l&2){let t=JT();In(7),Fv("ngModel",t.model.tlsCrt),pv("disabled",t.readonlyConnections),Nx(),In(2),If(" ",t.strings().label?.tlsSecure," "),In(5),Fv("ngModel",t.model.tlsKey),pv("disabled",t.readonlyConnections),Nx(),In(2),If(" ",t.strings().label?.tlsSecure," "),In(5),Fv("ngModel",t.model.tlsCa),pv("disabled",t.readonlyConnections),Nx(),In(2),If(" ",t.strings().label?.tlsSecure," ");}}function wt(l,_){if(l&1&&(Ba(0,"button",34)(1,"mat-icon",63),IS(2),vf(),IS(3),vf()),l&2){let t=JT();In(2),Rv(t.options.type==="new"?"add":"save"),In(),If(" ",t.options.type==="new"?t.strings().intention?.add:t.strings().intention?.save," ");}}var dn=(()=>{class l{dialogRef;data;i18n;socketService;commonService;askAuthDialogService;ngZone;state;settings;overlay;formRef;autosizeTextareas;options;model;strings;existingGroups=[];groupEnabled=false;passwordVisible=false;sshPasswordVisible=false;nodePasswordVisible={};onAskAuthChange(){this.model.askAuth&&(this.model.username="",this.model.password="");}get readonlyConnections(){return !!this.state.cfg()?.readonlyConnections}constructor(t,r,e,o,u,m,Ne,je,He,Ue){this.dialogRef=t,this.data=r,this.i18n=e,this.socketService=o,this.commonService=u,this.askAuthDialogService=m,this.ngZone=Ne,this.state=je,this.settings=He,this.overlay=Ue,this.strings=this.i18n.strings,this.options=r,this.model=this.initModel(r);let Ke=this.state.connections()?.list||[],L=new Set;for(let D of Ke)D.group&&typeof D.group=="string"&&D.group.trim()&&L.add(D.group.trim());this.existingGroups=[...L].sort(),this.groupEnabled=!!this.model.group?.trim();}onGroupToggle(){this.groupEnabled||(this.model.group=void 0);}ngAfterViewInit(){this.scheduleTextareaResize(),this.autosizeTextareas.changes.subscribe(()=>this.scheduleTextareaResize());}scheduleTextareaResize(){this.ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.autosizeTextareas?.forEach(t=>t.resizeToFitContent(true));});});});}initModel(t){let r;t.model!==void 0?(r=structuredClone(t.model),r.password=t.model.id,r.tlsCrt=t.model.id,r.tlsKey=t.model.id,r.tlsCa=t.model.id,r.sshPassword=t.model.id,r.sshPrivateKey=t.model.id):r={name:void 0,host:void 0,port:6379,askAuth:false,password:void 0,username:void 0,id:void 0,group:void 0,readonly:void 0,tlsWithoutCert:false,tlsRejectUnauthorized:false,tlsCrt:void 0,tlsKey:void 0,tlsCa:void 0},r.hasOwnProperty("ssh")||(r=F(E({},r),{ssh:false,sshHost:void 0,sshPort:22,sshUsername:void 0,sshPassword:t.model?.id,sshPrivateKey:t.model?.id})),r.hasOwnProperty("cluster")||(r.cluster=false),r.hasOwnProperty("sentinel")||(r.sentinel=false),r.hasOwnProperty("nodes")||(r.nodes=[]);for(let e of r.nodes)e.password=e.id;return r}onClusterChange(){this.model.cluster===true&&(this.model.sentinel=false);}onSentinelChange(){this.model.sentinel===true&&(this.model.cluster=false);}addNode(t){let r={host:void 0,port:void 0,password:void 0,username:void 0,id:this.settings.generateId()};t===void 0?this.model.nodes.push(r):this.model.nodes.splice(t+1,0,r);}removeNode(t,r){return L(this,null,function*(){try{yield this.commonService.confirm({event:t,message:this.strings().confirm?.deleteConnectionText}),this.model.nodes.splice(r,1),this.commonService.toast({message:this.strings().status?.nodeRemoved});}catch(e){if(e===void 0)return;this.commonService.generalHandleError(e);}})}handleInvalidForm(){return this.formRef&&this.formRef.invalid?(this.commonService.toast({message:this.strings().form?.error?.invalid}),false):true}testConnection(t){return L(this,null,function*(){if(this.formRef&&Object.keys(this.formRef.controls).forEach(r=>{this.formRef.controls[r].markAsTouched();}),!!this.handleInvalidForm())try{let r=structuredClone(this.model);if(this.model.askAuth===!0){let o=yield this.askAuthDialogService.show({$event:t});r.username=void 0,r.password=void 0,o.username&&(r.username=o.username),o.password&&(r.password=o.password);}this.overlay.show({message:this.strings().title?.connectingRedis});let e=yield this.socketService.request({action:"connection/test",payload:{model:r}});console.warn("response",e),this.commonService.toast({message:this.strings().status?.redisConnected});}catch(r){this.commonService.generalHandleError(r);}finally{this.overlay.hide();}})}submit(){return L(this,null,function*(){if(this.handleInvalidForm()){this.model.host===void 0&&(this.model.host="localhost"),this.model.port===void 0&&(this.model.port=6379),this.options.type==="new"&&(this.model.id=this.settings.generateId());for(let t of this.model.nodes)t.host===void 0&&(t.host="localhost"),t.id===void 0&&(t.id=this.settings.generateId());try{let t=structuredClone(this.model);typeof t.group=="string"&&(t.group=t.group.trim()||void 0),yield this.socketService.request({action:"connection/save",payload:{model:t}}),this.commonService.toast({message:this.options.type==="new"?this.strings().status?.added:this.strings().status?.saved}),this.dialogRef.close(void 0);}catch(t){this.commonService.generalHandleError(t);}}})}cancel(){this.dialogRef.close(void 0);}static \u0275fac=function(r){return new(r||l)(Xe$1(z),Xe$1(Ue),Xe$1(fQ),Xe$1(bi),Xe$1(It),Xe$1(u),Xe$1(N),Xe$1(Q),Xe$1(x),Xe$1(_t$1))};static \u0275cmp=_e({type:l,selectors:[["p3xr-connection-dialog"]],viewQuery:function(r,e){if(r&1&&rc(Oe,5)(ve,5),r&2){let o;Df(o=Ef())&&(e.formRef=o.first),Df(o=Ef())&&(e.autosizeTextareas=o);}},decls:76,vars:47,consts:[["p3xrConnectionForm","ngForm"],["groupAuto","matAutocomplete"],["novalidate","",3,"ngSubmit"],[1,"p3xr-dialog-toolbar","p3xr-connection-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-connection-dialog-content"],[1,"p3xr-padding"],[1,"md-block"],["matInput","","required","","name","name",3,"ngModelChange","ngModel","disabled"],["matInput","","name","group",3,"ngModelChange","ngModel","matAutocomplete","disabled"],[3,"value"],["name","ssh",2,"margin","0",3,"ngModelChange","change","ngModel","disabled"],["matInput","","name","host",3,"ngModelChange","ngModel","disabled"],["matInput","","name","port","type","number","min","1","max","65535",3,"ngModelChange","ngModel","disabled"],["name","askAuth",3,"ngModelChange","change","ngModel","disabled"],[1,"p3xr-md-input-container-bottom-info",2,"margin-top","4px"],["name","readonly",2,"margin","0",3,"ngModelChange","ngModel","disabled"],[2,"display","flex","flex-direction","row","align-items","center"],["name","cluster",2,"margin","0",3,"ngModelChange","change","ngModel","disabled"],[2,"margin-left","15px"],["name","sentinel",2,"margin","0",3,"ngModelChange","change","ngModel","disabled"],[2,"flex","1"],[1,"p3xr-connection-node-add"],[1,"md-block","p3xr-md-input-container-no-bottom"],[1,"p3xr-connection-inline-toggles","p3xr-connection-tls-toggles"],["name","tlsWithoutCert",3,"ngModelChange","change","ngModel","disabled"],["name","tlsRejectUnauthorized",3,"ngModelChange","ngModel","disabled"],[1,"p3xr-connection-tls-fields"],[1,"p3xr-dialog-actions","p3xr-dialog-connection-actions"],[3,"cancel"],[1,"p3xr-mat-common"],["mat-raised-button","","type","button",1,"btn-primary",3,"click"],[1,"fas","fa-plug"],["mat-raised-button","","type","submit",1,"btn-primary"],["matInput","","name","id","disabled","",3,"ngModelChange","ngModel"],[1,"p3xr-md-input-container-bottom-info"],["matInput","","required","","name","sshHost",3,"ngModelChange","ngModel","disabled"],["matInput","","required","","name","sshPort","type","number","min","1","max","65535",3,"ngModelChange","ngModel","disabled"],["matInput","","required","","name","sshUsername",3,"ngModelChange","ngModel","disabled"],["matInput","","name","sshPassword","autocomplete","off",3,"ngModelChange","type","ngModel","disabled"],["mat-icon-button","","matSuffix","","type","button"],["matInput","","name","sshPrivateKey","autocomplete","off","cdkTextareaAutosize","","cdkAutosizeMinRows","1","rows","1",3,"ngModelChange","ngModel","disabled"],["mat-icon-button","","matSuffix","","type","button",3,"click"],[1,"p3xr-md-input-container-bottom-info",2,"margin-bottom","8px"],["matInput","","name","username","type","text","autocomplete","off",3,"ngModelChange","ngModel","disabled"],["matInput","","name","password","autocomplete","off",3,"ngModelChange","type","ngModel","disabled"],[1,"p3xr-connection-node-add",3,"click"],["mat-mini-fab","","type","button",1,"btn-primary"],["matInput","","required","","name","sentinelName",3,"ngModelChange","ngModel","disabled"],[1,"p3xr-connection-node-actions",2,"float","right"],["matInput","",3,"ngModelChange","name","ngModel","disabled"],["matInput","","required","","type","number","min","1","max","65535",3,"ngModelChange","name","ngModel","disabled"],["matInput","","type","text","autocomplete","off",3,"ngModelChange","name","ngModel","disabled"],["matInput","","autocomplete","off",3,"ngModelChange","name","type","ngModel","disabled"],[2,"margin-bottom","16px"],[2,"clear","both"],["mat-mini-fab","","type","button",1,"btn-warn",3,"click","matTooltip"],["mat-mini-fab","","type","button",1,"btn-primary",3,"click","matTooltip"],["matInput","","disabled","",3,"ngModel","name"],["matInput","","name","tlsCrt","autocomplete","off","cdkTextareaAutosize","","cdkAutosizeMinRows","1","rows","1",3,"ngModelChange","ngModel","disabled"],["matInput","","name","tlsKey","autocomplete","off","cdkTextareaAutosize","","cdkAutosizeMinRows","1","rows","1",3,"ngModelChange","ngModel","disabled"],["matInput","","name","tlsCa","autocomplete","off","cdkTextareaAutosize","","cdkAutosizeMinRows","1","rows","1",3,"ngModelChange","ngModel","disabled"],[2,"font-size","24px","width","24px","height","24px"]],template:function(r,e){if(r&1){let o=YT();Ba(0,"form",2,0),bv("ngSubmit",function(){return e.submit()}),Ba(2,"mat-toolbar",3)(3,"span",4),no(4,Qe,1,1)(5,Ze,1,1)(6,Je,1,1),vf(),Ba(7,"button",5),bv("click",function(){return e.cancel()}),Ba(8,"mat-icon"),IS(9,"close"),vf()()(),Ba(10,"mat-dialog-content",6)(11,"div",7),no(12,Xe,6,3),Ba(13,"mat-form-field",8)(14,"mat-label"),IS(15),vf(),Ba(16,"input",9),Lv("ngModelChange",function(m){return fm(o),AS(e.model.name,m)||(e.model.name=m),pm(m)}),vf(),Mx(),no(17,Ye,2,1,"mat-error"),vf(),Ba(18,"mat-form-field",8)(19,"mat-label"),IS(20),vf(),Ba(21,"input",10),Lv("ngModelChange",function(m){return fm(o),AS(e.model.group,m)||(e.model.group=m),pm(m)}),vf(),Mx(),Ba(22,"mat-autocomplete",null,1),HT(24,$e,2,2,"mat-option",11,VT),vf()(),Ba(26,"span")(27,"mat-slide-toggle",12),Lv("ngModelChange",function(m){return fm(o),AS(e.model.ssh,m)||(e.model.ssh=m),pm(m)}),bv("change",function(){return e.scheduleTextareaResize()}),IS(28),vf(),Mx(),no(29,ot,32,22,"fieldset"),vf(),hv(30,"br"),Ba(31,"fieldset")(32,"legend"),IS(33,"Node 1"),vf(),Ba(34,"mat-form-field",8)(35,"mat-label"),IS(36),vf(),Ba(37,"input",13),Lv("ngModelChange",function(m){return fm(o),AS(e.model.host,m)||(e.model.host=m),pm(m)}),vf(),Mx(),vf(),Ba(38,"mat-form-field",8)(39,"mat-label"),IS(40),vf(),Ba(41,"input",14),Lv("ngModelChange",function(m){return fm(o),AS(e.model.port,m)||(e.model.port=m),pm(m)}),vf(),Mx(),no(42,at,2,1,"mat-error"),vf(),Ba(43,"mat-slide-toggle",15),Lv("ngModelChange",function(m){return fm(o),AS(e.model.askAuth,m)||(e.model.askAuth=m),pm(m)}),bv("change",function(){return e.onAskAuthChange()}),IS(44),vf(),Mx(),no(45,rt,2,1,"div",16),no(46,dt,15,10,"span"),vf(),hv(47,"br"),Ba(48,"span")(49,"mat-slide-toggle",17),Lv("ngModelChange",function(m){return fm(o),AS(e.model.readonly,m)||(e.model.readonly=m),pm(m)}),IS(50),vf(),Mx(),vf(),hv(51,"br"),Ba(52,"div",18)(53,"div")(54,"mat-slide-toggle",19),Lv("ngModelChange",function(m){return fm(o),AS(e.model.cluster,m)||(e.model.cluster=m),pm(m)}),bv("change",function(){return e.onClusterChange()}),IS(55),vf(),Mx(),vf(),Ba(56,"div",20)(57,"mat-slide-toggle",21),Lv("ngModelChange",function(m){return fm(o),AS(e.model.sentinel,m)||(e.model.sentinel=m),pm(m)}),bv("change",function(){return e.onSentinelChange()}),IS(58),vf(),Mx(),vf(),hv(59,"span",22),no(60,st,5,1,"div",23),vf(),no(61,ct,5,4,"mat-form-field",24),no(62,xt,3,0,"div"),Ba(63,"div",25)(64,"mat-slide-toggle",26),Lv("ngModelChange",function(m){return fm(o),AS(e.model.tlsWithoutCert,m)||(e.model.tlsWithoutCert=m),pm(m)}),bv("change",function(){return e.scheduleTextareaResize()}),IS(65),vf(),Mx(),Ba(66,"mat-slide-toggle",27),Lv("ngModelChange",function(m){return fm(o),AS(e.model.tlsRejectUnauthorized,m)||(e.model.tlsRejectUnauthorized=m),pm(m)}),IS(67),vf(),Mx(),vf(),no(68,yt,25,9,"div",28),vf()(),Ba(69,"mat-dialog-actions",29)(70,"p3xr-dialog-cancel",30),bv("cancel",function(){return e.cancel()}),vf(),Ba(71,"span",31)(72,"button",32),bv("click",function(m){return e.testConnection(m)}),hv(73,"i",33),IS(74),vf()(),no(75,wt,4,2,"button",34),vf()();}if(r&2){let o=rS(1),u=rS(23);In(4),ro(e.readonlyConnections?4:e.options.type==="new"?5:6),In(8),ro(e.model.id&&e.options.type!=="new"?12:-1),In(3),Rv(e.strings().form?.connection?.label?.name),In(),Fv("ngModel",e.model.name),pv("disabled",e.readonlyConnections),Nx(),In(),ro(o.controls.name?.hasError("required")&&o.controls.name?.touched?17:-1),In(3),Rv(e.strings().form?.connection?.label?.group),In(),Fv("ngModel",e.model.group),pv("matAutocomplete",u)("disabled",e.readonlyConnections),Nx(),In(3),UT(e.existingGroups),In(3),Fv("ngModel",e.model.ssh),pv("disabled",e.readonlyConnections),Nx(),In(),If(" ",e.model.ssh?e.strings().label?.ssh?.on:e.strings().label?.ssh?.off," "),In(),ro(e.model.ssh?29:-1),In(7),Rv(e.strings().form?.connection?.label?.host),In(),Fv("ngModel",e.model.host),pv("disabled",e.readonlyConnections),Nx(),In(3),Rv(e.strings().form?.connection?.label?.port),In(),Fv("ngModel",e.model.port),pv("disabled",e.readonlyConnections),Nx(),In(),ro(o.controls.port?.hasError("min")||o.controls.port?.hasError("max")?42:-1),In(),Fv("ngModel",e.model.askAuth),pv("disabled",e.readonlyConnections),Nx(),In(),If(" ",e.strings().label?.askAuth," "),In(),ro(e.model.askAuth?45:-1),In(),ro(e.model.askAuth?-1:46),In(3),Fv("ngModel",e.model.readonly),pv("disabled",e.readonlyConnections),Nx(),In(),If(" ",e.model.readonly?e.strings().label?.readonly?.on:e.strings().label?.readonly?.off," "),In(4),Fv("ngModel",e.model.cluster),pv("disabled",e.readonlyConnections),Nx(),In(),If(" ",e.model.cluster?e.strings().label?.cluster?.on:e.strings().label?.cluster?.off," "),In(2),Fv("ngModel",e.model.sentinel),pv("disabled",e.readonlyConnections),Nx(),In(),If(" ",e.model.sentinel?e.strings().label?.sentinel?.on:e.strings().label?.sentinel?.off," "),In(2),ro((e.model.cluster===true||e.model.sentinel===true)&&!e.readonlyConnections?60:-1),In(),ro(e.model.sentinel===true?61:-1),In(),ro(e.model.cluster===true||e.model.sentinel===true?62:-1),In(2),Fv("ngModel",e.model.tlsWithoutCert),pv("disabled",e.readonlyConnections),Nx(),In(),If(" ",e.strings().label?.tlsWithoutCert," "),In(),Fv("ngModel",e.model.tlsRejectUnauthorized),pv("disabled",e.readonlyConnections),Nx(),In(),If(" ",e.strings().label?.tlsRejectUnauthorized," "),In(),ro(e.model.tlsWithoutCert!==true?68:-1),In(6),If(" ",e.strings().intention?.testConnection," "),In(),ro(e.readonlyConnections?-1:75);}},dependencies:[mb,jn,Pn,He,rn,On,xn,ot$1,Tt,Pt,tn,Jt,X,ve,zt,jt,Vt,Nt,Ut,qe,q,xt$1,_t$2,Ve,Be,Lt,q$1,we,te,aY,iY,sY,_A,yt$1,wt$1,ae,se,Qt,gt$1,mi,di,bt,Q$1],styles:[".md-block[_ngcontent-%COMP%]{width:100%}.p3xr-show-xs[_ngcontent-%COMP%]{display:none}@media(max-width:699px){.p3xr-hide-xs[_ngcontent-%COMP%]{display:none}.p3xr-show-xs[_ngcontent-%COMP%]{display:inline}}"],changeDetection:1})}return l})();export{dn as ConnectionDialogComponent};