]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/330.070e111fc5b7315b4eac.js
import quincy beta 17.1.0
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / dist / en-US / 330.070e111fc5b7315b4eac.js
CommitLineData
20effc67 1"use strict";(self.webpackChunkceph_dashboard=self.webpackChunkceph_dashboard||[]).push([[330],{91330:(it,Oe,p)=>{p.r(Oe),p.d(Oe,{BlockModule:()=>Mt,RoutedBlockModule:()=>$a});var l=p(12057),r=p(24751),m=p(6283),ne=p(20356),I=p(38549),Ie=p(37496),D=p(79512),j=p(4222),_e=p(44466),be=p(23815),C=p.n(be),W=p(35758),b=p(64762),ie=p(58497),Y=p(93523),e=p(74788);let k=class{constructor(_){this.http=_}listTargets(){return this.http.get("api/iscsi/target")}getTarget(_){return this.http.get(`api/iscsi/target/${_}`)}updateTarget(_,t){return this.http.put(`api/iscsi/target/${_}`,t,{observe:"response"})}status(){return this.http.get("ui-api/iscsi/status")}settings(){return this.http.get("ui-api/iscsi/settings")}version(){return this.http.get("ui-api/iscsi/version")}portals(){return this.http.get("ui-api/iscsi/portals")}createTarget(_){return this.http.post("api/iscsi/target",_,{observe:"response"})}deleteTarget(_){return this.http.delete(`api/iscsi/target/${_}`,{observe:"response"})}getDiscovery(){return this.http.get("api/iscsi/discoveryauth")}updateDiscovery(_){return this.http.put("api/iscsi/discoveryauth",_)}overview(){return this.http.get("ui-api/iscsi/overview")}};k.\u0275fac=function(_){return new(_||k)(e.LFG(ie.eN))},k.\u0275prov=e.Yz7({token:k,factory:k.\u0275fac,providedIn:"root"}),k=(0,b.gn)([Y.o,(0,b.w6)("design:paramtypes",[ie.eN])],k);var Ne=p(88002),Z=p(19358),Ae=p(34089);let x=class{constructor(_,t){this.http=_,this.rbdConfigurationService=t}isRBDPool(_){return-1!==C().indexOf(_.application_metadata,"rbd")&&!_.pool_name.includes("/")}create(_){return this.http.post("api/block/image",_,{observe:"response"})}delete(_){return this.http.delete(`api/block/image/${_.toStringEncoded()}`,{observe:"response"})}update(_,t){return this.http.put(`api/block/image/${_.toStringEncoded()}`,t,{observe:"response"})}get(_){return this.http.get(`api/block/image/${_.toStringEncoded()}`)}list(){return this.http.get("api/block/image").pipe((0,Ne.U)(_=>_.map(t=>(t.value.map(o=>(o.configuration&&o.configuration.map(i=>Object.assign(i,this.rbdConfigurationService.getOptionByName(i.name))),o)),t))))}copy(_,t){return this.http.post(`api/block/image/${_.toStringEncoded()}/copy`,t,{observe:"response"})}flatten(_){return this.http.post(`api/block/image/${_.toStringEncoded()}/flatten`,null,{observe:"response"})}defaultFeatures(){return this.http.get("api/block/image/default_features")}cloneFormatVersion(){return this.http.get("api/block/image/clone_format_version")}createSnapshot(_,t){const o={snapshot_name:t};return this.http.post(`api/block/image/${_.toStringEncoded()}/snap`,o,{observe:"response"})}renameSnapshot(_,t,o){const i={new_snap_name:o};return this.http.put(`api/block/image/${_.toStringEncoded()}/snap/${t}`,i,{observe:"response"})}protectSnapshot(_,t,o){const i={is_protected:o};return this.http.put(`api/block/image/${_.toStringEncoded()}/snap/${t}`,i,{observe:"response"})}rollbackSnapshot(_,t){return this.http.post(`api/block/image/${_.toStringEncoded()}/snap/${t}/rollback`,null,{observe:"response"})}cloneSnapshot(_,t,o){return this.http.post(`api/block/image/${_.toStringEncoded()}/snap/${t}/clone`,o,{observe:"response"})}deleteSnapshot(_,t){return this.http.delete(`api/block/image/${_.toStringEncoded()}/snap/${t}`,{observe:"response"})}listTrash(){return this.http.get("api/block/image/trash/")}createNamespace(_,t){return this.http.post(`api/block/pool/${_}/namespace`,{namespace:t},{observe:"response"})}listNamespaces(_){return this.http.get(`api/block/pool/${_}/namespace/`)}deleteNamespace(_,t){return this.http.delete(`api/block/pool/${_}/namespace/${t}`,{observe:"response"})}moveTrash(_,t){return this.http.post(`api/block/image/${_.toStringEncoded()}/move_trash`,{delay:t},{observe:"response"})}purgeTrash(_){return this.http.post(`api/block/image/trash/purge/?pool_name=${_}`,null,{observe:"response"})}restoreTrash(_,t){return this.http.post(`api/block/image/trash/${_.toStringEncoded()}/restore`,{new_image_name:t},{observe:"response"})}removeTrash(_,t=!1){return this.http.delete(`api/block/image/trash/${_.toStringEncoded()}/?force=${t}`,{observe:"response"})}};x.\u0275fac=function(_){return new(_||x)(e.LFG(ie.eN),e.LFG(Ae.n))},x.\u0275prov=e.Yz7({token:x,factory:x.\u0275fac,providedIn:"root"}),(0,b.gn)([(0,b.fM)(1,Y.G),(0,b.w6)("design:type",Function),(0,b.w6)("design:paramtypes",[Z.N,String]),(0,b.w6)("design:returntype",void 0)],x.prototype,"createSnapshot",null),(0,b.gn)([(0,b.fM)(2,Y.G),(0,b.w6)("design:type",Function),(0,b.w6)("design:paramtypes",[Z.N,String,String]),(0,b.w6)("design:returntype",void 0)],x.prototype,"renameSnapshot",null),(0,b.gn)([(0,b.fM)(2,Y.G),(0,b.w6)("design:type",Function),(0,b.w6)("design:paramtypes",[Z.N,String,Boolean]),(0,b.w6)("design:returntype",void 0)],x.prototype,"protectSnapshot",null),(0,b.gn)([(0,b.fM)(1,Y.G),(0,b.w6)("design:type",Function),(0,b.w6)("design:paramtypes",[Z.N,String]),(0,b.w6)("design:returntype",void 0)],x.prototype,"restoreTrash",null),x=(0,b.gn)([Y.o,(0,b.w6)("design:paramtypes",[ie.eN,Ae.n])],x);var ae=p(7022),V=p(14745),T=p(65862),q=p(93614),M=p(95463),B=p(77205),F=p(76111),Q=p(32337),R=p(60312),v=p(41582),g=p(56310),f=p(87925),h=p(94276),O=p(30839);function H(n,_){if(1&n&&(e.TgZ(0,"option",6),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.Q6J("ngValue",t),e.xp6(1),e.Oqu(t)}}function De(n,_){if(1&n&&(e.TgZ(0,"select",5),e._UZ(1,"option",6),e.YNc(2,H,2,2,"option",7),e.qZA()),2&n){const t=e.oxw();e.s9C("id",t.setting),e.s9C("name",t.setting),e.Q6J("formControlName",t.setting),e.xp6(1),e.Q6J("ngValue",null),e.xp6(1),e.Q6J("ngForOf",t.limits.values)}}function Jt(n,_){if(1&n&&e._UZ(0,"input",10),2&n){const t=e.oxw(2);e.Q6J("formControlName",t.setting)}}function Yt(n,_){if(1&n&&e._UZ(0,"input",11),2&n){const t=e.oxw(2);e.Q6J("formControlName",t.setting)}}function Vt(n,_){if(1&n&&(e.ynx(0),e._UZ(1,"br"),e.TgZ(2,"div",12),e._UZ(3,"input",13),e.TgZ(4,"label",14),e._uU(5,"Yes"),e.qZA(),e.qZA(),e.TgZ(6,"div",12),e._UZ(7,"input",13),e.TgZ(8,"label",14),e._uU(9,"No"),e.qZA(),e.qZA(),e.BQk()),2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("id",t.setting+"True")("value",!0)("formControlName",t.setting),e.xp6(1),e.Q6J("for",t.setting+"True"),e.xp6(3),e.Q6J("id",t.setting+"False")("value",!1)("formControlName",t.setting),e.xp6(1),e.Q6J("for",t.setting+"False")}}function Ut(n,_){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,Jt,1,1,"input",8),e.YNc(2,Yt,1,1,"input",9),e.YNc(3,Vt,10,8,"ng-container",3),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf","int"===t.limits.type),e.xp6(1),e.Q6J("ngIf","str"===t.limits.type),e.xp6(1),e.Q6J("ngIf","bool"===t.limits.type)}}function jt(n,_){if(1&n&&(e.TgZ(0,"span",15),e.ynx(1),e.SDv(2,16),e.BQk(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.pQV(t.limits.min),e.QtT(2)}}function Wt(n,_){if(1&n&&(e.TgZ(0,"span",15),e.ynx(1),e.SDv(2,17),e.BQk(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.pQV(t.limits.max),e.QtT(2)}}let _t=(()=>{class n{ngOnInit(){const t=[];"min"in this.limits&&t.push(r.kI.min(this.limits.min)),"max"in this.limits&&t.push(r.kI.max(this.limits.max)),this.settingsForm.get(this.setting).setValidators(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-setting"]],inputs:{settingsForm:"settingsForm",formDir:"formDir",setting:"setting",limits:"limits"},decls:7,vars:7,consts:function(){let _,t;return _="Must be greater than or equal to " + "\ufffd0\ufffd" + ".",t="Must be less than or equal to " + "\ufffd0\ufffd" + ".",[[1,"form-group",3,"formGroup"],[1,"col-form-label",3,"for"],["class","form-control custom-select",3,"id","name","formControlName",4,"ngIf"],[4,"ngIf"],["class","invalid-feedback",4,"ngIf"],[1,"form-control","custom-select",3,"id","name","formControlName"],[3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["type","number","class","form-control",3,"formControlName",4,"ngIf"],["type","text","class","form-control",3,"formControlName",4,"ngIf"],["type","number",1,"form-control",3,"formControlName"],["type","text",1,"form-control",3,"formControlName"],[1,"custom-control","custom-radio","custom-control-inline"],["type","radio",1,"custom-control-input",3,"id","value","formControlName"],[1,"custom-control-label",3,"for"],[1,"invalid-feedback"],_,t]},template:function(t,o){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"label",1),e._uU(2),e.qZA(),e.YNc(3,De,3,5,"select",2),e.YNc(4,Ut,4,3,"span",3),e.YNc(5,jt,3,1,"span",4),e.YNc(6,Wt,3,1,"span",4),e.qZA()),2&t&&(e.Q6J("formGroup",o.settingsForm),e.xp6(1),e.s9C("for",o.setting),e.xp6(1),e.Oqu(o.setting),e.xp6(1),e.Q6J("ngIf","enum"===o.limits.type),e.xp6(1),e.Q6J("ngIf","enum"!==o.limits.type),e.xp6(1),e.Q6J("ngIf",o.settingsForm.showError(o.setting,o.formDir,"min")),e.xp6(1),e.Q6J("ngIf",o.settingsForm.showError(o.setting,o.formDir,"max")))},directives:[g.P,r.JL,r.sg,v.V,l.O5,f.o,r.EJ,h.b,r.JJ,r.u,r.YN,r.Kr,l.sg,r.wV,r.Fj,r._],styles:[""]}),n})();var He=p(88820);function eo(n,_){1&n&&(e.TgZ(0,"span",29),e.SDv(1,30),e.qZA())}function to(n,_){if(1&n&&(e.TgZ(0,"span"),e.TgZ(1,"legend",10),e.SDv(2,21),e.qZA(),e.TgZ(3,"div",12),e.TgZ(4,"div",13),e.TgZ(5,"label",22),e.SDv(6,23),e.qZA(),e._UZ(7,"input",24),e.YNc(8,eo,2,0,"span",25),e.qZA(),e.qZA(),e.TgZ(9,"div",12),e.TgZ(10,"div",13),e.TgZ(11,"label",26),e.SDv(12,27),e.qZA(),e._UZ(13,"input",28),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw(),o=e.MAs(9);e.xp6(8),e.Q6J("ngIf",t.settingsForm.showError("lun",o,"required"))}}function oo(n,_){if(1&n&&(e.TgZ(0,"option",31),e._uU(1),e.ALo(2,"iscsiBackstore"),e.qZA()),2&n){const t=_.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(e.lcZ(2,2,t))}}function no(n,_){if(1&n&&(e.TgZ(0,"div",12),e.TgZ(1,"div",13),e._UZ(2,"cd-iscsi-setting",33),e.qZA(),e.qZA()),2&n){const t=_.$implicit,o=e.oxw(2).$implicit,i=e.oxw(),s=e.MAs(9);e.xp6(2),e.Q6J("settingsForm",i.settingsForm)("formDir",s)("setting",t.key)("limits",i.getDiskControlLimits(o,t.key))}}function io(n,_){if(1&n&&(e.ynx(0),e.YNc(1,no,3,4,"div",32),e.ALo(2,"keyvalue"),e.BQk()),2&n){const t=e.oxw().$implicit,o=e.oxw();e.xp6(1),e.Q6J("ngForOf",e.lcZ(2,1,o.disk_default_controls[t]))}}function _o(n,_){if(1&n&&(e.ynx(0),e.YNc(1,io,3,3,"ng-container",9),e.BQk()),2&n){const t=_.$implicit,o=e.oxw();e.xp6(1),e.Q6J("ngIf",o.settingsForm.value.backstore===t)}}let so=(()=>{class n{constructor(t,o,i){this.activeModal=t,this.iscsiService=o,this.actionLabels=i}ngOnInit(){const t={backstore:new r.NI(this.imagesSettings[this.image].backstore),lun:new r.NI(this.imagesSettings[this.image].lun),wwn:new r.NI(this.imagesSettings[this.image].wwn)};C().forEach(this.backstores,o=>{const i=this.imagesSettings[this.image][o]||{};C().forIn(this.disk_default_controls[o],(s,a)=>{t[a]=new r.NI(i[a])})}),this.settingsForm=new M.d(t)}getDiskControlLimits(t,o){return this.disk_controls_limits?this.disk_controls_limits[t][o]:{type:"int"}}save(){const t=this.settingsForm.controls.backstore.value,o=this.settingsForm.controls.lun.value,i=this.settingsForm.controls.wwn.value,s={};C().forIn(this.settingsForm.controls,(a,d)=>{""!==a.value&&null!==a.value&&d in this.disk_default_controls[this.settingsForm.value.backstore]&&(s[d]=a.value,C().forEach(this.backstores,c=>{c!==t&&d in(this.imagesSettings[this.image][c]||{})&&(this.imagesSettings[this.image][c][d]=a.value)}))}),this.imagesSettings[this.image].backstore=t,this.imagesSettings[this.image].lun=o,this.imagesSettings[this.image].wwn=i,this.imagesSettings[this.image][t]=s,this.imagesSettings=Object.assign({},this.imagesSettings),this.control.updateValueAndValidity({emitEvent:!1}),this.activeModal.close()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(I.Kz),e.Y36(k),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-target-image-settings-modal"]],decls:25,vars:8,consts:function(){let _,t,o,i,s,a,d,c;return _="Configure",t="Changing these parameters from their default values is usually not necessary.",o="Settings",i="Backstore",s="Identifier",a="lun",d="wwn",c="This field is required.",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","settingsForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"alert-warning"],t,[4,"ngIf"],[1,"cd-header"],o,[1,"form-group","row"],[1,"col-sm-12"],[1,"col-form-label"],i,["id","backstore","name","backstore","formControlName","backstore",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],s,["for","lun",1,"col-form-label","required"],a,["type","number","id","lun","name","lun","formControlName","lun",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","wwn",1,"col-form-label"],d,["type","text","id","wwn","name","wwn","formControlName","wwn",1,"form-control"],[1,"invalid-feedback"],c,[3,"value"],["class","form-group row",4,"ngFor","ngForOf"],[3,"settingsForm","formDir","setting","limits"]]},template:function(t,o){1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.ynx(2),e.SDv(3,2),e.BQk(),e._uU(4,"\xa0 "),e.TgZ(5,"small"),e._uU(6),e.qZA(),e.BQk(),e.ynx(7,3),e.TgZ(8,"form",4,5),e.TgZ(10,"div",6),e.TgZ(11,"p",7),e.SDv(12,8),e.qZA(),e.YNc(13,to,14,1,"span",9),e.TgZ(14,"legend",10),e.SDv(15,11),e.qZA(),e.TgZ(16,"div",12),e.TgZ(17,"div",13),e.TgZ(18,"label",14),e.SDv(19,15),e.qZA(),e.TgZ(20,"select",16),e.YNc(21,oo,3,4,"option",17),e.qZA(),e.qZA(),e.qZA(),e.YNc(22,_o,2,1,"ng-container",18),e.qZA(),e.TgZ(23,"div",19),e.TgZ(24,"cd-form-button-panel",20),e.NdJ("submitActionEvent",function(){return o.save()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t&&(e.Q6J("modalRef",o.activeModal),e.xp6(6),e.Oqu(o.image),e.xp6(2),e.Q6J("formGroup",o.settingsForm),e.xp6(5),e.Q6J("ngIf",o.api_version>=1),e.xp6(8),e.Q6J("ngForOf",o.backstores),e.xp6(1),e.Q6J("ngForOf",o.backstores),e.xp6(2),e.Q6J("form",o.settingsForm)("submitText",o.actionLabels.UPDATE))},directives:[R.z,r._Y,r.JL,r.sg,v.V,l.O5,g.P,f.o,r.EJ,h.b,r.JJ,r.u,l.sg,O.p,r.wV,r.Fj,r.YN,r.Kr,_t],pipes:[He.V,l.Nd],styles:[""]}),n})();function ao(n,_){if(1&n&&(e.TgZ(0,"div",12),e.TgZ(1,"div",13),e._UZ(2,"cd-iscsi-setting",14),e.qZA(),e.qZA()),2&n){const t=_.$implicit,o=e.oxw(),i=e.MAs(5);e.xp6(2),e.Q6J("settingsForm",o.settingsForm)("formDir",i)("setting",t.key)("limits",o.getTargetControlLimits(t.key))}}let ro=(()=>{class n{constructor(t,o,i){this.activeModal=t,this.iscsiService=o,this.actionLabels=i}ngOnInit(){const t={};C().forIn(this.target_default_controls,(o,i)=>{t[i]=new r.NI(this.target_controls.value[i])}),this.settingsForm=new M.d(t)}save(){const t={};C().forIn(this.settingsForm.controls,(o,i)=>{""===o.value||null===o.value||(t[i]=o.value)}),this.target_controls.setValue(t),this.activeModal.close()}getTargetControlLimits(t){return this.target_controls_limits?this.target_controls_limits[t]:["Yes","No"].includes(this.target_default_controls[t])?{type:"bool"}:{type:"int"}}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(I.Kz),e.Y36(k),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-target-iqn-settings-modal"]],decls:13,vars:7,consts:function(){let _,t;return _="Advanced Settings",t="Changing these parameters from their default values is usually not necessary.",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","settingsForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"alert-warning"],t,["class","form-group row",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"form-group","row"],[1,"col-sm-12"],[3,"settingsForm","formDir","setting","limits"]]},template:function(t,o){1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.BQk(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.TgZ(7,"p",7),e.SDv(8,8),e.qZA(),e.YNc(9,ao,3,4,"div",9),e.ALo(10,"keyvalue"),e.qZA(),e.TgZ(11,"div",10),e.TgZ(12,"cd-form-button-panel",11),e.NdJ("submitActionEvent",function(){return o.save()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t&&(e.Q6J("modalRef",o.activeModal),e.xp6(4),e.Q6J("formGroup",o.settingsForm),e.xp6(5),e.Q6J("ngForOf",e.lcZ(10,5,o.settingsForm.controls)),e.xp6(3),e.Q6J("form",o.settingsForm)("submitText",o.actionLabels.UPDATE))},directives:[R.z,r._Y,r.JL,r.sg,v.V,l.sg,O.p,g.P,_t],pipes:[l.Nd],styles:[""]}),n})();var re=p(63285),st=p(63622);let lo=(()=>{class n{constructor(t){this.ngControl=t}onInput(t){this.setValue(t)}setValue(t){t=C().isString(t)?t.trim():t,this.ngControl.control.setValue(t)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(r.a5))},n.\u0275dir=e.lG2({type:n,selectors:[["","cdTrim",""]],hostBindings:function(t,o){1&t&&e.NdJ("input",function(s){return o.onInput(s.target.value)})}}),n})();var co=p(39092),at=p(4416),Je=p(58039),Ye=p(10545);function po(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,42),e.qZA())}function go(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,43),e.qZA())}function uo(n,_){1&n&&(e.TgZ(0,"span",41),e.ynx(1),e.SDv(2,44),e.BQk(),e._UZ(3,"br"),e.ynx(4),e.SDv(5,45),e.BQk(),e._UZ(6,"br"),e.TgZ(7,"a",46),e.SDv(8,47),e.qZA(),e.qZA())}function mo(n,_){1&n&&(e.TgZ(0,"span",48),e.SDv(1,49),e.qZA())}const z=function(n){return[n]};function To(n,_){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",50),e._UZ(2,"input",51),e.TgZ(3,"span",14),e.TgZ(4,"button",52),e.NdJ("click",function(){const i=e.CHM(t),s=i.index,a=i.$implicit;return e.oxw(2).removePortal(s,a)}),e._UZ(5,"i",16),e.qZA(),e.qZA(),e.qZA(),e.BQk()}if(2&n){const t=_.$implicit,o=e.oxw(2);e.xp6(2),e.Q6J("value",t),e.xp6(3),e.Q6J("ngClass",e.VKq(2,z,o.icons.destroy))}}function fo(n,_){if(1&n&&(e.TgZ(0,"span",41),e.SDv(1,53),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.pQV(t.minimum_gateways),e.QtT(1)}}function Co(n,_){if(1&n&&(e.TgZ(0,"div",56),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit,o=e.oxw(2);e.xp6(1),e.hij("lun: ",o.imagesSettings[t].lun,"")}}function So(n,_){if(1&n&&(e.ynx(0),e.SDv(1,57),e.ALo(2,"iscsiBackstore"),e.BQk()),2&n){const t=e.oxw().$implicit,o=e.oxw(2);e.xp6(2),e.pQV(e.lcZ(2,1,o.imagesSettings[t].backstore)),e.QtT(1)}}function Eo(n,_){1&n&&(e.ynx(0),e.SDv(1,58),e.BQk())}function Ro(n,_){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",50),e._UZ(2,"input",51),e.TgZ(3,"span",14),e.YNc(4,Co,2,1,"div",54),e.TgZ(5,"button",52),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw(2).imageSettingsModal(s)}),e._UZ(6,"i",16),e.qZA(),e.TgZ(7,"button",52),e.NdJ("click",function(){const i=e.CHM(t),s=i.index,a=i.$implicit;return e.oxw(2).removeImage(s,a)}),e._UZ(8,"i",16),e.qZA(),e.qZA(),e.qZA(),e.TgZ(9,"span",48),e.YNc(10,So,3,3,"ng-container",55),e.YNc(11,Eo,2,0,"ng-container",55),e.qZA(),e.BQk()}if(2&n){const t=_.$implicit,o=e.oxw(2);e.xp6(2),e.Q6J("value",t),e.xp6(2),e.Q6J("ngIf",o.api_version>=1),e.xp6(2),e.Q6J("ngClass",e.VKq(6,z,o.icons.deepCheck)),e.xp6(2),e.Q6J("ngClass",e.VKq(8,z,o.icons.destroy)),e.xp6(2),e.Q6J("ngIf",o.backstores.length>1),e.xp6(1),e.Q6J("ngIf",o.hasAdvancedSettings(o.imagesSettings[t][o.imagesSettings[t].backstore]))}}function Mo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,59),e.qZA())}function Oo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,60),e.qZA())}function Ao(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,78),e.qZA())}function ho(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,79),e.qZA())}function Po(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,80),e.qZA())}function Io(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,81),e.qZA())}function bo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,82),e.qZA())}function No(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,83),e.qZA())}function Do(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,84),e.qZA())}function vo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,85),e.qZA())}function Lo(n,_){if(1&n&&(e.TgZ(0,"div",61),e.TgZ(1,"div",8),e.TgZ(2,"label",62),e.ynx(3),e.SDv(4,63),e.BQk(),e.qZA(),e.TgZ(5,"div",11),e._UZ(6,"input",64),e.YNc(7,Ao,2,0,"span",17),e.YNc(8,ho,2,0,"span",17),e.qZA(),e.qZA(),e.TgZ(9,"div",8),e.TgZ(10,"label",65),e.ynx(11),e.SDv(12,66),e.BQk(),e.qZA(),e.TgZ(13,"div",11),e.TgZ(14,"div",12),e._UZ(15,"input",67),e.TgZ(16,"span",14),e._UZ(17,"button",68),e._UZ(18,"cd-copy-2-clipboard-button",69),e.qZA(),e.qZA(),e.YNc(19,Po,2,0,"span",17),e.YNc(20,Io,2,0,"span",17),e.qZA(),e.qZA(),e.TgZ(21,"div",8),e.TgZ(22,"label",70),e.ynx(23),e.SDv(24,71),e.BQk(),e.qZA(),e.TgZ(25,"div",11),e._UZ(26,"input",72),e.YNc(27,bo,2,0,"span",17),e.YNc(28,No,2,0,"span",17),e.qZA(),e.qZA(),e.TgZ(29,"div",8),e.TgZ(30,"label",73),e.ynx(31),e.SDv(32,74),e.BQk(),e.qZA(),e.TgZ(33,"div",11),e.TgZ(34,"div",12),e._UZ(35,"input",75),e.TgZ(36,"span",14),e._UZ(37,"button",76),e._UZ(38,"cd-copy-2-clipboard-button",77),e.qZA(),e.qZA(),e.YNc(39,Do,2,0,"span",17),e.YNc(40,vo,2,0,"span",17),e.qZA(),e.qZA(),e.qZA()),2&n){e.oxw();const t=e.MAs(2),o=e.oxw();e.xp6(7),e.Q6J("ngIf",o.targetForm.showError("user",t,"required")),e.xp6(1),e.Q6J("ngIf",o.targetForm.showError("user",t,"pattern")),e.xp6(11),e.Q6J("ngIf",o.targetForm.showError("password",t,"required")),e.xp6(1),e.Q6J("ngIf",o.targetForm.showError("password",t,"pattern")),e.xp6(7),e.Q6J("ngIf",o.targetForm.showError("mutual_user",t,"required")),e.xp6(1),e.Q6J("ngIf",o.targetForm.showError("mutual_user",t,"pattern")),e.xp6(11),e.Q6J("ngIf",o.targetForm.showError("mutual_password",t,"required")),e.xp6(1),e.Q6J("ngIf",o.targetForm.showError("mutual_password",t,"pattern"))}}function Fo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,115),e.qZA())}function $o(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,116),e.qZA())}function Zo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,117),e.qZA())}function Bo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,118),e.qZA())}function Go(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,119),e.qZA())}function yo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,120),e.qZA())}function xo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,121),e.qZA())}function wo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,122),e.qZA())}function qo(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,123),e.qZA())}function Ho(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,124),e.qZA())}function Ko(n,_){1&n&&(e.TgZ(0,"span",41),e.SDv(1,125),e.qZA())}function ko(n,_){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",50),e._UZ(2,"input",51),e.TgZ(3,"span",14),e.TgZ(4,"button",52),e.NdJ("click",function(){const i=e.CHM(t),s=i.index,a=i.$implicit,d=e.oxw(),c=d.$implicit,u=d.index;return e.oxw(3).removeInitiatorImage(c,s,u,a)}),e._UZ(5,"i",16),e.qZA(),e.qZA(),e.qZA(),e.BQk()}if(2&n){const t=_.$implicit,o=e.oxw(4);e.xp6(2),e.Q6J("value",t),e.xp6(3),e.Q6J("ngClass",e.VKq(2,z,o.icons.destroy))}}function Xo(n,_){1&n&&(e.TgZ(0,"span"),e.SDv(1,126),e.qZA())}function Qo(n,_){if(1&n&&(e.TgZ(0,"div",22),e.TgZ(1,"div",23),e.TgZ(2,"cd-select",127),e._UZ(3,"i",25),e.ynx(4),e.SDv(5,128),e.BQk(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw(),o=t.$implicit,i=t.index,s=e.oxw(3);e.xp6(2),e.Q6J("data",o.getValue("luns"))("options",s.imagesInitiatorSelections[i])("messages",s.messages.initiatorImage),e.xp6(1),e.Q6J("ngClass",e.VKq(4,z,s.icons.add))}}function zo(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"div",92),e.TgZ(1,"div",5),e.ynx(2),e.SDv(3,93),e.BQk(),e._uU(4),e.TgZ(5,"button",94),e.NdJ("click",function(){const s=e.CHM(t).index;return e.oxw(3).removeInitiator(s)}),e._UZ(6,"i",25),e.qZA(),e.qZA(),e.TgZ(7,"div",7),e.TgZ(8,"div",8),e.TgZ(9,"label",95),e.SDv(10,96),e.qZA(),e.TgZ(11,"div",11),e.TgZ(12,"input",97),e.NdJ("blur",function(){return e.CHM(t),e.oxw(3).updatedInitiatorSelector()}),e.qZA(),e.YNc(13,Fo,2,0,"span",17),e.YNc(14,$o,2,0,"span",17),e.YNc(15,Zo,2,0,"span",17),e.qZA(),e.qZA(),e.ynx(16,61),e.TgZ(17,"div",8),e.TgZ(18,"label",98),e.SDv(19,99),e.qZA(),e.TgZ(20,"div",11),e._UZ(21,"input",100),e.YNc(22,Bo,2,0,"span",17),e.YNc(23,Go,2,0,"span",17),e.qZA(),e.qZA(),e.TgZ(24,"div",8),e.TgZ(25,"label",101),e.SDv(26,102),e.qZA(),e.TgZ(27,"div",11),e.TgZ(28,"div",12),e._UZ(29,"input",103),e.TgZ(30,"span",14),e._UZ(31,"button",104),e._UZ(32,"cd-copy-2-clipboard-button",105),e.qZA(),e.qZA(),e.YNc(33,yo,2,0,"span",17),e.YNc(34,xo,2,0,"span",17),e.qZA(),e.qZA(),e.TgZ(35,"div",8),e.TgZ(36,"label",106),e.ynx(37),e.SDv(38,107),e.BQk(),e.qZA(),e.TgZ(39,"div",11),e._UZ(40,"input",108),e.YNc(41,wo,2,0,"span",17),e.YNc(42,qo,2,0,"span",17),e.qZA(),e.qZA(),e.TgZ(43,"div",8),e.TgZ(44,"label",109),e.SDv(45,110),e.qZA(),e.TgZ(46,"div",11),e.TgZ(47,"div",12),e._UZ(48,"input",111),e.TgZ(49,"span",14),e._UZ(50,"button",104),e._UZ(51,"cd-copy-2-clipboard-button",105),e.qZA(),e.qZA(),e.YNc(52,Ho,2,0,"span",17),e.YNc(53,Ko,2,0,"span",17),e.qZA(),e.qZA(),e.BQk(),e.TgZ(54,"div",8),e.TgZ(55,"label",112),e.SDv(56,113),e.qZA(),e.TgZ(57,"div",11),e.YNc(58,ko,6,4,"ng-container",21),e.YNc(59,Xo,2,0,"span",55),e.YNc(60,Qo,6,6,"div",114),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=_.$implicit,o=_.index;e.oxw(2);const i=e.MAs(2),s=e.oxw();e.Q6J("formGroup",t),e.xp6(4),e.hij(": ",t.getValue("client_iqn")," "),e.xp6(2),e.Q6J("ngClass",e.VKq(25,z,s.icons.destroy)),e.xp6(7),e.Q6J("ngIf",t.showError("client_iqn",i,"notUnique")),e.xp6(1),e.Q6J("ngIf",t.showError("client_iqn",i,"required")),e.xp6(1),e.Q6J("ngIf",t.showError("client_iqn",i,"pattern")),e.xp6(6),e.Q6J("id","user"+o),e.xp6(1),e.Q6J("ngIf",t.showError("user",i,"required")),e.xp6(1),e.Q6J("ngIf",t.showError("user",i,"pattern")),e.xp6(6),e.Q6J("id","password"+o),e.xp6(2),e.Q6J("cdPasswordButton","password"+o),e.xp6(1),e.Q6J("source","password"+o),e.xp6(1),e.Q6J("ngIf",t.showError("password",i,"required")),e.xp6(1),e.Q6J("ngIf",t.showError("password",i,"pattern")),e.xp6(6),e.Q6J("id","mutual_user"+o),e.xp6(1),e.Q6J("ngIf",t.showError("mutual_user",i,"required")),e.xp6(1),e.Q6J("ngIf",t.showError("mutual_user",i,"pattern")),e.xp6(6),e.Q6J("id","mutual_password"+o),e.xp6(2),e.Q6J("cdPasswordButton","mutual_password"+o),e.xp6(1),e.Q6J("source","mutual_password"+o),e.xp6(1),e.Q6J("ngIf",t.showError("mutual_password",i,"required")),e.xp6(1),e.Q6J("ngIf",t.showError("mutual_password",i,"pattern")),e.xp6(5),e.Q6J("ngForOf",t.getValue("luns")),e.xp6(1),e.Q6J("ngIf",t.getValue("cdIsInGroup")),e.xp6(1),e.Q6J("ngIf",!t.getValue("cdIsInGroup"))}}function Jo(n,_){1&n&&(e.TgZ(0,"span",48),e.SDv(1,129),e.qZA())}function Yo(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"div",8),e.TgZ(1,"label",86),e.SDv(2,87),e.qZA(),e.TgZ(3,"div",88),e.YNc(4,zo,61,27,"div",89),e.TgZ(5,"div",22),e.TgZ(6,"div",23),e.YNc(7,Jo,2,0,"span",18),e.TgZ(8,"button",90),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).addInitiator(),!1}),e._UZ(9,"i",25),e.ynx(10),e.SDv(11,91),e.BQk(),e.qZA(),e.qZA(),e.qZA(),e._UZ(12,"hr"),e.qZA(),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngForOf",t.initiators.controls),e.xp6(3),e.Q6J("ngIf",0===t.initiators.controls.length),e.xp6(2),e.Q6J("ngClass",e.VKq(3,z,t.icons.add))}}function Vo(n,_){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",50),e._UZ(2,"input",51),e.TgZ(3,"span",14),e.TgZ(4,"button",52),e.NdJ("click",function(){const s=e.CHM(t).index,a=e.oxw(),d=a.$implicit,c=a.index;return e.oxw(3).removeGroupInitiator(d,s,c)}),e._UZ(5,"i",16),e.qZA(),e.qZA(),e.qZA(),e.BQk()}if(2&n){const t=_.$implicit,o=e.oxw(4);e.xp6(2),e.Q6J("value",t),e.xp6(3),e.Q6J("ngClass",e.VKq(2,z,o.icons.destroy))}}function Uo(n,_){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",50),e._UZ(2,"input",51),e.TgZ(3,"span",14),e.TgZ(4,"button",52),e.NdJ("click",function(){const s=e.CHM(t).index,a=e.oxw(),d=a.$implicit,c=a.index;return e.oxw(3).removeGroupDisk(d,s,c)}),e._UZ(5,"i",16),e.qZA(),e.qZA(),e.qZA(),e.BQk()}if(2&n){const t=_.$implicit,o=e.oxw(4);e.xp6(2),e.Q6J("value",t),e.xp6(3),e.Q6J("ngClass",e.VKq(2,z,o.icons.destroy))}}function jo(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"div",92),e.TgZ(1,"div",5),e.ynx(2),e.SDv(3,133),e.BQk(),e._uU(4),e.TgZ(5,"button",94),e.NdJ("click",function(){const s=e.CHM(t).index;return e.oxw(3).removeGroup(s)}),e._UZ(6,"i",25),e.qZA(),e.qZA(),e.TgZ(7,"div",7),e.TgZ(8,"div",8),e.TgZ(9,"label",134),e.SDv(10,135),e.qZA(),e.TgZ(11,"div",11),e._UZ(12,"input",136),e.qZA(),e.qZA(),e.TgZ(13,"div",8),e.TgZ(14,"label",137),e.ynx(15),e.SDv(16,138),e.BQk(),e.qZA(),e.TgZ(17,"div",11),e.YNc(18,Vo,6,4,"ng-container",21),e.TgZ(19,"div",22),e.TgZ(20,"div",23),e.TgZ(21,"cd-select",24),e.NdJ("selection",function(i){const a=e.CHM(t).index;return e.oxw(3).onGroupMemberSelection(i,a)}),e._UZ(22,"i",25),e.ynx(23),e.SDv(24,139),e.BQk(),e.qZA(),e.qZA(),e.qZA(),e._UZ(25,"hr"),e.qZA(),e.qZA(),e.TgZ(26,"div",8),e.TgZ(27,"label",28),e.ynx(28),e.SDv(29,140),e.BQk(),e.qZA(),e.TgZ(30,"div",11),e.YNc(31,Uo,6,4,"ng-container",21),e.TgZ(32,"div",22),e.TgZ(33,"div",23),e.TgZ(34,"cd-select",127),e._UZ(35,"i",25),e.ynx(36),e.SDv(37,141),e.BQk(),e.qZA(),e.qZA(),e.qZA(),e._UZ(38,"hr"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=_.$implicit,o=_.index,i=e.oxw(3);e.Q6J("formGroup",t),e.xp6(4),e.hij(": ",t.getValue("group_id")," "),e.xp6(2),e.Q6J("ngClass",e.VKq(13,z,i.icons.destroy)),e.xp6(12),e.Q6J("ngForOf",t.getValue("members")),e.xp6(3),e.Q6J("data",t.getValue("members"))("options",i.groupMembersSelections[o])("messages",i.messages.groupInitiator),e.xp6(1),e.Q6J("ngClass",e.VKq(15,z,i.icons.add)),e.xp6(9),e.Q6J("ngForOf",t.getValue("disks")),e.xp6(3),e.Q6J("data",t.getValue("disks"))("options",i.groupDiskSelections[o])("messages",i.messages.initiatorImage),e.xp6(1),e.Q6J("ngClass",e.VKq(17,z,i.icons.add))}}function Wo(n,_){1&n&&(e.TgZ(0,"span",48),e.SDv(1,142),e.qZA())}function en(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"div",8),e.TgZ(1,"label",86),e.SDv(2,130),e.qZA(),e.TgZ(3,"div",131),e.YNc(4,jo,39,19,"div",89),e.TgZ(5,"div",22),e.TgZ(6,"div",23),e.YNc(7,Wo,2,0,"span",18),e.TgZ(8,"button",90),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).addGroup(),!1}),e._UZ(9,"i",25),e.ynx(10),e.SDv(11,132),e.BQk(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngForOf",t.groups.controls),e.xp6(3),e.Q6J("ngIf",0===t.groups.controls.length),e.xp6(2),e.Q6J("ngClass",e.VKq(3,z,t.icons.add))}}function tn(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"div",1),e.TgZ(1,"form",2,3),e.TgZ(3,"div",4),e.TgZ(4,"div",5),e.SDv(5,6),e.ALo(6,"titlecase"),e.ALo(7,"upperFirst"),e.qZA(),e.TgZ(8,"div",7),e.TgZ(9,"div",8),e.TgZ(10,"label",9),e.SDv(11,10),e.qZA(),e.TgZ(12,"div",11),e.TgZ(13,"div",12),e._UZ(14,"input",13),e.TgZ(15,"span",14),e.TgZ(16,"button",15),e.NdJ("click",function(){return e.CHM(t),e.oxw().targetSettingsModal()}),e._UZ(17,"i",16),e.qZA(),e.qZA(),e.qZA(),e.YNc(18,po,2,0,"span",17),e.YNc(19,go,2,0,"span",17),e.YNc(20,uo,9,0,"span",17),e.YNc(21,mo,2,0,"span",18),e._UZ(22,"hr"),e.qZA(),e.qZA(),e.TgZ(23,"div",8),e.TgZ(24,"label",19),e.SDv(25,20),e.qZA(),e.TgZ(26,"div",11),e.YNc(27,To,6,4,"ng-container",21),e.TgZ(28,"div",22),e.TgZ(29,"div",23),e.TgZ(30,"cd-select",24),e.NdJ("selection",function(i){return e.CHM(t),e.oxw().onPortalSelection(i)}),e._UZ(31,"i",25),e.ynx(32),e.SDv(33,26),e.BQk(),e.qZA(),e.qZA(),e.qZA(),e._UZ(34,"input",27),e.YNc(35,fo,2,1,"span",17),e._UZ(36,"hr"),e.qZA(),e.qZA(),e.TgZ(37,"div",8),e.TgZ(38,"label",28),e.SDv(39,29),e.qZA(),e.TgZ(40,"div",11),e.YNc(41,Ro,12,10,"ng-container",21),e._UZ(42,"input",30),e.YNc(43,Mo,2,0,"span",17),e.YNc(44,Oo,2,0,"span",17),e.TgZ(45,"div",22),e.TgZ(46,"div",23),e.TgZ(47,"cd-select",24),e.NdJ("selection",function(i){return e.CHM(t),e.oxw().onImageSelection(i)}),e._UZ(48,"i",25),e.ynx(49),e.SDv(50,31),e.BQk(),e.qZA(),e.qZA(),e.qZA(),e._UZ(51,"hr"),e.qZA(),e.qZA(),e.TgZ(52,"div",8),e.TgZ(53,"div",32),e.TgZ(54,"div",33),e._UZ(55,"input",34),e.TgZ(56,"label",35),e.SDv(57,36),e.qZA(),e.qZA(),e._UZ(58,"hr"),e.qZA(),e.qZA(),e.YNc(59,Lo,41,8,"div",37),e.YNc(60,Yo,13,5,"div",38),e.YNc(61,en,12,5,"div",38),e.qZA(),e.TgZ(62,"div",39),e.TgZ(63,"cd-form-button-panel",40),e.NdJ("submitActionEvent",function(){return e.CHM(t),e.oxw().submit()}),e.ALo(64,"titlecase"),e.ALo(65,"upperFirst"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.MAs(2),o=e.oxw();e.xp6(1),e.Q6J("formGroup",o.targetForm),e.xp6(6),e.pQV(e.lcZ(6,26,o.action))(e.lcZ(7,28,o.resource)),e.QtT(5),e.xp6(10),e.Q6J("ngClass",e.VKq(34,z,o.icons.deepCheck)),e.xp6(1),e.Q6J("ngIf",o.targetForm.showError("target_iqn",t,"required")),e.xp6(1),e.Q6J("ngIf",o.targetForm.showError("target_iqn",t,"pattern")),e.xp6(1),e.Q6J("ngIf",o.targetForm.showError("target_iqn",t,"iqn")),e.xp6(1),e.Q6J("ngIf",o.hasAdvancedSettings(o.targetForm.getValue("target_controls"))),e.xp6(6),e.Q6J("ngForOf",o.portals.value),e.xp6(3),e.Q6J("data",o.portals.value)("options",o.portalsSelections)("messages",o.messages.portals),e.xp6(1),e.Q6J("ngClass",e.VKq(36,z,o.icons.add)),e.xp6(4),e.Q6J("ngIf",o.targetForm.showError("portals",t,"minGateways")),e.xp6(6),e.Q6J("ngForOf",o.targetForm.getValue("disks")),e.xp6(2),e.Q6J("ngIf",o.targetForm.showError("disks",t,"dupLunId")),e.xp6(1),e.Q6J("ngIf",o.targetForm.showError("disks",t,"dupWwn")),e.xp6(3),e.Q6J("data",o.disks.value)("options",o.imagesSelections)("messages",o.messages.images),e.xp6(1),e.Q6J("ngClass",e.VKq(38,z,o.icons.add)),e.xp6(11),e.Q6J("ngIf",o.cephIscsiConfigVersion>10&&!o.targetForm.getValue("acl_enabled")),e.xp6(1),e.Q6J("ngIf",o.targetForm.getValue("acl_enabled")),e.xp6(1),e.Q6J("ngIf",o.targetForm.getValue("acl_enabled")),e.xp6(2),e.Q6J("form",o.targetForm)("submitText",e.lcZ(64,30,o.action)+" "+e.lcZ(65,32,o.resource))}}let rt=(()=>{class n extends q.E{constructor(t,o,i,s,a,d,c){super(),this.iscsiService=t,this.modalService=o,this.rbdService=i,this.router=s,this.route=a,this.taskWrapper=d,this.actionLabels=c,this.api_version=0,this.minimum_gateways=1,this.icons=T.P,this.isEdit=!1,this.portalsSelections=[],this.imagesInitiatorSelections=[],this.groupDiskSelections=[],this.groupMembersSelections=[],this.imagesSettings={},this.messages={portals:new ae.a({noOptions:"There are no portals available."}),images:new ae.a({noOptions:"There are no images available."}),initiatorImage:new ae.a({noOptions:"There are no images available. Please make sure you add an image to the target."}),groupInitiator:new ae.a({noOptions:"There are no initiators available. Please make sure you add an initiator to the target."})},this.IQN_REGEX=/^iqn\.(19|20)\d\d-(0[1-9]|1[0-2])\.\D{2,3}(\.[A-Za-z0-9-]+)+(:[A-Za-z0-9-\.]+)*$/,this.USER_REGEX=/^[\w\.:@_-]{8,64}$/,this.PASSWORD_REGEX=/^[\w@\-_\/]{12,16}$/,this.resource="target"}ngOnInit(){const t=[this.iscsiService.listTargets(),this.rbdService.list(),this.iscsiService.portals(),this.iscsiService.settings(),this.iscsiService.version()];this.router.url.startsWith("/block/iscsi/targets/edit")&&(this.isEdit=!0,this.route.params.subscribe(o=>{this.target_iqn=decodeURIComponent(o.target_iqn),t.push(this.iscsiService.getTarget(this.target_iqn))})),this.action=this.isEdit?this.actionLabels.EDIT:this.actionLabels.CREATE,(0,W.D)(t).subscribe(o=>{const i=C()(o[0]).filter(a=>a.target_iqn!==this.target_iqn).flatMap(a=>a.disks).map(a=>`${a.pool}/${a.image}`).value();"api_version"in o[3]&&(this.api_version=o[3].api_version),this.minimum_gateways=o[3].config.minimum_gateways,this.target_default_controls=o[3].target_default_controls,this.target_controls_limits=o[3].target_controls_limits,this.disk_default_controls=o[3].disk_default_controls,this.disk_controls_limits=o[3].disk_controls_limits,this.backstores=o[3].backstores,this.default_backstore=o[3].default_backstore,this.unsupported_rbd_features=o[3].unsupported_rbd_features,this.required_rbd_features=o[3].required_rbd_features,this.imagesAll=C()(o[1]).flatMap(a=>a.value).filter(a=>!a.namespace&&!(-1!==i.indexOf(`${a.pool_name}/${a.name}`)||0===this.getValidBackstores(a).length)).value(),this.imagesSelections=this.imagesAll.map(a=>new V.$(!1,`${a.pool_name}/${a.name}`,""));const s=[];o[2].forEach(a=>{a.ip_addresses.forEach(d=>{s.push(new V.$(!1,a.name+":"+d,""))})}),this.portalsSelections=[...s],this.cephIscsiConfigVersion=o[4].ceph_iscsi_config_version,this.createForm(),o[5]&&this.resolveModel(o[5]),this.loadingReady()})}createForm(){if(this.targetForm=new M.d({target_iqn:new r.NI("iqn.2001-07.com.ceph:"+Date.now(),{validators:[r.kI.required,r.kI.pattern(this.IQN_REGEX)]}),target_controls:new r.NI({}),portals:new r.NI([],{validators:[B.h.custom("minGateways",t=>C().uniq(t.map(i=>i.split(":")[0])).length<Math.max(1,this.minimum_gateways))]}),disks:new r.NI([],{validators:[B.h.custom("dupLunId",t=>{const o=this.getLunIds(t);return o.length!==C().uniq(o).length}),B.h.custom("dupWwn",t=>{const o=this.getWwns(t);return o.length!==C().uniq(o).length})]}),initiators:new r.Oe([]),groups:new r.Oe([]),acl_enabled:new r.NI(!1)}),this.cephIscsiConfigVersion>10){const t=new M.d({user:new r.NI(""),password:new r.NI(""),mutual_user:new r.NI(""),mutual_password:new r.NI("")});this.setAuthValidator(t),this.targetForm.addControl("auth",t)}}resolveModel(t){this.targetForm.patchValue({target_iqn:t.target_iqn,target_controls:t.target_controls,acl_enabled:t.acl_enabled}),this.cephIscsiConfigVersion>10&&this.targetForm.patchValue({auth:t.auth});const o=[];C().forEach(t.portals,s=>{o.push(`${s.host}:${s.ip}`)}),this.targetForm.patchValue({portals:o});const i=[];C().forEach(t.disks,s=>{const a=`${s.pool}/${s.image}`;i.push(a),this.imagesSettings[a]={backstore:s.backstore},this.imagesSettings[a][s.backstore]=s.controls,"lun"in s&&(this.imagesSettings[a].lun=s.lun),"wwn"in s&&(this.imagesSettings[a].wwn=s.wwn),this.onImageSelection({option:{name:a,selected:!0}})}),this.targetForm.patchValue({disks:i}),C().forEach(t.clients,s=>{const a=this.addInitiator();s.luns=C().map(s.luns,d=>`${d.pool}/${d.image}`),a.patchValue(s)}),t.groups.forEach((s,a)=>{const d=this.addGroup();s.disks=C().map(s.disks,c=>`${c.pool}/${c.image}`),d.patchValue(s),C().forEach(s.members,c=>{this.onGroupMemberSelection({option:new V.$(!0,c,"")},a)})})}hasAdvancedSettings(t){return Object.values(t).length>0}get portals(){return this.targetForm.get("portals")}onPortalSelection(){this.portals.setValue(this.portals.value)}removePortal(t,o){return this.portalsSelections.forEach(i=>{i.name===o&&(i.selected=!1)}),this.portals.value.splice(t,1),this.portals.setValue(this.portals.value),!1}get disks(){return this.targetForm.get("disks")}removeImage(t,o){return this.imagesSelections.forEach(i=>{i.name===o&&(i.selected=!1)}),this.disks.value.splice(t,1),this.removeImageRefs(o),this.targetForm.get("disks").updateValueAndValidity({emitEvent:!1}),!1}removeImageRefs(t){this.initiators.controls.forEach(o=>{const i=o.value.luns.filter(s=>s!==t);o.get("luns").setValue(i)}),this.groups.controls.forEach(o=>{const i=o.value.disks.filter(s=>s!==t);o.get("disks").setValue(i)}),C().forEach(this.imagesInitiatorSelections,(o,i)=>{this.imagesInitiatorSelections[i]=o.filter(s=>s.name!==t)}),C().forEach(this.groupDiskSelections,(o,i)=>{this.groupDiskSelections[i]=o.filter(s=>s.name!==t)})}getDefaultBackstore(t){let o=this.default_backstore;const i=this.getImageById(t);return this.validFeatures(i,this.default_backstore)||this.backstores.forEach(s=>{s!==this.default_backstore&&this.validFeatures(i,s)&&(o=s)}),o}isLunIdInUse(t,o){const i=this.disks.value.filter(s=>s!==o);return this.getLunIds(i).includes(t)}getLunIds(t){return C().map(t,o=>this.imagesSettings[o].lun)}nextLunId(t){const o=this.disks.value.filter(a=>a!==t),i=this.getLunIds(o);let s=0;for(;i.includes(s);)s++;return s}getWwns(t){return C().map(t,i=>this.imagesSettings[i].wwn).filter(i=>C().isString(i)&&""!==i)}onImageSelection(t){const o=t.option;if(o.selected){if(this.imagesSettings[o.name])this.isLunIdInUse(this.imagesSettings[o.name].lun,o.name)&&(this.imagesSettings[o.name].lun=this.nextLunId(o.name));else{const i=this.getDefaultBackstore(o.name);this.imagesSettings[o.name]={backstore:i,lun:this.nextLunId(o.name)},this.imagesSettings[o.name][i]={}}C().forEach(this.imagesInitiatorSelections,(i,s)=>{i.push(new V.$(!1,o.name,"")),this.imagesInitiatorSelections[s]=[...i]}),C().forEach(this.groupDiskSelections,(i,s)=>{i.push(new V.$(!1,o.name,"")),this.groupDiskSelections[s]=[...i]})}else this.removeImageRefs(o.name);this.targetForm.get("disks").updateValueAndValidity({emitEvent:!1})}get initiators(){return this.targetForm.get("initiators")}addInitiator(){const t=new M.d({client_iqn:new r.NI("",{validators:[r.kI.required,B.h.custom("notUnique",i=>{const s=this.initiators.controls.reduce(function(a,d){return a.concat(d.value.client_iqn)},[]);return s.indexOf(i)!==s.lastIndexOf(i)}),r.kI.pattern(this.IQN_REGEX)]}),auth:new M.d({user:new r.NI(""),password:new r.NI(""),mutual_user:new r.NI(""),mutual_password:new r.NI("")}),luns:new r.NI([]),cdIsInGroup:new r.NI(!1)});this.setAuthValidator(t),this.initiators.push(t),C().forEach(this.groupMembersSelections,(i,s)=>{i.push(new V.$(!1,"","")),this.groupMembersSelections[s]=[...i]});const o=C().map(this.targetForm.getValue("disks"),i=>new V.$(!1,i,""));return this.imagesInitiatorSelections.push(o),t}setAuthValidator(t){B.h.validateIf(t.get("user"),()=>t.getValue("password")||t.getValue("mutual_user")||t.getValue("mutual_password"),[r.kI.required],[r.kI.pattern(this.USER_REGEX)],[t.get("password"),t.get("mutual_user"),t.get("mutual_password")]),B.h.validateIf(t.get("password"),()=>t.getValue("user")||t.getValue("mutual_user")||t.getValue("mutual_password"),[r.kI.required],[r.kI.pattern(this.PASSWORD_REGEX)],[t.get("user"),t.get("mutual_user"),t.get("mutual_password")]),B.h.validateIf(t.get("mutual_user"),()=>t.getValue("mutual_password"),[r.kI.required],[r.kI.pattern(this.USER_REGEX)],[t.get("user"),t.get("password"),t.get("mutual_password")]),B.h.validateIf(t.get("mutual_password"),()=>t.getValue("mutual_user"),[r.kI.required],[r.kI.pattern(this.PASSWORD_REGEX)],[t.get("user"),t.get("password"),t.get("mutual_user")])}removeInitiator(t){const o=this.initiators.value[t];this.initiators.removeAt(t),C().forEach(this.groupMembersSelections,(i,s)=>{i.splice(t,1),this.groupMembersSelections[s]=[...i]}),this.groups.controls.forEach(i=>{const s=i.value.members.filter(a=>a!==o.client_iqn);i.get("members").setValue(s)}),this.imagesInitiatorSelections.splice(t,1)}updatedInitiatorSelector(){this.initiators.controls.forEach(t=>{t.get("client_iqn").updateValueAndValidity({emitEvent:!1})}),C().forEach(this.groupMembersSelections,(t,o)=>{C().forEach(t,(i,s)=>{const a=i.name;i.name=this.initiators.controls[s].value.client_iqn,this.groups.controls.forEach(d=>{const c=d.value.members,u=c.indexOf(a);-1!==u&&(c[u]=i.name),d.get("members").setValue(c)})}),this.groupMembersSelections[o]=[...this.groupMembersSelections[o]]})}removeInitiatorImage(t,o,i,s){const a=t.getValue("luns");return a.splice(o,1),t.patchValue({luns:a}),this.imagesInitiatorSelections[i].forEach(d=>{d.name===s&&(d.selected=!1)}),!1}get groups(){return this.targetForm.get("groups")}addGroup(){const t=new M.d({group_id:new r.NI("",{validators:[r.kI.required]}),members:new r.NI([]),disks:new r.NI([])});this.groups.push(t);const o=C().map(this.targetForm.getValue("disks"),s=>new V.$(!1,s,""));this.groupDiskSelections.push(o);const i=C().map(this.initiators.value,s=>new V.$(!1,s.client_iqn,"",!s.cdIsInGroup));return this.groupMembersSelections.push(i),t}removeGroup(t){this.groups.removeAt(t),this.groupMembersSelections[t].filter(i=>i.selected).forEach(i=>{i.selected=!1,this.onGroupMemberSelection({option:i},t)}),this.groupMembersSelections.splice(t,1),this.groupDiskSelections.splice(t,1)}onGroupMemberSelection(t,o){const i=t.option;let s=[];i.selected||(s=this.groupDiskSelections[o].filter(d=>d.selected).map(d=>d.name)),this.initiators.controls.forEach((a,d)=>{a.value.client_iqn===i.name&&(a.patchValue({luns:s}),a.get("cdIsInGroup").setValue(i.selected),C().forEach(this.groupMembersSelections,c=>{c[d].enabled=!i.selected}),this.imagesInitiatorSelections[d].forEach(c=>{c.selected=s.includes(c.name)}))})}removeGroupInitiator(t,o,i){const s=t.getValue("members")[o];t.getValue("members").splice(o,1),this.onGroupMemberSelection({option:new V.$(!1,s,"")},i)}removeGroupDisk(t,o,i){const s=t.getValue("disks")[o];t.getValue("disks").splice(o,1),this.groupDiskSelections[i].forEach(a=>{a.name===s&&(a.selected=!1)}),this.groupDiskSelections[i]=[...this.groupDiskSelections[i]]}submit(){const t=C().cloneDeep(this.targetForm.value),o={target_iqn:this.targetForm.getValue("target_iqn"),target_controls:this.targetForm.getValue("target_controls"),acl_enabled:this.targetForm.getValue("acl_enabled"),portals:[],disks:[],clients:[],groups:[]};if(this.cephIscsiConfigVersion>10){const s=this.targetForm.get("auth");s.getValue("user")||s.get("user").setValue(""),s.getValue("password")||s.get("password").setValue(""),s.getValue("mutual_user")||s.get("mutual_user").setValue(""),s.getValue("mutual_password")||s.get("mutual_password").setValue("");const a=this.targetForm.getValue("acl_enabled");o.auth={user:a?"":s.getValue("user"),password:a?"":s.getValue("password"),mutual_user:a?"":s.getValue("mutual_user"),mutual_password:a?"":s.getValue("mutual_password")}}let i;t.disks.forEach(s=>{const a=s.split("/"),d=this.imagesSettings[s].backstore;o.disks.push({pool:a[0],image:a[1],backstore:d,controls:this.imagesSettings[s][d],lun:this.imagesSettings[s].lun,wwn:this.imagesSettings[s].wwn})}),t.portals.forEach(s=>{const a=s.indexOf(":");o.portals.push({host:s.substring(0,a),ip:s.substring(a+1)})}),o.acl_enabled&&(t.initiators.forEach(s=>{s.auth.user||(s.auth.user=""),s.auth.password||(s.auth.password=""),s.auth.mutual_user||(s.auth.mutual_user=""),s.auth.mutual_password||(s.auth.mutual_password=""),delete s.cdIsInGroup;const a=[];s.luns.forEach(d=>{const c=d.split("/");a.push({pool:c[0],image:c[1]})}),s.luns=a}),o.clients=t.initiators),o.acl_enabled&&(t.groups.forEach(s=>{const a=[];s.disks.forEach(d=>{const c=d.split("/");a.push({pool:c[0],image:c[1]})}),s.disks=a}),o.groups=t.groups),this.isEdit?(o.new_target_iqn=o.target_iqn,o.target_iqn=this.target_iqn,i=this.taskWrapper.wrapTaskAroundCall({task:new F.R("iscsi/target/edit",{target_iqn:o.target_iqn}),call:this.iscsiService.updateTarget(this.target_iqn,o)})):i=this.taskWrapper.wrapTaskAroundCall({task:new F.R("iscsi/target/create",{target_iqn:o.target_iqn}),call:this.iscsiService.createTarget(o)}),i.subscribe({error:()=>{this.targetForm.setErrors({cdSubmitButton:!0})},complete:()=>this.router.navigate(["/block/iscsi/targets"])})}targetSettingsModal(){const t={target_controls:this.targetForm.get("target_controls"),target_default_controls:this.target_default_controls,target_controls_limits:this.target_controls_limits};this.modalRef=this.modalService.show(ro,t)}imageSettingsModal(t){const o={imagesSettings:this.imagesSettings,image:t,api_version:this.api_version,disk_default_controls:this.disk_default_controls,disk_controls_limits:this.disk_controls_limits,backstores:this.getValidBackstores(this.getImageById(t)),control:this.targetForm.get("disks")};this.modalRef=this.modalService.show(so,o)}validFeatures(t,o){const i=t.features,s=this.required_rbd_features[o];return(i&s)===s&&0==(i&this.unsupported_rbd_features[o])}getImageById(t){return this.imagesAll.find(o=>t===`${o.pool_name}/${o.name}`)}getValidBackstores(t){return this.backstores.filter(o=>this.validFeatures(t,o))}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(k),e.Y36(re.Z),e.Y36(x),e.Y36(m.F0),e.Y36(m.gz),e.Y36(Q.P),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-target-form"]],features:[e.qOj],decls:1,vars:1,consts:function(){let _,t,o,i,s,a,d,c,u,S,N,P,$,G,X,J,te,A,w,de,pe,ge,ue,me,Te,fe,Ce,Se,y,Ze,Be,Ge,ye,xe,we,qe,L,Ot,At,ht,Pt,It,bt,Nt,Dt,vt,Lt,Ft,$t,Zt,Bt,Gt,yt,xt,wt,qt,Ht,Kt,kt,Xt,Qt,zt;return _="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Target IQN",o="Portals",i="Add portal",s="Images",a="Add image",d="ACL authentication",c="This field is required.",u="IQN has wrong pattern.",S="An IQN has the following notation 'iqn.$year-$month.$reversedAddress:$definedName'",N="For example: iqn.2016-06.org.dashboard:storage:disk.sn-a8675309",P="More information",$="This target has modified advanced settings.",G="At least " + "\ufffd0\ufffd" + " gateways are required.",X="Backstore: " + "\ufffd0\ufffd" + ".\xA0",J="This image has modified settings.",te="Duplicated LUN numbers.",A="Duplicated WWN.",w="User",de="Password",pe="Mutual User",ge="Mutual Password",ue="This field is required.",me="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",Te="This field is required.",fe="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",Ce="This field is required.",Se="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",y="This field is required.",Ze="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",Be="Initiators",Ge="Add initiator",ye="Initiator",xe="Client IQN",we="User",qe="Password",L="Mutual User",Ot="Mutual Password",At="Images",ht="Initiator IQN needs to be unique.",Pt="This field is required.",It="IQN has wrong pattern.",bt="This field is required.",Nt="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",Dt="This field is required.",vt="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",Lt="This field is required.",Ft="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",$t="This field is required.",Zt="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",Bt="Initiator belongs to a group. Images will be configure in the group.",Gt="Add image",yt="No items added.",xt="Groups",wt="Add group",qt="Group",Ht="Name",Kt="Initiators",kt="Add initiator",Xt="Images",Qt="Add image",zt="No items added.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","targetForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],_,[1,"card-body"],[1,"form-group","row"],["for","target_iqn",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],[1,"input-group"],["type","text","id","target_iqn","name","target_iqn","formControlName","target_iqn","cdTrim","",1,"form-control"],[1,"input-group-append"],["id","ecp-info-button","type","button",1,"btn","btn-light",3,"click"],["aria-hidden","true",3,"ngClass"],["class","invalid-feedback",4,"ngIf"],["class","form-text text-muted",4,"ngIf"],["for","portals",1,"cd-col-form-label","required"],o,[4,"ngFor","ngForOf"],[1,"row"],[1,"col-md-12"],["elemClass","btn btn-light float-right",3,"data","options","messages","selection"],[3,"ngClass"],i,["type","hidden","id","portals","name","portals","formControlName","portals",1,"form-control"],["for","disks",1,"cd-col-form-label"],s,["type","hidden","id","disks","name","disks","formControlName","disks",1,"form-control"],a,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","acl_enabled","name","acl_enabled","id","acl_enabled",1,"custom-control-input"],["for","acl_enabled",1,"custom-control-label"],d,["formGroupName","auth",4,"ngIf"],["class","form-group row",4,"ngIf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],c,u,S,N,["target","_blank","href","https://en.wikipedia.org/wiki/ISCSI#Addressing"],P,[1,"form-text","text-muted"],$,[1,"input-group","cd-mb"],["type","text","disabled","",1,"cd-form-control",3,"value"],["type","button",1,"btn","btn-light",3,"click"],G,["class","input-group-text",4,"ngIf"],[4,"ngIf"],[1,"input-group-text"],X,J,te,A,["formGroupName","auth"],["for","target_user",1,"cd-col-form-label"],w,["type","text","autocomplete","off","id","target_user","name","target_user","formControlName","user",1,"form-control"],["for","target_password",1,"cd-col-form-label"],de,["type","password","autocomplete","new-password","id","target_password","name","target_password","formControlName","password",1,"form-control"],["type","button","cdPasswordButton","target_password",1,"btn","btn-light"],["source","target_password"],["for","target_mutual_user",1,"cd-col-form-label"],pe,["type","text","autocomplete","off","id","target_mutual_user","name","target_mutual_user","formControlName","mutual_user",1,"form-control"],["for","target_mutual_password",1,"cd-col-form-label"],ge,["type","password","autocomplete","new-password","id","target_mutual_password","name","target_mutual_password","formControlName","mutual_password",1,"form-control"],["type","button","cdPasswordButton","target_mutual_password",1,"btn","btn-light"],["source","target_mutual_password"],ue,me,Te,fe,Ce,Se,y,Ze,["for","initiators",1,"cd-col-form-label"],Be,["formArrayName","initiators",1,"cd-col-form-input"],["class","card mb-2",3,"formGroup",4,"ngFor","ngForOf"],[1,"btn","btn-light","float-right",3,"click"],Ge,[1,"card","mb-2",3,"formGroup"],ye,["type","button",1,"close",3,"click"],["for","client_iqn",1,"cd-col-form-label","required"],xe,["type","text","formControlName","client_iqn","cdTrim","",1,"form-control",3,"blur"],["for","user",1,"cd-col-form-label"],we,["formControlName","user","autocomplete","off","type","text",1,"form-control",3,"id"],["for","password",1,"cd-col-form-label"],qe,["formControlName","password","autocomplete","new-password","type","password",1,"form-control",3,"id"],["type","button",1,"btn","btn-light",3,"cdPasswordButton"],[3,"source"],["for","mutual_user",1,"cd-col-form-label"],L,["formControlName","mutual_user","autocomplete","off","type","text",1,"form-control",3,"id"],["for","mutual_password",1,"cd-col-form-label"],Ot,["formControlName","mutual_password","autocomplete","new-password","type","password",1,"form-control",3,"id"],["for","luns",1,"cd-col-form-label"],At,["class","row",4,"ngIf"],ht,Pt,It,bt,Nt,Dt,vt,Lt,Ft,$t,Zt,Bt,["elemClass","btn btn-light float-right",3,"data","options","messages"],Gt,yt,xt,["formArrayName","groups",1,"cd-col-form-input"],wt,qt,["for","group_id",1,"cd-col-form-label","required"],Ht,["type","text","formControlName","group_id",1,"form-control"],["for","members",1,"cd-col-form-label"],Kt,kt,Xt,Qt,zt]},template:function(t,o){1&t&&e.YNc(0,tn,66,40,"div",0),2&t&&e.Q6J("cdFormLoading",o.loading)},directives:[st.y,r._Y,r.JL,r.sg,v.V,g.P,f.o,r.Fj,h.b,r.JJ,r.u,lo,l.mk,l.O5,l.sg,co.H,r.Wl,O.p,r.x0,at.C,Je.s,r.CE],pipes:[l.rS,Ye.m,He.V],styles:[".cd-mb[_ngcontent-%COMP%]{margin-bottom:10px}"]}),n})();var lt=p(68136),he=p(30982),ee=p(64337),ve=p(99466),Ee=p(68774),ct=p(55657),se=p(38047),Ve=p(18001),Le=p(97161),oe=p(74937);function on(n,_){1&n&&(e.TgZ(0,"span",30),e.SDv(1,31),e.qZA())}function nn(n,_){1&n&&(e.TgZ(0,"span",30),e.SDv(1,32),e.qZA())}function _n(n,_){1&n&&(e.TgZ(0,"span",30),e.SDv(1,33),e.qZA())}function sn(n,_){1&n&&(e.TgZ(0,"span",30),e.SDv(1,34),e.qZA())}function an(n,_){1&n&&(e.TgZ(0,"span",30),e.SDv(1,35),e.qZA())}function rn(n,_){1&n&&(e.TgZ(0,"span",30),e.SDv(1,36),e.qZA())}function ln(n,_){1&n&&(e.TgZ(0,"span",30),e.SDv(1,37),e.qZA())}function cn(n,_){1&n&&(e.TgZ(0,"span",30),e.SDv(1,38),e.qZA())}let dn=(()=>{class n{constructor(t,o,i,s,a){this.authStorageService=t,this.activeModal=o,this.actionLabels=i,this.iscsiService=s,this.notificationService=a,this.USER_REGEX=/^[\w\.:@_-]{8,64}$/,this.PASSWORD_REGEX=/^[\w@\-_\/]{12,16}$/,this.permission=this.authStorageService.getPermissions().iscsi}ngOnInit(){this.hasPermission=this.permission.update,this.createForm(),this.iscsiService.getDiscovery().subscribe(t=>{this.discoveryForm.patchValue(t)})}createForm(){this.discoveryForm=new M.d({user:new r.NI({value:"",disabled:!this.hasPermission}),password:new r.NI({value:"",disabled:!this.hasPermission}),mutual_user:new r.NI({value:"",disabled:!this.hasPermission}),mutual_password:new r.NI({value:"",disabled:!this.hasPermission})}),B.h.validateIf(this.discoveryForm.get("user"),()=>this.discoveryForm.getValue("password")||this.discoveryForm.getValue("mutual_user")||this.discoveryForm.getValue("mutual_password"),[r.kI.required],[r.kI.pattern(this.USER_REGEX)],[this.discoveryForm.get("password"),this.discoveryForm.get("mutual_user"),this.discoveryForm.get("mutual_password")]),B.h.validateIf(this.discoveryForm.get("password"),()=>this.discoveryForm.getValue("user")||this.discoveryForm.getValue("mutual_user")||this.discoveryForm.getValue("mutual_password"),[r.kI.required],[r.kI.pattern(this.PASSWORD_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("mutual_user"),this.discoveryForm.get("mutual_password")]),B.h.validateIf(this.discoveryForm.get("mutual_user"),()=>this.discoveryForm.getValue("mutual_password"),[r.kI.required],[r.kI.pattern(this.USER_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("password"),this.discoveryForm.get("mutual_password")]),B.h.validateIf(this.discoveryForm.get("mutual_password"),()=>this.discoveryForm.getValue("mutual_user"),[r.kI.required],[r.kI.pattern(this.PASSWORD_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("password"),this.discoveryForm.get("mutual_user")])}submitAction(){this.iscsiService.updateDiscovery(this.discoveryForm.value).subscribe(()=>{this.notificationService.show(Ve.k.success,"Updated discovery authentication"),this.activeModal.close()},()=>{this.discoveryForm.setErrors({cdSubmitButton:!0})})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(I.Kz),e.Y36(D.p4),e.Y36(k),e.Y36(Le.g))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-target-discovery-modal"]],decls:46,vars:13,consts:function(){let _,t,o,i,s,a,d,c,u,S,N,P,$;return _="Discovery Authentication",t="User",o="Password",i="Mutual User",s="Mutual Password",a="This field is required.",d="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",c="This field is required.",u="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",S="This field is required.",N="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",P="This field is required.",$="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","discoveryForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","user",1,"cd-col-form-label"],t,[1,"cd-col-form-input"],["id","user","formControlName","user","type","text","autocomplete","off",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","password",1,"cd-col-form-label"],o,[1,"input-group"],["id","password","formControlName","password","type","password","autocomplete","new-password",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","password",1,"btn","btn-light"],["source","password"],["for","mutual_user",1,"cd-col-form-label"],i,["id","mutual_user","formControlName","mutual_user","type","text","autocomplete","off",1,"form-control"],["for","mutual_password",1,"cd-col-form-label"],s,["id","mutual_password","formControlName","mutual_password","type","password","autocomplete","new-password",1,"form-control"],["type","button","cdPasswordButton","mutual_password",1,"btn","btn-light"],["source","mutual_password"],[1,"modal-footer"],[3,"form","showSubmit","submitText","submitActionEvent"],[1,"invalid-feedback"],a,d,c,u,S,N,P,$]},template:function(t,o){if(1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.BQk(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.TgZ(7,"div",7),e.TgZ(8,"label",8),e.SDv(9,9),e.qZA(),e.TgZ(10,"div",10),e._UZ(11,"input",11),e.YNc(12,on,2,0,"span",12),e.YNc(13,nn,2,0,"span",12),e.qZA(),e.qZA(),e.TgZ(14,"div",7),e.TgZ(15,"label",13),e.SDv(16,14),e.qZA(),e.TgZ(17,"div",10),e.TgZ(18,"div",15),e._UZ(19,"input",16),e.TgZ(20,"span",17),e._UZ(21,"button",18),e._UZ(22,"cd-copy-2-clipboard-button",19),e.qZA(),e.qZA(),e.YNc(23,_n,2,0,"span",12),e.YNc(24,sn,2,0,"span",12),e.qZA(),e.qZA(),e.TgZ(25,"div",7),e.TgZ(26,"label",20),e.ynx(27),e.SDv(28,21),e.BQk(),e.qZA(),e.TgZ(29,"div",10),e._UZ(30,"input",22),e.YNc(31,an,2,0,"span",12),e.YNc(32,rn,2,0,"span",12),e.qZA(),e.qZA(),e.TgZ(33,"div",7),e.TgZ(34,"label",23),e.SDv(35,24),e.qZA(),e.TgZ(36,"div",10),e.TgZ(37,"div",15),e._UZ(38,"input",25),e.TgZ(39,"span",17),e._UZ(40,"button",26),e._UZ(41,"cd-copy-2-clipboard-button",27),e.qZA(),e.qZA(),e.YNc(42,ln,2,0,"span",12),e.YNc(43,cn,2,0,"span",12),e.qZA(),e.qZA(),e.qZA(),e.TgZ(44,"div",28),e.TgZ(45,"cd-form-button-panel",29),e.NdJ("submitActionEvent",function(){return o.submitAction()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t){const i=e.MAs(5);e.Q6J("modalRef",o.activeModal),e.xp6(4),e.Q6J("formGroup",o.discoveryForm),e.xp6(8),e.Q6J("ngIf",o.discoveryForm.showError("user",i,"required")),e.xp6(1),e.Q6J("ngIf",o.discoveryForm.showError("user",i,"pattern")),e.xp6(10),e.Q6J("ngIf",o.discoveryForm.showError("password",i,"required")),e.xp6(1),e.Q6J("ngIf",o.discoveryForm.showError("password",i,"pattern")),e.xp6(7),e.Q6J("ngIf",o.discoveryForm.showError("mutual_user",i,"required")),e.xp6(1),e.Q6J("ngIf",o.discoveryForm.showError("mutual_user",i,"pattern")),e.xp6(10),e.Q6J("ngIf",o.discoveryForm.showError("mutual_password",i,"required")),e.xp6(1),e.Q6J("ngIf",o.discoveryForm.showError("mutual_password",i,"pattern")),e.xp6(2),e.Q6J("form",o.discoveryForm)("showSubmit",o.hasPermission)("submitText",o.actionLabels.SUBMIT)}},directives:[R.z,r._Y,r.JL,r.sg,v.V,g.P,f.o,r.Fj,h.b,r.JJ,r.u,l.O5,at.C,Je.s,O.p],styles:[""]}),n})();var pn=p(86969);let dt=(()=>{class n{constructor(t){this.router=t}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(m.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-tabs"]],decls:8,vars:1,consts:function(){let _,t;return _="Overview",t="Targets",[["ngbNav","",1,"nav-tabs",3,"activeId","navChange"],["nav","ngbNav"],["ngbNavItem","/block/iscsi/overview"],["ngbNavLink",""],_,["ngbNavItem","/block/iscsi/targets"],t]},template:function(t,o){1&t&&(e.TgZ(0,"ul",0,1),e.NdJ("navChange",function(s){return o.router.navigate([s.nextId])}),e.TgZ(2,"li",2),e.TgZ(3,"a",3),e.SDv(4,4),e.qZA(),e.qZA(),e.TgZ(5,"li",5),e.TgZ(6,"a",3),e.SDv(7,6),e.qZA(),e.qZA(),e.qZA()),2&t&&e.Q6J("activeId",o.router.url)},directives:[I.Pz,I.nv,I.Vx],styles:[""]}),n})();var pt=p(34501),gn=p(30490),Re=p(94928),un=p(68962);const mn=["highlightTpl"],Tn=["detailTable"],fn=["tree"],Cn=function(){return["logged_in"]},Sn=function(){return["logged_out"]},En=function(n,_){return{"badge-success":n,"badge-danger":_}};function Rn(n,_){if(1&n&&(e._UZ(0,"i"),e.TgZ(1,"span"),e._uU(2),e.qZA(),e._uU(3," \xa0 "),e.TgZ(4,"span",8),e._uU(5),e.qZA()),2&n){const t=_.$implicit;e.Tol(t.data.cdIcon),e.xp6(2),e.Oqu(t.data.name),e.xp6(2),e.Q6J("ngClass",e.WLB(7,En,e.DdM(5,Cn).includes(t.data.status),e.DdM(6,Sn).includes(t.data.status))),e.xp6(1),e.hij(" ",t.data.status," ")}}function Mn(n,_){if(1&n&&(e.TgZ(0,"div",9),e.TgZ(1,"legend"),e._uU(2),e.qZA(),e._UZ(3,"cd-table",10,11),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.title),e.xp6(1),e.Q6J("data",t.data)("columns",t.columns)("limit",0)}}function On(n,_){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.Oqu(t)}}function An(n,_){if(1&n&&(e.TgZ(0,"strong"),e._uU(1),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.Oqu(t)}}function hn(n,_){if(1&n&&(e.YNc(0,On,2,1,"span",12),e.YNc(1,An,2,1,"strong",12)),2&n){const t=_.row;e.Q6J("ngIf",void 0===t.default||t.default===t.current),e.xp6(1),e.Q6J("ngIf",void 0!==t.default&&t.default!==t.current)}}let Pn=(()=>{class n{constructor(t,o){this.iscsiBackstorePipe=t,this.booleanTextPipe=o,this.icons=T.P,this.metadata={},this.nodes=[],this.treeOptions={useVirtualScroll:!0,actionMapping:{mouse:{click:this.onNodeSelected.bind(this)}}}}set content(t){this.detailTable=t,t&&t.updateColumns()}ngOnInit(){this.columns=[{prop:"displayName",name:"Name",flexGrow:1,cellTemplate:this.highlightTpl},{prop:"current",name:"Current",flexGrow:1,cellTemplate:this.highlightTpl},{prop:"default",name:"Default",flexGrow:1,cellTemplate:this.highlightTpl}]}ngOnChanges(){this.selection&&(this.selectedItem=this.selection,this.generateTree()),this.data=void 0}generateTree(){const t=C().cloneDeep(this.selectedItem.target_controls);this.cephIscsiConfigVersion>10&&C().extend(t,C().cloneDeep(this.selectedItem.auth)),this.metadata={root:t};const o={target:{expanded:C().join(this.selectedItem.cdExecuting?[T.P.large,T.P.spinner,T.P.spin]:[T.P.large,T.P.bullseye]," ")},initiators:{expanded:C().join([T.P.large,T.P.user]," "),leaf:C().join([T.P.user]," ")},groups:{expanded:C().join([T.P.large,T.P.users]," "),leaf:C().join([T.P.users]," ")},disks:{expanded:C().join([T.P.large,T.P.disk]," "),leaf:C().join([T.P.disk]," ")},portals:{expanded:C().join([T.P.large,T.P.server]," "),leaf:C().join([T.P.server]," ")}},i=[];C().forEach(this.selectedItem.disks,c=>{const u="disk_"+c.pool+"_"+c.image;this.metadata[u]={controls:c.controls,backstore:c.backstore},["wwn","lun"].forEach(S=>{S in c&&(this.metadata[u][S]=c[S])}),i.push({name:`${c.pool}/${c.image}`,cdId:u,cdIcon:o.disks.leaf})});const s=[];C().forEach(this.selectedItem.portals,c=>{s.push({name:`${c.host}:${c.ip}`,cdIcon:o.portals.leaf})});const a=[];C().forEach(this.selectedItem.clients,c=>{const u=C().cloneDeep(c.auth);c.info&&(C().extend(u,c.info),delete u.state,C().forEach(Object.keys(c.info.state),P=>{u[P.toLowerCase()]=c.info.state[P]})),this.metadata["client_"+c.client_iqn]=u;const S=[];c.luns.forEach(P=>{S.push({name:`${P.pool}/${P.image}`,cdId:"disk_"+P.pool+"_"+P.image,cdIcon:o.disks.leaf})});let N="";c.info&&(N=Object.keys(c.info.state).includes("LOGGED_IN")?"logged_in":"logged_out"),a.push({name:c.client_iqn,status:N,cdId:"client_"+c.client_iqn,children:S,cdIcon:o.initiators.leaf})});const d=[];C().forEach(this.selectedItem.groups,c=>{const u=[];c.disks.forEach(N=>{u.push({name:`${N.pool}/${N.image}`,cdId:"disk_"+N.pool+"_"+N.image,cdIcon:o.disks.leaf})});const S=[];c.members.forEach(N=>{S.push({name:N,cdId:"client_"+N})}),d.push({name:c.group_id,cdIcon:o.groups.leaf,children:[{name:"Disks",children:u,cdIcon:o.disks.expanded},{name:"Initiators",children:S,cdIcon:o.initiators.expanded}]})}),this.nodes=[{name:this.selectedItem.target_iqn,cdId:"root",isExpanded:!0,cdIcon:o.target.expanded,children:[{name:"Disks",isExpanded:!0,children:i,cdIcon:o.disks.expanded},{name:"Portals",isExpanded:!0,children:s,cdIcon:o.portals.expanded},{name:"Initiators",isExpanded:!0,children:a,cdIcon:o.initiators.expanded},{name:"Groups",isExpanded:!0,children:d,cdIcon:o.groups.expanded}]}]}format(t){return"boolean"==typeof t?this.booleanTextPipe.transform(t):t}onNodeSelected(t,o){var i,s,a,d;if(ne.iM.ACTIVATE(t,o,!0),o.data.cdId){this.title=o.data.name;const c=this.metadata[o.data.cdId]||{};"root"===o.data.cdId?(null===(i=this.detailTable)||void 0===i||i.toggleColumn({prop:"default",isHidden:!0}),this.data=C().map(this.settings.target_default_controls,(u,S)=>({displayName:S,default:u=this.format(u),current:C().isUndefined(c[S])?u:this.format(c[S])})),this.cephIscsiConfigVersion>10&&["user","password","mutual_user","mutual_password"].forEach(u=>{this.data.push({displayName:u,default:null,current:c[u]})})):o.data.cdId.toString().startsWith("disk_")?(null===(s=this.detailTable)||void 0===s||s.toggleColumn({prop:"default",isHidden:!0}),this.data=C().map(this.settings.disk_default_controls[c.backstore],(u,S)=>({displayName:S,default:u=this.format(u),current:C().isUndefined(c.controls[S])?u:this.format(c.controls[S])})),this.data.push({displayName:"backstore",default:this.iscsiBackstorePipe.transform(this.settings.default_backstore),current:this.iscsiBackstorePipe.transform(c.backstore)}),["wwn","lun"].forEach(u=>{u in c&&this.data.push({displayName:u,default:void 0,current:c[u]})})):(null===(a=this.detailTable)||void 0===a||a.toggleColumn({prop:"default",isHidden:!1}),this.data=C().map(c,(u,S)=>({displayName:S,default:void 0,current:this.format(u)})))}else this.data=void 0;null===(d=this.detailTable)||void 0===d||d.updateColumns()}onUpdateData(){this.tree.treeModel.expandAll()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(He.V),e.Y36(un.T))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-target-details"]],viewQuery:function(t,o){if(1&t&&(e.Gf(mn,7),e.Gf(Tn,5),e.Gf(fn,5)),2&t){let i;e.iGM(i=e.CRH())&&(o.highlightTpl=i.first),e.iGM(i=e.CRH())&&(o.content=i.first),e.iGM(i=e.CRH())&&(o.tree=i.first)}},inputs:{selection:"selection",settings:"settings",cephIscsiConfigVersion:"cephIscsiConfigVersion"},features:[e.TTD],decls:11,vars:3,consts:function(){let _;return _="iSCSI Topology",[[1,"row"],[1,"col-6"],_,[3,"nodes","options","updateData"],["tree",""],["treeNodeTemplate",""],["class","col-6 metadata",4,"ngIf"],["highlightTpl",""],[1,"badge",3,"ngClass"],[1,"col-6","metadata"],["columnMode","flex",3,"data","columns","limit"],["detailTable",""],[4,"ngIf"]]},template:function(t,o){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"legend"),e.SDv(3,2),e.qZA(),e.TgZ(4,"tree-root",3,4),e.NdJ("updateData",function(){return o.onUpdateData()}),e.YNc(6,Rn,6,10,"ng-template",null,5,e.W1O),e.qZA(),e.qZA(),e.YNc(8,Mn,5,4,"div",6),e.qZA(),e.YNc(9,hn,2,2,"ng-template",null,7,e.W1O)),2&t&&(e.xp6(4),e.Q6J("nodes",o.nodes)("options",o.treeOptions),e.xp6(4),e.Q6J("ngIf",o.data))},directives:[ne.qr,l.O5,l.mk,ee.a],styles:[""]}),n})();function In(n,_){if(1&n&&(e.ynx(0),e._UZ(1,"br"),e.TgZ(2,"span"),e.SDv(3,6),e.qZA(),e.TgZ(4,"pre"),e._uU(5),e.qZA(),e.BQk()),2&n){const t=e.oxw(2);e.xp6(5),e.Oqu(t.status)}}function bn(n,_){if(1&n&&(e.TgZ(0,"cd-alert-panel",2),e.ynx(1),e.tHW(2,3),e._UZ(3,"cd-doc",4),e.N_p(),e.BQk(),e.YNc(4,In,6,1,"ng-container",5),e.qZA()),2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngIf",t.status)}}function Nn(n,_){if(1&n&&e._UZ(0,"cd-iscsi-target-details",15),2&n){const t=e.oxw(2);e.Q6J("cephIscsiConfigVersion",t.cephIscsiConfigVersion)("selection",t.expandedRow)("settings",t.settings)}}const Dn=function(n){return[n]};function vn(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"cd-table",7,8),e.NdJ("fetchData",function(){return e.CHM(t),e.oxw().getTargets()})("setExpandedRow",function(i){return e.CHM(t),e.oxw().setExpandedRow(i)})("updateSelection",function(i){return e.CHM(t),e.oxw().updateSelection(i)}),e.TgZ(2,"div",9),e._UZ(3,"cd-table-actions",10),e.TgZ(4,"button",11),e.NdJ("click",function(){return e.CHM(t),e.oxw().configureDiscoveryAuth()}),e._UZ(5,"i",12),e.ynx(6),e.SDv(7,13),e.BQk(),e.qZA(),e.qZA(),e.YNc(8,Nn,1,3,"cd-iscsi-target-details",14),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("data",t.targets)("columns",t.columns)("hasDetails",!0)("autoReload",!1)("status",t.tableStatus),e.xp6(3),e.Q6J("permission",t.permission)("selection",t.selection)("tableActions",t.tableActions),e.xp6(2),e.Q6J("ngClass",e.VKq(10,Dn,t.icons.key)),e.xp6(3),e.Q6J("ngIf",t.expandedRow)}}let Ln=(()=>{class n extends lt.o{constructor(t,o,i,s,a,d,c,u,S){super(S),this.authStorageService=t,this.iscsiService=o,this.joinPipe=i,this.taskListService=s,this.notAvailablePipe=a,this.modalService=d,this.taskWrapper=c,this.actionLabels=u,this.ngZone=S,this.available=void 0,this.selection=new Ee.r,this.targets=[],this.icons=T.P,this.builders={"iscsi/target/create":N=>({target_iqn:N.target_iqn})},this.permission=this.authStorageService.getPermissions().iscsi,this.tableActions=[{permission:"create",icon:T.P.add,routerLink:()=>"/block/iscsi/targets/create",name:this.actionLabels.CREATE},{permission:"update",icon:T.P.edit,routerLink:()=>`/block/iscsi/targets/edit/${this.selection.first().target_iqn}`,name:this.actionLabels.EDIT,disable:()=>this.getEditDisableDesc()},{permission:"delete",icon:T.P.destroy,click:()=>this.deleteIscsiTargetModal(),name:this.actionLabels.DELETE,disable:()=>this.getDeleteDisableDesc()}]}ngOnInit(){this.columns=[{name:"Target",prop:"target_iqn",flexGrow:2,cellTransformation:ve.e.executing},{name:"Portals",prop:"cdPortals",pipe:this.joinPipe,flexGrow:2},{name:"Images",prop:"cdImages",pipe:this.joinPipe,flexGrow:2},{name:"# Sessions",prop:"info.num_sessions",pipe:this.notAvailablePipe,flexGrow:1}],this.iscsiService.status().subscribe(t=>{this.available=t.available,t.available||(this.status=t.message)})}getTargets(){this.available&&(this.setTableRefreshTimeout(),this.iscsiService.version().subscribe(t=>{this.cephIscsiConfigVersion=t.ceph_iscsi_config_version}),this.taskListService.init(()=>this.iscsiService.listTargets(),t=>this.prepareResponse(t),t=>this.targets=t,()=>this.onFetchError(),this.taskFilter,this.itemFilter,this.builders),this.iscsiService.settings().subscribe(t=>{this.settings=t}))}ngOnDestroy(){this.summaryDataSubscription&&this.summaryDataSubscription.unsubscribe()}getEditDisableDesc(){const t=this.selection.first();return t&&(null==t?void 0:t.cdExecuting)?t.cdExecuting:t&&C().isUndefined(null==t?void 0:t.info)?"Unavailable gateway(s)":!t}getDeleteDisableDesc(){var t;const o=this.selection.first();return(null==o?void 0:o.cdExecuting)?o.cdExecuting:o&&C().isUndefined(null==o?void 0:o.info)?"Unavailable gateway(s)":o&&(null===(t=null==o?void 0:o.info)||void 0===t?void 0:t.num_sessions)?"Target has active sessions":!o}prepareResponse(t){return t.forEach(o=>{o.cdPortals=o.portals.map(i=>`${i.host}:${i.ip}`),o.cdImages=o.disks.map(i=>`${i.pool}/${i.image}`)}),t}onFetchError(){this.table.reset()}itemFilter(t,o){return t.target_iqn===o.metadata.target_iqn}taskFilter(t){return["iscsi/target/create","iscsi/target/edit","iscsi/target/delete"].includes(t.name)}updateSelection(t){this.selection=t}deleteIscsiTargetModal(){const t=this.selection.first().target_iqn;this.modalRef=this.modalService.show(he.M,{itemDescription:"iSCSI target",itemNames:[t],submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new F.R("iscsi/target/delete",{target_iqn:t}),call:this.iscsiService.deleteTarget(t)})})}configureDiscoveryAuth(){this.modalService.show(dn)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(k),e.Y36(pn.A),e.Y36(se.j),e.Y36(ct.g),e.Y36(re.Z),e.Y36(Q.P),e.Y36(D.p4),e.Y36(e.R0b))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-target-list"]],viewQuery:function(t,o){if(1&t&&e.Gf(ee.a,5),2&t){let i;e.iGM(i=e.CRH())&&(o.table=i.first)}},features:[e._Bn([se.j]),e.qOj],decls:3,vars:2,consts:function(){let _,t,o,i;return _="iSCSI Targets not available",t="Please consult the " + "\ufffd#3\ufffd" + "" + "\ufffd/#3\ufffd" + " on how to configure and enable the iSCSI Targets management functionality.",o="Available information:",i="Discovery authentication",[["type","info","title",_,4,"ngIf"],["columnMode","flex","identifier","target_iqn","forceIdentifier","true","selectionType","single",3,"data","columns","hasDetails","autoReload","status","fetchData","setExpandedRow","updateSelection",4,"ngIf"],["type","info","title",_],t,["section","iscsi"],[4,"ngIf"],o,["columnMode","flex","identifier","target_iqn","forceIdentifier","true","selectionType","single",3,"data","columns","hasDetails","autoReload","status","fetchData","setExpandedRow","updateSelection"],["table",""],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"],["type","button",1,"btn","btn-light",3,"click"],["aria-hidden","true",3,"ngClass"],i,["cdTableDetail","",3,"cephIscsiConfigVersion","selection","settings",4,"ngIf"],["cdTableDetail","",3,"cephIscsiConfigVersion","selection","settings"]]},template:function(t,o){1&t&&(e._UZ(0,"cd-iscsi-tabs"),e.YNc(1,bn,5,1,"cd-alert-panel",0),e.YNc(2,vn,9,12,"cd-table",1)),2&t&&(e.xp6(1),e.Q6J("ngIf",!1===o.available),e.xp6(1),e.Q6J("ngIf",!0===o.available))},directives:[dt,l.O5,pt.G,gn.K,ee.a,Re.K,f.o,l.mk,Pn],styles:[""]}),n})();var Ue=p(66369),Fn=p(76446),$n=p(90068);const Zn=["iscsiSparklineTpl"],Bn=["iscsiPerSecondTpl"],Gn=["iscsiRelativeDateTpl"];function yn(n,_){if(1&n&&(e.TgZ(0,"span"),e._UZ(1,"cd-sparkline",9),e.qZA()),2&n){const t=e.oxw(),o=t.value,i=t.row;e.xp6(1),e.Q6J("data",o)("isBinary",i.cdIsBinary)}}function xn(n,_){1&n&&(e.TgZ(0,"span",10),e._uU(1," n/a "),e.qZA())}function wn(n,_){if(1&n&&(e.YNc(0,yn,2,2,"span",7),e.YNc(1,xn,2,0,"span",8)),2&n){const t=_.row;e.Q6J("ngIf","user:rbd"===t.backstore),e.xp6(1),e.Q6J("ngIf","user:rbd"!==t.backstore)}}function qn(n,_){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.hij(" ",t," /s ")}}function Hn(n,_){1&n&&(e.TgZ(0,"span",10),e._uU(1," n/a "),e.qZA())}function Kn(n,_){if(1&n&&(e.YNc(0,qn,2,1,"span",7),e.YNc(1,Hn,2,0,"span",8)),2&n){const t=_.row;e.Q6J("ngIf","user:rbd"===t.backstore),e.xp6(1),e.Q6J("ngIf","user:rbd"!==t.backstore)}}function kn(n,_){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"notAvailable"),e.ALo(3,"relativeDate"),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.hij(" ",e.lcZ(2,1,e.lcZ(3,3,t))," ")}}function Xn(n,_){1&n&&(e.TgZ(0,"span",10),e._uU(1," n/a "),e.qZA())}function Qn(n,_){if(1&n&&(e.YNc(0,kn,4,5,"span",7),e.YNc(1,Xn,2,0,"span",8)),2&n){const t=_.row;e.Q6J("ngIf","user:rbd"===t.backstore),e.xp6(1),e.Q6J("ngIf","user:rbd"!==t.backstore)}}let zn=(()=>{class n{constructor(t,o,i){this.iscsiService=t,this.dimlessPipe=o,this.iscsiBackstorePipe=i,this.gateways=[],this.images=[]}ngOnInit(){this.gatewaysColumns=[{name:"Name",prop:"name"},{name:"State",prop:"state",flexGrow:1,cellTransformation:ve.e.badge,customTemplateConfig:{map:{up:{class:"badge-success"},down:{class:"badge-danger"}}}},{name:"# Targets",prop:"num_targets"},{name:"# Sessions",prop:"num_sessions"}],this.imagesColumns=[{name:"Pool",prop:"pool"},{name:"Image",prop:"image"},{name:"Backstore",prop:"backstore",pipe:this.iscsiBackstorePipe},{name:"Read Bytes",prop:"stats_history.rd_bytes",cellTemplate:this.iscsiSparklineTpl},{name:"Write Bytes",prop:"stats_history.wr_bytes",cellTemplate:this.iscsiSparklineTpl},{name:"Read Ops",prop:"stats.rd",pipe:this.dimlessPipe,cellTemplate:this.iscsiPerSecondTpl},{name:"Write Ops",prop:"stats.wr",pipe:this.dimlessPipe,cellTemplate:this.iscsiPerSecondTpl},{name:"A/O Since",prop:"optimized_since",cellTemplate:this.iscsiRelativeDateTpl}]}refresh(){this.iscsiService.overview().subscribe(t=>{this.gateways=t.gateways,this.images=t.images,this.images.map(o=>(o.stats_history&&(o.stats_history.rd_bytes=o.stats_history.rd_bytes.map(i=>i[1]),o.stats_history.wr_bytes=o.stats_history.wr_bytes.map(i=>i[1])),o.cdIsBinary=!0,o))})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(k),e.Y36(Ue.n),e.Y36(He.V))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi"]],viewQuery:function(t,o){if(1&t&&(e.Gf(Zn,7),e.Gf(Bn,7),e.Gf(Gn,7)),2&t){let i;e.iGM(i=e.CRH())&&(o.iscsiSparklineTpl=i.first),e.iGM(i=e.CRH())&&(o.iscsiPerSecondTpl=i.first),e.iGM(i=e.CRH())&&(o.iscsiRelativeDateTpl=i.first)}},decls:13,vars:4,consts:function(){let _,t;return _="Gateways",t="Images",[_,[3,"data","columns","fetchData"],t,[3,"data","columns"],["iscsiSparklineTpl",""],["iscsiPerSecondTpl",""],["iscsiRelativeDateTpl",""],[4,"ngIf"],["class","text-muted",4,"ngIf"],[3,"data","isBinary"],[1,"text-muted"]]},template:function(t,o){1&t&&(e._UZ(0,"cd-iscsi-tabs"),e.TgZ(1,"legend"),e.SDv(2,0),e.qZA(),e.TgZ(3,"cd-table",1),e.NdJ("fetchData",function(){return o.refresh()}),e.qZA(),e.TgZ(4,"legend"),e.SDv(5,2),e.qZA(),e._UZ(6,"cd-table",3),e.YNc(7,wn,2,2,"ng-template",null,4,e.W1O),e.YNc(9,Kn,2,2,"ng-template",null,5,e.W1O),e.YNc(11,Qn,2,2,"ng-template",null,6,e.W1O)),2&t&&(e.xp6(3),e.Q6J("data",o.gateways)("columns",o.gatewaysColumns),e.xp6(3),e.Q6J("data",o.images)("columns",o.imagesColumns))},directives:[dt,ee.a,l.O5,Fn.l],pipes:[ct.g,$n.h],styles:[""]}),n})(),Jn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[l.ez,_e.m,I.Oz,m.Bz,r.u5,r.UX,I.ZQ]]}),n})();var Yn=p(75319),Vn=p(26215),Un=p(45435),gt=p(55358);let K=class{constructor(_,t){this.http=_,this.timerService=t,this.REFRESH_INTERVAL=3e4,this.summaryDataSource=new Vn.X(null),this.summaryData$=this.summaryDataSource.asObservable()}startPolling(){return this.timerService.get(()=>this.retrieveSummaryObservable(),this.REFRESH_INTERVAL).subscribe(this.retrieveSummaryObserver())}refresh(){return this.retrieveSummaryObservable().subscribe(this.retrieveSummaryObserver())}retrieveSummaryObservable(){return this.http.get("api/block/mirroring/summary")}retrieveSummaryObserver(){return _=>{this.summaryDataSource.next(_)}}subscribeSummary(_,t){return this.summaryData$.pipe((0,Un.h)(o=>!!o)).subscribe(_,t)}getPool(_){return this.http.get(`api/block/mirroring/pool/${_}`)}updatePool(_,t){return this.http.put(`api/block/mirroring/pool/${_}`,t,{observe:"response"})}getSiteName(){return this.http.get("api/block/mirroring/site_name")}setSiteName(_){return this.http.put("api/block/mirroring/site_name",{site_name:_},{observe:"response"})}createBootstrapToken(_){return this.http.post(`api/block/mirroring/pool/${_}/bootstrap/token`,{})}importBootstrapToken(_,t,o){return this.http.post(`api/block/mirroring/pool/${_}/bootstrap/peer`,{direction:t,token:o},{observe:"response"})}getPeer(_,t){return this.http.get(`api/block/mirroring/pool/${_}/peer/${t}`)}addPeer(_,t){return this.http.post(`api/block/mirroring/pool/${_}/peer`,t,{observe:"response"})}updatePeer(_,t,o){return this.http.put(`api/block/mirroring/pool/${_}/peer/${t}`,o,{observe:"response"})}deletePeer(_,t){return this.http.delete(`api/block/mirroring/pool/${_}/peer/${t}`,{observe:"response"})}};K.\u0275fac=function(_){return new(_||K)(e.LFG(ie.eN),e.LFG(gt.f))},K.\u0275prov=e.Yz7({token:K,factory:K.\u0275fac,providedIn:"root"}),(0,b.gn)([(0,b.fM)(0,Y.G),(0,b.w6)("design:type",Function),(0,b.w6)("design:paramtypes",[String]),(0,b.w6)("design:returntype",void 0)],K.prototype,"setSiteName",null),(0,b.gn)([(0,b.fM)(1,Y.G),(0,b.fM)(2,Y.G),(0,b.w6)("design:type",Function),(0,b.w6)("design:paramtypes",[String,String,String]),(0,b.w6)("design:returntype",void 0)],K.prototype,"importBootstrapToken",null),K=(0,b.gn)([Y.o,(0,b.w6)("design:paramtypes",[ie.eN,gt.f])],K);var je=p(58071),jn=p(68307),ut=p(12627),le=p(82945),Wn=p(39749),ei=p(13472);function ti(n,_){1&n&&(e.TgZ(0,"span",25),e.SDv(1,26),e.qZA())}function oi(n,_){if(1&n&&(e.TgZ(0,"div",27),e._UZ(1,"input",28),e.TgZ(2,"label",29),e._uU(3),e.qZA(),e.qZA()),2&n){const t=_.$implicit;e.xp6(1),e.s9C("id",t.name),e.s9C("name",t.name),e.s9C("formControlName",t.name),e.xp6(1),e.s9C("for",t.name),e.xp6(1),e.Oqu(t.name)}}function ni(n,_){1&n&&(e.TgZ(0,"span",25),e.SDv(1,30),e.qZA())}let ii=(()=>{class n{constructor(t,o,i){this.activeModal=t,this.rbdMirroringService=o,this.taskWrapper=i,this.pools=[],this.createForm()}createForm(){this.createBootstrapForm=new M.d({siteName:new r.NI("",{validators:[r.kI.required]}),pools:new r.cw({},{validators:[this.validatePools()]}),token:new r.NI("",{})})}ngOnInit(){this.createBootstrapForm.get("siteName").setValue(this.siteName),this.rbdMirroringService.getSiteName().subscribe(t=>{this.createBootstrapForm.get("siteName").setValue(t.site_name)}),this.subs=this.rbdMirroringService.subscribeSummary(t=>{this.pools=t.content_data.pools.reduce((s,a)=>(s.push({name:a.name,mirror_mode:a.mirror_mode}),s),[]);const i=this.createBootstrapForm.get("pools");C().each(this.pools,s=>{const a=s.name,d="disabled"===s.mirror_mode,c=i.controls[a];c?d&&c.disabled?c.enable():!d&&c.enabled&&(c.disable(),c.setValue(!0)):i.addControl(a,new r.NI({value:!d,disabled:!d}))})})}ngOnDestroy(){this.subs&&this.subs.unsubscribe()}validatePools(){return t=>{let o=0;return C().each(t.controls,i=>{!0===i.value&&++o}),o>0?null:{requirePool:!0}}}generate(){this.createBootstrapForm.get("token").setValue("");let t="";const o=[],i=this.createBootstrapForm.get("pools");C().each(i.controls,(u,S)=>{!0===u.value&&(t=S,u.disabled||o.push(S))});const s={mirror_mode:"image"},a=(0,je.z)(this.rbdMirroringService.setSiteName(this.createBootstrapForm.getValue("siteName")),(0,W.D)(o.map(u=>this.rbdMirroringService.updatePool(u,s))),this.rbdMirroringService.createBootstrapToken(t).pipe((0,jn.b)(u=>this.createBootstrapForm.get("token").setValue(u.token)))).pipe((0,ut.Z)()),d=()=>{this.rbdMirroringService.refresh(),this.createBootstrapForm.setErrors({cdSubmitButton:!0})};this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/mirroring/bootstrap/create",{}),call:a}).subscribe({error:d,complete:d})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(I.Kz),e.Y36(K),e.Y36(Q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-bootstrap-create-modal"]],decls:32,vars:6,consts:function(){let _,t,o,i,s,a,d,c,u,S,N;return _="Create Bootstrap Token",t="To create a bootstrap token which can be imported by a peer site cluster, provide the local site's name, select which pools will have mirroring enabled, and click\xA0 " + "\ufffd#10\ufffd" + "Generate" + "\ufffd/#10\ufffd" + ".",o="Site Name",i="Name...",s="Pools",a="Generate",d="Token",c="Generated token...",u="Close",S="This field is required.",N="At least one pool is required.",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","createBootstrapForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],["for","siteName",1,"col-form-label","required"],o,["type","text","placeholder",i,"id","siteName","name","siteName","formControlName","siteName","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["formGroupName","pools",1,"form-group"],["for","pools",1,"col-form-label","required"],s,["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"mb-4","float-right",3,"form","submitAction"],a,["for","token",1,"col-form-label"],d,["placeholder",c,"id","token","formControlName","token","readonly","",1,"form-control","resize-vertical"],["source","token",1,"float-right"],[1,"modal-footer"],["name",u,3,"backAction"],[1,"invalid-feedback"],S,[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],N]},template:function(t,o){if(1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.BQk(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.TgZ(7,"p"),e.ynx(8),e.tHW(9,7),e._UZ(10,"kbd"),e.N_p(),e.BQk(),e.qZA(),e.TgZ(11,"div",8),e.TgZ(12,"label",9),e.SDv(13,10),e.qZA(),e._UZ(14,"input",11),e.YNc(15,ti,2,0,"span",12),e.qZA(),e.TgZ(16,"div",13),e.TgZ(17,"label",14),e.SDv(18,15),e.qZA(),e.YNc(19,oi,4,5,"div",16),e.YNc(20,ni,2,0,"span",12),e.qZA(),e.TgZ(21,"cd-submit-button",17),e.NdJ("submitAction",function(){return o.generate()}),e.SDv(22,18),e.qZA(),e.TgZ(23,"div",8),e.TgZ(24,"label",19),e.TgZ(25,"span"),e.SDv(26,20),e.qZA(),e.qZA(),e.TgZ(27,"textarea",21),e._uU(28," "),e.qZA(),e.qZA(),e._UZ(29,"cd-copy-2-clipboard-button",22),e.qZA(),e.TgZ(30,"div",23),e.TgZ(31,"cd-back-button",24),e.NdJ("backAction",function(){return o.activeModal.close()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t){const i=e.MAs(5);e.Q6J("modalRef",o.activeModal),e.xp6(4),e.Q6J("formGroup",o.createBootstrapForm),e.xp6(11),e.Q6J("ngIf",o.createBootstrapForm.showError("siteName",i,"required")),e.xp6(4),e.Q6J("ngForOf",o.pools),e.xp6(1),e.Q6J("ngIf",o.createBootstrapForm.showError("pools",i,"requirePool")),e.xp6(1),e.Q6J("form",o.createBootstrapForm)}},directives:[R.z,r._Y,r.JL,v.V,r.sg,g.P,f.o,r.Fj,h.b,r.JJ,r.u,le.U,l.O5,r.x0,l.sg,Wn.w,Je.s,ei.W,r.Wl],styles:[".form-group.ng-invalid[_ngcontent-%COMP%] .invalid-feedback[_ngcontent-%COMP%]{display:block}"]}),n})();function _i(n,_){1&n&&(e.TgZ(0,"span",26),e.SDv(1,27),e.qZA())}function si(n,_){if(1&n&&(e.TgZ(0,"option",28),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.Q6J("value",t.key),e.xp6(1),e.Oqu(t.desc)}}function ai(n,_){if(1&n&&(e.TgZ(0,"div",29),e._UZ(1,"input",30),e.TgZ(2,"label",31),e._uU(3),e.qZA(),e.qZA()),2&n){const t=_.$implicit;e.xp6(1),e.s9C("id",t.name),e.s9C("name",t.name),e.s9C("formControlName",t.name),e.xp6(1),e.s9C("for",t.name),e.xp6(1),e.Oqu(t.name)}}function ri(n,_){1&n&&(e.TgZ(0,"span",26),e.SDv(1,32),e.qZA())}function li(n,_){1&n&&(e.TgZ(0,"span",26),e.SDv(1,33),e.qZA())}function ci(n,_){1&n&&(e.TgZ(0,"span",26),e.SDv(1,34),e.qZA())}let di=(()=>{class n{constructor(t,o,i,s){this.activeModal=t,this.actionLabels=o,this.rbdMirroringService=i,this.taskWrapper=s,this.pools=[],this.directions=[{key:"rx-tx",desc:"Bidirectional"},{key:"rx",desc:"Unidirectional (receive-only)"}],this.createForm()}createForm(){this.importBootstrapForm=new M.d({siteName:new r.NI("",{validators:[r.kI.required]}),direction:new r.NI("rx-tx",{}),pools:new r.cw({},{validators:[this.validatePools()]}),token:new r.NI("",{validators:[r.kI.required,this.validateToken()]})})}ngOnInit(){this.rbdMirroringService.getSiteName().subscribe(t=>{this.importBootstrapForm.get("siteName").setValue(t.site_name)}),this.subs=this.rbdMirroringService.subscribeSummary(t=>{this.pools=t.content_data.pools.reduce((s,a)=>(s.push({name:a.name,mirror_mode:a.mirror_mode}),s),[]);const i=this.importBootstrapForm.get("pools");C().each(this.pools,s=>{const a=s.name,d="disabled"===s.mirror_mode,c=i.controls[a];c?d&&c.disabled?c.enable():!d&&c.enabled&&(c.disable(),c.setValue(!0)):i.addControl(a,new r.NI({value:!d,disabled:!d}))})})}ngOnDestroy(){this.subs&&this.subs.unsubscribe()}validatePools(){return t=>{let o=0;return C().each(t.controls,i=>{!0===i.value&&++o}),o>0?null:{requirePool:!0}}}validateToken(){return t=>{try{if(JSON.parse(atob(t.value)))return null}catch(o){}return{invalidToken:!0}}}import(){const t=[],o=[],i=this.importBootstrapForm.get("pools");C().each(i.controls,(u,S)=>{!0===u.value&&(t.push(S),u.disabled||o.push(S))});const s={mirror_mode:"image"};let a=(0,je.z)(this.rbdMirroringService.setSiteName(this.importBootstrapForm.getValue("siteName")),(0,W.D)(o.map(u=>this.rbdMirroringService.updatePool(u,s))));a=t.reduce((u,S)=>(0,je.z)(u,this.rbdMirroringService.importBootstrapToken(S,this.importBootstrapForm.getValue("direction"),this.importBootstrapForm.getValue("token"))),a).pipe((0,ut.Z)());const d=()=>{this.rbdMirroringService.refresh(),this.importBootstrapForm.setErrors({cdSubmitButton:!0})};this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/mirroring/bootstrap/import",{}),call:a}).subscribe({error:d,complete:()=>{d(),this.activeModal.close()}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(I.Kz),e.Y36(D.p4),e.Y36(K),e.Y36(Q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-bootstrap-import-modal"]],decls:36,vars:10,consts:function(){let _,t,o,i,s,a,d,c,u,S,N,P;return _="Import Bootstrap Token",t="To import a bootstrap token which was created by a peer site cluster, provide the local site's name, select which pools will have mirroring enabled, provide the generated token, and click\xA0" + "\ufffd#10\ufffd" + "Import" + "\ufffd/#10\ufffd" + ".",o="Site Name",i="Name...",s="Direction",a="Pools",d="Token",c="Generated token...",u="This field is required.",S="At least one pool is required.",N="This field is required.",P="The token is invalid.",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","importBootstrapForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],["for","siteName",1,"col-form-label","required"],o,["type","text","placeholder",i,"id","siteName","name","siteName","formControlName","siteName","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","direction",1,"col-form-label"],s,["id","direction","name","direction","formControlName","direction",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],["formGroupName","pools",1,"form-group"],["for","pools",1,"col-form-label","required"],a,["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],["for","token",1,"col-form-label","required"],d,["placeholder",c,"id","token","formControlName","token",1,"form-control","resize-vertical"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],u,[3,"value"],[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],S,N,P]},template:function(t,o){if(1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.BQk(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.TgZ(7,"p"),e.ynx(8),e.tHW(9,7),e._UZ(10,"kbd"),e.N_p(),e.BQk(),e.qZA(),e.TgZ(11,"div",8),e.TgZ(12,"label",9),e.SDv(13,10),e.qZA(),e._UZ(14,"input",11),e.YNc(15,_i,2,0,"span",12),e.qZA(),e.TgZ(16,"div",8),e.TgZ(17,"label",13),e.TgZ(18,"span"),e.SDv(19,14),e.qZA(),e.qZA(),e.TgZ(20,"select",15),e.YNc(21,si,2,2,"option",16),e.qZA(),e.qZA(),e.TgZ(22,"div",17),e.TgZ(23,"label",18),e.SDv(24,19),e.qZA(),e.YNc(25,ai,4,5,"div",20),e.YNc(26,ri,2,0,"span",12),e.qZA(),e.TgZ(27,"div",8),e.TgZ(28,"label",21),e.SDv(29,22),e.qZA(),e.TgZ(30,"textarea",23),e._uU(31," "),e.qZA(),e.YNc(32,li,2,0,"span",12),e.YNc(33,ci,2,0,"span",12),e.qZA(),e.qZA(),e.TgZ(34,"div",24),e.TgZ(35,"cd-form-button-panel",25),e.NdJ("submitActionEvent",function(){return o.import()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t){const i=e.MAs(5);e.Q6J("modalRef",o.activeModal),e.xp6(4),e.Q6J("formGroup",o.importBootstrapForm),e.xp6(11),e.Q6J("ngIf",o.importBootstrapForm.showError("siteName",i,"required")),e.xp6(6),e.Q6J("ngForOf",o.directions),e.xp6(4),e.Q6J("ngForOf",o.pools),e.xp6(1),e.Q6J("ngIf",o.importBootstrapForm.showError("pools",i,"requirePool")),e.xp6(6),e.Q6J("ngIf",o.importBootstrapForm.showError("token",i,"required")),e.xp6(1),e.Q6J("ngIf",o.importBootstrapForm.showError("token",i,"invalidToken")),e.xp6(2),e.Q6J("form",o.importBootstrapForm)("submitText",o.actionLabels.SUBMIT)}},directives:[R.z,r._Y,r.JL,v.V,r.sg,g.P,f.o,r.Fj,h.b,r.JJ,r.u,le.U,l.O5,r.EJ,l.sg,r.x0,O.p,r.YN,r.Kr,r.Wl],styles:[""]}),n})(),pi=(()=>{class n{constructor(t,o,i,s){this.activeModal=t,this.actionLabels=o,this.rbdMirroringService=i,this.taskWrapper=s,this.createForm()}createForm(){this.editSiteNameForm=new M.d({siteName:new r.NI("",{})})}ngOnInit(){this.editSiteNameForm.get("siteName").setValue(this.siteName),this.rbdMirroringService.getSiteName().subscribe(t=>{this.editSiteNameForm.get("siteName").setValue(t.site_name)})}update(){this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/mirroring/site_name/edit",{}),call:this.rbdMirroringService.setSiteName(this.editSiteNameForm.getValue("siteName"))}).subscribe({error:()=>this.editSiteNameForm.setErrors({cdSubmitButton:!0}),complete:()=>{this.rbdMirroringService.refresh(),this.activeModal.close()}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(I.Kz),e.Y36(D.p4),e.Y36(K),e.Y36(Q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-edit-site-mode-modal"]],decls:17,vars:4,consts:function(){let _,t,o,i;return _="Edit site name",t="Edit the site name and click\xA0 " + "\ufffd#10\ufffd" + "Update" + "\ufffd/#10\ufffd" + ".",o="Site Name",i="Name...",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","editSiteNameForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],["for","siteName",1,"col-form-label","required"],o,["type","text","placeholder",i,"id","siteName","name","siteName","formControlName","siteName","autofocus","",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"]]},template:function(t,o){1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.BQk(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.TgZ(7,"p"),e.ynx(8),e.tHW(9,7),e._UZ(10,"kbd"),e.N_p(),e.BQk(),e.qZA(),e.TgZ(11,"div",8),e.TgZ(12,"label",9),e.SDv(13,10),e.qZA(),e._UZ(14,"input",11),e.qZA(),e.qZA(),e.TgZ(15,"div",12),e.TgZ(16,"cd-form-button-panel",13),e.NdJ("submitActionEvent",function(){return o.update()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t&&(e.Q6J("modalRef",o.activeModal),e.xp6(4),e.Q6J("formGroup",o.editSiteNameForm),e.xp6(12),e.Q6J("form",o.editSiteNameForm)("submitText",o.actionLabels.UPDATE))},directives:[R.z,r._Y,r.JL,v.V,r.sg,g.P,f.o,r.Fj,h.b,r.JJ,r.u,le.U,O.p],styles:[""]}),n})();var U=p(69158),gi=p(58111);let We=(()=>{class n{transform(t){return"warning"===t?"badge badge-warning":"error"===t?"badge badge-danger":"success"===t?"badge badge-success":"badge badge-info"}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=e.Yjl({name:"mirrorHealthColor",type:n,pure:!0}),n})();const ui=["healthTmpl"];function mi(n,_){if(1&n&&(e.TgZ(0,"span",2),e.ALo(1,"mirrorHealthColor"),e._uU(2),e.qZA()),2&n){const o=_.value;e.Q6J("ngClass",e.lcZ(1,2,_.row.health_color)),e.xp6(2),e.Oqu(o)}}let Ti=(()=>{class n{constructor(t,o){this.rbdMirroringService=t,this.cephShortVersionPipe=o,this.tableStatus=new U.E}ngOnInit(){this.columns=[{prop:"instance_id",name:"Instance",flexGrow:2},{prop:"id",name:"ID",flexGrow:2},{prop:"server_hostname",name:"Hostname",flexGrow:2},{prop:"version",name:"Version",pipe:this.cephShortVersionPipe,flexGrow:2},{prop:"health",name:"Health",cellTemplate:this.healthTmpl,flexGrow:1}],this.subs=this.rbdMirroringService.subscribeSummary(t=>{this.data=t.content_data.daemons,this.tableStatus=new U.E(t.status)})}ngOnDestroy(){this.subs.unsubscribe()}refresh(){this.rbdMirroringService.refresh()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(K),e.Y36(gi.F))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-mirroring-daemons"]],viewQuery:function(t,o){if(1&t&&e.Gf(ui,7),2&t){let i;e.iGM(i=e.CRH())&&(o.healthTmpl=i.first)}},decls:3,vars:4,consts:[["columnMode","flex",3,"data","columns","autoReload","status","fetchData"],["healthTmpl",""],[3,"ngClass"]],template:function(t,o){1&t&&(e.TgZ(0,"cd-table",0),e.NdJ("fetchData",function(){return o.refresh()}),e.qZA(),e.YNc(1,mi,3,4,"ng-template",null,1,e.W1O)),2&t&&e.Q6J("data",o.data)("columns",o.columns)("autoReload",-1)("status",o.tableStatus)},directives:[ee.a,l.mk],pipes:[We],styles:[""]}),n})();var fi=p(18891);class Ci{}function Si(n,_){if(1&n&&(e.TgZ(0,"option",16),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.Q6J("value",t.id),e.xp6(1),e.Oqu(t.name)}}function Ei(n,_){1&n&&(e.TgZ(0,"span",17),e.SDv(1,18),e.qZA())}let Ri=(()=>{class n{constructor(t,o,i,s){this.activeModal=t,this.actionLabels=o,this.rbdMirroringService=i,this.taskWrapper=s,this.bsConfig={containerClass:"theme-default"},this.peerExists=!1,this.mirrorModes=[{id:"disabled",name:"Disabled"},{id:"pool",name:"Pool"},{id:"image",name:"Image"}],this.createForm()}createForm(){this.editModeForm=new M.d({mirrorMode:new r.NI("",{validators:[r.kI.required,this.validateMode.bind(this)]})})}ngOnInit(){this.pattern=`${this.poolName}`,this.rbdMirroringService.getPool(this.poolName).subscribe(t=>{this.setResponse(t)}),this.subs=this.rbdMirroringService.subscribeSummary(t=>{this.peerExists=!1;const i=t.content_data.pools.find(s=>this.poolName===s.name);this.peerExists=i&&i.peer_uuids.length})}ngOnDestroy(){this.subs.unsubscribe()}validateMode(t){return"disabled"===t.value&&this.peerExists?{cannotDisable:{value:t.value}}:null}setResponse(t){this.editModeForm.get("mirrorMode").setValue(t.mirror_mode)}update(){const t=new Ci;t.mirror_mode=this.editModeForm.getValue("mirrorMode"),this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/mirroring/pool/edit",{pool_name:this.poolName}),call:this.rbdMirroringService.updatePool(this.poolName,t)}).subscribe({error:()=>this.editModeForm.setErrors({cdSubmitButton:!0}),complete:()=>{this.rbdMirroringService.refresh(),this.activeModal.close()}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(I.Kz),e.Y36(D.p4),e.Y36(K),e.Y36(Q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-pool-edit-mode-modal"]],decls:21,vars:7,consts:function(){let _,t,o,i;return _="Edit pool mirror mode",t="To edit the mirror mode for pool\xA0 " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "" + "\ufffd0\ufffd" + "" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ", select a new mode from the list and click\xA0 " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "Update" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ".",t=e.Zx4(t),o="Mode",i="Peer clusters must be removed prior to disabling mirror.",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","editModeForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],["for","mirrorMode",1,"col-form-label"],o,["id","mirrorMode","name","mirrorMode","formControlName","mirrorMode",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[3,"value"],[1,"invalid-feedback"],i]},template:function(t,o){if(1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.BQk(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.TgZ(7,"p"),e.ynx(8),e.tHW(9,7),e._UZ(10,"kbd"),e._UZ(11,"kbd"),e.N_p(),e.BQk(),e.qZA(),e.TgZ(12,"div",8),e.TgZ(13,"label",9),e.TgZ(14,"span"),e.SDv(15,10),e.qZA(),e.qZA(),e.TgZ(16,"select",11),e.YNc(17,Si,2,2,"option",12),e.qZA(),e.YNc(18,Ei,2,0,"span",13),e.qZA(),e.qZA(),e.TgZ(19,"div",14),e.TgZ(20,"cd-form-button-panel",15),e.NdJ("submitActionEvent",function(){return o.update()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t){const i=e.MAs(5);e.Q6J("modalRef",o.activeModal),e.xp6(4),e.Q6J("formGroup",o.editModeForm),e.xp6(7),e.pQV(o.poolName),e.QtT(9),e.xp6(6),e.Q6J("ngForOf",o.mirrorModes),e.xp6(1),e.Q6J("ngIf",o.editModeForm.showError("mirrorMode",i,"cannotDisable")),e.xp6(2),e.Q6J("form",o.editModeForm)("submitText",o.actionLabels.UPDATE)}},directives:[R.z,r._Y,r.JL,v.V,r.sg,g.P,f.o,r.EJ,h.b,r.JJ,r.u,l.sg,l.O5,O.p,r.YN,r.Kr],styles:[""]}),n})();class Mi{}function Oi(n,_){1&n&&(e.TgZ(0,"span",24),e.SDv(1,25),e.qZA())}function Ai(n,_){1&n&&(e.TgZ(0,"span",24),e.SDv(1,26),e.qZA())}function hi(n,_){1&n&&(e.TgZ(0,"span",24),e.SDv(1,27),e.qZA())}function Pi(n,_){1&n&&(e.TgZ(0,"span",24),e.SDv(1,28),e.qZA())}function Ii(n,_){1&n&&(e.TgZ(0,"span",24),e.SDv(1,29),e.qZA())}function bi(n,_){1&n&&(e.TgZ(0,"span",24),e.SDv(1,30),e.qZA())}let Ni=(()=>{class n{constructor(t,o,i,s){this.activeModal=t,this.actionLabels=o,this.rbdMirroringService=i,this.taskWrapper=s,this.bsConfig={containerClass:"theme-default"},this.createForm()}createForm(){this.editPeerForm=new M.d({clusterName:new r.NI("",{validators:[r.kI.required,this.validateClusterName]}),clientID:new r.NI("",{validators:[r.kI.required,this.validateClientID]}),monAddr:new r.NI("",{validators:[this.validateMonAddr]}),key:new r.NI("",{validators:[this.validateKey]})})}ngOnInit(){this.pattern=`${this.poolName}/${this.peerUUID}`,"edit"===this.mode&&this.rbdMirroringService.getPeer(this.poolName,this.peerUUID).subscribe(t=>{this.setResponse(t)})}validateClusterName(t){if(!t.value.match(/^[\w\-_]*$/))return{invalidClusterName:{value:t.value}}}validateClientID(t){if(!t.value.match(/^(?!client\.)[\w\-_.]*$/))return{invalidClientID:{value:t.value}}}validateMonAddr(t){if(!t.value.match(/^[,; ]*([\w.\-_\[\]]+(:[\d]+)?[,; ]*)*$/))return{invalidMonAddr:{value:t.value}}}validateKey(t){try{if(""===t.value||atob(t.value))return null}catch(o){}return{invalidKey:{value:t.value}}}setResponse(t){this.response=t,this.editPeerForm.get("clusterName").setValue(t.cluster_name),this.editPeerForm.get("clientID").setValue(t.client_id),this.editPeerForm.get("monAddr").setValue(t.mon_host),this.editPeerForm.get("key").setValue(t.key)}update(){const t=new Mi;let o;t.cluster_name=this.editPeerForm.getValue("clusterName"),t.client_id=this.editPeerForm.getValue("clientID"),t.mon_host=this.editPeerForm.getValue("monAddr"),t.key=this.editPeerForm.getValue("key"),o=this.taskWrapper.wrapTaskAroundCall("edit"===this.mode?{task:new F.R("rbd/mirroring/peer/edit",{pool_name:this.poolName}),call:this.rbdMirroringService.updatePeer(this.poolName,this.peerUUID,t)}:{task:new F.R("rbd/mirroring/peer/add",{pool_name:this.poolName}),call:this.rbdMirroringService.addPeer(this.poolName,t)}),o.subscribe({error:()=>this.editPeerForm.setErrors({cdSubmitButton:!0}),complete:()=>{this.rbdMirroringService.refresh(),this.activeModal.close()}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(I.Kz),e.Y36(D.p4),e.Y36(K),e.Y36(Q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-pool-edit-peer-modal"]],decls:38,vars:13,consts:function(){let _,t,o,i,s,a,d,c,u,S,N,P,$,G,X,J,te,A;return _="{VAR_SELECT, select, edit {Edit} other {Add}}",_=e.Zx4(_,{VAR_SELECT:"\ufffd0\ufffd"}),t="" + _ + " pool mirror peer",o="{VAR_SELECT, select, edit {Edit} other {Add}}",o=e.Zx4(o,{VAR_SELECT:"\ufffd0\ufffd"}),i="" + o + " the pool mirror peer attributes for pool " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "" + "\ufffd1\ufffd" + "" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + " and click " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "Submit" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ".",i=e.Zx4(i),s="Cluster Name",a="Name...",d="CephX ID",c="CephX ID...",u="Monitor Addresses",S="Comma-delimited addresses...",N="CephX Key",P="Base64-encoded key...",$="This field is required.",G="The cluster name is not valid.",X="This field is required.",J="The CephX ID is not valid.",te="The monitory address is not valid.",A="CephX key must be base64 encoded.",[[3,"modalRef"],[1,"modal-title"],t,[1,"modal-content"],["name","editPeerForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],i,[1,"form-group"],["for","clusterName",1,"col-form-label","required"],s,["type","text","placeholder",a,"id","clusterName","name","clusterName","formControlName","clusterName","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","clientID",1,"col-form-label","required"],d,["type","text","placeholder",c,"id","clientID","name","clientID","formControlName","clientID",1,"form-control"],["for","monAddr",1,"col-form-label"],u,["type","text","placeholder",S,"id","monAddr","name","monAddr","formControlName","monAddr",1,"form-control"],["for","key",1,"col-form-label"],N,["type","text","placeholder",P,"id","key","name","key","formControlName","key",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],$,G,X,J,te,A]},template:function(t,o){if(1&t&&(e.TgZ(0,"cd-modal",0),e.TgZ(1,"span",1),e.SDv(2,2),e.qZA(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.TgZ(7,"p"),e.TgZ(8,"span"),e.tHW(9,7),e._UZ(10,"kbd"),e._UZ(11,"kbd"),e.N_p(),e.qZA(),e.qZA(),e.TgZ(12,"div",8),e.TgZ(13,"label",9),e.SDv(14,10),e.qZA(),e._UZ(15,"input",11),e.YNc(16,Oi,2,0,"span",12),e.YNc(17,Ai,2,0,"span",12),e.qZA(),e.TgZ(18,"div",8),e.TgZ(19,"label",13),e.SDv(20,14),e.qZA(),e._UZ(21,"input",15),e.YNc(22,hi,2,0,"span",12),e.YNc(23,Pi,2,0,"span",12),e.qZA(),e.TgZ(24,"div",8),e.TgZ(25,"label",16),e.TgZ(26,"span"),e.SDv(27,17),e.qZA(),e.qZA(),e._UZ(28,"input",18),e.YNc(29,Ii,2,0,"span",12),e.qZA(),e.TgZ(30,"div",8),e.TgZ(31,"label",19),e.TgZ(32,"span"),e.SDv(33,20),e.qZA(),e.qZA(),e._UZ(34,"input",21),e.YNc(35,bi,2,0,"span",12),e.qZA(),e.qZA(),e.TgZ(36,"div",22),e.TgZ(37,"cd-form-button-panel",23),e.NdJ("submitActionEvent",function(){return o.update()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t){const i=e.MAs(5);e.Q6J("modalRef",o.activeModal),e.xp6(2),e.pQV(o.mode),e.QtT(2),e.xp6(2),e.Q6J("formGroup",o.editPeerForm),e.xp6(7),e.pQV(o.mode)(o.poolName),e.QtT(9),e.xp6(5),e.Q6J("ngIf",o.editPeerForm.showError("clusterName",i,"required")),e.xp6(1),e.Q6J("ngIf",o.editPeerForm.showError("clusterName",i,"invalidClusterName")),e.xp6(5),e.Q6J("ngIf",o.editPeerForm.showError("clientID",i,"required")),e.xp6(1),e.Q6J("ngIf",o.editPeerForm.showError("clientID",i,"invalidClientID")),e.xp6(6),e.Q6J("ngIf",o.editPeerForm.showError("monAddr",i,"invalidMonAddr")),e.xp6(6),e.Q6J("ngIf",o.editPeerForm.showError("key",i,"invalidKey")),e.xp6(2),e.Q6J("form",o.editPeerForm)("submitText",o.actionLabels.SUBMIT)}},directives:[R.z,r._Y,r.JL,v.V,r.sg,g.P,f.o,r.Fj,h.b,r.JJ,r.u,le.U,l.O5,O.p],styles:[""]}),n})();const Di=["healthTmpl"];function vi(n,_){if(1&n&&(e.TgZ(0,"span",3),e.ALo(1,"mirrorHealthColor"),e._uU(2),e.qZA()),2&n){const o=_.value;e.Q6J("ngClass",e.lcZ(1,2,_.row.health_color)),e.xp6(2),e.Oqu(o)}}let Li=(()=>{class n{constructor(t,o,i,s){this.authStorageService=t,this.rbdMirroringService=o,this.modalService=i,this.taskWrapper=s,this.selection=new Ee.r,this.tableStatus=new U.E,this.data=[],this.permission=this.authStorageService.getPermissions().rbdMirroring;const a={permission:"update",icon:T.P.edit,click:()=>this.editModeModal(),name:"Edit Mode",canBePrimary:()=>!0},d={permission:"create",icon:T.P.add,name:"Add Peer",click:()=>this.editPeersModal("add"),disable:()=>!this.selection.first()||"disabled"===this.selection.first().mirror_mode,visible:()=>!this.getPeerUUID(),canBePrimary:()=>!1},c={permission:"update",icon:T.P.exchange,name:"Edit Peer",click:()=>this.editPeersModal("edit"),visible:()=>!!this.getPeerUUID()},u={permission:"delete",icon:T.P.destroy,name:"Delete Peer",click:()=>this.deletePeersModal(),visible:()=>!!this.getPeerUUID()};this.tableActions=[a,d,c,u]}ngOnInit(){this.columns=[{prop:"name",name:"Name",flexGrow:2},{prop:"mirror_mode",name:"Mode",flexGrow:2},{prop:"leader_id",name:"Leader",flexGrow:2},{prop:"image_local_count",name:"# Local",flexGrow:2},{prop:"image_remote_count",name:"# Remote",flexGrow:2},{prop:"health",name:"Health",cellTemplate:this.healthTmpl,flexGrow:1}],this.subs=this.rbdMirroringService.subscribeSummary(t=>{this.data=t.content_data.pools,this.tableStatus=new U.E(t.status)})}ngOnDestroy(){this.subs.unsubscribe()}refresh(){this.rbdMirroringService.refresh()}editModeModal(){const t={poolName:this.selection.first().name};this.modalRef=this.modalService.show(Ri,t)}editPeersModal(t){const o={poolName:this.selection.first().name,mode:t};"edit"===t&&(o.peerUUID=this.getPeerUUID()),this.modalRef=this.modalService.show(Ni,o)}deletePeersModal(){const t=this.selection.first().name,o=this.getPeerUUID();this.modalRef=this.modalService.show(he.M,{itemDescription:"mirror peer",itemNames:[`${t} (${o})`],submitActionObservable:()=>new fi.y(i=>{this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/mirroring/peer/delete",{pool_name:t}),call:this.rbdMirroringService.deletePeer(t,o)}).subscribe({error:s=>i.error(s),complete:()=>{this.rbdMirroringService.refresh(),i.complete()}})})})}getPeerUUID(){const t=this.selection.first(),o=this.data.find(i=>t&&t.name===i.name);if(o&&o.peer_uuids)return o.peer_uuids[0]}updateSelection(t){this.selection=t}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(K),e.Y36(re.Z),e.Y36(Q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-mirroring-pools"]],viewQuery:function(t,o){if(1&t&&e.Gf(Di,7),2&t){let i;e.iGM(i=e.CRH())&&(o.healthTmpl=i.first)}},decls:4,vars:7,consts:[["columnMode","flex","identifier","name","forceIdentifier","true","selectionType","single",3,"data","columns","autoReload","status","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["healthTmpl",""],[3,"ngClass"]],template:function(t,o){1&t&&(e.TgZ(0,"cd-table",0),e.NdJ("fetchData",function(){return o.refresh()})("updateSelection",function(s){return o.updateSelection(s)}),e._UZ(1,"cd-table-actions",1),e.qZA(),e.YNc(2,vi,3,4,"ng-template",null,2,e.W1O)),2&t&&(e.Q6J("data",o.data)("columns",o.columns)("autoReload",-1)("status",o.tableStatus),e.xp6(1),e.Q6J("permission",o.permission)("selection",o.selection)("tableActions",o.tableActions))},directives:[ee.a,Re.K,l.mk],pipes:[We],styles:[""]}),n})();var mt=p(59376);const Fi=["stateTmpl"],$i=["syncTmpl"],Zi=["progressTmpl"];function Bi(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"cd-table",14),e.NdJ("fetchData",function(){return e.CHM(t),e.oxw().refresh()}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("data",t.image_error.data)("columns",t.image_error.columns)("autoReload",-1)("status",t.tableStatus)}}function Gi(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"cd-table",14),e.NdJ("fetchData",function(){return e.CHM(t),e.oxw().refresh()}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("data",t.image_syncing.data)("columns",t.image_syncing.columns)("autoReload",-1)("status",t.tableStatus)}}function yi(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"cd-table",14),e.NdJ("fetchData",function(){return e.CHM(t),e.oxw().refresh()}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("data",t.image_ready.data)("columns",t.image_ready.columns)("autoReload",-1)("status",t.tableStatus)}}function xi(n,_){if(1&n&&(e.TgZ(0,"span",15),e.ALo(1,"mirrorHealthColor"),e._uU(2),e.qZA()),2&n){const o=_.value;e.Q6J("ngClass",e.lcZ(1,2,_.row.state_color)),e.xp6(2),e.Oqu(o)}}function wi(n,_){1&n&&(e.TgZ(0,"span",16),e.SDv(1,17),e.qZA())}function qi(n,_){1&n&&e._UZ(0,"ngb-progressbar",18),2&n&&e.Q6J("value",_.value)("showValue",!0)}let Hi=(()=>{class n{constructor(t){this.rbdMirroringService=t,this.image_error={data:[],columns:{}},this.image_syncing={data:[],columns:{}},this.image_ready={data:[],columns:{}},this.tableStatus=new U.E}ngOnInit(){this.image_error.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"description",name:"Issue",flexGrow:4},{prop:"state",name:"State",cellTemplate:this.stateTmpl,flexGrow:1}],this.image_syncing.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"progress",name:"Progress",cellTemplate:this.progressTmpl,flexGrow:2},{prop:"state",name:"State",cellTemplate:this.syncTmpl,flexGrow:1}],this.image_ready.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"description",name:"Description",flexGrow:4},{prop:"state",name:"State",cellTemplate:this.stateTmpl,flexGrow:1}],this.subs=this.rbdMirroringService.subscribeSummary(t=>{this.image_error.data=t.content_data.image_error,this.image_syncing.data=t.content_data.image_syncing,this.image_ready.data=t.content_data.image_ready,this.tableStatus=new U.E(t.status)})}ngOnDestroy(){this.subs.unsubscribe()}refresh(){this.rbdMirroringService.refresh()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(K))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-mirroring-images"]],viewQuery:function(t,o){if(1&t&&(e.Gf(Fi,7),e.Gf($i,7),e.Gf(Zi,7)),2&t){let i;e.iGM(i=e.CRH())&&(o.stateTmpl=i.first),e.iGM(i=e.CRH())&&(o.syncTmpl=i.first),e.iGM(i=e.CRH())&&(o.progressTmpl=i.first)}},decls:21,vars:1,consts:function(){let _,t,o,i;return _="Issues",t="Syncing",o="Ready",i="Syncing",[["ngbNav","","cdStatefulTab","image-list",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","issues"],["ngbNavLink",""],_,["ngbNavContent",""],["ngbNavItem","syncing"],t,["ngbNavItem","ready"],o,[3,"ngbNavOutlet"],["stateTmpl",""],["syncTmpl",""],["progressTmpl",""],["columnMode","flex",3,"data","columns","autoReload","status","fetchData"],[3,"ngClass"],[1,"badge","badge-info"],i,["type","info",3,"value","showValue"]]},template:function(t,o){if(1&t&&(e.TgZ(0,"ul",0,1),e.TgZ(2,"li",2),e.TgZ(3,"a",3),e.SDv(4,4),e.qZA(),e.YNc(5,Bi,1,4,"ng-template",5),e.qZA(),e.TgZ(6,"li",6),e.TgZ(7,"a",3),e.SDv(8,7),e.qZA(),e.YNc(9,Gi,1,4,"ng-template",5),e.qZA(),e.TgZ(10,"li",8),e.TgZ(11,"a",3),e.SDv(12,9),e.qZA(),e.YNc(13,yi,1,4,"ng-template",5),e.qZA(),e.qZA(),e._UZ(14,"div",10),e.YNc(15,xi,3,4,"ng-template",null,11,e.W1O),e.YNc(17,wi,2,0,"ng-template",null,12,e.W1O),e.YNc(19,qi,1,2,"ng-template",null,13,e.W1O)),2&t){const i=e.MAs(1);e.xp6(14),e.Q6J("ngbNavOutlet",i)}},directives:[I.Pz,mt.m,I.nv,I.Vx,I.uN,I.tO,ee.a,l.mk,I.Ly],pipes:[We],styles:[""]}),n})(),Ki=(()=>{class n{constructor(t,o,i){this.authStorageService=t,this.rbdMirroringService=o,this.modalService=i,this.selection=new Ee.r,this.peersExist=!0,this.subs=new Yn.w,this.permission=this.authStorageService.getPermissions().rbdMirroring;const s={permission:"update",icon:T.P.edit,click:()=>this.editSiteNameModal(),name:"Edit Site Name",canBePrimary:()=>!0,disable:()=>!1},a={permission:"update",icon:T.P.upload,click:()=>this.createBootstrapModal(),name:"Create Bootstrap Token",disable:()=>!1},d={permission:"update",icon:T.P.download,click:()=>this.importBootstrapModal(),name:"Import Bootstrap Token",disable:()=>this.peersExist};this.tableActions=[s,a,d]}ngOnInit(){this.subs.add(this.rbdMirroringService.startPolling()),this.subs.add(this.rbdMirroringService.subscribeSummary(t=>{this.status=t.content_data.status,this.siteName=t.site_name,this.peersExist=!!t.content_data.pools.find(o=>o.peer_uuids.length>0)}))}ngOnDestroy(){this.subs.unsubscribe()}editSiteNameModal(){this.modalRef=this.modalService.show(pi,{siteName:this.siteName})}createBootstrapModal(){this.modalRef=this.modalService.show(ii,{siteName:this.siteName})}importBootstrapModal(){this.modalRef=this.modalService.show(di,{siteName:this.siteName})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(K),e.Y36(re.Z))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-mirroring"]],decls:21,vars:4,consts:function(){let _,t,o,i;return _="Site Name:",t="Daemons",o="Pools",i="Images",[[1,"row"],[1,"col-md-12"],_,[1,"table-actions","float-right",3,"permission","selection","tableActions"],[1,"col-sm-6"],t,o,i]},template:function(t,o){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"span"),e.TgZ(3,"strong"),e.SDv(4,2),e.qZA(),e._uU(5),e.qZA(),e._UZ(6,"cd-table-actions",3),e.qZA(),e.qZA(),e.TgZ(7,"div",0),e.TgZ(8,"div",4),e.TgZ(9,"legend"),e.SDv(10,5),e.qZA(),e._UZ(11,"cd-mirroring-daemons"),e.qZA(),e.TgZ(12,"div",4),e.TgZ(13,"legend"),e.SDv(14,6),e.qZA(),e._UZ(15,"cd-mirroring-pools"),e.qZA(),e.qZA(),e.TgZ(16,"div",0),e.TgZ(17,"div",1),e.TgZ(18,"legend"),e.SDv(19,7),e.qZA(),e._UZ(20,"cd-mirroring-images"),e.qZA(),e.qZA()),2&t&&(e.xp6(5),e.hij(" ",o.siteName,""),e.xp6(1),e.Q6J("permission",o.permission)("selection",o.selection)("tableActions",o.tableActions))},directives:[Re.K,Ti,Li,Hi],styles:[""]}),n})();var Tt=p(80226),ki=p(28049),Xi=p(43190),Ke=p(80842),et=p(30633),Fe=p(47557),Qi=p(28211);class zi{}var Pe=(()=>{return(n=Pe||(Pe={}))[n.V1=1]="V1",n[n.V2=2]="V2",Pe;var n})();class Ji{constructor(){this.features=[]}}class Yi{constructor(){this.features=[]}}class Ui extends class{}{constructor(){super(...arguments),this.features=[]}}class ji{constructor(){this.features=[]}}var ke=(()=>{return(n=ke||(ke={})).editing="editing",n.cloning="cloning",n.copying="copying",ke;var n})(),Wi=p(17932),e_=p(54555),t_=p(18372);function o_(n,_){if(1&n&&(e.TgZ(0,"div",9),e.TgZ(1,"label",56),e.SDv(2,57),e.ALo(3,"titlecase"),e.qZA(),e.TgZ(4,"div",12),e._UZ(5,"input",58),e._UZ(6,"hr"),e.qZA(),e.qZA()),2&n){const t=e.oxw(2);e.xp6(3),e.pQV(e.lcZ(3,1,t.action)),e.QtT(2)}}function n_(n,_){1&n&&(e.TgZ(0,"span",59),e.ynx(1),e.SDv(2,60),e.BQk(),e.qZA())}function i_(n,_){1&n&&(e.TgZ(0,"span",59),e.ynx(1),e.SDv(2,61),e.BQk(),e.qZA())}function __(n,_){1&n&&e._UZ(0,"input",62)}function s_(n,_){1&n&&(e.TgZ(0,"option",48),e.SDv(1,65),e.qZA()),2&n&&e.Q6J("ngValue",null)}function a_(n,_){1&n&&(e.TgZ(0,"option",48),e.SDv(1,66),e.qZA()),2&n&&e.Q6J("ngValue",null)}function r_(n,_){1&n&&(e.TgZ(0,"option",48),e.SDv(1,67),e.qZA()),2&n&&e.Q6J("ngValue",null)}function l_(n,_){if(1&n&&(e.TgZ(0,"option",68),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.Q6J("value",t.pool_name),e.xp6(1),e.Oqu(t.pool_name)}}function c_(n,_){if(1&n&&(e.TgZ(0,"select",63),e.YNc(1,s_,2,1,"option",64),e.YNc(2,a_,2,1,"option",64),e.YNc(3,r_,2,1,"option",64),e.YNc(4,l_,2,2,"option",44),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",null===t.pools),e.xp6(1),e.Q6J("ngIf",null!==t.pools&&0===t.pools.length),e.xp6(1),e.Q6J("ngIf",null!==t.pools&&t.pools.length>0),e.xp6(1),e.Q6J("ngForOf",t.pools)}}function d_(n,_){1&n&&(e.TgZ(0,"span",59),e.SDv(1,69),e.qZA())}const p_=function(n,_){return[n,_]};function g_(n,_){if(1&n&&(e.TgZ(0,"div",9),e.TgZ(1,"div",20),e._UZ(2,"i",70),e.qZA(),e.qZA()),2&n){const t=e.oxw(2);e.xp6(2),e.Q6J("ngClass",e.WLB(1,p_,t.icons.spinner,t.icons.spin))}}function u_(n,_){1&n&&e._UZ(0,"input",74)}function m_(n,_){1&n&&(e.TgZ(0,"option",48),e.SDv(1,76),e.qZA()),2&n&&e.Q6J("ngValue",null)}function T_(n,_){1&n&&(e.TgZ(0,"option",48),e.SDv(1,77),e.qZA()),2&n&&e.Q6J("ngValue",null)}function f_(n,_){1&n&&(e.TgZ(0,"option",48),e.SDv(1,78),e.qZA()),2&n&&e.Q6J("ngValue",null)}function C_(n,_){if(1&n&&(e.TgZ(0,"option",68),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t)}}function S_(n,_){if(1&n&&(e.TgZ(0,"select",75),e.YNc(1,m_,2,1,"option",64),e.YNc(2,T_,2,1,"option",64),e.YNc(3,f_,2,1,"option",64),e.YNc(4,C_,2,2,"option",44),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",null===t.pools),e.xp6(1),e.Q6J("ngIf",null!==t.pools&&0===t.pools.length),e.xp6(1),e.Q6J("ngIf",null!==t.pools&&t.pools.length>0),e.xp6(1),e.Q6J("ngForOf",t.namespaces)}}function E_(n,_){if(1&n&&(e.TgZ(0,"div",9),e.TgZ(1,"label",71),e._uU(2," Namespace "),e.qZA(),e.TgZ(3,"div",12),e.YNc(4,u_,1,0,"input",72),e.YNc(5,S_,5,4,"select",73),e.qZA(),e.qZA()),2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngIf","editing"===t.mode||!t.poolPermission.read),e.xp6(1),e.Q6J("ngIf","editing"!==t.mode&&t.poolPermission.read)}}function R_(n,_){1&n&&(e.TgZ(0,"cd-helper"),e.TgZ(1,"span"),e.SDv(2,79),e.qZA(),e.qZA())}function M_(n,_){1&n&&e._UZ(0,"input",85)}function O_(n,_){1&n&&(e.TgZ(0,"option",48),e.SDv(1,87),e.qZA()),2&n&&e.Q6J("ngValue",null)}function A_(n,_){1&n&&(e.TgZ(0,"option",48),e.SDv(1,88),e.qZA()),2&n&&e.Q6J("ngValue",null)}function h_(n,_){1&n&&(e.TgZ(0,"option",48),e._uU(1,"-- Select a data pool -- "),e.qZA()),2&n&&e.Q6J("ngValue",null)}function P_(n,_){if(1&n&&(e.TgZ(0,"option",68),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.Q6J("value",t.pool_name),e.xp6(1),e.Oqu(t.pool_name)}}function I_(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"select",86),e.NdJ("change",function(i){return e.CHM(t),e.oxw(3).onDataPoolChange(i.target.value)}),e.YNc(1,O_,2,1,"option",64),e.YNc(2,A_,2,1,"option",64),e.YNc(3,h_,2,1,"option",64),e.YNc(4,P_,2,2,"option",44),e.qZA()}if(2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",null===t.dataPools),e.xp6(1),e.Q6J("ngIf",null!==t.dataPools&&0===t.dataPools.length),e.xp6(1),e.Q6J("ngIf",null!==t.dataPools&&t.dataPools.length>0),e.xp6(1),e.Q6J("ngForOf",t.dataPools)}}function b_(n,_){1&n&&(e.TgZ(0,"span",59),e.SDv(1,89),e.qZA())}const Xe=function(n){return{required:n}};function N_(n,_){if(1&n&&(e.TgZ(0,"div",9),e.TgZ(1,"label",80),e.TgZ(2,"span",70),e.SDv(3,81),e.qZA(),e._UZ(4,"cd-helper",82),e.qZA(),e.TgZ(5,"div",12),e.YNc(6,M_,1,0,"input",83),e.YNc(7,I_,5,4,"select",84),e.YNc(8,b_,2,0,"span",14),e.qZA(),e.qZA()),2&n){e.oxw();const t=e.MAs(2),o=e.oxw();e.xp6(2),e.Q6J("ngClass",e.VKq(4,Xe,"editing"!==o.mode)),e.xp6(4),e.Q6J("ngIf","editing"===o.mode||!o.poolPermission.read),e.xp6(1),e.Q6J("ngIf","editing"!==o.mode&&o.poolPermission.read),e.xp6(1),e.Q6J("ngIf",o.rbdForm.showError("dataPool",t,"required"))}}function D_(n,_){1&n&&(e.TgZ(0,"span",59),e.SDv(1,90),e.qZA())}function v_(n,_){1&n&&(e.TgZ(0,"span",59),e.SDv(1,91),e.qZA())}function L_(n,_){if(1&n&&e._UZ(0,"cd-helper",95),2&n){const t=e.oxw().$implicit;e.s9C("html",t.helperHtml)}}function F_(n,_){if(1&n&&(e.TgZ(0,"div",21),e._UZ(1,"input",92),e.TgZ(2,"label",93),e._uU(3),e.qZA(),e.YNc(4,L_,1,1,"cd-helper",94),e.qZA()),2&n){const t=_.$implicit;e.xp6(1),e.s9C("id",t.key),e.s9C("name",t.key),e.s9C("formControlName",t.key),e.xp6(1),e.s9C("for",t.key),e.xp6(1),e.Oqu(t.desc),e.xp6(1),e.Q6J("ngIf",t.helperHtml)}}function $_(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"a",96),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).advancedEnabled=!0,!1}),e.SDv(1,97),e.qZA()}}function Z_(n,_){if(1&n&&(e.TgZ(0,"option",68),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t)}}function B_(n,_){if(1&n&&(e.TgZ(0,"option",68),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t)}}function G_(n,_){1&n&&(e.TgZ(0,"span",59),e.SDv(1,98),e.qZA())}function y_(n,_){1&n&&(e.TgZ(0,"span",59),e.SDv(1,99),e.qZA())}function x_(n,_){1&n&&(e.TgZ(0,"span",59),e.SDv(1,100),e.qZA())}function w_(n,_){1&n&&(e.TgZ(0,"span",59),e.SDv(1,101),e.qZA())}function q_(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"div",1),e.TgZ(1,"form",2,3),e.TgZ(3,"div",4),e.TgZ(4,"div",5),e.SDv(5,6),e.ALo(6,"titlecase"),e.ALo(7,"upperFirst"),e.qZA(),e.TgZ(8,"div",7),e.YNc(9,o_,7,3,"div",8),e.TgZ(10,"div",9),e.TgZ(11,"label",10),e.SDv(12,11),e.qZA(),e.TgZ(13,"div",12),e._UZ(14,"input",13),e.YNc(15,n_,3,0,"span",14),e.YNc(16,i_,3,0,"span",14),e.qZA(),e.qZA(),e.TgZ(17,"div",15),e.NdJ("change",function(i){return e.CHM(t),e.oxw().onPoolChange(i.target.value)}),e.TgZ(18,"label",16),e.SDv(19,17),e.qZA(),e.TgZ(20,"div",12),e.YNc(21,__,1,0,"input",18),e.YNc(22,c_,5,4,"select",19),e.YNc(23,d_,2,0,"span",14),e.qZA(),e.qZA(),e.YNc(24,g_,3,4,"div",8),e.YNc(25,E_,6,2,"div",8),e.TgZ(26,"div",9),e.TgZ(27,"div",20),e.TgZ(28,"div",21),e.TgZ(29,"input",22),e.NdJ("change",function(){return e.CHM(t),e.oxw().onUseDataPoolChange()}),e.qZA(),e.TgZ(30,"label",23),e.SDv(31,24),e.qZA(),e.YNc(32,R_,3,0,"cd-helper",25),e.qZA(),e.qZA(),e.qZA(),e.YNc(33,N_,9,6,"div",8),e.TgZ(34,"div",9),e.TgZ(35,"label",26),e.SDv(36,27),e.qZA(),e.TgZ(37,"div",12),e._UZ(38,"input",28),e.YNc(39,D_,2,0,"span",14),e.YNc(40,v_,2,0,"span",14),e.qZA(),e.qZA(),e.TgZ(41,"div",29),e.TgZ(42,"label",30),e.SDv(43,31),e.qZA(),e.TgZ(44,"div",12),e.YNc(45,F_,5,6,"div",32),e.qZA(),e.qZA(),e.TgZ(46,"div",33),e.TgZ(47,"div",34),e.YNc(48,$_,2,0,"a",35),e.qZA(),e.qZA(),e.TgZ(49,"div",36),e.TgZ(50,"legend",37),e.SDv(51,38),e.qZA(),e.TgZ(52,"div",39),e.TgZ(53,"h4",37),e.SDv(54,40),e.qZA(),e.TgZ(55,"div",9),e.TgZ(56,"label",41),e.SDv(57,42),e.qZA(),e.TgZ(58,"div",12),e.TgZ(59,"select",43),e.YNc(60,Z_,2,2,"option",44),e.qZA(),e.qZA(),e.qZA(),e.TgZ(61,"div",9),e.TgZ(62,"label",45),e.SDv(63,46),e.qZA(),e.TgZ(64,"div",12),e.TgZ(65,"select",47),e.TgZ(66,"option",48),e.SDv(67,49),e.qZA(),e.YNc(68,B_,2,2,"option",44),e.qZA(),e.YNc(69,G_,2,0,"span",14),e.YNc(70,y_,2,0,"span",14),e.qZA(),e.qZA(),e.TgZ(71,"div",9),e.TgZ(72,"label",50),e.SDv(73,51),e.qZA(),e.TgZ(74,"div",12),e._UZ(75,"input",52),e.YNc(76,x_,2,0,"span",14),e.YNc(77,w_,2,0,"span",14),e.qZA(),e.qZA(),e.qZA(),e.TgZ(78,"cd-rbd-configuration-form",53),e.NdJ("changes",function(i){return e.CHM(t),e.oxw().getDirtyConfigurationValues=i}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(79,"div",54),e.TgZ(80,"cd-form-button-panel",55),e.NdJ("submitActionEvent",function(){return e.CHM(t),e.oxw().submit()}),e.ALo(81,"titlecase"),e.ALo(82,"upperFirst"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.MAs(2),o=e.oxw();e.xp6(1),e.Q6J("formGroup",o.rbdForm),e.xp6(6),e.pQV(e.lcZ(6,32,o.action))(e.lcZ(7,34,o.resource)),e.QtT(5),e.xp6(2),e.Q6J("ngIf",o.rbdForm.getValue("parent")),e.xp6(6),e.Q6J("ngIf",o.rbdForm.showError("name",t,"required")),e.xp6(1),e.Q6J("ngIf",o.rbdForm.showError("name",t,"pattern")),e.xp6(2),e.Q6J("ngClass",e.VKq(40,Xe,"editing"!==o.mode)),e.xp6(3),e.Q6J("ngIf","editing"===o.mode||!o.poolPermission.read),e.xp6(1),e.Q6J("ngIf","editing"!==o.mode&&o.poolPermission.read),e.xp6(1),e.Q6J("ngIf",o.rbdForm.showError("pool",t,"required")),e.xp6(1),e.Q6J("ngIf","editing"!==o.mode&&o.rbdForm.getValue("pool")&&null===o.namespaces),e.xp6(1),e.Q6J("ngIf","editing"===o.mode&&o.rbdForm.getValue("namespace")||"editing"!==o.mode&&(o.namespaces&&o.namespaces.length>0||!o.poolPermission.read)),e.xp6(7),e.Q6J("ngIf",o.allDataPools.length<=1),e.xp6(1),e.Q6J("ngIf",o.rbdForm.getValue("useDataPool")),e.xp6(6),e.Q6J("ngIf",o.rbdForm.showError("size",t,"required")),e.xp6(1),e.Q6J("ngIf",o.rbdForm.showError("size",t,"invalidSizeObject")),e.xp6(5),e.Q6J("ngForOf",o.featuresList),e.xp6(3),e.Q6J("ngIf",!o.advancedEnabled),e.xp6(1),e.Q6J("hidden",!o.advancedEnabled),e.xp6(11),e.Q6J("ngForOf",o.objectSizes),e.xp6(2),e.Q6J("ngClass",e.VKq(42,Xe,o.rbdForm.getValue("stripingCount"))),e.xp6(4),e.Q6J("ngValue",null),e.xp6(2),e.Q6J("ngForOf",o.objectSizes),e.xp6(1),e.Q6J("ngIf",o.rbdForm.showError("stripingUnit",t,"required")),e.xp6(1),e.Q6J("ngIf",o.rbdForm.showError("stripingUnit",t,"invalidStripingUnit")),e.xp6(2),e.Q6J("ngClass",e.VKq(44,Xe,o.rbdForm.getValue("stripingUnit"))),e.xp6(4),e.Q6J("ngIf",o.rbdForm.showError("stripingCount",t,"required")),e.xp6(1),e.Q6J("ngIf",o.rbdForm.showError("stripingCount",t,"min")),e.xp6(1),e.Q6J("form",o.rbdForm)("initializeData",o.initializeConfigData),e.xp6(2),e.Q6J("form",t)("submitText",e.lcZ(81,36,o.action)+" "+e.lcZ(82,38,o.resource))}}let $e=(()=>{class n extends q.E{constructor(t,o,i,s,a,d,c,u,S){super(),this.authStorageService=t,this.route=o,this.poolService=i,this.rbdService=s,this.formatter=a,this.taskWrapper=d,this.dimlessBinaryPipe=c,this.actionLabels=u,this.router=S,this.namespaces=[],this.namespacesByPoolCache={},this.pools=null,this.allPools=null,this.dataPools=null,this.allDataPools=[],this.featuresList=[],this.initializeConfigData=new Tt.t(1),this.advancedEnabled=!1,this.rbdFormMode=ke,this.defaultObjectSize="4 MiB",this.objectSizes=["4 KiB","8 KiB","16 KiB","32 KiB","64 KiB","128 KiB","256 KiB","512 KiB","1 MiB","2 MiB","4 MiB","8 MiB","16 MiB","32 MiB"],this.rbdImage=new Tt.t(1),this.icons=T.P,this.routerUrl=this.router.url,this.poolPermission=this.authStorageService.getPermissions().pool,this.resource="RBD",this.features={"deep-flatten":{desc:"Deep flatten",requires:null,allowEnable:!1,allowDisable:!0},layering:{desc:"Layering",requires:null,allowEnable:!1,allowDisable:!1},"exclusive-lock":{desc:"Exclusive lock",requires:null,allowEnable:!0,allowDisable:!0},"object-map":{desc:"Object map (requires exclusive-lock)",requires:"exclusive-lock",allowEnable:!0,allowDisable:!0,initDisabled:!0},journaling:{desc:"Journaling (requires exclusive-lock)",requires:"exclusive-lock",allowEnable:!0,allowDisable:!0,initDisabled:!0},"fast-diff":{desc:"Fast diff (interlocked with object-map)",requires:"object-map",allowEnable:!0,allowDisable:!0,interlockedWith:"object-map",initDisabled:!0}},this.featuresList=this.objToArray(this.features),this.createForm()}objToArray(t){return C().map(t,(o,i)=>Object.assign(o,{key:i}))}createForm(){this.rbdForm=new M.d({parent:new r.NI(""),name:new r.NI("",{validators:[r.kI.required,r.kI.pattern(/^[^@/]+?$/)]}),pool:new r.NI(null,{validators:[r.kI.required]}),namespace:new r.NI(null),useDataPool:new r.NI(!1),dataPool:new r.NI(null),size:new r.NI(null,{updateOn:"blur"}),obj_size:new r.NI(this.defaultObjectSize),features:new M.d(this.featuresList.reduce((t,o)=>(t[o.key]=new r.NI({value:!1,disabled:!!o.initDisabled}),t),{})),stripingUnit:new r.NI(null),stripingCount:new r.NI(null,{updateOn:"blur"})},this.validateRbdForm(this.formatter))}disableForEdit(){this.rbdForm.get("parent").disable(),this.rbdForm.get("pool").disable(),this.rbdForm.get("namespace").disable(),this.rbdForm.get("useDataPool").disable(),this.rbdForm.get("dataPool").disable(),this.rbdForm.get("obj_size").disable(),this.rbdForm.get("stripingUnit").disable(),this.rbdForm.get("stripingCount").disable(),this.rbdImage.subscribe(t=>{t.image_format===Pe.V1&&(this.rbdForm.get("deep-flatten").disable(),this.rbdForm.get("layering").disable(),this.rbdForm.get("exclusive-lock").disable())})}disableForClone(){this.rbdForm.get("parent").disable(),this.rbdForm.get("size").disable()}disableForCopy(){this.rbdForm.get("parent").disable(),this.rbdForm.get("size").disable()}ngOnInit(){this.prepareFormForAction(),this.gatherNeededData().subscribe(this.handleExternalData.bind(this))}prepareFormForAction(){const t=this.routerUrl;t.startsWith("/block/rbd/edit")?(this.mode=this.rbdFormMode.editing,this.action=this.actionLabels.EDIT,this.disableForEdit()):t.startsWith("/block/rbd/clone")?(this.mode=this.rbdFormMode.cloning,this.disableForClone(),this.action=this.actionLabels.CLONE):t.startsWith("/block/rbd/copy")?(this.mode=this.rbdFormMode.copying,this.action=this.actionLabels.COPY,this.disableForCopy()):this.action=this.actionLabels.CREATE,C().each(this.features,o=>{this.rbdForm.get("features").get(o.key).valueChanges.subscribe(i=>this.featureFormUpdate(o.key,i))})}gatherNeededData(){const t={};return this.mode?this.route.params.subscribe(o=>{const i=Z.N.fromString(decodeURIComponent(o.image_spec));o.snap&&(this.snapName=decodeURIComponent(o.snap)),t.rbd=this.rbdService.get(i)}):t.defaultFeatures=this.rbdService.defaultFeatures(),this.mode!==this.rbdFormMode.editing&&this.poolPermission.read&&(t.pools=this.poolService.list(["pool_name","type","flags_names","application_metadata"])),(0,W.D)(t)}handleExternalData(t){if(this.handlePoolData(t.pools),t.defaultFeatures&&this.setFeatures(t.defaultFeatures),t.rbd){const o=t.rbd;this.setResponse(o,this.snapName),this.rbdImage.next(o)}this.loadingReady()}handlePoolData(t){if(!t)return;const o=[],i=[];for(const s of t)this.rbdService.isRBDPool(s)&&("replicated"===s.type?(o.push(s),i.push(s)):"erasure"===s.type&&-1!==s.flags_names.indexOf("ec_overwrites")&&i.push(s));if(this.pools=o,this.allPools=o,this.dataPools=i,this.allDataPools=i,1===this.pools.length){const s=this.pools[0].pool_name;this.rbdForm.get("pool").setValue(s),this.onPoolChange(s)}this.allDataPools.length<=1&&this.rbdForm.get("useDataPool").disable()}onPoolChange(t){const o=this.rbdForm.get("dataPool");o.value===t&&o.setValue(null),this.dataPools=this.allDataPools?this.allDataPools.filter(i=>i.pool_name!==t):[],this.namespaces=null,t in this.namespacesByPoolCache?this.namespaces=this.namespacesByPoolCache[t]:this.rbdService.listNamespaces(t).subscribe(i=>{i=i.map(s=>s.namespace),this.namespacesByPoolCache[t]=i,this.namespaces=i}),this.rbdForm.get("namespace").setValue(null)}onUseDataPoolChange(){this.rbdForm.getValue("useDataPool")||(this.rbdForm.get("dataPool").setValue(null),this.onDataPoolChange(null))}onDataPoolChange(t){const o=this.allPools.filter(i=>i.pool_name!==t);this.rbdForm.getValue("pool")===t&&this.rbdForm.get("pool").setValue(null),this.pools=o}validateRbdForm(t){return o=>{const i=o.get("useDataPool"),s=o.get("dataPool");let a=null;i.value&&null==s.value&&(a={required:!0}),s.setErrors(a);const d=o.get("size"),c=o.get("obj_size"),u=t.toBytes(null!=c.value?c.value:this.defaultObjectSize),S=o.get("stripingCount"),N=null!=S.value?S.value:1;let P=null;null===d.value?P={required:!0}:N*u>t.toBytes(d.value)&&(P={invalidSizeObject:!0}),d.setErrors(P);const $=o.get("stripingUnit");let G=null;null===$.value&&null!==S.value?G={required:!0}:null!==$.value&&t.toBytes($.value)>u&&(G={invalidStripingUnit:!0}),$.setErrors(G);let X=null;return null===S.value&&null!==$.value?X={required:!0}:N<1&&(X={min:!0}),S.setErrors(X),null}}deepBoxCheck(t,o){this.getDependentChildFeatures(t).forEach(s=>{const a=this.rbdForm.get(s.key);o?a.enable({emitEvent:!1}):(a.disable({emitEvent:!1}),a.setValue(!1,{emitEvent:!1}),this.deepBoxCheck(s.key,o));const d=this.rbdForm.get("features");this.mode===this.rbdFormMode.editing&&d.get(s.key).enabled&&(-1!==this.response.features_name.indexOf(s.key)&&!s.allowDisable||-1===this.response.features_name.indexOf(s.key)&&!s.allowEnable)&&d.get(s.key).disable()})}getDependentChildFeatures(t){return C().filter(this.features,o=>o.requires===t)||[]}interlockCheck(t,o){const i=this.featuresList.find(s=>s.key===t);if(this.response){const s=null!=i.interlockedWith,a=this.featuresList.find(c=>c.interlockedWith===i.key),d=!!this.response.features_name.find(c=>c===i.key);if(s){if(d!==!!this.response.features_name.find(u=>u===i.interlockedWith))return}else if(a&&!!this.response.features_name.find(u=>u===a.key)!==d)return}o?C().filter(this.features,s=>s.interlockedWith===t).forEach(s=>this.rbdForm.get(s.key).setValue(!0,{emitEvent:!1})):i.interlockedWith&&this.rbdForm.get("features").get(i.interlockedWith).setValue(!1)}featureFormUpdate(t,o){if(o){const i=this.features[t].requires;if(i&&!this.rbdForm.getValue(i))return void this.rbdForm.get(`features.${t}`).setValue(!1)}this.deepBoxCheck(t,o),this.interlockCheck(t,o)}setFeatures(t){const o=this.rbdForm.get("features");C().forIn(this.features,i=>{-1!==t.indexOf(i.key)&&o.get(i.key).setValue(!0),this.featureFormUpdate(i.key,o.get(i.key).value)})}setResponse(t,o){this.response=t;const i=new Z.N(t.pool_name,t.namespace,t.name).toString();if(this.mode===this.rbdFormMode.cloning)this.rbdForm.get("parent").setValue(`${i}@${o}`);else if(this.mode===this.rbdFormMode.copying)o?this.rbdForm.get("parent").setValue(`${i}@${o}`):this.rbdForm.get("parent").setValue(`${i}`);else if(t.parent){const s=t.parent;this.rbdForm.get("parent").setValue(`${s.pool_name}/${s.image_name}@${s.snap_name}`)}this.mode===this.rbdFormMode.editing&&this.rbdForm.get("name").setValue(t.name),this.rbdForm.get("pool").setValue(t.pool_name),this.onPoolChange(t.pool_name),this.rbdForm.get("namespace").setValue(t.namespace),t.data_pool&&(this.rbdForm.get("useDataPool").setValue(!0),this.rbdForm.get("dataPool").setValue(t.data_pool)),this.rbdForm.get("size").setValue(this.dimlessBinaryPipe.transform(t.size)),this.rbdForm.get("obj_size").setValue(this.dimlessBinaryPipe.transform(t.obj_size)),this.setFeatures(t.features_name),this.rbdForm.get("stripingUnit").setValue(this.dimlessBinaryPipe.transform(t.stripe_unit)),this.rbdForm.get("stripingCount").setValue(t.stripe_count),this.initializeConfigData.next({initialData:this.response.configuration,sourceType:et.h.image})}createRequest(){const t=new Ui;return t.pool_name=this.rbdForm.getValue("pool"),t.namespace=this.rbdForm.getValue("namespace"),t.name=this.rbdForm.getValue("name"),t.size=this.formatter.toBytes(this.rbdForm.getValue("size")),this.addObjectSizeAndStripingToRequest(t),t.configuration=this.getDirtyConfigurationValues(),t}addObjectSizeAndStripingToRequest(t){t.obj_size=this.formatter.toBytes(this.rbdForm.getValue("obj_size")),C().forIn(this.features,o=>{this.rbdForm.getValue(o.key)&&t.features.push(o.key)}),t.stripe_unit=this.formatter.toBytes(this.rbdForm.getValue("stripingUnit")),t.stripe_count=this.rbdForm.getValue("stripingCount"),t.data_pool=this.rbdForm.getValue("dataPool")}createAction(){const t=this.createRequest();return this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/create",{pool_name:t.pool_name,namespace:t.namespace,image_name:t.name}),call:this.rbdService.create(t)})}editRequest(){const t=new ji;return t.name=this.rbdForm.getValue("name"),t.size=this.formatter.toBytes(this.rbdForm.getValue("size")),C().forIn(this.features,o=>{this.rbdForm.getValue(o.key)&&t.features.push(o.key)}),t.configuration=this.getDirtyConfigurationValues(),t}cloneRequest(){const t=new Ji;return t.child_pool_name=this.rbdForm.getValue("pool"),t.child_namespace=this.rbdForm.getValue("namespace"),t.child_image_name=this.rbdForm.getValue("name"),this.addObjectSizeAndStripingToRequest(t),t.configuration=this.getDirtyConfigurationValues(!0,et.h.image),t}editAction(){const t=new Z.N(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/edit",{image_spec:t.toString()}),call:this.rbdService.update(t,this.editRequest())})}cloneAction(){const t=this.cloneRequest(),o=new Z.N(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/clone",{parent_image_spec:o.toString(),parent_snap_name:this.snapName,child_pool_name:t.child_pool_name,child_namespace:t.child_namespace,child_image_name:t.child_image_name}),call:this.rbdService.cloneSnapshot(o,this.snapName,t)})}copyRequest(){const t=new Yi;return this.snapName&&(t.snapshot_name=this.snapName),t.dest_pool_name=this.rbdForm.getValue("pool"),t.dest_namespace=this.rbdForm.getValue("namespace"),t.dest_image_name=this.rbdForm.getValue("name"),this.addObjectSizeAndStripingToRequest(t),t.configuration=this.getDirtyConfigurationValues(!0,et.h.image),t}copyAction(){const t=this.copyRequest(),o=new Z.N(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/copy",{src_image_spec:o.toString(),dest_pool_name:t.dest_pool_name,dest_namespace:t.dest_namespace,dest_image_name:t.dest_image_name}),call:this.rbdService.copy(o,t)})}submit(){this.mode||this.rbdImage.next("create"),this.rbdImage.pipe((0,ki.P)(),(0,Xi.w)(()=>this.mode===this.rbdFormMode.editing?this.editAction():this.mode===this.rbdFormMode.cloning?this.cloneAction():this.mode===this.rbdFormMode.copying?this.copyAction():this.createAction())).subscribe(()=>{},()=>this.rbdForm.setErrors({cdSubmitButton:!0}),()=>this.router.navigate(["/block/rbd"]))}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(m.gz),e.Y36(Ke.q),e.Y36(x),e.Y36(Qi.H),e.Y36(Q.P),e.Y36(Fe.$),e.Y36(D.p4),e.Y36(m.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-form"]],features:[e.qOj],decls:1,vars:1,consts:function(){let _,t,o,i,s,a,d,c,u,S,N,P,$,G,X,J,te,A,w,de,pe,ge,ue,me,Te,fe,Ce,Se,y,Ze,Be,Ge,ye,xe,we,qe;return _="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",o="Pool",i="Use a dedicated data pool",s="Size",a="e.g., 10GiB",d="Features",c="Advanced",u="Striping",S="Object size",N="Stripe unit",P="-- Select stripe unit --",$="Stripe count",G="" + "\ufffd0\ufffd" + " from",X="This field is required.",J="'/' and '@' are not allowed.",te="Loading...",A="-- No rbd pools available --",w="-- Select a pool --",de="This field is required.",pe="Loading...",ge="-- No namespaces available --",ue="-- Select a namespace --",me="You need more than one pool with the rbd application label use to use a dedicated data pool.",Te="Data pool",fe="Dedicated pool that stores the object-data of the RBD.",Ce="Loading...",Se="-- No data pools available --",y="This field is required.",Ze="This field is required.",Be="You have to increase the size.",Ge="Advanced...",ye="This field is required because stripe count is defined!",xe="Stripe unit is greater than object size.",we="This field is required because stripe unit is defined!",qe="Stripe count must be greater than 0.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","rbdForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],_,[1,"card-body"],["class","form-group row",4,"ngIf"],[1,"form-group","row"],["for","name",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["type","text","placeholder","Name...","id","name","name","name","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"form-group","row",3,"change"],["for","pool",1,"cd-col-form-label",3,"ngClass"],o,["class","form-control","type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",4,"ngIf"],["id","pool","name","pool","class","form-control custom-select","formControlName","pool",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","useDataPool","name","useDataPool","formControlName","useDataPool",1,"custom-control-input",3,"change"],["for","useDataPool",1,"custom-control-label"],i,[4,"ngIf"],["for","size",1,"cd-col-form-label","required"],s,["id","size","name","size","type","text","formControlName","size","placeholder",a,"defaultUnit","GiB","cdDimlessBinary","",1,"form-control"],["formGroupName","features",1,"form-group","row"],["for","features",1,"cd-col-form-label"],d,["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"row"],[1,"col-sm-12"],["class","float-right margin-right-md","href","",3,"click",4,"ngIf"],[3,"hidden"],[1,"cd-header"],c,[1,"col-md-12"],u,["for","size",1,"cd-col-form-label"],S,["id","obj_size","name","obj_size","formControlName","obj_size",1,"form-control","custom-select"],[3,"value",4,"ngFor","ngForOf"],["for","stripingUnit",1,"cd-col-form-label",3,"ngClass"],N,["id","stripingUnit","name","stripingUnit","formControlName","stripingUnit",1,"form-control","custom-select"],[3,"ngValue"],P,["for","stripingCount",1,"cd-col-form-label",3,"ngClass"],$,["id","stripingCount","name","stripingCount","formControlName","stripingCount","type","number",1,"form-control"],[3,"form","initializeData","changes"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],["for","name",1,"cd-col-form-label"],G,["type","text","id","parent","name","parent","formControlName","parent",1,"form-control"],[1,"invalid-feedback"],X,J,["type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",1,"form-control"],["id","pool","name","pool","formControlName","pool",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],te,A,w,[3,"value"],de,[3,"ngClass"],["for","pool",1,"cd-col-form-label"],["class","form-control","type","text","placeholder","Namespace...","id","namespace","name","namespace","formControlName","namespace",4,"ngIf"],["id","namespace","name","namespace","class","form-control custom-select","formControlName","namespace",4,"ngIf"],["type","text","placeholder","Namespace...","id","namespace","name","namespace","formControlName","namespace",1,"form-control"],["id","namespace","name","namespace","formControlName","namespace",1,"form-control","custom-select"],pe,ge,ue,me,["for","dataPool",1,"cd-col-form-label"],Te,["html",fe],["class","form-control","type","text","placeholder","Data pool name...","id","dataPool","name","dataPool","formControlName","dataPool",4,"ngIf"],["id","dataPool","name","dataPool","class","form-control custom-select","formControlName","dataPool",3,"change",4,"ngIf"],["type","text","placeholder","Data pool name...","id","dataPool","name","dataPool","formControlName","dataPool",1,"form-control"],["id","dataPool","name","dataPool","formControlName","dataPool",1,"form-control","custom-select",3,"change"],Ce,Se,y,Ze,Be,["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],[3,"html",4,"ngIf"],[3,"html"],["href","",1,"float-right","margin-right-md",3,"click"],Ge,ye,xe,we,qe]},template:function(t,o){1&t&&e.YNc(0,q_,83,46,"div",0),2&t&&e.Q6J("cdFormLoading",o.loading)},directives:[st.y,r._Y,r.JL,r.sg,v.V,l.O5,g.P,f.o,r.Fj,h.b,r.JJ,r.u,le.U,l.mk,r.Wl,Wi.Q,r.x0,l.sg,r.EJ,r.YN,r.Kr,r.wV,e_.d,O.p,t_.S],pipes:[l.rS,Ye.m],styles:[""]}),n})();var ft=p(36169),ce=p(91801),tt=p(51847),H_=p(16738),Me=p.n(H_),ot=p(62862),K_=p(52266);function k_(n,_){1&n&&(e.TgZ(0,"div",18),e.TgZ(1,"span"),e.SDv(2,19),e.qZA(),e.qZA())}function X_(n,_){1&n&&(e.TgZ(0,"span",20),e.SDv(1,21),e.qZA())}function Q_(n,_){1&n&&(e.TgZ(0,"span",20),e.SDv(1,22),e.qZA())}function z_(n,_){if(1&n&&e._UZ(0,"cd-date-time-picker",23),2&n){const t=e.oxw();e.Q6J("control",t.moveForm.get("expiresAt"))}}let J_=(()=>{class n{constructor(t,o,i,s,a){this.rbdService=t,this.activeModal=o,this.actionLabels=i,this.fb=s,this.taskWrapper=a,this.createForm()}createForm(){this.moveForm=this.fb.group({expiresAt:["",[B.h.custom("format",t=>!(""===t||Me()(t,"YYYY-MM-DD HH:mm:ss").isValid())),B.h.custom("expired",t=>Me()().isAfter(t))]]})}ngOnInit(){this.imageSpec=new Z.N(this.poolName,this.namespace,this.imageName),this.imageSpecStr=this.imageSpec.toString(),this.pattern=`${this.poolName}/${this.imageName}`}moveImage(){let t=0;const o=this.moveForm.getValue("expiresAt");o&&(t=Me()(o,"YYYY-MM-DD HH:mm:ss").diff(Me()(),"seconds",!0)),t<0&&(t=0),this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/trash/move",{image_spec:this.imageSpecStr}),call:this.rbdService.moveTrash(this.imageSpec,t)}).subscribe({complete:()=>{this.activeModal.close()}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(x),e.Y36(I.Kz),e.Y36(D.p4),e.Y36(ot.O),e.Y36(Q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-trash-move-modal"]],decls:23,vars:9,consts:function(){let _,t,o,i,s,a,d;return _="Move an image to trash",t="To move " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "" + "\ufffd0\ufffd" + "" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + " to trash, click " + "[\ufffd#10\ufffd|\ufffd#11\ufffd]" + "Move" + "[\ufffd/#10\ufffd|\ufffd/#11\ufffd]" + ". Optionally, you can pick an expiration date.",t=e.Zx4(t),o="Protection expires at",i="NOT PROTECTED",s="This image contains snapshot(s), which will prevent it from being removed after moved to trash.",a="Wrong date format. Please use \"YYYY-MM-DD HH:mm:ss\".",d="Protection has already expired. Please pick a future date or leave it empty.",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","moveForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],["class","alert alert-warning","role","alert",4,"ngIf"],t,[1,"form-group"],["for","expiresAt",1,"col-form-label"],o,["type","text","placeholder",i,"formControlName","expiresAt","triggers","manual",1,"form-control",3,"ngbPopover","click","keypress"],["p","ngbPopover"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["popContent",""],["role","alert",1,"alert","alert-warning"],s,[1,"invalid-feedback"],a,d,[3,"control"]]},template:function(t,o){if(1&t){const i=e.EpF();e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.BQk(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.YNc(7,k_,3,0,"div",7),e.TgZ(8,"p"),e.tHW(9,8),e._UZ(10,"kbd"),e._UZ(11,"kbd"),e.N_p(),e.qZA(),e.TgZ(12,"div",9),e.TgZ(13,"label",10),e.SDv(14,11),e.qZA(),e.TgZ(15,"input",12,13),e.NdJ("click",function(){return e.CHM(i),e.MAs(16).open()})("keypress",function(){return e.CHM(i),e.MAs(16).close()}),e.qZA(),e.YNc(17,X_,2,0,"span",14),e.YNc(18,Q_,2,0,"span",14),e.qZA(),e.qZA(),e.TgZ(19,"div",15),e.TgZ(20,"cd-form-button-panel",16),e.NdJ("submitActionEvent",function(){return o.moveImage()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA(),e.YNc(21,z_,1,1,"ng-template",null,17,e.W1O)}if(2&t){const i=e.MAs(5),s=e.MAs(22);e.Q6J("modalRef",o.activeModal),e.xp6(4),e.Q6J("formGroup",o.moveForm),e.xp6(3),e.Q6J("ngIf",o.hasSnapshots),e.xp6(4),e.pQV(o.imageSpecStr),e.QtT(9),e.xp6(4),e.Q6J("ngbPopover",s),e.xp6(2),e.Q6J("ngIf",o.moveForm.showError("expiresAt",i,"format")),e.xp6(1),e.Q6J("ngIf",o.moveForm.showError("expiresAt",i,"expired")),e.xp6(2),e.Q6J("form",o.moveForm)("submitText",o.actionLabels.MOVE)}},directives:[R.z,r._Y,r.JL,r.sg,v.V,l.O5,g.P,f.o,r.Fj,h.b,r.JJ,r.u,I.o8,O.p,K_.J],styles:[""]}),n})();function Y_(n,_){1&n&&(e.TgZ(0,"li",10),e.TgZ(1,"a",3),e.SDv(2,11),e.qZA(),e.qZA())}let Qe=(()=>{class n{constructor(t,o){this.authStorageService=t,this.router=o,this.grafanaPermission=this.authStorageService.getPermissions().grafana}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(m.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-tabs"]],decls:12,vars:2,consts:function(){let _,t,o,i;return _="Images",t="Namespaces",o="Trash",i="Overall Performance",[["ngbNav","",1,"nav-tabs",3,"activeId","navChange"],["nav","ngbNav"],["ngbNavItem","/block/rbd"],["ngbNavLink",""],_,["ngbNavItem","/block/rbd/namespaces"],t,["ngbNavItem","/block/rbd/trash"],o,["ngbNavItem","/block/rbd/performance",4,"ngIf"],["ngbNavItem","/block/rbd/performance"],i]},template:function(t,o){1&t&&(e.TgZ(0,"ul",0,1),e.NdJ("navChange",function(s){return o.router.navigate([s.nextId])}),e.TgZ(2,"li",2),e.TgZ(3,"a",3),e.SDv(4,4),e.qZA(),e.qZA(),e.TgZ(5,"li",5),e.TgZ(6,"a",3),e.SDv(7,6),e.qZA(),e.qZA(),e.TgZ(8,"li",7),e.TgZ(9,"a",3),e.SDv(10,8),e.qZA(),e.qZA(),e.YNc(11,Y_,3,0,"li",9),e.qZA()),2&t&&(e.Q6J("activeId",o.router.url),e.xp6(11),e.Q6J("ngIf",o.grafanaPermission.read))},directives:[I.Pz,I.nv,I.Vx,l.O5],styles:[""]}),n})();var V_=p(25917),Ct=p(51295),nt=p(60737),U_=p(74255),St=p(71099),Et=p(79765);function j_(n,_){1&n&&(e.TgZ(0,"span",15),e.SDv(1,16),e.qZA())}let W_=(()=>{class n{constructor(t,o,i,s,a){this.activeModal=t,this.rbdService=o,this.taskManagerService=i,this.notificationService=s,this.actionLabels=a,this.editing=!1,this.onSubmit=new Et.xQ,this.action=this.actionLabels.CREATE,this.resource="RBD Snapshot",this.createForm()}createForm(){this.snapshotForm=new M.d({snapshotName:new r.NI("",{validators:[r.kI.required]})})}setSnapName(t){this.snapName=t,this.snapshotForm.get("snapshotName").setValue(t)}setEditing(t=!0){this.editing=t,this.action=this.editing?this.actionLabels.RENAME:this.actionLabels.CREATE}editAction(){const t=this.snapshotForm.getValue("snapshotName"),o=new Z.N(this.poolName,this.namespace,this.imageName),i=new F.R;i.name="rbd/snap/edit",i.metadata={image_spec:o.toString(),snapshot_name:t},this.rbdService.renameSnapshot(o,this.snapName,t).toPromise().then(()=>{this.taskManagerService.subscribe(i.name,i.metadata,s=>{this.notificationService.notifyTask(s)}),this.activeModal.close(),this.onSubmit.next(this.snapName)}).catch(()=>{this.snapshotForm.setErrors({cdSubmitButton:!0})})}createAction(){const t=this.snapshotForm.getValue("snapshotName"),o=new Z.N(this.poolName,this.namespace,this.imageName),i=new F.R;i.name="rbd/snap/create",i.metadata={image_spec:o.toString(),snapshot_name:t},this.rbdService.createSnapshot(o,t).toPromise().then(()=>{this.taskManagerService.subscribe(i.name,i.metadata,s=>{this.notificationService.notifyTask(s)}),this.activeModal.close(),this.onSubmit.next(t)}).catch(()=>{this.snapshotForm.setErrors({cdSubmitButton:!0})})}submit(){this.editing?this.editAction():this.createAction()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(I.Kz),e.Y36(x),e.Y36(St.k),e.Y36(Le.g),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-snapshot-form-modal"]],decls:19,vars:15,consts:function(){let _,t,o;return _="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",o="This field is required.",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","snapshotForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","snapshotName",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["type","text","placeholder","Snapshot name...","id","snapshotName","name","snapshotName","formControlName","snapshotName","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],o]},template:function(t,o){if(1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.ALo(3,"titlecase"),e.ALo(4,"upperFirst"),e.BQk(),e.ynx(5,3),e.TgZ(6,"form",4,5),e.TgZ(8,"div",6),e.TgZ(9,"div",7),e.TgZ(10,"label",8),e.SDv(11,9),e.qZA(),e.TgZ(12,"div",10),e._UZ(13,"input",11),e.YNc(14,j_,2,0,"span",12),e.qZA(),e.qZA(),e.qZA(),e.TgZ(15,"div",13),e.TgZ(16,"cd-form-button-panel",14),e.NdJ("submitActionEvent",function(){return o.submit()}),e.ALo(17,"titlecase"),e.ALo(18,"upperFirst"),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t){const i=e.MAs(7);e.Q6J("modalRef",o.activeModal),e.xp6(4),e.pQV(e.lcZ(3,7,o.action))(e.lcZ(4,9,o.resource)),e.QtT(2),e.xp6(2),e.Q6J("formGroup",o.snapshotForm),e.xp6(8),e.Q6J("ngIf",o.snapshotForm.showError("snapshotName",i,"required")),e.xp6(2),e.Q6J("form",o.snapshotForm)("submitText",e.lcZ(17,11,o.action)+" "+e.lcZ(18,13,o.resource))}},directives:[R.z,r._Y,r.JL,r.sg,v.V,g.P,f.o,r.Fj,h.b,r.JJ,r.u,le.U,l.O5,O.p],pipes:[l.rS,Ye.m],styles:[""]}),n})();class es{constructor(_,t,o){this.featuresName=t,this.cloneFormatVersion=1,o.cloneFormatVersion().subscribe(i=>{this.cloneFormatVersion=i}),this.create={permission:"create",icon:T.P.add,name:_.CREATE},this.rename={permission:"update",icon:T.P.edit,name:_.RENAME},this.protect={permission:"update",icon:T.P.lock,visible:i=>i.hasSingleSelection&&!i.first().is_protected,name:_.PROTECT},this.unprotect={permission:"update",icon:T.P.unlock,visible:i=>i.hasSingleSelection&&i.first().is_protected,name:_.UNPROTECT},this.clone={permission:"create",canBePrimary:i=>i.hasSingleSelection,disable:i=>this.getCloneDisableDesc(i,this.featuresName),icon:T.P.clone,name:_.CLONE},this.copy={permission:"create",canBePrimary:i=>i.hasSingleSelection,disable:i=>!i.hasSingleSelection||i.first().cdExecuting,icon:T.P.copy,name:_.COPY},this.rollback={permission:"update",icon:T.P.undo,name:_.ROLLBACK},this.deleteSnap={permission:"delete",icon:T.P.destroy,disable:i=>{const s=i.first();return!i.hasSingleSelection||s.cdExecuting||s.is_protected},name:_.DELETE},this.ordering=[this.create,this.rename,this.protect,this.unprotect,this.clone,this.copy,this.rollback,this.deleteSnap]}getCloneDisableDesc(_,t){return!(_.hasSingleSelection&&!_.first().cdExecuting)||((null==t?void 0:t.includes("layering"))?1===this.cloneFormatVersion&&!_.first().is_protected&&"Snapshot must be protected in order to clone.":"Parent image must support Layering")}}class ts{}var ze=p(96102);const os=["nameTpl"],ns=["rollbackTpl"];function is(n,_){if(1&n&&(e.ynx(0),e.SDv(1,3),e.BQk(),e.TgZ(2,"strong"),e._uU(3),e.qZA(),e._uU(4,".\n")),2&n){const t=_.$implicit;e.xp6(3),e.hij(" ",t.snapName,"")}}let _s=(()=>{class n{constructor(t,o,i,s,a,d,c,u,S,N,P){this.authStorageService=t,this.modalService=o,this.dimlessBinaryPipe=i,this.cdDatePipe=s,this.rbdService=a,this.taskManagerService=d,this.notificationService=c,this.summaryService=u,this.taskListService=S,this.actionLabels=N,this.cdr=P,this.snapshots=[],this.selection=new Ee.r,this.builders={"rbd/snap/create":$=>{const G=new ts;return G.name=$.snapshot_name,G}},this.permission=this.authStorageService.getPermissions().rbdImage}ngOnInit(){this.columns=[{name:"Name",prop:"name",cellTransformation:ve.e.executing,flexGrow:2},{name:"Size",prop:"size",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"Provisioned",prop:"disk_usage",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"State",prop:"is_protected",flexGrow:1,cellTransformation:ve.e.badge,customTemplateConfig:{map:{true:{value:"PROTECTED",class:"badge-success"},false:{value:"UNPROTECTED",class:"badge-info"}}}},{name:"Created",prop:"timestamp",flexGrow:1,pipe:this.cdDatePipe}],this.imageSpec=new Z.N(this.poolName,this.namespace,this.rbdName),this.rbdTableActions=new es(this.actionLabels,this.featuresName,this.rbdService),this.rbdTableActions.create.click=()=>this.openCreateSnapshotModal(),this.rbdTableActions.rename.click=()=>this.openEditSnapshotModal(),this.rbdTableActions.protect.click=()=>this.toggleProtection(),this.rbdTableActions.unprotect.click=()=>this.toggleProtection();const t=()=>this.selection.first()&&`${this.imageSpec.toStringEncoded()}/${encodeURIComponent(this.selection.first().name)}`;this.rbdTableActions.clone.routerLink=()=>`/block/rbd/clone/${t()}`,this.rbdTableActions.copy.routerLink=()=>`/block/rbd/copy/${t()}`,this.rbdTableActions.rollback.click=()=>this.rollbackModal(),this.rbdTableActions.deleteSnap.click=()=>this.deleteSnapshotModal(),this.tableActions=this.rbdTableActions.ordering,this.taskListService.init(()=>(0,V_.of)(this.snapshots),null,s=>{Ct.T.updateChanged(this,{data:s})&&(this.cdr.detectChanges(),this.data=[...this.data])},()=>{Ct.T.updateChanged(this,{data:this.snapshots})&&(this.cdr.detectChanges(),this.data=[...this.data])},s=>["rbd/snap/create","rbd/snap/delete","rbd/snap/edit","rbd/snap/rollback"].includes(s.name)&&this.imageSpec.toString()===s.metadata.image_spec,(s,a)=>s.name===a.metadata.snapshot_name,this.builders)}ngOnChanges(){this.columns&&(this.imageSpec=new Z.N(this.poolName,this.namespace,this.rbdName),this.rbdTableActions&&(this.rbdTableActions.featuresName=this.featuresName),this.taskListService.fetch())}openSnapshotModal(t,o=null){this.modalRef=this.modalService.show(W_),this.modalRef.componentInstance.poolName=this.poolName,this.modalRef.componentInstance.imageName=this.rbdName,this.modalRef.componentInstance.namespace=this.namespace,o?this.modalRef.componentInstance.setEditing():o=`${this.rbdName}_${Me()().toISOString(!0)}`,this.modalRef.componentInstance.setSnapName(o),this.modalRef.componentInstance.onSubmit.subscribe(i=>{const s=new nt.o;s.name=t,s.metadata={image_spec:this.imageSpec.toString(),snapshot_name:i},this.summaryService.addRunningTask(s)})}openCreateSnapshotModal(){this.openSnapshotModal("rbd/snap/create")}openEditSnapshotModal(){this.openSnapshotModal("rbd/snap/edit",this.selection.first().name)}toggleProtection(){const t=this.selection.first().name,o=this.selection.first().is_protected,i=new F.R;i.name="rbd/snap/edit";const s=new Z.N(this.poolName,this.namespace,this.rbdName);i.metadata={image_spec:s.toString(),snapshot_name:t},this.rbdService.protectSnapshot(s,t,!o).toPromise().then(()=>{const a=new nt.o;a.name=i.name,a.metadata=i.metadata,this.summaryService.addRunningTask(a),this.taskManagerService.subscribe(i.name,i.metadata,d=>{this.notificationService.notifyTask(d)})})}_asyncTask(t,o,i){const s=new F.R;s.name=o,s.metadata={image_spec:new Z.N(this.poolName,this.namespace,this.rbdName).toString(),snapshot_name:i};const a=new Z.N(this.poolName,this.namespace,this.rbdName);this.rbdService[t](a,i).toPromise().then(()=>{const d=new nt.o;d.name=s.name,d.metadata=s.metadata,this.summaryService.addRunningTask(d),this.modalRef.close(),this.taskManagerService.subscribe(d.name,d.metadata,c=>{this.notificationService.notifyTask(c)})}).catch(()=>{this.modalRef.componentInstance.stopLoadingSpinner()})}rollbackModal(){const t=this.selection.selected[0].name,o=new Z.N(this.poolName,this.namespace,this.rbdName).toString(),i={titleText:"RBD snapshot rollback",buttonText:"Rollback",bodyTpl:this.rollbackTpl,bodyData:{snapName:`${o}@${t}`},onSubmit:()=>{this._asyncTask("rollbackSnapshot","rbd/snap/rollback",t)}};this.modalRef=this.modalService.show(ft.Y,i)}deleteSnapshotModal(){const t=this.selection.selected[0].name;this.modalRef=this.modalService.show(he.M,{itemDescription:"RBD snapshot",itemNames:[t],submitAction:()=>this._asyncTask("deleteSnapshot","rbd/snap/delete",t)})}updateSelection(t){this.selection=t}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(re.Z),e.Y36(Fe.$),e.Y36(ze.N),e.Y36(x),e.Y36(St.k),e.Y36(Le.g),e.Y36(U_.J),e.Y36(se.j),e.Y36(D.p4),e.Y36(e.sBO))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-snapshot-list"]],viewQuery:function(t,o){if(1&t&&(e.Gf(os,5),e.Gf(ns,7)),2&t){let i;e.iGM(i=e.CRH())&&(o.nameTpl=i.first),e.iGM(i=e.CRH())&&(o.rollbackTpl=i.first)}},inputs:{snapshots:"snapshots",featuresName:"featuresName",poolName:"poolName",namespace:"namespace",rbdName:"rbdName"},features:[e._Bn([se.j]),e.TTD],decls:4,vars:5,consts:function(){let _;return _="You are about to rollback",[["columnMode","flex","selectionType","single",3,"data","columns","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["rollbackTpl",""],_]},template:function(t,o){1&t&&(e.TgZ(0,"cd-table",0),e.NdJ("updateSelection",function(s){return o.updateSelection(s)}),e._UZ(1,"cd-table-actions",1),e.qZA(),e.YNc(2,is,5,1,"ng-template",null,2,e.W1O)),2&t&&(e.Q6J("data",o.data)("columns",o.columns),e.xp6(1),e.Q6J("permission",o.permission)("selection",o.selection)("tableActions",o.tableActions))},directives:[ee.a,Re.K],styles:[""],changeDetection:0}),n})();var ss=p(71752),Rt=p(76317),as=p(41039);const rs=["poolConfigurationSourceTpl"];function ls(n,_){1&n&&(e.ynx(0),e.tHW(1,3),e._UZ(2,"strong"),e.N_p(),e.BQk())}function cs(n,_){if(1&n&&(e.TgZ(0,"span"),e.TgZ(1,"span",38),e._uU(2),e.qZA(),e.qZA()),2&n){const t=_.$implicit;e.xp6(2),e.Oqu(t)}}function ds(n,_){if(1&n&&(e.TgZ(0,"span"),e.TgZ(1,"span",39),e.SDv(2,40),e.qZA(),e.qZA()),2&n){e.oxw(3);const t=e.MAs(1);e.xp6(1),e.Q6J("ngbTooltip",t)}}function ps(n,_){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"dimlessBinary"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.hij(" ",e.lcZ(2,1,t.selection.disk_usage)," ")}}function gs(n,_){if(1&n&&(e.TgZ(0,"span"),e.TgZ(1,"span",39),e.SDv(2,41),e.qZA(),e.qZA()),2&n){e.oxw(3);const t=e.MAs(1);e.xp6(1),e.Q6J("ngbTooltip",t)}}function us(n,_){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"dimlessBinary"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.hij(" ",e.lcZ(2,1,t.selection.total_disk_usage)," ")}}function ms(n,_){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(4);e.xp6(1),e.hij("/",t.selection.parent.pool_namespace,"")}}function Ts(n,_){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.YNc(2,ms,2,1,"span",1),e._uU(3),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(t.selection.parent.pool_name),e.xp6(1),e.Q6J("ngIf",t.selection.parent.pool_namespace),e.xp6(1),e.AsE("/",t.selection.parent.image_name,"@",t.selection.parent.snap_name,"")}}function fs(n,_){1&n&&(e.TgZ(0,"span"),e._uU(1,"-"),e.qZA())}function Cs(n,_){if(1&n&&(e.TgZ(0,"table",17),e.TgZ(1,"tbody"),e.TgZ(2,"tr"),e.TgZ(3,"td",18),e.SDv(4,19),e.qZA(),e.TgZ(5,"td",20),e._uU(6),e.qZA(),e.qZA(),e.TgZ(7,"tr"),e.TgZ(8,"td",21),e.SDv(9,22),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.qZA(),e.qZA(),e.TgZ(12,"tr"),e.TgZ(13,"td",21),e.SDv(14,23),e.qZA(),e.TgZ(15,"td"),e._uU(16),e.ALo(17,"empty"),e.qZA(),e.qZA(),e.TgZ(18,"tr"),e.TgZ(19,"td",21),e.SDv(20,24),e.qZA(),e.TgZ(21,"td"),e._uU(22),e.ALo(23,"cdDate"),e.qZA(),e.qZA(),e.TgZ(24,"tr"),e.TgZ(25,"td",21),e.SDv(26,25),e.qZA(),e.TgZ(27,"td"),e._uU(28),e.ALo(29,"dimlessBinary"),e.qZA(),e.qZA(),e.TgZ(30,"tr"),e.TgZ(31,"td",21),e.SDv(32,26),e.qZA(),e.TgZ(33,"td"),e._uU(34),e.ALo(35,"dimless"),e.qZA(),e.qZA(),e.TgZ(36,"tr"),e.TgZ(37,"td",21),e.SDv(38,27),e.qZA(),e.TgZ(39,"td"),e._uU(40),e.ALo(41,"dimlessBinary"),e.qZA(),e.qZA(),e.TgZ(42,"tr"),e.TgZ(43,"td",21),e.SDv(44,28),e.qZA(),e.TgZ(45,"td"),e.YNc(46,cs,3,1,"span",29),e.qZA(),e.qZA(),e.TgZ(47,"tr"),e.TgZ(48,"td",21),e.SDv(49,30),e.qZA(),e.TgZ(50,"td"),e.YNc(51,ds,3,1,"span",1),e.YNc(52,ps,3,3,"span",1),e.qZA(),e.qZA(),e.TgZ(53,"tr"),e.TgZ(54,"td",21),e.SDv(55,31),e.qZA(),e.TgZ(56,"td"),e.YNc(57,gs,3,1,"span",1),e.YNc(58,us,3,3,"span",1),e.qZA(),e.qZA(),e.TgZ(59,"tr"),e.TgZ(60,"td",21),e.SDv(61,32),e.qZA(),e.TgZ(62,"td"),e._uU(63),e.ALo(64,"dimlessBinary"),e.qZA(),e.qZA(),e.TgZ(65,"tr"),e.TgZ(66,"td",21),e.SDv(67,33),e.qZA(),e.TgZ(68,"td"),e._uU(69),e.qZA(),e.qZA(),e.TgZ(70,"tr"),e.TgZ(71,"td",21),e.SDv(72,34),e.qZA(),e.TgZ(73,"td"),e.YNc(74,Ts,4,4,"span",1),e.YNc(75,fs,2,0,"span",1),e.qZA(),e.qZA(),e.TgZ(76,"tr"),e.TgZ(77,"td",21),e.SDv(78,35),e.qZA(),e.TgZ(79,"td"),e._uU(80),e.qZA(),e.qZA(),e.TgZ(81,"tr"),e.TgZ(82,"td",21),e.SDv(83,36),e.qZA(),e.TgZ(84,"td"),e._uU(85),e.qZA(),e.qZA(),e.TgZ(86,"tr"),e.TgZ(87,"td",21),e.SDv(88,37),e.qZA(),e.TgZ(89,"td"),e._uU(90),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw(2);e.xp6(6),e.Oqu(t.selection.name),e.xp6(5),e.Oqu(t.selection.pool_name),e.xp6(5),e.Oqu(e.lcZ(17,19,t.selection.data_pool)),e.xp6(6),e.Oqu(e.lcZ(23,21,t.selection.timestamp)),e.xp6(6),e.Oqu(e.lcZ(29,23,t.selection.size)),e.xp6(6),e.Oqu(e.lcZ(35,25,t.selection.num_objs)),e.xp6(6),e.Oqu(e.lcZ(41,27,t.selection.obj_size)),e.xp6(6),e.Q6J("ngForOf",t.selection.features_name),e.xp6(5),e.Q6J("ngIf",-1===(null==t.selection.features_name?null:t.selection.features_name.indexOf("fast-diff"))),e.xp6(1),e.Q6J("ngIf",-1!==(null==t.selection.features_name?null:t.selection.features_name.indexOf("fast-diff"))),e.xp6(5),e.Q6J("ngIf",-1===(null==t.selection.features_name?null:t.selection.features_name.indexOf("fast-diff"))),e.xp6(1),e.Q6J("ngIf",-1!==(null==t.selection.features_name?null:t.selection.features_name.indexOf("fast-diff"))),e.xp6(5),e.Oqu(e.lcZ(64,29,t.selection.stripe_unit)),e.xp6(6),e.Oqu(t.selection.stripe_count),e.xp6(5),e.Q6J("ngIf",t.selection.parent),e.xp6(1),e.Q6J("ngIf",!t.selection.parent),e.xp6(5),e.Oqu(t.selection.block_name_prefix),e.xp6(5),e.Oqu(t.selection.order),e.xp6(5),e.Oqu(t.selection.image_format)}}function Ss(n,_){if(1&n&&e._UZ(0,"cd-rbd-snapshot-list",42),2&n){const t=e.oxw(2);e.Q6J("snapshots",t.selection.snapshots)("featuresName",t.selection.features_name)("poolName",t.selection.pool_name)("namespace",t.selection.namespace)("rbdName",t.selection.name)}}function Es(n,_){if(1&n&&e._UZ(0,"cd-rbd-configuration-table",43),2&n){const t=e.oxw(2);e.Q6J("data",t.selection.configuration)}}function Rs(n,_){if(1&n&&e._UZ(0,"cd-grafana",44),2&n){const t=e.oxw(2);e.Q6J("grafanaPath",t.rbdDashboardUrl)}}function Ms(n,_){if(1&n&&(e.ynx(0),e.TgZ(1,"ul",4,5),e.TgZ(3,"li",6),e.TgZ(4,"a",7),e.SDv(5,8),e.qZA(),e.YNc(6,Cs,91,31,"ng-template",9),e.qZA(),e.TgZ(7,"li",10),e.TgZ(8,"a",7),e.SDv(9,11),e.qZA(),e.YNc(10,Ss,1,5,"ng-template",9),e.qZA(),e.TgZ(11,"li",12),e.TgZ(12,"a",7),e.SDv(13,13),e.qZA(),e.YNc(14,Es,1,1,"ng-template",9),e.qZA(),e.TgZ(15,"li",14),e.TgZ(16,"a",7),e.SDv(17,15),e.qZA(),e.YNc(18,Rs,1,1,"ng-template",9),e.qZA(),e.qZA(),e._UZ(19,"div",16),e.BQk()),2&n){const t=e.MAs(2);e.xp6(19),e.Q6J("ngbNavOutlet",t)}}function Os(n,_){1&n&&(e.ynx(0),e.TgZ(1,"cd-alert-panel",45),e.SDv(2,46),e.qZA(),e.BQk())}function As(n,_){1&n&&(e.ynx(0),e.TgZ(1,"strong",49),e.SDv(2,50),e.qZA(),e.BQk())}function hs(n,_){1&n&&(e.TgZ(0,"span",51),e.SDv(1,52),e.qZA())}function Ps(n,_){if(1&n&&(e.YNc(0,As,3,0,"ng-container",47),e.YNc(1,hs,2,0,"ng-template",null,48,e.W1O)),2&n){const t=_.value,o=e.MAs(2);e.Q6J("ngIf",+t)("ngIfElse",o)}}let Is=(()=>{class n{ngOnChanges(){this.selection&&(this.rbdDashboardUrl=`rbd-details?var-Pool=${this.selection.pool_name}&var-Image=${this.selection.name}`)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-details"]],viewQuery:function(t,o){if(1&t&&(e.Gf(rs,7),e.Gf(I.Pz,7)),2&t){let i;e.iGM(i=e.CRH())&&(o.poolConfigurationSourceTpl=i.first),e.iGM(i=e.CRH())&&(o.nav=i.first)}},inputs:{selection:"selection",images:"images"},features:[e.TTD],decls:6,vars:2,consts:function(){let _,t,o,i,s,a,d,c,u,S,N,P,$,G,X,J,te,A,w,de,pe,ge,ue,me,Te,fe,Ce,Se;return _="Only available for RBD images with " + "\ufffd#2\ufffd" + "fast-diff" + "\ufffd/#2\ufffd" + " enabled",t="Details",o="Snapshots",i="Configuration",s="Performance",a="Name",d="Pool",c="Data Pool",u="Created",S="Size",N="Objects",P="Object size",$="Features",G="Provisioned",X="Total provisioned",J="Striping unit",te="Striping count",A="Parent",w="Block name prefix",de="Order",pe="Format Version",ge="N/A",ue="N/A",me="Information can not be displayed for RBD in status 'Removing'.",Te="This setting overrides the global value",fe="Image",Ce="This is the global value. No value for this option has been set for this image.",Se="Global",[["usageNotAvailableTooltipTpl",""],[4,"ngIf"],["poolConfigurationSourceTpl",""],_,["ngbNav","","cdStatefulTab","rbd-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],t,["ngbNavContent",""],["ngbNavItem","snapshots"],o,["ngbNavItem","configuration"],i,["ngbNavItem","performance"],s,[3,"ngbNavOutlet"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],a,[1,"w-75"],[1,"bold"],d,c,u,S,N,P,$,[4,"ngFor","ngForOf"],G,X,J,te,A,w,de,pe,[1,"badge","badge-dark","mr-2"],["placement","top",1,"form-text","text-muted",3,"ngbTooltip"],ge,ue,[3,"snapshots","featuresName","poolName","namespace","rbdName"],[3,"data"],["uid","YhCYGcuZz","grafanaStyle","one",3,"grafanaPath"],["type","warning"],me,[4,"ngIf","ngIfElse"],["global",""],["ngbTooltip",Te],fe,["ngbTooltip",Ce],Se]},template:function(t,o){1&t&&(e.YNc(0,ls,3,0,"ng-template",null,0,e.W1O),e.YNc(2,Ms,20,1,"ng-container",1),e.YNc(3,Os,3,0,"ng-container",1),e.YNc(4,Ps,3,2,"ng-template",null,2,e.W1O)),2&t&&(e.xp6(2),e.Q6J("ngIf",o.selection&&"REMOVING"!==o.selection.source),e.xp6(1),e.Q6J("ngIf",o.selection&&"REMOVING"===o.selection.source))},directives:[l.O5,I.Pz,mt.m,I.nv,I.Vx,I.uN,I.tO,l.sg,I._L,_s,ss.P,Rt.F,pt.G],pipes:[as.W,ze.N,Fe.$,Ue.n],styles:[""]}),n})();const bs=["usageTpl"],Ns=["parentTpl"],Ds=["nameTpl"],vs=["flattenTpl"],Ls=["deleteTpl"],Fs=["removingStatTpl"],$s=["provisionedNotAvailableTooltipTpl"],Zs=["totalProvisionedNotAvailableTooltipTpl"];function Bs(n,_){1&n&&e._UZ(0,"div",11),2&n&&e.Q6J("innerHtml","Only available for RBD images with <strong>fast-diff</strong> enabled",e.oJD)}function Gs(n,_){if(1&n&&(e.TgZ(0,"span",14),e.SDv(1,15),e.qZA()),2&n){e.oxw(2);const t=e.MAs(6);e.Q6J("ngbTooltip",t)}}function ys(n,_){if(1&n&&(e.SDv(0,16),e.ALo(1,"dimlessBinary")),2&n){const t=e.oxw().row;e.xp6(1),e.pQV(e.lcZ(1,1,t.disk_usage)),e.QtT(0)}}function xs(n,_){if(1&n&&(e.YNc(0,Gs,2,1,"span",12),e.YNc(1,ys,2,3,"ng-template",null,13,e.W1O)),2&n){const t=_.row,o=e.MAs(2);e.Q6J("ngIf",null===t.disk_usage&&!t.features_name.includes("fast-diff"))("ngIfElse",o)}}function ws(n,_){if(1&n&&(e.TgZ(0,"span",14),e.SDv(1,18),e.qZA()),2&n){e.oxw(2);const t=e.MAs(6);e.Q6J("ngbTooltip",t)}}function qs(n,_){if(1&n&&(e.SDv(0,19),e.ALo(1,"dimlessBinary")),2&n){const t=e.oxw().row;e.xp6(1),e.pQV(e.lcZ(1,1,t.total_disk_usage)),e.QtT(0)}}function Hs(n,_){if(1&n&&(e.YNc(0,ws,2,1,"span",12),e.YNc(1,qs,2,3,"ng-template",null,17,e.W1O)),2&n){const t=_.row,o=e.MAs(2);e.Q6J("ngIf",null===t.total_disk_usage&&!t.features_name.includes("fast-diff"))("ngIfElse",o)}}function Ks(n,_){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2).value;e.xp6(1),e.hij("/",t.pool_namespace,"")}}function ks(n,_){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.YNc(2,Ks,2,1,"span",20),e._uU(3),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.Oqu(t.pool_name),e.xp6(1),e.Q6J("ngIf",t.pool_namespace),e.xp6(1),e.AsE("/",t.image_name,"@",t.snap_name,"")}}function Xs(n,_){1&n&&(e.TgZ(0,"span"),e._uU(1,"-"),e.qZA())}function Qs(n,_){if(1&n&&(e.YNc(0,ks,4,4,"span",20),e.YNc(1,Xs,2,0,"span",20)),2&n){const t=_.value;e.Q6J("ngIf",t),e.xp6(1),e.Q6J("ngIf",!t)}}function zs(n,_){if(1&n&&(e._uU(0," You are about to flatten "),e.TgZ(1,"strong"),e._uU(2),e.qZA(),e._uU(3,". "),e._UZ(4,"br"),e._UZ(5,"br"),e._uU(6," All blocks will be copied from parent "),e.TgZ(7,"strong"),e._uU(8),e.qZA(),e._uU(9," to child "),e.TgZ(10,"strong"),e._uU(11),e.qZA(),e._uU(12,".\n")),2&n){const t=_.$implicit;e.xp6(2),e.Oqu(t.child),e.xp6(6),e.Oqu(t.parent),e.xp6(3),e.Oqu(t.child)}}function Js(n,_){if(1&n&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.xp6(1),e.Oqu(t)}}function Ys(n,_){if(1&n&&(e.ynx(0),e.TgZ(1,"span"),e.SDv(2,24),e.qZA(),e.TgZ(3,"ul"),e.YNc(4,Js,2,1,"li",25),e.qZA(),e.BQk()),2&n){const t=e.oxw(2).snapshots;e.xp6(4),e.Q6J("ngForOf",t)}}function Vs(n,_){if(1&n&&(e.TgZ(0,"div",22),e.TgZ(1,"span"),e.SDv(2,23),e.qZA(),e._UZ(3,"br"),e.YNc(4,Ys,5,1,"ng-container",20),e.qZA()),2&n){const t=e.oxw().snapshots;e.xp6(4),e.Q6J("ngIf",t.length>0)}}function Us(n,_){1&n&&e.YNc(0,Vs,5,1,"div",21),2&n&&e.Q6J("ngIf",_.hasSnapshots)}const js=function(n,_){return[n,_]};function Ws(n,_){if(1&n&&e._UZ(0,"i",27),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.WLB(1,js,t.icons.spinner,t.icons.spin))}}function ea(n,_){if(1&n&&(e.TgZ(0,"span",27),e._uU(1),e.qZA()),2&n){const t=e.oxw(),o=t.column,i=t.row;e.Q6J("ngClass",null!=o&&null!=o.customTemplateConfig&&o.customTemplateConfig.executingClass?o.customTemplateConfig.executingClass:"text-muted italic"),e.xp6(1),e.hij(" (",i.cdExecuting,") ")}}function ta(n,_){if(1&n&&e._UZ(0,"i",29),2&n){const t=e.oxw(2);e.Gre("",t.icons.warning," warn")}}function oa(n,_){if(1&n&&(e.YNc(0,Ws,1,4,"i",26),e.TgZ(1,"span",27),e._uU(2),e.qZA(),e.YNc(3,ea,2,2,"span",26),e.YNc(4,ta,1,3,"i",28)),2&n){const t=_.column,o=_.value,i=_.row;e.Q6J("ngIf",i.cdExecuting),e.xp6(1),e.Q6J("ngClass",null==t||null==t.customTemplateConfig?null:t.customTemplateConfig.valueClass),e.xp6(1),e.hij(" ",o," "),e.xp6(1),e.Q6J("ngIf",i.cdExecuting),e.xp6(1),e.Q6J("ngIf",i.source&&"REMOVING"===i.source)}}let ia=(()=>{class n extends lt.o{constructor(t,o,i,s,a,d,c,u,S){super(),this.authStorageService=t,this.rbdService=o,this.dimlessBinaryPipe=i,this.dimlessPipe=s,this.modalService=a,this.taskWrapper=d,this.taskListService=c,this.urlBuilder=u,this.actionLabels=S,this.tableStatus=new U.E,this.selection=new Ee.r,this.icons=T.P,this.builders={"rbd/create":A=>this.createRbdFromTask(A.pool_name,A.namespace,A.image_name),"rbd/delete":A=>this.createRbdFromTaskImageSpec(A.image_spec),"rbd/clone":A=>this.createRbdFromTask(A.child_pool_name,A.child_namespace,A.child_image_name),"rbd/copy":A=>this.createRbdFromTask(A.dest_pool_name,A.dest_namespace,A.dest_image_name)},this.permission=this.authStorageService.getPermissions().rbdImage;const N=()=>this.selection.first()&&new Z.N(this.selection.first().pool_name,this.selection.first().namespace,this.selection.first().name).toStringEncoded();this.tableActions=[{permission:"create",icon:T.P.add,routerLink:()=>this.urlBuilder.getCreate(),canBePrimary:A=>!A.hasSingleSelection,name:this.actionLabels.CREATE},{permission:"update",icon:T.P.edit,routerLink:()=>this.urlBuilder.getEdit(N()),name:this.actionLabels.EDIT,disable:A=>this.getRemovingStatusDesc(A)||this.getInvalidNameDisable(A)},{permission:"create",canBePrimary:A=>A.hasSingleSelection,disable:A=>this.getRemovingStatusDesc(A)||this.getInvalidNameDisable(A)||!!A.first().cdExecuting,icon:T.P.copy,routerLink:()=>`/block/rbd/copy/${N()}`,name:this.actionLabels.COPY},{permission:"update",disable:A=>this.getRemovingStatusDesc(A)||this.getInvalidNameDisable(A)||A.first().cdExecuting||!A.first().parent,icon:T.P.flatten,click:()=>this.flattenRbdModal(),name:this.actionLabels.FLATTEN},{permission:"delete",icon:T.P.destroy,click:()=>this.deleteRbdModal(),name:this.actionLabels.DELETE,disable:A=>this.getDeleteDisableDesc(A)},{permission:"delete",icon:T.P.trash,click:()=>this.trashRbdModal(),name:this.actionLabels.TRASH,disable:A=>this.getRemovingStatusDesc(A)||this.getInvalidNameDisable(A)||A.first().image_format===Pe.V1}]}createRbdFromTaskImageSpec(t){const o=Z.N.fromString(t);return this.createRbdFromTask(o.poolName,o.namespace,o.imageName)}createRbdFromTask(t,o,i){const s=new zi;return s.id="-1",s.unique_id="-1",s.name=i,s.namespace=o,s.pool_name=t,s.image_format=Pe.V2,s}ngOnInit(){this.columns=[{name:"Name",prop:"name",flexGrow:2,cellTemplate:this.removingStatTpl},{name:"Pool",prop:"pool_name",flexGrow:2},{name:"Namespace",prop:"namespace",flexGrow:2},{name:"Size",prop:"size",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"Objects",prop:"num_objs",flexGrow:1,cellClass:"text-right",pipe:this.dimlessPipe},{name:"Object size",prop:"obj_size",flexGrow:1,cellClass:"text-right",pipe:this.dimlessBinaryPipe},{name:"Provisioned",prop:"disk_usage",cellClass:"text-center",flexGrow:1,pipe:this.dimlessBinaryPipe,cellTemplate:this.provisionedNotAvailableTooltipTpl},{name:"Total provisioned",prop:"total_disk_usage",cellClass:"text-center",flexGrow:1,pipe:this.dimlessBinaryPipe,cellTemplate:this.totalProvisionedNotAvailableTooltipTpl},{name:"Parent",prop:"parent",flexGrow:2,cellTemplate:this.parentTpl}],this.taskListService.init(()=>this.rbdService.list(),i=>this.prepareResponse(i),i=>this.images=i,()=>this.onFetchError(),i=>["rbd/clone","rbd/copy","rbd/create","rbd/delete","rbd/edit","rbd/flatten","rbd/trash/move"].includes(i.name),(i,s)=>{let a;switch(s.name){case"rbd/copy":a=new Z.N(s.metadata.dest_pool_name,s.metadata.dest_namespace,s.metadata.dest_image_name).toString();break;case"rbd/clone":a=new Z.N(s.metadata.child_pool_name,s.metadata.child_namespace,s.metadata.child_image_name).toString();break;case"rbd/create":a=new Z.N(s.metadata.pool_name,s.metadata.namespace,s.metadata.image_name).toString();break;default:a=s.metadata.image_spec}return a===new Z.N(i.pool_name,i.namespace,i.name).toString()},this.builders)}onFetchError(){this.table.reset(),this.tableStatus=new U.E(ce.T.ValueException)}prepareResponse(t){let o=[];const i={};let s;if(t.forEach(a=>{C().isUndefined(i[a.status])&&(i[a.status]=[]),i[a.status].push(a.pool_name),o=o.concat(a.value)}),i[ce.T.ValueException]?s=ce.T.ValueException:i[ce.T.ValueStale]?s=ce.T.ValueStale:i[ce.T.ValueNone]&&(s=ce.T.ValueNone),s){const a=(i[s].length>1?"pools ":"pool ")+i[s].join();this.tableStatus=new U.E(s,a)}else this.tableStatus=new U.E;return o}updateSelection(t){this.selection=t}deleteRbdModal(){const t=this.selection.first().pool_name,o=this.selection.first().namespace,i=this.selection.first().name,s=new Z.N(t,o,i);this.modalRef=this.modalService.show(he.M,{itemDescription:"RBD",itemNames:[s],bodyTemplate:this.deleteTpl,bodyContext:{hasSnapshots:this.hasSnapshots(),snapshots:this.listProtectedSnapshots()},submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/delete",{image_spec:s.toString()}),call:this.rbdService.delete(s)})})}trashRbdModal(){const t={poolName:this.selection.first().pool_name,namespace:this.selection.first().namespace,imageName:this.selection.first().name,hasSnapshots:this.hasSnapshots()};this.modalRef=this.modalService.show(J_,t)}flattenRbd(t){this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/flatten",{image_spec:t.toString()}),call:this.rbdService.flatten(t)}).subscribe({complete:()=>{this.modalRef.close()}})}flattenRbdModal(){const t=this.selection.first().pool_name,o=this.selection.first().namespace,i=this.selection.first().name,s=this.selection.first().parent,a=new Z.N(s.pool_name,s.pool_namespace,s.image_name),d=new Z.N(t,o,i),c={titleText:"RBD flatten",buttonText:"Flatten",bodyTpl:this.flattenTpl,bodyData:{parent:`${a}@${s.snap_name}`,child:d.toString()},onSubmit:()=>{this.flattenRbd(d)}};this.modalRef=this.modalService.show(ft.Y,c)}hasSnapshots(){return(this.selection.first().snapshots||[]).length>0}hasClonedSnapshots(t){return(t.snapshots||[]).some(i=>i.children&&i.children.length>0)}listProtectedSnapshots(){return this.selection.first().snapshots.reduce((i,s)=>(s.is_protected&&i.push(s.name),i),[])}getDeleteDisableDesc(t){const o=t.first();return o&&this.hasClonedSnapshots(o)?"This RBD has cloned snapshots. Please delete related RBDs before deleting this RBD.":this.getInvalidNameDisable(t)||this.hasClonedSnapshots(t.first())}getInvalidNameDisable(t){var o;const i=t.first();return(null===(o=null==i?void 0:i.name)||void 0===o?void 0:o.match(/[@/]/))?"This RBD image has an invalid name and can't be managed by ceph.":!t.first()||!t.hasSingleSelection}getRemovingStatusDesc(t){const o=t.first();return"REMOVING"===(null==o?void 0:o.source)&&"Action not possible for an RBD in status 'Removing'"}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(x),e.Y36(Fe.$),e.Y36(Ue.n),e.Y36(re.Z),e.Y36(Q.P),e.Y36(se.j),e.Y36(tt.F),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-list"]],viewQuery:function(t,o){if(1&t&&(e.Gf(ee.a,7),e.Gf(bs,5),e.Gf(Ns,7),e.Gf(Ds,5),e.Gf(vs,7),e.Gf(Ls,7),e.Gf(Fs,7),e.Gf($s,7),e.Gf(Zs,7)),2&t){let i;e.iGM(i=e.CRH())&&(o.table=i.first),e.iGM(i=e.CRH())&&(o.usageTpl=i.first),e.iGM(i=e.CRH())&&(o.parentTpl=i.first),e.iGM(i=e.CRH())&&(o.nameTpl=i.first),e.iGM(i=e.CRH())&&(o.flattenTpl=i.first),e.iGM(i=e.CRH())&&(o.deleteTpl=i.first),e.iGM(i=e.CRH())&&(o.removingStatTpl=i.first),e.iGM(i=e.CRH())&&(o.provisionedNotAvailableTooltipTpl=i.first),e.iGM(i=e.CRH())&&(o.totalProvisionedNotAvailableTooltipTpl=i.first)}},features:[e._Bn([se.j,{provide:tt.F,useValue:new tt.F("block/rbd")}]),e.qOj],decls:19,vars:10,consts:function(){let _,t,o,i,s,a,d;return _="N/A",t="" + "\ufffd0\ufffd" + "",o="N/A",i="" + "\ufffd0\ufffd" + "",s="Deleting this image will also delete all its snapshots.",a="The following snapshots are currently protected and will be removed:",d="RBD in status 'Removing'",[["columnMode","flex","identifier","unique_id","forceIdentifier","true","selectionType","single",3,"data","columns","searchableObjects","hasDetails","status","autoReload","fetchData","setExpandedRow","updateSelection"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["usageNotAvailableTooltipTpl",""],["provisionedNotAvailableTooltipTpl",""],["totalProvisionedNotAvailableTooltipTpl",""],["parentTpl",""],["flattenTpl",""],["deleteTpl",""],["removingStatTpl",""],[3,"innerHtml"],["placement","top",3,"ngbTooltip",4,"ngIf","ngIfElse"],["provisioned",""],["placement","top",3,"ngbTooltip"],_,t,["totalProvisioned",""],o,i,[4,"ngIf"],["class","alert alert-warning","role","alert",4,"ngIf"],["role","alert",1,"alert","alert-warning"],s,a,[4,"ngFor","ngForOf"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],["title",d,3,"class",4,"ngIf"],["title",d]]},template:function(t,o){1&t&&(e._UZ(0,"cd-rbd-tabs"),e.TgZ(1,"cd-table",0,1),e.NdJ("fetchData",function(){return o.taskListService.fetch()})("setExpandedRow",function(s){return o.setExpandedRow(s)})("updateSelection",function(s){return o.updateSelection(s)}),e._UZ(3,"cd-table-actions",2),e._UZ(4,"cd-rbd-details",3),e.qZA(),e.YNc(5,Bs,1,1,"ng-template",null,4,e.W1O),e.YNc(7,xs,3,2,"ng-template",null,5,e.W1O),e.YNc(9,Hs,3,2,"ng-template",null,6,e.W1O),e.YNc(11,Qs,2,2,"ng-template",null,7,e.W1O),e.YNc(13,zs,13,3,"ng-template",null,8,e.W1O),e.YNc(15,Us,1,1,"ng-template",null,9,e.W1O),e.YNc(17,oa,5,5,"ng-template",null,10,e.W1O)),2&t&&(e.xp6(1),e.Q6J("data",o.images)("columns",o.columns)("searchableObjects",!0)("hasDetails",!0)("status",o.tableStatus)("autoReload",-1),e.xp6(2),e.Q6J("permission",o.permission)("selection",o.selection)("tableActions",o.tableActions),e.xp6(1),e.Q6J("selection",o.expandedRow))},directives:[Qe,ee.a,Re.K,Is,l.O5,I._L,l.sg,l.mk],pipes:[Fe.$],styles:[".warn[_ngcontent-%COMP%]{color:#ffc200}"]}),n})();function _a(n,_){1&n&&e._UZ(0,"input",19)}function sa(n,_){1&n&&(e.TgZ(0,"option",23),e.SDv(1,24),e.qZA()),2&n&&e.Q6J("ngValue",null)}function aa(n,_){1&n&&(e.TgZ(0,"option",23),e.SDv(1,25),e.qZA()),2&n&&e.Q6J("ngValue",null)}function ra(n,_){1&n&&(e.TgZ(0,"option",23),e.SDv(1,26),e.qZA()),2&n&&e.Q6J("ngValue",null)}function la(n,_){if(1&n&&(e.TgZ(0,"option",27),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.Q6J("value",t.pool_name),e.xp6(1),e.Oqu(t.pool_name)}}function ca(n,_){if(1&n&&(e.TgZ(0,"select",20),e.YNc(1,sa,2,1,"option",21),e.YNc(2,aa,2,1,"option",21),e.YNc(3,ra,2,1,"option",21),e.YNc(4,la,2,2,"option",22),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",null===t.pools),e.xp6(1),e.Q6J("ngIf",null!==t.pools&&0===t.pools.length),e.xp6(1),e.Q6J("ngIf",null!==t.pools&&t.pools.length>0),e.xp6(1),e.Q6J("ngForOf",t.pools)}}function da(n,_){1&n&&(e.TgZ(0,"span",28),e.SDv(1,29),e.qZA())}function pa(n,_){1&n&&(e.TgZ(0,"span",28),e.SDv(1,30),e.qZA())}function ga(n,_){1&n&&(e.TgZ(0,"span",28),e.SDv(1,31),e.qZA())}let ua=(()=>{class n{constructor(t,o,i,s,a,d){this.activeModal=t,this.actionLabels=o,this.authStorageService=i,this.notificationService=s,this.poolService=a,this.rbdService=d,this.pools=null,this.editing=!1,this.poolPermission=this.authStorageService.getPermissions().pool,this.createForm()}createForm(){this.namespaceForm=new M.d({pool:new r.NI(""),namespace:new r.NI("")},this.validator(),this.asyncValidator())}validator(){return t=>{const o=t.get("pool"),i=t.get("namespace");let s=null;o.value||(s={required:!0}),o.setErrors(s);let a=null;return i.value||(a={required:!0}),i.setErrors(a),null}}asyncValidator(){return t=>new Promise(o=>{const i=t.get("pool"),s=t.get("namespace");this.rbdService.listNamespaces(i.value).subscribe(a=>{if(a.some(d=>d.namespace===s.value)){const d={namespaceExists:!0};s.setErrors(d),o(d)}else o(null)})})}ngOnInit(){this.onSubmit=new Et.xQ,this.poolPermission.read&&this.poolService.list(["pool_name","type","application_metadata"]).then(t=>{const o=[];for(const i of t)this.rbdService.isRBDPool(i)&&"replicated"===i.type&&o.push(i);if(this.pools=o,1===this.pools.length){const i=this.pools[0].pool_name;this.namespaceForm.get("pool").setValue(i)}})}submit(){const t=this.namespaceForm.getValue("pool"),o=this.namespaceForm.getValue("namespace"),i=new F.R;i.name="rbd/namespace/create",i.metadata={pool:t,namespace:o},this.rbdService.createNamespace(t,o).toPromise().then(()=>{this.notificationService.show(Ve.k.success,"Created namespace '" + t + "/" + o + "'"),this.activeModal.close(),this.onSubmit.next()}).catch(()=>{this.namespaceForm.setErrors({cdSubmitButton:!0})})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(I.Kz),e.Y36(D.p4),e.Y36(oe.j),e.Y36(Le.g),e.Y36(Ke.q),e.Y36(x))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-namespace-form-modal"]],decls:23,vars:9,consts:function(){let _,t,o,i,s,a,d,c,u;return _="Create Namespace",t="Pool",o="Name",i="Loading...",s="-- No rbd pools available --",a="-- Select a pool --",d="This field is required.",c="This field is required.",u="Namespace already exists.",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","namespaceForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","pool",1,"cd-col-form-label","required"],t,[1,"cd-col-form-input"],["class","form-control","type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",4,"ngIf"],["id","pool","name","pool","class","form-control custom-select","formControlName","pool",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["for","namespace",1,"cd-col-form-label","required"],o,["type","text","placeholder","Namespace name...","id","namespace","name","namespace","formControlName","namespace","autofocus","",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",1,"form-control"],["id","pool","name","pool","formControlName","pool",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"ngValue"],i,s,a,[3,"value"],[1,"invalid-feedback"],d,c,u]},template:function(t,o){if(1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.BQk(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.TgZ(7,"div",7),e.TgZ(8,"label",8),e.SDv(9,9),e.qZA(),e.TgZ(10,"div",10),e.YNc(11,_a,1,0,"input",11),e.YNc(12,ca,5,4,"select",12),e.YNc(13,da,2,0,"span",13),e.qZA(),e.qZA(),e.TgZ(14,"div",7),e.TgZ(15,"label",14),e.SDv(16,15),e.qZA(),e.TgZ(17,"div",10),e._UZ(18,"input",16),e.YNc(19,pa,2,0,"span",13),e.YNc(20,ga,2,0,"span",13),e.qZA(),e.qZA(),e.qZA(),e.TgZ(21,"div",17),e.TgZ(22,"cd-form-button-panel",18),e.NdJ("submitActionEvent",function(){return o.submit()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t){const i=e.MAs(5);e.Q6J("modalRef",o.activeModal),e.xp6(4),e.Q6J("formGroup",o.namespaceForm),e.xp6(7),e.Q6J("ngIf",!o.poolPermission.read),e.xp6(1),e.Q6J("ngIf",o.poolPermission.read),e.xp6(1),e.Q6J("ngIf",o.namespaceForm.showError("pool",i,"required")),e.xp6(6),e.Q6J("ngIf",o.namespaceForm.showError("namespace",i,"required")),e.xp6(1),e.Q6J("ngIf",o.namespaceForm.showError("namespace",i,"namespaceExists")),e.xp6(2),e.Q6J("form",o.namespaceForm)("submitText",o.actionLabels.CREATE)}},directives:[R.z,r._Y,r.JL,r.sg,v.V,g.P,l.O5,f.o,r.Fj,h.b,r.JJ,r.u,le.U,O.p,r.EJ,l.sg,r.YN,r.Kr],styles:[""]}),n})(),ma=(()=>{class n{constructor(t,o,i,s,a,d){this.authStorageService=t,this.rbdService=o,this.poolService=i,this.modalService=s,this.notificationService=a,this.actionLabels=d,this.selection=new Ee.r,this.permission=this.authStorageService.getPermissions().rbdImage,this.tableActions=[{permission:"create",icon:T.P.add,click:()=>this.createModal(),name:this.actionLabels.CREATE},{permission:"delete",icon:T.P.destroy,click:()=>this.deleteModal(),name:this.actionLabels.DELETE,disable:()=>this.getDeleteDisableDesc()}]}ngOnInit(){this.columns=[{name:"Namespace",prop:"namespace",flexGrow:1},{name:"Pool",prop:"pool",flexGrow:1},{name:"Total images",prop:"num_images",flexGrow:1}],this.refresh()}refresh(){this.poolService.list(["pool_name","type","application_metadata"]).then(t=>{t=t.filter(i=>this.rbdService.isRBDPool(i)&&"replicated"===i.type);const o=[];t.forEach(i=>{o.push(this.rbdService.listNamespaces(i.pool_name))}),o.length>0?(0,W.D)(o).subscribe(i=>{const s=[];for(let a=0;a<i.length;a++){const c=t[a].pool_name;i[a].forEach(u=>{s.push({id:`${c}/${u.namespace}`,pool:c,namespace:u.namespace,num_images:u.num_images})})}this.namespaces=s}):this.namespaces=[]})}updateSelection(t){this.selection=t}createModal(){this.modalRef=this.modalService.show(ua),this.modalRef.componentInstance.onSubmit.subscribe(()=>{this.refresh()})}deleteModal(){const t=this.selection.first().pool,o=this.selection.first().namespace;this.modalRef=this.modalService.show(he.M,{itemDescription:"Namespace",itemNames:[`${t}/${o}`],submitAction:()=>this.rbdService.deleteNamespace(t,o).subscribe(()=>{this.notificationService.show(Ve.k.success,"Deleted namespace '" + t + "/" + o + "'"),this.modalRef.close(),this.refresh()},()=>{this.modalRef.componentInstance.stopLoadingSpinner()})})}getDeleteDisableDesc(){var t;const o=this.selection.first();return(null==o?void 0:o.num_images)>0?"Namespace contains images":!(null===(t=this.selection)||void 0===t?void 0:t.first())}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(x),e.Y36(Ke.q),e.Y36(re.Z),e.Y36(Le.g),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-namespace-list"]],features:[e._Bn([se.j])],decls:4,vars:5,consts:[["columnMode","flex","identifier","id","forceIdentifier","true","selectionType","single",3,"data","columns","fetchData","updateSelection"],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"]],template:function(t,o){1&t&&(e._UZ(0,"cd-rbd-tabs"),e.TgZ(1,"cd-table",0),e.NdJ("fetchData",function(){return o.refresh()})("updateSelection",function(s){return o.updateSelection(s)}),e.TgZ(2,"div",1),e._UZ(3,"cd-table-actions",2),e.qZA(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("data",o.namespaces)("columns",o.columns),e.xp6(2),e.Q6J("permission",o.permission)("selection",o.selection)("tableActions",o.tableActions))},directives:[Qe,ee.a,Re.K],styles:[""]}),n})(),Ta=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-performance"]],decls:2,vars:1,consts:[["uid","41FrpeUiz","grafanaStyle","two",3,"grafanaPath"]],template:function(t,o){1&t&&(e._UZ(0,"cd-rbd-tabs"),e._UZ(1,"cd-grafana",0)),2&t&&(e.xp6(1),e.Q6J("grafanaPath","rbd-overview?"))},directives:[Qe,Rt.F],styles:[""]}),n})();function fa(n,_){1&n&&e._UZ(0,"input",15)}function Ca(n,_){if(1&n&&(e.TgZ(0,"option",20),e._uU(1),e.qZA()),2&n){const t=_.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t)}}function Sa(n,_){if(1&n&&(e.TgZ(0,"select",16),e.TgZ(1,"option",17),e.SDv(2,18),e.qZA(),e.YNc(3,Ca,2,2,"option",19),e.qZA()),2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngForOf",t.pools)}}let Ea=(()=>{class n{constructor(t,o,i,s,a,d,c){this.authStorageService=t,this.rbdService=o,this.activeModal=i,this.actionLabels=s,this.fb=a,this.poolService=d,this.taskWrapper=c,this.poolPermission=this.authStorageService.getPermissions().pool}createForm(){this.purgeForm=this.fb.group({poolName:""})}ngOnInit(){this.poolPermission.read&&this.poolService.list(["pool_name","application_metadata"]).then(t=>{this.pools=t.filter(o=>o.application_metadata.includes("rbd")).map(o=>o.pool_name)}),this.createForm()}purge(){const t=this.purgeForm.getValue("poolName")||"";this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/trash/purge",{pool_name:t}),call:this.rbdService.purgeTrash(t)}).subscribe({error:()=>{this.purgeForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close()}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(x),e.Y36(I.Kz),e.Y36(D.p4),e.Y36(ot.O),e.Y36(Ke.q),e.Y36(Q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-trash-purge-modal"]],decls:18,vars:6,consts:function(){let _,t,o,i,s;return _="Purge Trash",t="To purge, select\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "All" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + "\xA0 or one pool and click\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "Purge" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + ".\xA0",t=e.Zx4(t),o="Pool:",i="Pool name...",s="All",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","purgeForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],[1,"col-form-label","mx-auto"],o,["class","form-control","type","text","placeholder",i,"formControlName","poolName",4,"ngIf"],["id","poolName","name","poolName","class","form-control custom-select","formControlName","poolName",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["type","text","placeholder",i,"formControlName","poolName",1,"form-control"],["id","poolName","name","poolName","formControlName","poolName",1,"form-control","custom-select"],["value",""],s,[3,"value",4,"ngFor","ngForOf"],[3,"value"]]},template:function(t,o){1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.BQk(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.TgZ(7,"p"),e.tHW(8,7),e._UZ(9,"kbd"),e._UZ(10,"kbd"),e.N_p(),e.qZA(),e.TgZ(11,"div",8),e.TgZ(12,"label",9),e.SDv(13,10),e.qZA(),e.YNc(14,fa,1,0,"input",11),e.YNc(15,Sa,4,1,"select",12),e.qZA(),e.qZA(),e.TgZ(16,"div",13),e.TgZ(17,"cd-form-button-panel",14),e.NdJ("submitActionEvent",function(){return o.purge()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t&&(e.Q6J("modalRef",o.activeModal),e.xp6(4),e.Q6J("formGroup",o.purgeForm),e.xp6(10),e.Q6J("ngIf",!o.poolPermission.read),e.xp6(1),e.Q6J("ngIf",o.poolPermission.read),e.xp6(2),e.Q6J("form",o.purgeForm)("submitText",o.actionLabels.PURGE))},directives:[R.z,r._Y,r.JL,r.sg,v.V,g.P,l.O5,O.p,f.o,r.Fj,h.b,r.JJ,r.u,r.EJ,r.YN,r.Kr,l.sg],styles:[""]}),n})();function Ra(n,_){1&n&&(e.TgZ(0,"span",15),e.SDv(1,16),e.qZA())}let Ma=(()=>{class n{constructor(t,o,i,s,a){this.rbdService=t,this.activeModal=o,this.actionLabels=i,this.fb=s,this.taskWrapper=a}ngOnInit(){this.imageSpec=new Z.N(this.poolName,this.namespace,this.imageName).toString(),this.restoreForm=this.fb.group({name:this.imageName})}restore(){const t=this.restoreForm.getValue("name"),o=new Z.N(this.poolName,this.namespace,this.imageId);this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/trash/restore",{image_id_spec:o.toString(),new_image_name:t}),call:this.rbdService.restoreTrash(o,t)}).subscribe({error:()=>{this.restoreForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close()}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(x),e.Y36(I.Kz),e.Y36(D.p4),e.Y36(ot.O),e.Y36(Q.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-trash-restore-modal"]],decls:18,vars:7,consts:function(){let _,t,o,i;return _="Restore Image",t="To restore\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "" + "\ufffd0\ufffd" + "@" + "\ufffd1\ufffd" + "" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + ",\xA0 type the image's new name and click\xA0 " + "[\ufffd#9\ufffd|\ufffd#10\ufffd]" + "Restore" + "[\ufffd/#9\ufffd|\ufffd/#10\ufffd]" + ".",t=e.Zx4(t),o="New Name",i="This field is required.",[[3,"modalRef"],[1,"modal-title"],_,[1,"modal-content"],["name","restoreForm","novalidate","",1,"form",3,"formGroup"],["formDir","ngForm"],[1,"modal-body"],t,[1,"form-group"],["for","name",1,"col-form-label"],o,["type","text","name","name","id","name","autocomplete","off","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],i]},template:function(t,o){if(1&t&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.BQk(),e.ynx(3,3),e.TgZ(4,"form",4,5),e.TgZ(6,"div",6),e.TgZ(7,"p"),e.tHW(8,7),e._UZ(9,"kbd"),e._UZ(10,"kbd"),e.N_p(),e.qZA(),e.TgZ(11,"div",8),e.TgZ(12,"label",9),e.SDv(13,10),e.qZA(),e._UZ(14,"input",11),e.YNc(15,Ra,2,0,"span",12),e.qZA(),e.qZA(),e.TgZ(16,"div",13),e.TgZ(17,"cd-form-button-panel",14),e.NdJ("submitActionEvent",function(){return o.restore()}),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&t){const i=e.MAs(5);e.Q6J("modalRef",o.activeModal),e.xp6(4),e.Q6J("formGroup",o.restoreForm),e.xp6(6),e.pQV(o.imageSpec)(o.imageId),e.QtT(8),e.xp6(5),e.Q6J("ngIf",o.restoreForm.showError("name",i,"required")),e.xp6(2),e.Q6J("form",o.restoreForm)("submitText",o.actionLabels.RESTORE)}},directives:[R.z,r._Y,r.JL,r.sg,v.V,g.P,f.o,r.Fj,h.b,r.JJ,r.u,le.U,l.O5,O.p],styles:[""]}),n})();const Oa=["expiresTpl"],Aa=["deleteTpl"],ha=function(n){return[n]};function Pa(n,_){if(1&n){const t=e.EpF();e.TgZ(0,"button",6),e.NdJ("click",function(){return e.CHM(t),e.oxw().purgeModal()}),e._UZ(1,"i",7),e.ynx(2),e.SDv(3,8),e.BQk(),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("disabled",t.disablePurgeBtn),e.xp6(1),e.Q6J("ngClass",e.VKq(2,ha,t.icons.destroy))}}function Ia(n,_){1&n&&(e.ynx(0),e.SDv(1,10),e.BQk())}function ba(n,_){1&n&&(e.ynx(0),e.SDv(1,11),e.BQk())}function Na(n,_){if(1&n&&(e.YNc(0,Ia,2,0,"ng-container",9),e.YNc(1,ba,2,0,"ng-container",9),e._uU(2),e.ALo(3,"cdDate")),2&n){const t=_.row,o=_.value;e.Q6J("ngIf",t.cdIsExpired),e.xp6(1),e.Q6J("ngIf",!t.cdIsExpired),e.xp6(1),e.hij(" ",e.lcZ(3,3,o),"\n")}}function Da(n,_){if(1&n&&(e.TgZ(0,"p",13),e.TgZ(1,"strong"),e.ynx(2),e.SDv(3,14),e.ALo(4,"cdDate"),e.BQk(),e.qZA(),e.qZA()),2&n){const t=e.oxw().expiresAt;e.xp6(4),e.pQV(e.lcZ(4,1,t)),e.QtT(3)}}function va(n,_){1&n&&e.YNc(0,Da,5,3,"p",12),2&n&&e.Q6J("ngIf",!_.isExpired)}let La=(()=>{class n{constructor(t,o,i,s,a,d,c){this.authStorageService=t,this.rbdService=o,this.modalService=i,this.cdDatePipe=s,this.taskListService=a,this.taskWrapper=d,this.actionLabels=c,this.icons=T.P,this.executingTasks=[],this.selection=new Ee.r,this.tableStatus=new U.E,this.disablePurgeBtn=!0,this.permission=this.authStorageService.getPermissions().rbdImage,this.tableActions=[{permission:"update",icon:T.P.undo,click:()=>this.restoreModal(),name:this.actionLabels.RESTORE},{permission:"delete",icon:T.P.destroy,click:()=>this.deleteModal(),name:this.actionLabels.DELETE}]}ngOnInit(){this.columns=[{name:"ID",prop:"id",flexGrow:1,cellTransformation:ve.e.executing},{name:"Name",prop:"name",flexGrow:1},{name:"Pool",prop:"pool_name",flexGrow:1},{name:"Namespace",prop:"namespace",flexGrow:1},{name:"Status",prop:"deferment_end_time",flexGrow:1,cellTemplate:this.expiresTpl},{name:"Deleted At",prop:"deletion_time",flexGrow:1,pipe:this.cdDatePipe}],this.taskListService.init(()=>this.rbdService.listTrash(),i=>this.prepareResponse(i),i=>this.images=i,()=>this.onFetchError(),i=>["rbd/trash/remove","rbd/trash/restore"].includes(i.name),(i,s)=>new Z.N(i.pool_name,i.namespace,i.id).toString()===s.metadata.image_id_spec,void 0)}prepareResponse(t){let o=[];const i={};let s;if(t.forEach(a=>{C().isUndefined(i[a.status])&&(i[a.status]=[]),i[a.status].push(a.pool_name),o=o.concat(a.value),this.disablePurgeBtn=!o.length}),i[3]?s=3:i[1]?s=1:i[2]&&(s=2),s){const a=(i[s].length>1?"pools ":"pool ")+i[s].join();this.tableStatus=new U.E(s,a)}else this.tableStatus=new U.E;return o.forEach(a=>{a.cdIsExpired=Me()().isAfter(a.deferment_end_time)}),o}onFetchError(){this.table.reset(),this.tableStatus=new U.E(ce.T.ValueException)}updateSelection(t){this.selection=t}restoreModal(){const t={poolName:this.selection.first().pool_name,namespace:this.selection.first().namespace,imageName:this.selection.first().name,imageId:this.selection.first().id};this.modalRef=this.modalService.show(Ma,t)}deleteModal(){const t=this.selection.first().pool_name,o=this.selection.first().namespace,i=this.selection.first().id,s=this.selection.first().deferment_end_time,a=Me()().isAfter(s),d=new Z.N(t,o,i);this.modalRef=this.modalService.show(he.M,{itemDescription:"RBD",itemNames:[d],bodyTemplate:this.deleteTpl,bodyContext:{expiresAt:s,isExpired:a},submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new F.R("rbd/trash/remove",{image_id_spec:d.toString()}),call:this.rbdService.removeTrash(d,!0)})})}purgeModal(){this.modalService.show(Ea)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(x),e.Y36(re.Z),e.Y36(ze.N),e.Y36(se.j),e.Y36(Q.P),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-trash-list"]],viewQuery:function(t,o){if(1&t&&(e.Gf(ee.a,7),e.Gf(Oa,7),e.Gf(Aa,7)),2&t){let i;e.iGM(i=e.CRH())&&(o.table=i.first),e.iGM(i=e.CRH())&&(o.expiresTpl=i.first),e.iGM(i=e.CRH())&&(o.deleteTpl=i.first)}},features:[e._Bn([se.j])],decls:9,vars:8,consts:function(){let _,t,o,i;return _="Purge Trash",t="Expired at",o="Protected until",i="This image is protected until " + "\ufffd0\ufffd" + ".",[["columnMode","flex","identifier","id","forceIdentifier","true","selectionType","single",3,"data","columns","status","autoReload","fetchData","updateSelection"],[1,"table-actions","btn-toolbar"],[1,"btn-group",3,"permission","selection","tableActions"],["class","btn btn-light","type","button",3,"disabled","click",4,"ngIf"],["expiresTpl",""],["deleteTpl",""],["type","button",1,"btn","btn-light",3,"disabled","click"],["aria-hidden","true",3,"ngClass"],_,[4,"ngIf"],t,o,["class","text-danger",4,"ngIf"],[1,"text-danger"],i]},template:function(t,o){1&t&&(e._UZ(0,"cd-rbd-tabs"),e.TgZ(1,"cd-table",0),e.NdJ("fetchData",function(){return o.taskListService.fetch()})("updateSelection",function(s){return o.updateSelection(s)}),e.TgZ(2,"div",1),e._UZ(3,"cd-table-actions",2),e.YNc(4,Pa,4,4,"button",3),e.qZA(),e.qZA(),e.YNc(5,Na,4,5,"ng-template",null,4,e.W1O),e.YNc(7,va,1,1,"ng-template",null,5,e.W1O)),2&t&&(e.xp6(1),e.Q6J("data",o.images)("columns",o.columns)("status",o.tableStatus)("autoReload",-1),e.xp6(2),e.Q6J("permission",o.permission)("selection",o.selection)("tableActions",o.tableActions),e.xp6(1),e.Q6J("ngIf",o.permission.delete))},directives:[Qe,ee.a,Re.K,l.O5,f.o,l.mk],pipes:[ze.N],styles:[""]}),n})(),Mt=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[l.ez,Jn,r.u5,r.UX,I.Oz,I.dT,I.HK,Ie.b,_e.m,m.Bz,ne.xc]]}),n})();const Fa=[{path:"",redirectTo:"rbd",pathMatch:"full"},{path:"rbd",canActivate:[j.T],data:{breadcrumbs:"Images"},children:[{path:"",component:ia},{path:"namespaces",component:ma,data:{breadcrumbs:"Namespaces"}},{path:"trash",component:La,data:{breadcrumbs:"Trash"}},{path:"performance",component:Ta,data:{breadcrumbs:"Overall Performance"}},{path:D.MQ.CREATE,component:$e,data:{breadcrumbs:D.Qn.CREATE}},{path:`${D.MQ.EDIT}/:image_spec`,component:$e,data:{breadcrumbs:D.Qn.EDIT}},{path:`${D.MQ.CLONE}/:image_spec/:snap`,component:$e,data:{breadcrumbs:D.Qn.CLONE}},{path:`${D.MQ.COPY}/:image_spec`,component:$e,data:{breadcrumbs:D.Qn.COPY}},{path:`${D.MQ.COPY}/:image_spec/:snap`,component:$e,data:{breadcrumbs:D.Qn.COPY}}]},{path:"mirroring",component:Ki,canActivate:[j.T],data:{breadcrumbs:"Mirroring"}},{path:"iscsi",canActivate:[j.T],data:{breadcrumbs:"iSCSI"},children:[{path:"",redirectTo:"overview",pathMatch:"full"},{path:"overview",component:zn,data:{breadcrumbs:"Overview"}},{path:"targets",data:{breadcrumbs:"Targets"},children:[{path:"",component:Ln},{path:D.MQ.CREATE,component:rt,data:{breadcrumbs:D.Qn.CREATE}},{path:`${D.MQ.EDIT}/:target_iqn`,component:rt,data:{breadcrumbs:D.Qn.EDIT}}]}]}];let $a=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[Mt,m.Bz.forChild(Fa)]]}),n})()},54555:(it,Oe,p)=>{p.d(Oe,{d:()=>Q});var l=p(74788),r=p(24751),m=p(23815),ne=p.n(m),I=p(80226),Ie=p(65862),D=p(95463),j=p(30633),_e=p(28211),be=p(34089),C=p(41582),W=p(12057),b=p(56310),ie=p(18372),Y=p(87925),e=p(94276);let k=(()=>{class R{constructor(g,f){this.control=g,this.formatter=f}setValue(g){const f=this.formatter.toMilliseconds(g);this.control.control.setValue(`${f} ms`)}ngOnInit(){this.setValue(this.control.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.control.value))}onUpdate(g){this.setValue(g)}}return R.\u0275fac=function(g){return new(g||R)(l.Y36(r.a5),l.Y36(_e.H))},R.\u0275dir=l.lG2({type:R,selectors:[["","cdMilliseconds",""]],hostBindings:function(g,f){1&g&&l.NdJ("blur",function(O){return f.onUpdate(O.target.value)})},inputs:{ngDataReady:"ngDataReady"}}),R})();var Ne=p(20044);let Z=(()=>{class R{constructor(g,f,h,O){this.elementRef=g,this.control=f,this.dimlessBinaryPerSecondPipe=h,this.formatter=O,this.ngModelChange=new l.vpe,this.el=this.elementRef.nativeElement}ngOnInit(){this.setValue(this.el.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.el.value))}setValue(g){/^[\d.]+$/.test(g)&&(g+=this.defaultUnit||"m");const f=this.formatter.toBytes(g,0),h=this.round(f);this.el.value=this.dimlessBinaryPerSecondPipe.transform(h),null!==f?(this.ngModelChange.emit(this.el.value),this.control.control.setValue(this.el.value)):(this.ngModelChange.emit(null),this.control.control.setValue(null))}round(g){if(null!==g&&0!==g){if(!ne().isUndefined(this.minBytes)&&g<this.minBytes)return this.minBytes;if(!ne().isUndefined(this.maxBytes)&&g>this.maxBytes)return this.maxBytes;if(!ne().isUndefined(this.roundPower)){const f=Math.round(Math.log(g)/Math.log(this.roundPower));return Math.pow(this.roundPower,f)}}return g}onBlur(g){this.setValue(g)}}return R.\u0275fac=function(g){return new(g||R)(l.Y36(l.SBq),l.Y36(r.a5),l.Y36(Ne.O),l.Y36(_e.H))},R.\u0275dir=l.lG2({type:R,selectors:[["","cdDimlessBinaryPerSecond",""]],hostBindings:function(g,f){1&g&&l.NdJ("blur",function(O){return f.onBlur(O.target.value)})},inputs:{ngDataReady:"ngDataReady",minBytes:"minBytes",maxBytes:"maxBytes",roundPower:"roundPower",defaultUnit:"defaultUnit"},outputs:{ngModelChange:"ngModelChange"}}),R})(),Ae=(()=>{class R{constructor(g,f){this.formatter=g,this.ngControl=f}setValue(g){const f=this.formatter.toIops(g);this.ngControl.control.setValue(`${f} IOPS`)}ngOnInit(){this.setValue(this.ngControl.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.ngControl.value))}onUpdate(g){this.setValue(g)}}return R.\u0275fac=function(g){return new(g||R)(l.Y36(_e.H),l.Y36(r.a5))},R.\u0275dir=l.lG2({type:R,selectors:[["","cdIops",""]],hostBindings:function(g,f){1&g&&l.NdJ("blur",function(O){return f.onUpdate(O.target.value)})},inputs:{ngDataReady:"ngDataReady"}}),R})();function x(R,v){if(1&R&&(l.ynx(0),l._UZ(1,"input",18),l.BQk()),2&R){const g=l.oxw().$implicit,f=l.oxw(2);l.xp6(1),l.Q6J("id",g.name)("name",g.name)("formControlName",g.name)("ngDataReady",f.ngDataReady)}}function ae(R,v){if(1&R&&(l.ynx(0),l._UZ(1,"input",19),l.BQk()),2&R){const g=l.oxw().$implicit,f=l.oxw(2);l.xp6(1),l.Q6J("id",g.name)("name",g.name)("formControlName",g.name)("ngDataReady",f.ngDataReady)}}function V(R,v){if(1&R&&(l.ynx(0),l._UZ(1,"input",20),l.BQk()),2&R){const g=l.oxw().$implicit,f=l.oxw(2);l.xp6(1),l.Q6J("id",g.name)("name",g.name)("formControlName",g.name)("ngDataReady",f.ngDataReady)}}function T(R,v){1&R&&(l.TgZ(0,"span",21),l.SDv(1,22),l.qZA())}const q=function(R){return{active:R}},M=function(R){return[R]};function B(R,v){if(1&R){const g=l.EpF();l.TgZ(0,"div",10),l.TgZ(1,"label",11),l._uU(2),l.TgZ(3,"cd-helper"),l._uU(4),l.qZA(),l.qZA(),l.TgZ(5,"div"),l.TgZ(6,"div",12),l.ynx(7,13),l.YNc(8,x,2,4,"ng-container",14),l.YNc(9,ae,2,4,"ng-container",14),l.YNc(10,V,2,4,"ng-container",14),l.BQk(),l.TgZ(11,"span",15),l.TgZ(12,"button",16),l.NdJ("click",function(){const O=l.CHM(g).$implicit;return l.oxw(2).reset(O.name)}),l._UZ(13,"i",7),l.qZA(),l.qZA(),l.qZA(),l.YNc(14,T,2,0,"span",17),l.qZA(),l.qZA()}if(2&R){const g=v.$implicit,f=l.oxw().$implicit,h=l.oxw(),O=l.MAs(1);l.xp6(1),l.Q6J("for",g.name),l.xp6(1),l.Oqu(g.displayName),l.xp6(2),l.Oqu(g.description),l.xp6(1),l.Gre("cd-col-form-input ",f.heading,""),l.xp6(2),l.Q6J("ngSwitch",g.type),l.xp6(1),l.Q6J("ngSwitchCase",h.configurationType.milliseconds),l.xp6(1),l.Q6J("ngSwitchCase",h.configurationType.bps),l.xp6(1),l.Q6J("ngSwitchCase",h.configurationType.iops),l.xp6(2),l.Q6J("ngClass",l.VKq(13,q,h.isDisabled(g.name))),l.xp6(1),l.Q6J("ngClass",l.VKq(15,M,h.icons.erase)),l.xp6(1),l.Q6J("ngIf",h.form.showError("configuration."+g.name,O,"min"))}}function F(R,v){if(1&R){const g=l.EpF();l.TgZ(0,"div",4),l.TgZ(1,"h4",5),l.TgZ(2,"span",6),l.NdJ("click",function(){const O=l.CHM(g).$implicit;return l.oxw().toggleSectionVisibility(O.class)}),l._uU(3),l._UZ(4,"i",7),l.qZA(),l.qZA(),l.TgZ(5,"div",8),l.YNc(6,B,15,17,"div",9),l.qZA(),l.qZA()}if(2&R){const g=v.$implicit,f=l.oxw();l.xp6(3),l.hij(" ",g.heading," "),l.xp6(1),l.Q6J("ngClass",f.sectionVisibility[g.class]?f.icons.minusCircle:f.icons.addCircle),l.xp6(1),l.Tol(g.class),l.Q6J("hidden",!f.sectionVisibility[g.class]),l.xp6(1),l.Q6J("ngForOf",g.options)}}let Q=(()=>{class R{constructor(g,f){this.formatterService=g,this.rbdConfigurationService=f,this.initializeData=new I.t(1),this.changes=new l.vpe,this.icons=Ie.P,this.ngDataReady=new l.vpe,this.configurationType=j.r,this.sectionVisibility={}}ngOnInit(){const g=this.createConfigurationFormGroup();this.form.addControl("configuration",g),g.valueChanges.subscribe(()=>{this.changes.emit(this.getDirtyValues.bind(this))}),this.initializeData&&this.initializeData.subscribe(f=>{this.initialData=f.initialData;const h=f.sourceType;this.rbdConfigurationService.getWritableOptionFields().forEach(O=>{const H=f.initialData.filter(De=>De.name===O.name).pop();H&&H.source===h&&this.form.get(`configuration.${O.name}`).setValue(H.value)}),this.ngDataReady.emit()}),this.rbdConfigurationService.getWritableSections().forEach(f=>this.sectionVisibility[f.class]=!1)}getDirtyValues(g=!1,f){if(g&&!f)throw new Error("ProgrammingError: If local values shall be included, a proper localFieldType argument has to be provided, too");const h={};return this.rbdConfigurationService.getWritableOptionFields().forEach(O=>{const H=this.form.get("configuration").get(O.name);this.initialData&&this.initialData[O.name]===H.value||(H.dirty||g&&H.source===f)&&(h[O.name]=null===H.value?H.value:O.type===j.r.bps?this.formatterService.toBytes(H.value):O.type===j.r.milliseconds?this.formatterService.toMilliseconds(H.value):O.type===j.r.iops?this.formatterService.toIops(H.value):H.value)}),h}createConfigurationFormGroup(){const g=new D.d({});return this.rbdConfigurationService.getWritableOptionFields().forEach(f=>{let h;if(f.type!==j.r.milliseconds&&f.type!==j.r.iops&&f.type!==j.r.bps)throw new Error(`Type ${f.type} is unknown, you may need to add it to RbdConfiguration class`);{let O=0;ne().forEach(this.initialData,H=>{H.name===f.name&&(O=H.value)}),h=new r.NI(O,r.kI.min(0))}g.addControl(f.name,h)}),g}reset(g){const f=this.form.get("configuration").get(g);f.disabled?(f.setValue(f.previousValue||0),f.enable(),f.previousValue||f.markAsPristine()):(f.previousValue=f.value,f.setValue(null),f.markAsDirty(),f.disable())}isDisabled(g){return this.form.get("configuration").get(g).disabled}toggleSectionVisibility(g){this.sectionVisibility[g]=!this.sectionVisibility[g]}}return R.\u0275fac=function(g){return new(g||R)(l.Y36(_e.H),l.Y36(be.n))},R.\u0275cmp=l.Xpm({type:R,selectors:[["cd-rbd-configuration-form"]],inputs:{form:"form",initializeData:"initializeData"},outputs:{changes:"changes"},decls:5,vars:2,consts:function(){let v,g,f;return v="RBD Configuration",g="Remove the local configuration value. The parent configuration value will be inherited and used instead.",f="The minimum value is 0",[[3,"formGroup"],["cfgFormGroup",""],v,["class","col-12",4,"ngFor","ngForOf"],[1,"col-12"],[1,"cd-header"],[1,"collapsible",3,"click"],["aria-hidden","true",3,"ngClass"],[3,"hidden"],["class","form-group row",4,"ngFor","ngForOf"],[1,"form-group","row"],[1,"cd-col-form-label",3,"for"],[1,"input-group"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"input-group-append"],["type","button","data-toggle","button","title",g,1,"btn","btn-light",3,"ngClass","click"],["class","invalid-feedback",4,"ngIf"],["type","text","cdMilliseconds","",1,"form-control",3,"id","name","formControlName","ngDataReady"],["type","text","defaultUnit","b","cdDimlessBinaryPerSecond","",1,"form-control",3,"id","name","formControlName","ngDataReady"],["type","text","cdIops","",1,"form-control",3,"id","name","formControlName","ngDataReady"],[1,"invalid-feedback"],f]},template:function(g,f){1&g&&(l.TgZ(0,"fieldset",0,1),l.TgZ(2,"legend"),l.SDv(3,2),l.qZA(),l.YNc(4,F,7,7,"div",3),l.qZA()),2&g&&(l.Q6J("formGroup",f.form.get("configuration")),l.xp6(4),l.Q6J("ngForOf",f.rbdConfigurationService.sections))},directives:[r.JL,r.sg,C.V,W.sg,W.mk,b.P,ie.S,W.RF,W.n9,Y.o,W.O5,r.Fj,e.b,k,r.JJ,r.u,Z,Ae],styles:[".collapsible[_ngcontent-%COMP%]{cursor:pointer;user-select:none}"]}),R})()},71752:(it,Oe,p)=>{p.d(Oe,{P:()=>V});var l=p(64337),r=p(30633),m=p(74788);let ne=(()=>{class T{transform(M){return{0:"global",1:"pool",2:"image"}[M]}}return T.\u0275fac=function(M){return new(M||T)},T.\u0275pipe=m.Yjl({name:"rbdConfigurationSource",type:T,pure:!0}),T})();var I=p(28211),Ie=p(34089),D=p(12057),j=p(20044),_e=p(48537),be=p(21766);const C=["configurationSourceTpl"],W=["configurationValueTpl"],b=["poolConfTable"];function ie(T,q){1&T&&(m.TgZ(0,"span"),m.SDv(1,6),m.qZA())}function Y(T,q){1&T&&(m.TgZ(0,"strong"),m.SDv(1,7),m.qZA())}function e(T,q){1&T&&(m.TgZ(0,"strong"),m.SDv(1,8),m.qZA())}function k(T,q){1&T&&(m.TgZ(0,"div",4),m.YNc(1,ie,2,0,"span",5),m.YNc(2,Y,2,0,"strong",5),m.YNc(3,e,2,0,"strong",5),m.qZA()),2&T&&(m.Q6J("ngSwitch",q.value),m.xp6(1),m.Q6J("ngSwitchCase","global"),m.xp6(1),m.Q6J("ngSwitchCase","image"),m.xp6(1),m.Q6J("ngSwitchCase","pool"))}function Ne(T,q){if(1&T&&(m.TgZ(0,"span"),m._uU(1),m.ALo(2,"dimlessBinaryPerSecond"),m.qZA()),2&T){const M=m.oxw().value;m.xp6(1),m.Oqu(m.lcZ(2,1,M))}}function Z(T,q){if(1&T&&(m.TgZ(0,"span"),m._uU(1),m.ALo(2,"milliseconds"),m.qZA()),2&T){const M=m.oxw().value;m.xp6(1),m.Oqu(m.lcZ(2,1,M))}}function Ae(T,q){if(1&T&&(m.TgZ(0,"span"),m._uU(1),m.ALo(2,"iops"),m.qZA()),2&T){const M=m.oxw().value;m.xp6(1),m.Oqu(m.lcZ(2,1,M))}}function x(T,q){if(1&T&&(m.TgZ(0,"span"),m._uU(1),m.qZA()),2&T){const M=m.oxw().value;m.xp6(1),m.Oqu(M)}}function ae(T,q){if(1&T&&(m.TgZ(0,"div",4),m.YNc(1,Ne,3,3,"span",5),m.YNc(2,Z,3,3,"span",5),m.YNc(3,Ae,3,3,"span",5),m.YNc(4,x,2,1,"span",9),m.qZA()),2&T){const M=q.row,B=m.oxw();m.Q6J("ngSwitch",M.type),m.xp6(1),m.Q6J("ngSwitchCase",B.typeField.bps),m.xp6(1),m.Q6J("ngSwitchCase",B.typeField.milliseconds),m.xp6(1),m.Q6J("ngSwitchCase",B.typeField.iops)}}let V=(()=>{class T{constructor(M,B){this.formatterService=M,this.rbdConfigurationService=B,this.sourceField=r.h,this.typeField=r.r}ngOnInit(){this.poolConfigurationColumns=[{prop:"displayName",name:"Name"},{prop:"description",name:"Description"},{prop:"name",name:"Key"},{prop:"source",name:"Source",cellTemplate:this.configurationSourceTpl,pipe:new ne},{prop:"value",name:"Value",cellTemplate:this.configurationValueTpl}]}ngOnChanges(){!this.data||(this.data=this.data.filter(M=>this.rbdConfigurationService.getOptionFields().map(B=>B.name).includes(M.name)))}}return T.\u0275fac=function(M){return new(M||T)(m.Y36(I.H),m.Y36(Ie.n))},T.\u0275cmp=m.Xpm({type:T,selectors:[["cd-rbd-configuration-table"]],viewQuery:function(M,B){if(1&M&&(m.Gf(C,7),m.Gf(W,7),m.Gf(b,7)),2&M){let F;m.iGM(F=m.CRH())&&(B.configurationSourceTpl=F.first),m.iGM(F=m.CRH())&&(B.configurationValueTpl=F.first),m.iGM(F=m.CRH())&&(B.poolConfTable=F.first)}},inputs:{data:"data"},features:[m.TTD],decls:6,vars:2,consts:function(){let q,M,B;return q="Global",M="Image",B="Pool",[["identifier","name",3,"data","columns"],["poolConfTable",""],["configurationSourceTpl",""],["configurationValueTpl",""],[3,"ngSwitch"],[4,"ngSwitchCase"],q,M,B,[4,"ngSwitchDefault"]]},template:function(M,B){1&M&&(m._UZ(0,"cd-table",0,1),m.YNc(2,k,4,4,"ng-template",null,2,m.W1O),m.YNc(4,ae,5,4,"ng-template",null,3,m.W1O)),2&M&&m.Q6J("data",B.data)("columns",B.poolConfigurationColumns)},directives:[l.a,D.RF,D.n9,D.ED],pipes:[j.O,_e.J,be.A],styles:[""]}),T})()}}]);