]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/43.819b1fed46aadf1b.js
import ceph quincy 17.2.6
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / dist / en-US / 43.819b1fed46aadf1b.js
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/43.819b1fed46aadf1b.js b/ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/43.819b1fed46aadf1b.js
new file mode 100644 (file)
index 0000000..9e1584c
--- /dev/null
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkceph_dashboard=self.webpackChunkceph_dashboard||[]).push([[43],{21043:(dt,he,p)=>{p.r(he),p.d(he,{BlockModule:()=>Bt,RoutedBlockModule:()=>ur});var c=p(11048),a=p(1659),g=p(55860),ne=p(62946),v=p(71334),be=p(37496),D=p(79512),U=p(4222),re=p(54462),Ae=p(44466),Ne=p(23815),S=p.n(Ne),le=p(35758),F=p(64762),ie=p(19725),Y=p(93523),e=p(89724);let Q=class{constructor(s){this.http=s}listTargets(){return this.http.get("api/iscsi/target")}getTarget(s){return this.http.get(`api/iscsi/target/${s}`)}updateTarget(s,t){return this.http.put(`api/iscsi/target/${s}`,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(s){return this.http.post("api/iscsi/target",s,{observe:"response"})}deleteTarget(s){return this.http.delete(`api/iscsi/target/${s}`,{observe:"response"})}getDiscovery(){return this.http.get("api/iscsi/discoveryauth")}updateDiscovery(s){return this.http.put("api/iscsi/discoveryauth",s)}overview(){return this.http.get("ui-api/iscsi/overview")}};Q.\u0275fac=function(s){return new(s||Q)(e.LFG(ie.eN))},Q.\u0275prov=e.Yz7({token:Q,factory:Q.\u0275fac,providedIn:"root"}),Q=(0,F.gn)([Y.o,(0,F.w6)("design:paramtypes",[ie.eN])],Q);var Fe=p(88002),De=p(76189),L=p(19358),Pe=p(34089);let H=class extends De.S{constructor(s,t){super(),this.http=s,this.rbdConfigurationService=t}isRBDPool(s){return-1!==S().indexOf(s.application_metadata,"rbd")&&!s.pool_name.includes("/")}create(s){return this.http.post("api/block/image",s,{observe:"response"})}delete(s){return this.http.delete(`api/block/image/${s.toStringEncoded()}`,{observe:"response"})}update(s,t){return this.http.put(`api/block/image/${s.toStringEncoded()}`,t,{observe:"response"})}get(s){return this.http.get(`api/block/image/${s.toStringEncoded()}`)}list(s){return this.http.get("api/block/image",{params:s,headers:{Accept:this.getVersionHeaderValue(2,0)},observe:"response"}).pipe((0,Fe.U)(t=>t.body.map(o=>(o.value.map(i=>(i.configuration&&i.configuration.map(_=>Object.assign(_,this.rbdConfigurationService.getOptionByName(_.name))),i)),o.headers=t.headers,o))))}copy(s,t){return this.http.post(`api/block/image/${s.toStringEncoded()}/copy`,t,{observe:"response"})}flatten(s){return this.http.post(`api/block/image/${s.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(s,t){const o={snapshot_name:t};return this.http.post(`api/block/image/${s.toStringEncoded()}/snap`,o,{observe:"response"})}renameSnapshot(s,t,o){const i={new_snap_name:o};return this.http.put(`api/block/image/${s.toStringEncoded()}/snap/${t}`,i,{observe:"response"})}protectSnapshot(s,t,o){const i={is_protected:o};return this.http.put(`api/block/image/${s.toStringEncoded()}/snap/${t}`,i,{observe:"response"})}rollbackSnapshot(s,t){return this.http.post(`api/block/image/${s.toStringEncoded()}/snap/${t}/rollback`,null,{observe:"response"})}cloneSnapshot(s,t,o){return this.http.post(`api/block/image/${s.toStringEncoded()}/snap/${t}/clone`,o,{observe:"response"})}deleteSnapshot(s,t){return this.http.delete(`api/block/image/${s.toStringEncoded()}/snap/${t}`,{observe:"response"})}listTrash(){return this.http.get("api/block/image/trash/")}createNamespace(s,t){return this.http.post(`api/block/pool/${s}/namespace`,{namespace:t},{observe:"response"})}listNamespaces(s){return this.http.get(`api/block/pool/${s}/namespace/`)}deleteNamespace(s,t){return this.http.delete(`api/block/pool/${s}/namespace/${t}`,{observe:"response"})}moveTrash(s,t){return this.http.post(`api/block/image/${s.toStringEncoded()}/move_trash`,{delay:t},{observe:"response"})}purgeTrash(s){return this.http.post(`api/block/image/trash/purge/?pool_name=${s}`,null,{observe:"response"})}restoreTrash(s,t){return this.http.post(`api/block/image/trash/${s.toStringEncoded()}/restore`,{new_image_name:t},{observe:"response"})}removeTrash(s,t=!1){return this.http.delete(`api/block/image/trash/${s.toStringEncoded()}/?force=${t}`,{observe:"response"})}};H.\u0275fac=function(s){return new(s||H)(e.LFG(ie.eN),e.LFG(Pe.n))},H.\u0275prov=e.Yz7({token:H,factory:H.\u0275fac,providedIn:"root"}),(0,F.gn)([(0,F.fM)(1,Y.G),(0,F.w6)("design:type",Function),(0,F.w6)("design:paramtypes",[L.N,String]),(0,F.w6)("design:returntype",void 0)],H.prototype,"createSnapshot",null),(0,F.gn)([(0,F.fM)(2,Y.G),(0,F.w6)("design:type",Function),(0,F.w6)("design:paramtypes",[L.N,String,String]),(0,F.w6)("design:returntype",void 0)],H.prototype,"renameSnapshot",null),(0,F.gn)([(0,F.fM)(2,Y.G),(0,F.w6)("design:type",Function),(0,F.w6)("design:paramtypes",[L.N,String,Boolean]),(0,F.w6)("design:returntype",void 0)],H.prototype,"protectSnapshot",null),(0,F.gn)([(0,F.fM)(1,Y.G),(0,F.w6)("design:type",Function),(0,F.w6)("design:paramtypes",[L.N,String]),(0,F.w6)("design:returntype",void 0)],H.prototype,"restoreTrash",null),H=(0,F.gn)([Y.o,(0,F.w6)("design:paramtypes",[ie.eN,Pe.n])],H);var N=p(7022),y=p(14745),T=p(65862),k=p(93614),Z=p(95463),z=p(90070),h=p(48168),R=p(76111),m=p(32337),C=p(60312),A=p(41582),O=p(56310),$=p(87925),X=p(94276);function oo(n,s){if(1&n&&(e.TgZ(0,"option",6),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.Q6J("ngValue",t),e.xp6(1),e.Oqu(t)}}function no(n,s){if(1&n&&(e.TgZ(0,"select",5),e._UZ(1,"option",6),e.YNc(2,oo,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 io(n,s){if(1&n&&e._UZ(0,"input",10),2&n){const t=e.oxw(2);e.Q6J("formControlName",t.setting)}}function so(n,s){if(1&n&&e._UZ(0,"input",11),2&n){const t=e.oxw(2);e.Q6J("formControlName",t.setting)}}function _o(n,s){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.TgZ(6,"div",12),e._UZ(7,"input",13),e.TgZ(8,"label",14),e._uU(9,"No"),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 ao(n,s){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,io,1,1,"input",8),e.YNc(2,so,1,1,"input",9),e.YNc(3,_o,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 ro(n,s){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 lo(n,s){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 pt=(()=>{class n{ngOnInit(){const t=[];"min"in this.limits&&t.push(a.kI.min(this.limits.min)),"max"in this.limits&&t.push(a.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 s,t;return s="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",3,"id","name","formControlName",4,"ngIf"],[4,"ngIf"],["class","invalid-feedback",4,"ngIf"],[1,"form-control",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"],s,t]},template:function(t,o){1&t&&(e.TgZ(0,"div",0)(1,"label",1),e._uU(2),e.qZA(),e.YNc(3,no,3,5,"select",2),e.YNc(4,ao,4,3,"span",3),e.YNc(5,ro,3,1,"span",4),e.YNc(6,lo,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:[O.P,a.JL,a.sg,A.V,c.O5,$.o,a.EJ,X.b,a.JJ,a.u,a.YN,a.Kr,c.sg,a.wV,a.Fj,a._],styles:[""]}),n})();var j=p(30839),Je=p(88820);function co(n,s){1&n&&(e.TgZ(0,"span",29),e.SDv(1,30),e.qZA())}function po(n,s){if(1&n&&(e.TgZ(0,"span")(1,"legend",10),e.SDv(2,21),e.qZA(),e.TgZ(3,"div",12)(4,"div",13)(5,"label",22),e.SDv(6,23),e.qZA(),e._UZ(7,"input",24),e.YNc(8,co,2,0,"span",25),e.qZA()(),e.TgZ(9,"div",12)(10,"div",13)(11,"label",26),e.SDv(12,27),e.qZA(),e._UZ(13,"input",28),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 uo(n,s){if(1&n&&(e.TgZ(0,"option",31),e._uU(1),e.ALo(2,"iscsiBackstore"),e.qZA()),2&n){const t=s.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(e.lcZ(2,2,t))}}function mo(n,s){if(1&n&&(e.TgZ(0,"div",12)(1,"div",13),e._UZ(2,"cd-iscsi-setting",33),e.qZA()()),2&n){const t=s.$implicit,o=e.oxw(2).$implicit,i=e.oxw(),_=e.MAs(9);e.xp6(2),e.Q6J("settingsForm",i.settingsForm)("formDir",_)("setting",t.key)("limits",i.getDiskControlLimits(o,t.key))}}function go(n,s){if(1&n&&(e.ynx(0),e.YNc(1,mo,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 To(n,s){if(1&n&&(e.ynx(0),e.YNc(1,go,3,3,"ng-container",9),e.BQk()),2&n){const t=s.$implicit,o=e.oxw();e.xp6(1),e.Q6J("ngIf",o.settingsForm.value.backstore===t)}}let fo=(()=>{class n{constructor(t,o,i){this.activeModal=t,this.iscsiService=o,this.actionLabels=i}ngOnInit(){const t={backstore:new a.NI(this.imagesSettings[this.image].backstore),lun:new a.NI(this.imagesSettings[this.image].lun),wwn:new a.NI(this.imagesSettings[this.image].wwn)};S().forEach(this.backstores,o=>{const i=this.imagesSettings[this.image][o]||{};S().forIn(this.disk_default_controls[o],(_,r)=>{t[r]=new a.NI(i[r])})}),this.settingsForm=new Z.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().forIn(this.settingsForm.controls,(r,l)=>{""!==r.value&&null!==r.value&&l in this.disk_default_controls[this.settingsForm.value.backstore]&&(_[l]=r.value,S().forEach(this.backstores,d=>{d!==t&&l in(this.imagesSettings[this.image][d]||{})&&(this.imagesSettings[this.image][d][l]=r.value)}))}),this.imagesSettings[this.image].backstore=t,this.imagesSettings[this.image].lun=o,this.imagesSettings[this.image].wwn=i,this.imagesSettings[this.image][t]=_,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(v.Kz),e.Y36(Q),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-target-image-settings-modal"]],decls:25,vars:8,consts:function(){let s,t,o,i,_,r,l,d;return s="Configure",t="Changing these parameters from their default values is usually not necessary.",o="Settings",i="Backstore",_="Identifier",r="lun",l="wwn",d="This field is required.",[[3,"modalRef"],[1,"modal-title"],s,[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-select"],[3,"value",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],_,["for","lun",1,"col-form-label","required"],r,["type","number","id","lun","name","lun","formControlName","lun",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","wwn",1,"col-form-label"],l,["type","text","id","wwn","name","wwn","formControlName","wwn",1,"form-control"],[1,"invalid-feedback"],d,[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)(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)(10,"div",6)(11,"p",7),e.SDv(12,8),e.qZA(),e.YNc(13,po,14,1,"span",9),e.TgZ(14,"legend",10),e.SDv(15,11),e.qZA(),e.TgZ(16,"div",12)(17,"div",13)(18,"label",14),e.SDv(19,15),e.qZA(),e.TgZ(20,"select",16),e.YNc(21,uo,3,4,"option",17),e.qZA()()(),e.YNc(22,To,2,1,"ng-container",18),e.qZA(),e.TgZ(23,"div",19)(24,"cd-form-button-panel",20),e.NdJ("submitActionEvent",function(){return o.save()}),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:[C.z,a._Y,a.JL,a.sg,A.V,c.O5,O.P,$.o,a.wV,a.Fj,X.b,a.JJ,a.u,a.EJ,c.sg,a.YN,a.Kr,pt,j.p],pipes:[Je.V,c.Nd],styles:[""]}),n})();function Co(n,s){if(1&n&&(e.TgZ(0,"div",12)(1,"div",13),e._UZ(2,"cd-iscsi-setting",14),e.qZA()()),2&n){const t=s.$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 So=(()=>{class n{constructor(t,o,i){this.activeModal=t,this.iscsiService=o,this.actionLabels=i}ngOnInit(){const t={};S().forIn(this.target_default_controls,(o,i)=>{t[i]=new a.NI(this.target_controls.value[i])}),this.settingsForm=new Z.d(t)}save(){const t={};S().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(v.Kz),e.Y36(Q),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-target-iqn-settings-modal"]],decls:13,vars:7,consts:function(){let s,t;return s="Advanced Settings",t="Changing these parameters from their default values is usually not necessary.",[[3,"modalRef"],[1,"modal-title"],s,[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)(6,"div",6)(7,"p",7),e.SDv(8,8),e.qZA(),e.YNc(9,Co,3,4,"div",9),e.ALo(10,"keyvalue"),e.qZA(),e.TgZ(11,"div",10)(12,"cd-form-button-panel",11),e.NdJ("submitActionEvent",function(){return o.save()}),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:[C.z,a._Y,a.JL,a.sg,A.V,c.sg,O.P,pt,j.p],pipes:[c.Nd],styles:[""]}),n})();var de=p(63285),ut=p(63622);let Eo=(()=>{class n{constructor(t){this.ngControl=t}onInput(t){this.setValue(t)}setValue(t){t=S().isString(t)?t.trim():t,this.ngControl.control.setValue(t)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(a.a5))},n.\u0275dir=e.lG2({type:n,selectors:[["","cdTrim",""]],hostBindings:function(t,o){1&t&&e.NdJ("input",function(_){return o.onInput(_.target.value)})}}),n})();var Ro=p(39092),mt=p(4416),Ye=p(58039),tt=p(10545);function Mo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,41),e.qZA())}function Oo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,42),e.qZA())}function ho(n,s){1&n&&(e.TgZ(0,"span",40),e.ynx(1),e.SDv(2,43),e.BQk(),e._UZ(3,"br"),e.ynx(4),e.SDv(5,44),e.BQk(),e._UZ(6,"br"),e.TgZ(7,"a",45),e.SDv(8,46),e.qZA()())}function Ao(n,s){1&n&&(e.TgZ(0,"span",47),e.SDv(1,48),e.qZA())}const V=function(n){return[n]};function Po(n,s){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",49),e._UZ(2,"input",50),e.TgZ(3,"button",51),e.NdJ("click",function(){const i=e.CHM(t),_=i.index,r=i.$implicit;return e.oxw(2).removePortal(_,r)}),e._UZ(4,"i",15),e.qZA()(),e.BQk()}if(2&n){const t=s.$implicit,o=e.oxw(2);e.xp6(2),e.Q6J("value",t),e.xp6(2),e.Q6J("ngClass",e.VKq(2,V,o.icons.destroy))}}function Io(n,s){if(1&n&&(e.TgZ(0,"span",40),e.SDv(1,52),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.pQV(t.minimum_gateways),e.QtT(1)}}function bo(n,s){if(1&n&&(e.TgZ(0,"div",55),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 No(n,s){if(1&n&&(e.ynx(0),e.SDv(1,56),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 Fo(n,s){1&n&&(e.ynx(0),e.SDv(1,57),e.BQk())}function Do(n,s){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",49),e._UZ(2,"input",50),e.YNc(3,bo,2,1,"div",53),e.TgZ(4,"button",51),e.NdJ("click",function(){const _=e.CHM(t).$implicit;return e.oxw(2).imageSettingsModal(_)}),e._UZ(5,"i",15),e.qZA(),e.TgZ(6,"button",51),e.NdJ("click",function(){const i=e.CHM(t),_=i.index,r=i.$implicit;return e.oxw(2).removeImage(_,r)}),e._UZ(7,"i",15),e.qZA()(),e.TgZ(8,"span",47),e.YNc(9,No,3,3,"ng-container",54),e.YNc(10,Fo,2,0,"ng-container",54),e.qZA(),e.BQk()}if(2&n){const t=s.$implicit,o=e.oxw(2);e.xp6(2),e.Q6J("value",t),e.xp6(1),e.Q6J("ngIf",o.api_version>=1),e.xp6(2),e.Q6J("ngClass",e.VKq(6,V,o.icons.deepCheck)),e.xp6(2),e.Q6J("ngClass",e.VKq(8,V,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 vo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,58),e.qZA())}function Lo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,59),e.qZA())}function $o(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,77),e.qZA())}function Bo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,78),e.qZA())}function Go(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,79),e.qZA())}function yo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,80),e.qZA())}function xo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,81),e.qZA())}function Zo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,82),e.qZA())}function wo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,83),e.qZA())}function Ho(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,84),e.qZA())}function ko(n,s){if(1&n&&(e.TgZ(0,"div",60)(1,"div",8)(2,"label",61),e.ynx(3),e.SDv(4,62),e.BQk(),e.qZA(),e.TgZ(5,"div",11),e._UZ(6,"input",63),e.YNc(7,$o,2,0,"span",16),e.YNc(8,Bo,2,0,"span",16),e.qZA()(),e.TgZ(9,"div",8)(10,"label",64),e.ynx(11),e.SDv(12,65),e.BQk(),e.qZA(),e.TgZ(13,"div",11)(14,"div",12),e._UZ(15,"input",66)(16,"button",67)(17,"cd-copy-2-clipboard-button",68),e.qZA(),e.YNc(18,Go,2,0,"span",16),e.YNc(19,yo,2,0,"span",16),e.qZA()(),e.TgZ(20,"div",8)(21,"label",69),e.ynx(22),e.SDv(23,70),e.BQk(),e.qZA(),e.TgZ(24,"div",11),e._UZ(25,"input",71),e.YNc(26,xo,2,0,"span",16),e.YNc(27,Zo,2,0,"span",16),e.qZA()(),e.TgZ(28,"div",8)(29,"label",72),e.ynx(30),e.SDv(31,73),e.BQk(),e.qZA(),e.TgZ(32,"div",11)(33,"div",12),e._UZ(34,"input",74)(35,"button",75)(36,"cd-copy-2-clipboard-button",76),e.qZA(),e.YNc(37,wo,2,0,"span",16),e.YNc(38,Ho,2,0,"span",16),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(10),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(10),e.Q6J("ngIf",o.targetForm.showError("mutual_password",t,"required")),e.xp6(1),e.Q6J("ngIf",o.targetForm.showError("mutual_password",t,"pattern"))}}function qo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,114),e.qZA())}function Ko(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,115),e.qZA())}function Xo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,116),e.qZA())}function Qo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,117),e.qZA())}function zo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,118),e.qZA())}function Jo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,119),e.qZA())}function Yo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,120),e.qZA())}function Vo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,121),e.qZA())}function Uo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,122),e.qZA())}function jo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,123),e.qZA())}function Wo(n,s){1&n&&(e.TgZ(0,"span",40),e.SDv(1,124),e.qZA())}function en(n,s){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",49),e._UZ(2,"input",50),e.TgZ(3,"button",51),e.NdJ("click",function(){const i=e.CHM(t),_=i.index,r=i.$implicit,l=e.oxw(),d=l.$implicit,u=l.index;return e.oxw(3).removeInitiatorImage(d,_,u,r)}),e._UZ(4,"i",15),e.qZA()(),e.BQk()}if(2&n){const t=s.$implicit,o=e.oxw(4);e.xp6(2),e.Q6J("value",t),e.xp6(2),e.Q6J("ngClass",e.VKq(2,V,o.icons.destroy))}}function tn(n,s){1&n&&(e.TgZ(0,"span"),e.SDv(1,125),e.qZA())}function on(n,s){if(1&n&&(e.TgZ(0,"div",21)(1,"div",22)(2,"cd-select",126),e._UZ(3,"i",24),e.ynx(4),e.SDv(5,127),e.BQk(),e.qZA()()()),2&n){const t=e.oxw(),o=t.$implicit,i=t.index,_=e.oxw(3);e.xp6(2),e.Q6J("data",o.getValue("luns"))("options",_.imagesInitiatorSelections[i])("messages",_.messages.initiatorImage),e.xp6(1),e.Q6J("ngClass",e.VKq(4,V,_.icons.add))}}function nn(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div",91)(1,"div",5),e.ynx(2),e.SDv(3,92),e.BQk(),e._uU(4),e.TgZ(5,"button",93),e.NdJ("click",function(){const _=e.CHM(t).index;return e.oxw(3).removeInitiator(_)}),e.qZA()(),e.TgZ(6,"div",7)(7,"div",8)(8,"label",94),e.SDv(9,95),e.qZA(),e.TgZ(10,"div",11)(11,"input",96),e.NdJ("blur",function(){return e.CHM(t),e.oxw(3).updatedInitiatorSelector()}),e.qZA(),e.YNc(12,qo,2,0,"span",16),e.YNc(13,Ko,2,0,"span",16),e.YNc(14,Xo,2,0,"span",16),e.qZA()(),e.ynx(15,60),e.TgZ(16,"div",8)(17,"label",97),e.SDv(18,98),e.qZA(),e.TgZ(19,"div",11),e._UZ(20,"input",99),e.YNc(21,Qo,2,0,"span",16),e.YNc(22,zo,2,0,"span",16),e.qZA()(),e.TgZ(23,"div",8)(24,"label",100),e.SDv(25,101),e.qZA(),e.TgZ(26,"div",11)(27,"div",12),e._UZ(28,"input",102)(29,"button",103)(30,"cd-copy-2-clipboard-button",104),e.qZA(),e.YNc(31,Jo,2,0,"span",16),e.YNc(32,Yo,2,0,"span",16),e.qZA()(),e.TgZ(33,"div",8)(34,"label",105),e.ynx(35),e.SDv(36,106),e.BQk(),e.qZA(),e.TgZ(37,"div",11),e._UZ(38,"input",107),e.YNc(39,Vo,2,0,"span",16),e.YNc(40,Uo,2,0,"span",16),e.qZA()(),e.TgZ(41,"div",8)(42,"label",108),e.SDv(43,109),e.qZA(),e.TgZ(44,"div",11)(45,"div",12),e._UZ(46,"input",110)(47,"button",103)(48,"cd-copy-2-clipboard-button",104),e.qZA(),e.YNc(49,jo,2,0,"span",16),e.YNc(50,Wo,2,0,"span",16),e.qZA()(),e.BQk(),e.TgZ(51,"div",8)(52,"label",111),e.SDv(53,112),e.qZA(),e.TgZ(54,"div",11),e.YNc(55,en,5,4,"ng-container",20),e.YNc(56,tn,2,0,"span",54),e.YNc(57,on,6,6,"div",113),e.qZA()()()()}if(2&n){const t=s.$implicit,o=s.index;e.oxw(2);const i=e.MAs(2);e.Q6J("formGroup",t),e.xp6(4),e.hij(": ",t.getValue("client_iqn")," "),e.xp6(8),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(1),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(1),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 sn(n,s){1&n&&(e.TgZ(0,"span",47),e.SDv(1,128),e.qZA())}function _n(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"label",85),e.SDv(2,86),e.qZA(),e.TgZ(3,"div",87),e.YNc(4,nn,58,24,"div",88),e.TgZ(5,"div",21)(6,"div",22),e.YNc(7,sn,2,0,"span",17),e.TgZ(8,"button",89),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).addInitiator(),!1}),e._UZ(9,"i",24),e.ynx(10),e.SDv(11,90),e.BQk(),e.qZA()()(),e._UZ(12,"hr"),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,V,t.icons.add))}}function an(n,s){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",49),e._UZ(2,"input",50),e.TgZ(3,"button",51),e.NdJ("click",function(){const _=e.CHM(t).index,r=e.oxw(),l=r.$implicit,d=r.index;return e.oxw(3).removeGroupInitiator(l,_,d)}),e._UZ(4,"i",15),e.qZA()(),e.BQk()}if(2&n){const t=s.$implicit,o=e.oxw(4);e.xp6(2),e.Q6J("value",t),e.xp6(2),e.Q6J("ngClass",e.VKq(2,V,o.icons.destroy))}}function rn(n,s){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",49),e._UZ(2,"input",50),e.TgZ(3,"button",51),e.NdJ("click",function(){const _=e.CHM(t).index,r=e.oxw(),l=r.$implicit,d=r.index;return e.oxw(3).removeGroupDisk(l,_,d)}),e._UZ(4,"i",15),e.qZA()(),e.BQk()}if(2&n){const t=s.$implicit,o=e.oxw(4);e.xp6(2),e.Q6J("value",t),e.xp6(2),e.Q6J("ngClass",e.VKq(2,V,o.icons.destroy))}}function ln(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div",91)(1,"div",5),e.ynx(2),e.SDv(3,132),e.BQk(),e._uU(4),e.TgZ(5,"button",93),e.NdJ("click",function(){const _=e.CHM(t).index;return e.oxw(3).removeGroup(_)}),e.qZA()(),e.TgZ(6,"div",7)(7,"div",8)(8,"label",133),e.SDv(9,134),e.qZA(),e.TgZ(10,"div",11),e._UZ(11,"input",135),e.qZA()(),e.TgZ(12,"div",8)(13,"label",136),e.ynx(14),e.SDv(15,137),e.BQk(),e.qZA(),e.TgZ(16,"div",11),e.YNc(17,an,5,4,"ng-container",20),e.TgZ(18,"div",21)(19,"div",22)(20,"cd-select",23),e.NdJ("selection",function(i){const r=e.CHM(t).index;return e.oxw(3).onGroupMemberSelection(i,r)}),e._UZ(21,"i",24),e.ynx(22),e.SDv(23,138),e.BQk(),e.qZA()()(),e._UZ(24,"hr"),e.qZA()(),e.TgZ(25,"div",8)(26,"label",27),e.ynx(27),e.SDv(28,139),e.BQk(),e.qZA(),e.TgZ(29,"div",11),e.YNc(30,rn,5,4,"ng-container",20),e.TgZ(31,"div",21)(32,"div",22)(33,"cd-select",126),e._UZ(34,"i",24),e.ynx(35),e.SDv(36,140),e.BQk(),e.qZA()()(),e._UZ(37,"hr"),e.qZA()()()()}if(2&n){const t=s.$implicit,o=s.index,i=e.oxw(3);e.Q6J("formGroup",t),e.xp6(4),e.hij(": ",t.getValue("group_id")," "),e.xp6(13),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(12,V,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(14,V,i.icons.add))}}function cn(n,s){1&n&&(e.TgZ(0,"span",47),e.SDv(1,141),e.qZA())}function dn(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"label",85),e.SDv(2,129),e.qZA(),e.TgZ(3,"div",130),e.YNc(4,ln,38,16,"div",88),e.TgZ(5,"div",21)(6,"div",22),e.YNc(7,cn,2,0,"span",17),e.TgZ(8,"button",89),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).addGroup(),!1}),e._UZ(9,"i",24),e.ynx(10),e.SDv(11,131),e.BQk(),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,V,t.icons.add))}}function pn(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div",1)(1,"form",2,3)(3,"div",4)(4,"div",5),e.SDv(5,6),e.ALo(6,"titlecase"),e.ALo(7,"upperFirst"),e.qZA(),e.TgZ(8,"div",7)(9,"div",8)(10,"label",9),e.SDv(11,10),e.qZA(),e.TgZ(12,"div",11)(13,"div",12),e._UZ(14,"input",13),e.TgZ(15,"button",14),e.NdJ("click",function(){return e.CHM(t),e.oxw().targetSettingsModal()}),e._UZ(16,"i",15),e.qZA()(),e.YNc(17,Mo,2,0,"span",16),e.YNc(18,Oo,2,0,"span",16),e.YNc(19,ho,9,0,"span",16),e.YNc(20,Ao,2,0,"span",17),e._UZ(21,"hr"),e.qZA()(),e.TgZ(22,"div",8)(23,"label",18),e.SDv(24,19),e.qZA(),e.TgZ(25,"div",11),e.YNc(26,Po,5,4,"ng-container",20),e.TgZ(27,"div",21)(28,"div",22)(29,"cd-select",23),e.NdJ("selection",function(i){return e.CHM(t),e.oxw().onPortalSelection(i)}),e._UZ(30,"i",24),e.ynx(31),e.SDv(32,25),e.BQk(),e.qZA()()(),e._UZ(33,"input",26),e.YNc(34,Io,2,1,"span",16),e._UZ(35,"hr"),e.qZA()(),e.TgZ(36,"div",8)(37,"label",27),e.SDv(38,28),e.qZA(),e.TgZ(39,"div",11),e.YNc(40,Do,11,10,"ng-container",20),e._UZ(41,"input",29),e.YNc(42,vo,2,0,"span",16),e.YNc(43,Lo,2,0,"span",16),e.TgZ(44,"div",21)(45,"div",22)(46,"cd-select",23),e.NdJ("selection",function(i){return e.CHM(t),e.oxw().onImageSelection(i)}),e._UZ(47,"i",24),e.ynx(48),e.SDv(49,30),e.BQk(),e.qZA()()(),e._UZ(50,"hr"),e.qZA()(),e.TgZ(51,"div",8)(52,"div",31)(53,"div",32),e._UZ(54,"input",33),e.TgZ(55,"label",34),e.SDv(56,35),e.qZA()(),e._UZ(57,"hr"),e.qZA()(),e.YNc(58,ko,39,8,"div",36),e.YNc(59,_n,13,5,"div",37),e.YNc(60,dn,12,5,"div",37),e.qZA(),e.TgZ(61,"div",38)(62,"cd-form-button-panel",39),e.NdJ("submitActionEvent",function(){return e.CHM(t),e.oxw().submit()}),e.ALo(63,"titlecase"),e.ALo(64,"upperFirst"),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(9),e.Q6J("ngClass",e.VKq(34,V,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,V,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,V,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(63,30,o.action)+" "+e.lcZ(64,32,o.resource))}}let gt=(()=>{class n extends k.E{constructor(t,o,i,_,r,l,d){super(),this.iscsiService=t,this.modalService=o,this.rbdService=i,this.router=_,this.route=r,this.taskWrapper=l,this.actionLabels=d,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 N.a({noOptions:"There are no portals available."}),images:new N.a({noOptions:"There are no images available."}),initiatorImage:new N.a({noOptions:"There are no images available. Please make sure you add an image to the target."}),groupInitiator:new N.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=new h.E(()=>{});t.pageInfo.limit=-1;const o=[this.iscsiService.listTargets(),this.rbdService.list(t.toParams()),this.iscsiService.portals(),this.iscsiService.settings(),this.iscsiService.version()];this.router.url.startsWith("/block/iscsi/targets/edit")&&(this.isEdit=!0,this.route.params.subscribe(i=>{this.target_iqn=decodeURIComponent(i.target_iqn),o.push(this.iscsiService.getTarget(this.target_iqn))})),this.action=this.isEdit?this.actionLabels.EDIT:this.actionLabels.CREATE,(0,le.D)(o).subscribe(i=>{const _=S()(i[0]).filter(l=>l.target_iqn!==this.target_iqn).flatMap(l=>l.disks).map(l=>`${l.pool}/${l.image}`).value();"api_version"in i[3]&&(this.api_version=i[3].api_version),this.minimum_gateways=i[3].config.minimum_gateways,this.target_default_controls=i[3].target_default_controls,this.target_controls_limits=i[3].target_controls_limits,this.disk_default_controls=i[3].disk_default_controls,this.disk_controls_limits=i[3].disk_controls_limits,this.backstores=i[3].backstores,this.default_backstore=i[3].default_backstore,this.unsupported_rbd_features=i[3].unsupported_rbd_features,this.required_rbd_features=i[3].required_rbd_features,this.imagesAll=S()(i[1]).flatMap(l=>l.value).filter(l=>!l.namespace&&!(-1!==_.indexOf(`${l.pool_name}/${l.name}`)||0===this.getValidBackstores(l).length)).value(),this.imagesSelections=this.imagesAll.map(l=>new y.$(!1,`${l.pool_name}/${l.name}`,""));const r=[];i[2].forEach(l=>{l.ip_addresses.forEach(d=>{r.push(new y.$(!1,l.name+":"+d,""))})}),this.portalsSelections=[...r],this.cephIscsiConfigVersion=i[4].ceph_iscsi_config_version,this.createForm(),i[5]&&this.resolveModel(i[5]),this.loadingReady()})}createForm(){if(this.targetForm=new Z.d({target_iqn:new a.NI("iqn.2001-07.com.ceph:"+Date.now(),{validators:[a.kI.required,a.kI.pattern(this.IQN_REGEX)]}),target_controls:new a.NI({}),portals:new a.NI([],{validators:[z.h.custom("minGateways",t=>S().uniq(t.map(i=>i.split(":")[0])).length<Math.max(1,this.minimum_gateways))]}),disks:new a.NI([],{validators:[z.h.custom("dupLunId",t=>{const o=this.getLunIds(t);return o.length!==S().uniq(o).length}),z.h.custom("dupWwn",t=>{const o=this.getWwns(t);return o.length!==S().uniq(o).length})]}),initiators:new a.Oe([]),groups:new a.Oe([]),acl_enabled:new a.NI(!1)}),this.cephIscsiConfigVersion>10){const t=new Z.d({user:new a.NI(""),password:new a.NI(""),mutual_user:new a.NI(""),mutual_password:new a.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=[];S().forEach(t.portals,_=>{o.push(`${_.host}:${_.ip}`)}),this.targetForm.patchValue({portals:o});const i=[];S().forEach(t.disks,_=>{const r=`${_.pool}/${_.image}`;i.push(r),this.imagesSettings[r]={backstore:_.backstore},this.imagesSettings[r][_.backstore]=_.controls,"lun"in _&&(this.imagesSettings[r].lun=_.lun),"wwn"in _&&(this.imagesSettings[r].wwn=_.wwn),this.onImageSelection({option:{name:r,selected:!0}})}),this.targetForm.patchValue({disks:i}),S().forEach(t.clients,_=>{const r=this.addInitiator();_.luns=S().map(_.luns,l=>`${l.pool}/${l.image}`),r.patchValue(_)}),t.groups.forEach((_,r)=>{const l=this.addGroup();_.disks=S().map(_.disks,d=>`${d.pool}/${d.image}`),l.patchValue(_),S().forEach(_.members,d=>{this.onGroupMemberSelection({option:new y.$(!0,d,"")},r)})})}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(_=>_!==t);o.get("luns").setValue(i)}),this.groups.controls.forEach(o=>{const i=o.value.disks.filter(_=>_!==t);o.get("disks").setValue(i)}),S().forEach(this.imagesInitiatorSelections,(o,i)=>{this.imagesInitiatorSelections[i]=o.filter(_=>_.name!==t)}),S().forEach(this.groupDiskSelections,(o,i)=>{this.groupDiskSelections[i]=o.filter(_=>_.name!==t)})}getDefaultBackstore(t){let o=this.default_backstore;const i=this.getImageById(t);return this.validFeatures(i,this.default_backstore)||this.backstores.forEach(_=>{_!==this.default_backstore&&this.validFeatures(i,_)&&(o=_)}),o}isLunIdInUse(t,o){const i=this.disks.value.filter(_=>_!==o);return this.getLunIds(i).includes(t)}getLunIds(t){return S().map(t,o=>this.imagesSettings[o].lun)}nextLunId(t){const o=this.disks.value.filter(r=>r!==t),i=this.getLunIds(o);let _=0;for(;i.includes(_);)_++;return _}getWwns(t){return S().map(t,i=>this.imagesSettings[i].wwn).filter(i=>S().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]={}}S().forEach(this.imagesInitiatorSelections,(i,_)=>{i.push(new y.$(!1,o.name,"")),this.imagesInitiatorSelections[_]=[...i]}),S().forEach(this.groupDiskSelections,(i,_)=>{i.push(new y.$(!1,o.name,"")),this.groupDiskSelections[_]=[...i]})}else this.removeImageRefs(o.name);this.targetForm.get("disks").updateValueAndValidity({emitEvent:!1})}get initiators(){return this.targetForm.get("initiators")}addInitiator(){const t=new Z.d({client_iqn:new a.NI("",{validators:[a.kI.required,z.h.custom("notUnique",i=>{const _=this.initiators.controls.reduce(function(r,l){return r.concat(l.value.client_iqn)},[]);return _.indexOf(i)!==_.lastIndexOf(i)}),a.kI.pattern(this.IQN_REGEX)]}),auth:new Z.d({user:new a.NI(""),password:new a.NI(""),mutual_user:new a.NI(""),mutual_password:new a.NI("")}),luns:new a.NI([]),cdIsInGroup:new a.NI(!1)});this.setAuthValidator(t),this.initiators.push(t),S().forEach(this.groupMembersSelections,(i,_)=>{i.push(new y.$(!1,"","")),this.groupMembersSelections[_]=[...i]});const o=S().map(this.targetForm.getValue("disks"),i=>new y.$(!1,i,""));return this.imagesInitiatorSelections.push(o),t}setAuthValidator(t){z.h.validateIf(t.get("user"),()=>t.getValue("password")||t.getValue("mutual_user")||t.getValue("mutual_password"),[a.kI.required],[a.kI.pattern(this.USER_REGEX)],[t.get("password"),t.get("mutual_user"),t.get("mutual_password")]),z.h.validateIf(t.get("password"),()=>t.getValue("user")||t.getValue("mutual_user")||t.getValue("mutual_password"),[a.kI.required],[a.kI.pattern(this.PASSWORD_REGEX)],[t.get("user"),t.get("mutual_user"),t.get("mutual_password")]),z.h.validateIf(t.get("mutual_user"),()=>t.getValue("mutual_password"),[a.kI.required],[a.kI.pattern(this.USER_REGEX)],[t.get("user"),t.get("password"),t.get("mutual_password")]),z.h.validateIf(t.get("mutual_password"),()=>t.getValue("mutual_user"),[a.kI.required],[a.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),S().forEach(this.groupMembersSelections,(i,_)=>{i.splice(t,1),this.groupMembersSelections[_]=[...i]}),this.groups.controls.forEach(i=>{const _=i.value.members.filter(r=>r!==o.client_iqn);i.get("members").setValue(_)}),this.imagesInitiatorSelections.splice(t,1)}updatedInitiatorSelector(){this.initiators.controls.forEach(t=>{t.get("client_iqn").updateValueAndValidity({emitEvent:!1})}),S().forEach(this.groupMembersSelections,(t,o)=>{S().forEach(t,(i,_)=>{const r=i.name;i.name=this.initiators.controls[_].value.client_iqn,this.groups.controls.forEach(l=>{const d=l.value.members,u=d.indexOf(r);-1!==u&&(d[u]=i.name),l.get("members").setValue(d)})}),this.groupMembersSelections[o]=[...this.groupMembersSelections[o]]})}removeInitiatorImage(t,o,i,_){const r=t.getValue("luns");return r.splice(o,1),t.patchValue({luns:r}),this.imagesInitiatorSelections[i].forEach(l=>{l.name===_&&(l.selected=!1)}),!1}get groups(){return this.targetForm.get("groups")}addGroup(){const t=new Z.d({group_id:new a.NI("",{validators:[a.kI.required]}),members:new a.NI([]),disks:new a.NI([])});this.groups.push(t);const o=S().map(this.targetForm.getValue("disks"),_=>new y.$(!1,_,""));this.groupDiskSelections.push(o);const i=S().map(this.initiators.value,_=>new y.$(!1,_.client_iqn,"",!_.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 _=[];i.selected||(_=this.groupDiskSelections[o].filter(l=>l.selected).map(l=>l.name)),this.initiators.controls.forEach((r,l)=>{r.value.client_iqn===i.name&&(r.patchValue({luns:_}),r.get("cdIsInGroup").setValue(i.selected),S().forEach(this.groupMembersSelections,d=>{d[l].enabled=!i.selected}),this.imagesInitiatorSelections[l].forEach(d=>{d.selected=_.includes(d.name)}))})}removeGroupInitiator(t,o,i){const _=t.getValue("members")[o];t.getValue("members").splice(o,1),this.onGroupMemberSelection({option:new y.$(!1,_,"")},i)}removeGroupDisk(t,o,i){const _=t.getValue("disks")[o];t.getValue("disks").splice(o,1),this.groupDiskSelections[i].forEach(r=>{r.name===_&&(r.selected=!1)}),this.groupDiskSelections[i]=[...this.groupDiskSelections[i]]}submit(){const t=S().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 _=this.targetForm.get("auth");_.getValue("user")||_.get("user").setValue(""),_.getValue("password")||_.get("password").setValue(""),_.getValue("mutual_user")||_.get("mutual_user").setValue(""),_.getValue("mutual_password")||_.get("mutual_password").setValue("");const r=this.targetForm.getValue("acl_enabled");o.auth={user:r?"":_.getValue("user"),password:r?"":_.getValue("password"),mutual_user:r?"":_.getValue("mutual_user"),mutual_password:r?"":_.getValue("mutual_password")}}let i;t.disks.forEach(_=>{const r=_.split("/"),l=this.imagesSettings[_].backstore;o.disks.push({pool:r[0],image:r[1],backstore:l,controls:this.imagesSettings[_][l],lun:this.imagesSettings[_].lun,wwn:this.imagesSettings[_].wwn})}),t.portals.forEach(_=>{const r=_.indexOf(":");o.portals.push({host:_.substring(0,r),ip:_.substring(r+1)})}),o.acl_enabled&&(t.initiators.forEach(_=>{_.auth.user||(_.auth.user=""),_.auth.password||(_.auth.password=""),_.auth.mutual_user||(_.auth.mutual_user=""),_.auth.mutual_password||(_.auth.mutual_password=""),delete _.cdIsInGroup;const r=[];_.luns.forEach(l=>{const d=l.split("/");r.push({pool:d[0],image:d[1]})}),_.luns=r}),o.clients=t.initiators),o.acl_enabled&&(t.groups.forEach(_=>{const r=[];_.disks.forEach(l=>{const d=l.split("/");r.push({pool:d[0],image:d[1]})}),_.disks=r}),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 R.R("iscsi/target/edit",{target_iqn:o.target_iqn}),call:this.iscsiService.updateTarget(this.target_iqn,o)})):i=this.taskWrapper.wrapTaskAroundCall({task:new R.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(So,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(fo,o)}validFeatures(t,o){const i=t.features,_=this.required_rbd_features[o];return(i&_)===_&&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(Q),e.Y36(de.Z),e.Y36(H),e.Y36(g.F0),e.Y36(g.gz),e.Y36(m.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 s,t,o,i,_,r,l,d,u,f,I,P,B,x,q,J,ee,te,w,_e,ae,M,ue,me,ge,Te,fe,Ce,Se,G,ye,xe,Ze,we,He,ke,qe,Ke,Xe,Qe,ze,b,Gt,yt,xt,Zt,wt,Ht,kt,qt,Kt,Xt,Qt,zt,Jt,Yt,Vt,Ut,jt,Wt,eo,to;return s="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Target IQN",o="Portals",i="Add portal",_="Images",r="Add image",l="ACL authentication",d="This field is required.",u="IQN has wrong pattern.",f="An IQN has the following notation 'iqn.$year-$month.$reversedAddress:$definedName'",I="For example: iqn.2016-06.org.dashboard:storage:disk.sn-a8675309",P="More information",B="This target has modified advanced settings.",x="At least " + "\ufffd0\ufffd" + " gateways are required.",q="Backstore: " + "\ufffd0\ufffd" + ".\xA0",J="This image has modified settings.",ee="Duplicated LUN numbers.",te="Duplicated WWN.",w="User",_e="Password",ae="Mutual User",M="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 ':'.",ge="This field is required.",Te="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",fe="This field is required.",Ce="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",Se="This field is required.",G="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",ye="Initiators",xe="Add initiator",Ze="Initiator",we="Client IQN",He="User",ke="Password",qe="Mutual User",Ke="Mutual Password",Xe="Images",Qe="Initiator IQN needs to be unique.",ze="This field is required.",b="IQN has wrong pattern.",Gt="This field is required.",yt="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",xt="This field is required.",Zt="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",wt="This field is required.",Ht="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",kt="This field is required.",qt="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",Kt="Initiator belongs to a group. Images will be configure in the group.",Xt="Add image",Qt="No items added.",zt="Groups",Jt="Add group",Yt="Group",Vt="Name",Ut="Initiators",jt="Add initiator",Wt="Images",eo="Add image",to="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"],s,[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"],["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-end",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"],_,["type","hidden","id","disks","name","disks","formControlName","disks",1,"form-control"],r,[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"],l,["formGroupName","auth",4,"ngIf"],["class","form-group row",4,"ngIf"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],d,u,f,I,["target","_blank","href","https://en.wikipedia.org/wiki/ISCSI#Addressing"],P,[1,"form-text","text-muted"],B,[1,"input-group","cd-mb"],["type","text","disabled","",1,"cd-form-control",3,"value"],["type","button",1,"btn","btn-light",3,"click"],x,["class","input-group-text",4,"ngIf"],[4,"ngIf"],[1,"input-group-text"],q,J,ee,te,["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"],_e,["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"],ae,["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"],M,["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,ge,Te,fe,Ce,Se,G,["for","initiators",1,"cd-col-form-label"],ye,["formArrayName","initiators",1,"cd-col-form-input"],["class","card mb-2",3,"formGroup",4,"ngFor","ngForOf"],[1,"btn","btn-light","float-end",3,"click"],xe,[1,"card","mb-2",3,"formGroup"],Ze,["type","button",1,"btn-close","float-end",3,"click"],["for","client_iqn",1,"cd-col-form-label","required"],we,["type","text","formControlName","client_iqn","cdTrim","",1,"form-control",3,"blur"],["for","user",1,"cd-col-form-label"],He,["formControlName","user","autocomplete","off","type","text",1,"form-control",3,"id"],["for","password",1,"cd-col-form-label"],ke,["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"],qe,["formControlName","mutual_user","autocomplete","off","type","text",1,"form-control",3,"id"],["for","mutual_password",1,"cd-col-form-label"],Ke,["formControlName","mutual_password","autocomplete","new-password","type","password",1,"form-control",3,"id"],["for","luns",1,"cd-col-form-label"],Xe,["class","row",4,"ngIf"],Qe,ze,b,Gt,yt,xt,Zt,wt,Ht,kt,qt,Kt,["elemClass","btn btn-light float-end",3,"data","options","messages"],Xt,Qt,zt,["formArrayName","groups",1,"cd-col-form-input"],Jt,Yt,["for","group_id",1,"cd-col-form-label","required"],Vt,["type","text","formControlName","group_id",1,"form-control"],["for","members",1,"cd-col-form-label"],Ut,jt,Wt,eo,to]},template:function(t,o){1&t&&e.YNc(0,pn,65,40,"div",0),2&t&&e.Q6J("cdFormLoading",o.loading)},directives:[ut.y,a._Y,a.JL,a.sg,A.V,O.P,$.o,a.Fj,X.b,a.JJ,a.u,Eo,c.mk,c.O5,c.sg,Ro.H,a.Wl,a.x0,mt.C,Ye.s,a.CE,j.p],pipes:[c.rS,tt.m,Je.V],styles:[".cd-mb[_ngcontent-%COMP%]{margin-bottom:10px}"]}),n})();var Tt=p(68136),pe=p(30982),W=p(83697),ve=p(99466),Ee=p(68774),ft=p(55657),ce=p(38047),ot=p(18001),Le=p(97161),oe=p(47640);function un(n,s){1&n&&(e.TgZ(0,"span",29),e.SDv(1,30),e.qZA())}function mn(n,s){1&n&&(e.TgZ(0,"span",29),e.SDv(1,31),e.qZA())}function gn(n,s){1&n&&(e.TgZ(0,"span",29),e.SDv(1,32),e.qZA())}function Tn(n,s){1&n&&(e.TgZ(0,"span",29),e.SDv(1,33),e.qZA())}function fn(n,s){1&n&&(e.TgZ(0,"span",29),e.SDv(1,34),e.qZA())}function Cn(n,s){1&n&&(e.TgZ(0,"span",29),e.SDv(1,35),e.qZA())}function Sn(n,s){1&n&&(e.TgZ(0,"span",29),e.SDv(1,36),e.qZA())}function En(n,s){1&n&&(e.TgZ(0,"span",29),e.SDv(1,37),e.qZA())}let Rn=(()=>{class n{constructor(t,o,i,_,r){this.authStorageService=t,this.activeModal=o,this.actionLabels=i,this.iscsiService=_,this.notificationService=r,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 Z.d({user:new a.NI({value:"",disabled:!this.hasPermission}),password:new a.NI({value:"",disabled:!this.hasPermission}),mutual_user:new a.NI({value:"",disabled:!this.hasPermission}),mutual_password:new a.NI({value:"",disabled:!this.hasPermission})}),z.h.validateIf(this.discoveryForm.get("user"),()=>this.discoveryForm.getValue("password")||this.discoveryForm.getValue("mutual_user")||this.discoveryForm.getValue("mutual_password"),[a.kI.required],[a.kI.pattern(this.USER_REGEX)],[this.discoveryForm.get("password"),this.discoveryForm.get("mutual_user"),this.discoveryForm.get("mutual_password")]),z.h.validateIf(this.discoveryForm.get("password"),()=>this.discoveryForm.getValue("user")||this.discoveryForm.getValue("mutual_user")||this.discoveryForm.getValue("mutual_password"),[a.kI.required],[a.kI.pattern(this.PASSWORD_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("mutual_user"),this.discoveryForm.get("mutual_password")]),z.h.validateIf(this.discoveryForm.get("mutual_user"),()=>this.discoveryForm.getValue("mutual_password"),[a.kI.required],[a.kI.pattern(this.USER_REGEX)],[this.discoveryForm.get("user"),this.discoveryForm.get("password"),this.discoveryForm.get("mutual_password")]),z.h.validateIf(this.discoveryForm.get("mutual_password"),()=>this.discoveryForm.getValue("mutual_user"),[a.kI.required],[a.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(ot.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(v.Kz),e.Y36(D.p4),e.Y36(Q),e.Y36(Le.g))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-target-discovery-modal"]],decls:44,vars:13,consts:function(){let s,t,o,i,_,r,l,d,u,f,I,P,B;return s="Discovery Authentication",t="User",o="Password",i="Mutual User",_="Mutual Password",r="This field is required.",l="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",d="This field is required.",u="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",f="This field is required.",I="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",P="This field is required.",B="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",[[3,"modalRef"],[1,"modal-title"],s,[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"],["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"],_,["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"],r,l,d,u,f,I,P,B]},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)(6,"div",6)(7,"div",7)(8,"label",8),e.SDv(9,9),e.qZA(),e.TgZ(10,"div",10),e._UZ(11,"input",11),e.YNc(12,un,2,0,"span",12),e.YNc(13,mn,2,0,"span",12),e.qZA()(),e.TgZ(14,"div",7)(15,"label",13),e.SDv(16,14),e.qZA(),e.TgZ(17,"div",10)(18,"div",15),e._UZ(19,"input",16)(20,"button",17)(21,"cd-copy-2-clipboard-button",18),e.qZA(),e.YNc(22,gn,2,0,"span",12),e.YNc(23,Tn,2,0,"span",12),e.qZA()(),e.TgZ(24,"div",7)(25,"label",19),e.ynx(26),e.SDv(27,20),e.BQk(),e.qZA(),e.TgZ(28,"div",10),e._UZ(29,"input",21),e.YNc(30,fn,2,0,"span",12),e.YNc(31,Cn,2,0,"span",12),e.qZA()(),e.TgZ(32,"div",7)(33,"label",22),e.SDv(34,23),e.qZA(),e.TgZ(35,"div",10)(36,"div",15),e._UZ(37,"input",24)(38,"button",25)(39,"cd-copy-2-clipboard-button",26),e.qZA(),e.YNc(40,Sn,2,0,"span",12),e.YNc(41,En,2,0,"span",12),e.qZA()()(),e.TgZ(42,"div",27)(43,"cd-form-button-panel",28),e.NdJ("submitActionEvent",function(){return o.submitAction()}),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(9),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(9),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:[C.z,a._Y,a.JL,a.sg,A.V,O.P,$.o,a.Fj,X.b,a.JJ,a.u,c.O5,mt.C,Ye.s,j.p],styles:[""]}),n})();var Mn=p(86969);let Ct=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-tabs"]],decls:7,vars:0,consts:function(){let s,t;return s="Overview",t="Targets",[[1,"nav","nav-tabs"],[1,"nav-item"],["routerLink","/block/iscsi/overview","routerLinkActive","active","ariaCurrentWhenActive","page",1,"nav-link"],s,["routerLink","/block/iscsi/targets","routerLinkActive","active","ariaCurrentWhenActive","page",1,"nav-link"],t]},template:function(t,o){1&t&&(e.TgZ(0,"ul",0)(1,"li",1)(2,"a",2),e.SDv(3,3),e.qZA()(),e.TgZ(4,"li",1)(5,"a",4),e.SDv(6,5),e.qZA()()())},directives:[g.yS,g.Od],styles:[""]}),n})();var St=p(34501),On=p(30490),Re=p(94928),hn=p(68962);const An=["highlightTpl"],Pn=["detailTable"],In=["tree"],bn=function(){return["logged_in"]},Nn=function(){return["logged_out"]},Fn=function(n,s){return{"badge-success":n,"badge-danger":s}};function Dn(n,s){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=s.$implicit;e.Tol(t.data.cdIcon),e.xp6(2),e.Oqu(t.data.name),e.xp6(2),e.Q6J("ngClass",e.WLB(7,Fn,e.DdM(5,bn).includes(t.data.status),e.DdM(6,Nn).includes(t.data.status))),e.xp6(1),e.hij(" ",t.data.status," ")}}function vn(n,s){if(1&n&&(e.TgZ(0,"div",9)(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 Ln(n,s){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 $n(n,s){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 Bn(n,s){if(1&n&&(e.YNc(0,Ln,2,1,"span",12),e.YNc(1,$n,2,1,"strong",12)),2&n){const t=s.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 Gn=(()=>{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=S().cloneDeep(this.selectedItem.target_controls);this.cephIscsiConfigVersion>10&&S().extend(t,S().cloneDeep(this.selectedItem.auth)),this.metadata={root:t};const o={target:{expanded:S().join(this.selectedItem.cdExecuting?[T.P.large,T.P.spinner,T.P.spin]:[T.P.large,T.P.bullseye]," ")},initiators:{expanded:S().join([T.P.large,T.P.user]," "),leaf:S().join([T.P.user]," ")},groups:{expanded:S().join([T.P.large,T.P.users]," "),leaf:S().join([T.P.users]," ")},disks:{expanded:S().join([T.P.large,T.P.disk]," "),leaf:S().join([T.P.disk]," ")},portals:{expanded:S().join([T.P.large,T.P.server]," "),leaf:S().join([T.P.server]," ")}},i=[];S().forEach(this.selectedItem.disks,d=>{const u="disk_"+d.pool+"_"+d.image;this.metadata[u]={controls:d.controls,backstore:d.backstore},["wwn","lun"].forEach(f=>{f in d&&(this.metadata[u][f]=d[f])}),i.push({name:`${d.pool}/${d.image}`,cdId:u,cdIcon:o.disks.leaf})});const _=[];S().forEach(this.selectedItem.portals,d=>{_.push({name:`${d.host}:${d.ip}`,cdIcon:o.portals.leaf})});const r=[];S().forEach(this.selectedItem.clients,d=>{const u=S().cloneDeep(d.auth);d.info&&(S().extend(u,d.info),delete u.state,S().forEach(Object.keys(d.info.state),P=>{u[P.toLowerCase()]=d.info.state[P]})),this.metadata["client_"+d.client_iqn]=u;const f=[];d.luns.forEach(P=>{f.push({name:`${P.pool}/${P.image}`,cdId:"disk_"+P.pool+"_"+P.image,cdIcon:o.disks.leaf})});let I="";d.info&&(I=Object.keys(d.info.state).includes("LOGGED_IN")?"logged_in":"logged_out"),r.push({name:d.client_iqn,status:I,cdId:"client_"+d.client_iqn,children:f,cdIcon:o.initiators.leaf})});const l=[];S().forEach(this.selectedItem.groups,d=>{const u=[];d.disks.forEach(I=>{u.push({name:`${I.pool}/${I.image}`,cdId:"disk_"+I.pool+"_"+I.image,cdIcon:o.disks.leaf})});const f=[];d.members.forEach(I=>{f.push({name:I,cdId:"client_"+I})}),l.push({name:d.group_id,cdIcon:o.groups.leaf,children:[{name:"Disks",children:u,cdIcon:o.disks.expanded},{name:"Initiators",children:f,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:_,cdIcon:o.portals.expanded},{name:"Initiators",isExpanded:!0,children:r,cdIcon:o.initiators.expanded},{name:"Groups",isExpanded:!0,children:l,cdIcon:o.groups.expanded}]}]}format(t){return"boolean"==typeof t?this.booleanTextPipe.transform(t):t}onNodeSelected(t,o){var i,_,r,l;if(ne.iM.ACTIVATE(t,o,!0),o.data.cdId){this.title=o.data.name;const d=this.metadata[o.data.cdId]||{};"root"===o.data.cdId?(null===(i=this.detailTable)||void 0===i||i.toggleColumn({prop:"default",isHidden:!0}),this.data=S().map(this.settings.target_default_controls,(u,f)=>({displayName:f,default:u=this.format(u),current:S().isUndefined(d[f])?u:this.format(d[f])})),this.cephIscsiConfigVersion>10&&["user","password","mutual_user","mutual_password"].forEach(u=>{this.data.push({displayName:u,default:null,current:d[u]})})):o.data.cdId.toString().startsWith("disk_")?(null===(_=this.detailTable)||void 0===_||_.toggleColumn({prop:"default",isHidden:!0}),this.data=S().map(this.settings.disk_default_controls[d.backstore],(u,f)=>({displayName:f,default:u=this.format(u),current:S().isUndefined(d.controls[f])?u:this.format(d.controls[f])})),this.data.push({displayName:"backstore",default:this.iscsiBackstorePipe.transform(this.settings.default_backstore),current:this.iscsiBackstorePipe.transform(d.backstore)}),["wwn","lun"].forEach(u=>{u in d&&this.data.push({displayName:u,default:void 0,current:d[u]})})):(null===(r=this.detailTable)||void 0===r||r.toggleColumn({prop:"default",isHidden:!1}),this.data=S().map(d,(u,f)=>({displayName:f,default:void 0,current:this.format(u)})))}else this.data=void 0;null===(l=this.detailTable)||void 0===l||l.updateColumns()}onUpdateData(){this.tree.treeModel.expandAll()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Je.V),e.Y36(hn.T))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi-target-details"]],viewQuery:function(t,o){if(1&t&&(e.Gf(An,7),e.Gf(Pn,5),e.Gf(In,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 s;return s="iSCSI Topology",[[1,"row"],[1,"col-6"],s,[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)(1,"div",1)(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,Dn,6,10,"ng-template",null,5,e.W1O),e.qZA()(),e.YNc(8,vn,5,4,"div",6),e.qZA(),e.YNc(9,Bn,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,c.mk,c.O5,W.a],styles:[""]}),n})();function yn(n,s){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 xn(n,s){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,yn,6,1,"ng-container",5),e.qZA()),2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngIf",t.status)}}function Zn(n,s){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 wn=function(n){return[n]};function Hn(n,s){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.YNc(8,Zn,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,wn,t.icons.key)),e.xp6(3),e.Q6J("ngIf",t.expandedRow)}}let kn=(()=>{class n extends Tt.o{constructor(t,o,i,_,r,l,d,u,f){super(f),this.authStorageService=t,this.iscsiService=o,this.joinPipe=i,this.taskListService=_,this.notAvailablePipe=r,this.modalService=l,this.taskWrapper=d,this.actionLabels=u,this.ngZone=f,this.available=void 0,this.selection=new Ee.r,this.targets=[],this.icons=T.P,this.builders={"iscsi/target/create":I=>({target_iqn:I.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&&S().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&&S().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(pe.M,{itemDescription:"iSCSI target",itemNames:[t],submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new R.R("iscsi/target/delete",{target_iqn:t}),call:this.iscsiService.deleteTarget(t)})})}configureDiscoveryAuth(){this.modalService.show(Rn)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(Q),e.Y36(Mn.A),e.Y36(ce.j),e.Y36(ft.g),e.Y36(de.Z),e.Y36(m.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(W.a,5),2&t){let i;e.iGM(i=e.CRH())&&(o.table=i.first)}},features:[e._Bn([ce.j]),e.qOj],decls:3,vars:2,consts:function(){let s,t,o,i;return s="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",s,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",s],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,xn,5,1,"cd-alert-panel",0),e.YNc(2,Hn,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:[Ct,c.O5,St.G,On.K,W.a,Re.K,$.o,c.mk,Gn],styles:[""]}),n})();var nt=p(66369),qn=p(76446),Kn=p(90068);const Xn=["iscsiSparklineTpl"],Qn=["iscsiPerSecondTpl"],zn=["iscsiRelativeDateTpl"];function Jn(n,s){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 Yn(n,s){1&n&&(e.TgZ(0,"span",10),e._uU(1," n/a "),e.qZA())}function Vn(n,s){if(1&n&&(e.YNc(0,Jn,2,2,"span",7),e.YNc(1,Yn,2,0,"span",8)),2&n){const t=s.row;e.Q6J("ngIf","user:rbd"===t.backstore),e.xp6(1),e.Q6J("ngIf","user:rbd"!==t.backstore)}}function Un(n,s){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 jn(n,s){1&n&&(e.TgZ(0,"span",10),e._uU(1," n/a "),e.qZA())}function Wn(n,s){if(1&n&&(e.YNc(0,Un,2,1,"span",7),e.YNc(1,jn,2,0,"span",8)),2&n){const t=s.row;e.Q6J("ngIf","user:rbd"===t.backstore),e.xp6(1),e.Q6J("ngIf","user:rbd"!==t.backstore)}}function ei(n,s){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 ti(n,s){1&n&&(e.TgZ(0,"span",10),e._uU(1," n/a "),e.qZA())}function oi(n,s){if(1&n&&(e.YNc(0,ei,4,5,"span",7),e.YNc(1,ti,2,0,"span",8)),2&n){const t=s.row;e.Q6J("ngIf","user:rbd"===t.backstore),e.xp6(1),e.Q6J("ngIf","user:rbd"!==t.backstore)}}let ni=(()=>{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(Q),e.Y36(nt.n),e.Y36(Je.V))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-iscsi"]],viewQuery:function(t,o){if(1&t&&(e.Gf(Xn,7),e.Gf(Qn,7),e.Gf(zn,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:15,vars:4,consts:function(){let s,t;return s="Gateways",t="Images",[s,[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,"div")(4,"cd-table",1),e.NdJ("fetchData",function(){return o.refresh()}),e.qZA()(),e.TgZ(5,"legend"),e.SDv(6,2),e.qZA(),e.TgZ(7,"div"),e._UZ(8,"cd-table",3),e.qZA(),e.YNc(9,Vn,2,2,"ng-template",null,4,e.W1O),e.YNc(11,Wn,2,2,"ng-template",null,5,e.W1O),e.YNc(13,oi,2,2,"ng-template",null,6,e.W1O)),2&t&&(e.xp6(4),e.Q6J("data",o.gateways)("columns",o.gatewaysColumns),e.xp6(4),e.Q6J("data",o.images)("columns",o.imagesColumns))},directives:[Ct,W.a,c.O5,qn.l],pipes:[ft.g,Kn.h],styles:[""]}),n})(),ii=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[c.ez,Ae.m,v.Oz,g.Bz,a.u5,a.UX,v.ZQ,v.HK]]}),n})();var si=p(13464),_i=p(26215),ai=p(45435),Et=p(36848);let K=class{constructor(s,t){this.http=s,this.timerService=t,this.REFRESH_INTERVAL=3e4,this.summaryDataSource=new _i.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 s=>{this.summaryDataSource.next(s)}}subscribeSummary(s,t){return this.summaryData$.pipe((0,ai.h)(o=>!!o)).subscribe(s,t)}getPool(s){return this.http.get(`api/block/mirroring/pool/${s}`)}updatePool(s,t){return this.http.put(`api/block/mirroring/pool/${s}`,t,{observe:"response"})}getSiteName(){return this.http.get("api/block/mirroring/site_name")}setSiteName(s){return this.http.put("api/block/mirroring/site_name",{site_name:s},{observe:"response"})}createBootstrapToken(s){return this.http.post(`api/block/mirroring/pool/${s}/bootstrap/token`,{})}importBootstrapToken(s,t,o){return this.http.post(`api/block/mirroring/pool/${s}/bootstrap/peer`,{direction:t,token:o},{observe:"response"})}getPeer(s,t){return this.http.get(`api/block/mirroring/pool/${s}/peer/${t}`)}getPeerForPool(s){return this.http.get(`api/block/mirroring/pool/${s}/peer`)}addPeer(s,t){return this.http.post(`api/block/mirroring/pool/${s}/peer`,t,{observe:"response"})}updatePeer(s,t,o){return this.http.put(`api/block/mirroring/pool/${s}/peer/${t}`,o,{observe:"response"})}deletePeer(s,t){return this.http.delete(`api/block/mirroring/pool/${s}/peer/${t}`,{observe:"response"})}};K.\u0275fac=function(s){return new(s||K)(e.LFG(ie.eN),e.LFG(Et.f))},K.\u0275prov=e.Yz7({token:K,factory:K.\u0275fac,providedIn:"root"}),(0,F.gn)([(0,F.fM)(0,Y.G),(0,F.w6)("design:type",Function),(0,F.w6)("design:paramtypes",[String]),(0,F.w6)("design:returntype",void 0)],K.prototype,"setSiteName",null),(0,F.gn)([(0,F.fM)(1,Y.G),(0,F.fM)(2,Y.G),(0,F.w6)("design:type",Function),(0,F.w6)("design:paramtypes",[String,String,String]),(0,F.w6)("design:returntype",void 0)],K.prototype,"importBootstrapToken",null),K=(0,F.gn)([Y.o,(0,F.w6)("design:paramtypes",[ie.eN,Et.f])],K);var it=p(6481),ri=p(68307),Rt=p(12627),Me=p(82945),li=p(39749),ci=p(13472);function di(n,s){1&n&&(e.TgZ(0,"span",25),e.SDv(1,26),e.qZA())}function pi(n,s){if(1&n&&(e.TgZ(0,"div",27),e._UZ(1,"input",28),e.TgZ(2,"label",29),e._uU(3),e.qZA()()),2&n){const t=s.$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 ui(n,s){1&n&&(e.TgZ(0,"span",25),e.SDv(1,30),e.qZA())}let mi=(()=>{class n{constructor(t,o,i){this.activeModal=t,this.rbdMirroringService=o,this.taskWrapper=i,this.pools=[],this.createForm()}createForm(){this.createBootstrapForm=new Z.d({siteName:new a.NI("",{validators:[a.kI.required]}),pools:new a.cw({},{validators:[this.validatePools()]}),token:new a.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((_,r)=>(_.push({name:r.name,mirror_mode:r.mirror_mode}),_),[]);const i=this.createBootstrapForm.get("pools");S().each(this.pools,_=>{const r=_.name,l="disabled"===_.mirror_mode,d=i.controls[r];d?l&&d.disabled?d.enable():!l&&d.enabled&&(d.disable(),d.setValue(!0)):i.addControl(r,new a.NI({value:!l,disabled:!l}))})})}ngOnDestroy(){this.subs&&this.subs.unsubscribe()}validatePools(){return t=>{let o=0;return S().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");S().each(i.controls,(u,f)=>{!0===u.value&&(t=f,u.disabled||o.push(f))});const _={mirror_mode:"image"},r=(0,it.z)(this.rbdMirroringService.setSiteName(this.createBootstrapForm.getValue("siteName")),(0,le.D)(o.map(u=>this.rbdMirroringService.updatePool(u,_))),this.rbdMirroringService.createBootstrapToken(t).pipe((0,ri.b)(u=>this.createBootstrapForm.get("token").setValue(u.token)))).pipe((0,Rt.Z)()),l=()=>{this.rbdMirroringService.refresh(),this.createBootstrapForm.setErrors({cdSubmitButton:!0})};this.taskWrapper.wrapTaskAroundCall({task:new R.R("rbd/mirroring/bootstrap/create",{}),call:r}).subscribe({error:l,complete:l})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(v.Kz),e.Y36(K),e.Y36(m.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-bootstrap-create-modal"]],decls:32,vars:6,consts:function(){let s,t,o,i,_,r,l,d,u,f,I;return s="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...",_="Pools",r="Generate",l="Token",d="Generated token...",u="Close",f="This field is required.",I="At least one pool is required.",[[3,"modalRef"],[1,"modal-title"],s,[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"],_,["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],[1,"mb-4","float-end",3,"form","submitAction"],r,["for","token",1,"col-form-label"],l,["placeholder",d,"id","token","formControlName","token","readonly","",1,"form-control","resize-vertical"],["source","token",1,"float-end"],[1,"modal-footer"],["name",u,3,"backAction"],[1,"invalid-feedback"],f,[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],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)(6,"div",6)(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)(12,"label",9),e.SDv(13,10),e.qZA(),e._UZ(14,"input",11),e.YNc(15,di,2,0,"span",12),e.qZA(),e.TgZ(16,"div",13)(17,"label",14),e.SDv(18,15),e.qZA(),e.YNc(19,pi,4,5,"div",16),e.YNc(20,ui,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)(24,"label",19)(25,"span"),e.SDv(26,20),e.qZA()(),e.TgZ(27,"textarea",21),e._uU(28,"          "),e.qZA()(),e._UZ(29,"cd-copy-2-clipboard-button",22),e.qZA(),e.TgZ(30,"div",23)(31,"cd-back-button",24),e.NdJ("backAction",function(){return o.activeModal.close()}),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:[C.z,a._Y,a.JL,A.V,a.sg,O.P,$.o,a.Fj,X.b,a.JJ,a.u,Me.U,c.O5,a.x0,c.sg,a.Wl,li.w,Ye.s,ci.W],styles:[".form-group.ng-invalid[_ngcontent-%COMP%]   .invalid-feedback[_ngcontent-%COMP%]{display:block}"]}),n})();function gi(n,s){1&n&&(e.TgZ(0,"span",26),e.SDv(1,27),e.qZA())}function Ti(n,s){if(1&n&&(e.TgZ(0,"option",28),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.Q6J("value",t.key),e.xp6(1),e.Oqu(t.desc)}}function fi(n,s){if(1&n&&(e.TgZ(0,"div",29),e._UZ(1,"input",30),e.TgZ(2,"label",31),e._uU(3),e.qZA()()),2&n){const t=s.$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 Ci(n,s){1&n&&(e.TgZ(0,"span",26),e.SDv(1,32),e.qZA())}function Si(n,s){1&n&&(e.TgZ(0,"span",26),e.SDv(1,33),e.qZA())}function Ei(n,s){1&n&&(e.TgZ(0,"span",26),e.SDv(1,34),e.qZA())}let Ri=(()=>{class n{constructor(t,o,i,_){this.activeModal=t,this.actionLabels=o,this.rbdMirroringService=i,this.taskWrapper=_,this.pools=[],this.directions=[{key:"rx-tx",desc:"Bidirectional"},{key:"rx",desc:"Unidirectional (receive-only)"}],this.createForm()}createForm(){this.importBootstrapForm=new Z.d({siteName:new a.NI("",{validators:[a.kI.required]}),direction:new a.NI("rx-tx",{}),pools:new a.cw({},{validators:[this.validatePools()]}),token:new a.NI("",{validators:[a.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((_,r)=>(_.push({name:r.name,mirror_mode:r.mirror_mode}),_),[]);const i=this.importBootstrapForm.get("pools");S().each(this.pools,_=>{const r=_.name,l="disabled"===_.mirror_mode,d=i.controls[r];d?l&&d.disabled?d.enable():!l&&d.enabled&&(d.disable(),d.setValue(!0)):i.addControl(r,new a.NI({value:!l,disabled:!l}))})})}ngOnDestroy(){this.subs&&this.subs.unsubscribe()}validatePools(){return t=>{let o=0;return S().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");S().each(i.controls,(u,f)=>{!0===u.value&&(t.push(f),u.disabled||o.push(f))});const _={mirror_mode:"image"};let r=(0,it.z)(this.rbdMirroringService.setSiteName(this.importBootstrapForm.getValue("siteName")),(0,le.D)(o.map(u=>this.rbdMirroringService.updatePool(u,_))));r=t.reduce((u,f)=>(0,it.z)(u,this.rbdMirroringService.importBootstrapToken(f,this.importBootstrapForm.getValue("direction"),this.importBootstrapForm.getValue("token"))),r).pipe((0,Rt.Z)());const l=()=>{this.rbdMirroringService.refresh(),this.importBootstrapForm.setErrors({cdSubmitButton:!0})};this.taskWrapper.wrapTaskAroundCall({task:new R.R("rbd/mirroring/bootstrap/import",{}),call:r}).subscribe({error:l,complete:()=>{l(),this.activeModal.close()}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(v.Kz),e.Y36(D.p4),e.Y36(K),e.Y36(m.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-bootstrap-import-modal"]],decls:36,vars:10,consts:function(){let s,t,o,i,_,r,l,d,u,f,I,P;return s="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...",_="Direction",r="Pools",l="Token",d="Generated token...",u="This field is required.",f="At least one pool is required.",I="This field is required.",P="The token is invalid.",[[3,"modalRef"],[1,"modal-title"],s,[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"],_,["id","direction","name","direction","formControlName","direction",1,"form-control"],[3,"value",4,"ngFor","ngForOf"],["formGroupName","pools",1,"form-group"],["for","pools",1,"col-form-label","required"],r,["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],["for","token",1,"col-form-label","required"],l,["placeholder",d,"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"],f,I,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)(6,"div",6)(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)(12,"label",9),e.SDv(13,10),e.qZA(),e._UZ(14,"input",11),e.YNc(15,gi,2,0,"span",12),e.qZA(),e.TgZ(16,"div",8)(17,"label",13)(18,"span"),e.SDv(19,14),e.qZA()(),e.TgZ(20,"select",15),e.YNc(21,Ti,2,2,"option",16),e.qZA()(),e.TgZ(22,"div",17)(23,"label",18),e.SDv(24,19),e.qZA(),e.YNc(25,fi,4,5,"div",20),e.YNc(26,Ci,2,0,"span",12),e.qZA(),e.TgZ(27,"div",8)(28,"label",21),e.SDv(29,22),e.qZA(),e.TgZ(30,"textarea",23),e._uU(31,"          "),e.qZA(),e.YNc(32,Si,2,0,"span",12),e.YNc(33,Ei,2,0,"span",12),e.qZA()(),e.TgZ(34,"div",24)(35,"cd-form-button-panel",25),e.NdJ("submitActionEvent",function(){return o.import()}),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:[C.z,a._Y,a.JL,A.V,a.sg,O.P,$.o,a.Fj,X.b,a.JJ,a.u,Me.U,c.O5,a.EJ,c.sg,a.YN,a.Kr,a.x0,a.Wl,j.p],styles:[""]}),n})();var se=p(69158),Mi=p(58111);let st=(()=>{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 Oi=["healthTmpl"];function hi(n,s){if(1&n&&(e.TgZ(0,"span",2),e.ALo(1,"mirrorHealthColor"),e._uU(2),e.qZA()),2&n){const o=s.value;e.Q6J("ngClass",e.lcZ(1,2,s.row.health_color)),e.xp6(2),e.Oqu(o)}}let Ai=(()=>{class n{constructor(t,o){this.rbdMirroringService=t,this.cephShortVersionPipe=o,this.tableStatus=new se.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 se.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(Mi.F))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-mirroring-daemons"]],viewQuery:function(t,o){if(1&t&&e.Gf(Oi,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,hi,3,4,"ng-template",null,1,e.W1O)),2&t&&e.Q6J("data",o.data)("columns",o.columns)("autoReload",-1)("status",o.tableStatus)},directives:[W.a,c.mk],pipes:[st],styles:[""]}),n})();var Mt=p(70882);class Pi{}function Ii(n,s){1&n&&(e.TgZ(0,"span",24),e.SDv(1,25),e.qZA())}function bi(n,s){1&n&&(e.TgZ(0,"span",24),e.SDv(1,26),e.qZA())}function Ni(n,s){1&n&&(e.TgZ(0,"span",24),e.SDv(1,27),e.qZA())}function Fi(n,s){1&n&&(e.TgZ(0,"span",24),e.SDv(1,28),e.qZA())}function Di(n,s){1&n&&(e.TgZ(0,"span",24),e.SDv(1,29),e.qZA())}function vi(n,s){1&n&&(e.TgZ(0,"span",24),e.SDv(1,30),e.qZA())}let Li=(()=>{class n{constructor(t,o,i,_){this.activeModal=t,this.actionLabels=o,this.rbdMirroringService=i,this.taskWrapper=_,this.bsConfig={containerClass:"theme-default"},this.createForm()}createForm(){this.editPeerForm=new Z.d({clusterName:new a.NI("",{validators:[a.kI.required,this.validateClusterName]}),clientID:new a.NI("",{validators:[a.kI.required,this.validateClientID]}),monAddr:new a.NI("",{validators:[this.validateMonAddr]}),key:new a.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 Pi;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 R.R("rbd/mirroring/peer/edit",{pool_name:this.poolName}),call:this.rbdMirroringService.updatePeer(this.poolName,this.peerUUID,t)}:{task:new R.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(v.Kz),e.Y36(D.p4),e.Y36(K),e.Y36(m.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-pool-edit-peer-modal"]],decls:38,vars:13,consts:function(){let s,t,o,i,_,r,l,d,u,f,I,P,B,x,q,J,ee,te;return s="{VAR_SELECT, select, edit {Edit} other {Add}}",s=e.Zx4(s,{VAR_SELECT:"\ufffd0\ufffd"}),t="" + s + " 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),_="Cluster Name",r="Name...",l="CephX ID",d="CephX ID...",u="Monitor Addresses",f="Comma-delimited addresses...",I="CephX Key",P="Base64-encoded key...",B="This field is required.",x="The cluster name is not valid.",q="This field is required.",J="The CephX ID is not valid.",ee="The monitory address is not valid.",te="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"],_,["type","text","placeholder",r,"id","clusterName","name","clusterName","formControlName","clusterName","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","clientID",1,"col-form-label","required"],l,["type","text","placeholder",d,"id","clientID","name","clientID","formControlName","clientID",1,"form-control"],["for","monAddr",1,"col-form-label"],u,["type","text","placeholder",f,"id","monAddr","name","monAddr","formControlName","monAddr",1,"form-control"],["for","key",1,"col-form-label"],I,["type","text","placeholder",P,"id","key","name","key","formControlName","key",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],B,x,q,J,ee,te]},template:function(t,o){if(1&t&&(e.TgZ(0,"cd-modal",0)(1,"span",1),e.SDv(2,2),e.qZA(),e.ynx(3,3),e.TgZ(4,"form",4,5)(6,"div",6)(7,"p")(8,"span"),e.tHW(9,7),e._UZ(10,"kbd")(11,"kbd"),e.N_p(),e.qZA()(),e.TgZ(12,"div",8)(13,"label",9),e.SDv(14,10),e.qZA(),e._UZ(15,"input",11),e.YNc(16,Ii,2,0,"span",12),e.YNc(17,bi,2,0,"span",12),e.qZA(),e.TgZ(18,"div",8)(19,"label",13),e.SDv(20,14),e.qZA(),e._UZ(21,"input",15),e.YNc(22,Ni,2,0,"span",12),e.YNc(23,Fi,2,0,"span",12),e.qZA(),e.TgZ(24,"div",8)(25,"label",16)(26,"span"),e.SDv(27,17),e.qZA()(),e._UZ(28,"input",18),e.YNc(29,Di,2,0,"span",12),e.qZA(),e.TgZ(30,"div",8)(31,"label",19)(32,"span"),e.SDv(33,20),e.qZA()(),e._UZ(34,"input",21),e.YNc(35,vi,2,0,"span",12),e.qZA()(),e.TgZ(36,"div",22)(37,"cd-form-button-panel",23),e.NdJ("submitActionEvent",function(){return o.update()}),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:[C.z,a._Y,a.JL,A.V,a.sg,O.P,$.o,a.Fj,X.b,a.JJ,a.u,Me.U,c.O5,j.p],styles:[""]}),n})();const $i=["healthTmpl"],Bi=["localTmpl"],Gi=["remoteTmpl"];function yi(n,s){if(1&n&&(e.TgZ(0,"span",6),e.ALo(1,"mirrorHealthColor"),e._uU(2),e.qZA()),2&n){const o=s.value;e.Q6J("ngClass",e.lcZ(1,2,s.row.health_color)),e.xp6(2),e.Oqu(o)}}function xi(n,s){1&n&&(e.TgZ(0,"span",7),e.SDv(1,8),e.qZA())}function Zi(n,s){1&n&&(e.TgZ(0,"span",9),e.SDv(1,10),e.qZA())}let Hi=(()=>{class n{constructor(t,o,i,_,r){this.authStorageService=t,this.rbdMirroringService=o,this.modalService=i,this.taskWrapper=_,this.router=r,this.selection=new Ee.r,this.tableStatus=new se.E,this.data=[],this.permission=this.authStorageService.getPermissions().rbdMirroring;const l={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},u={permission:"update",icon:T.P.exchange,name:"Edit Peer",click:()=>this.editPeersModal("edit"),visible:()=>!!this.getPeerUUID()},f={permission:"delete",icon:T.P.destroy,name:"Delete Peer",click:()=>this.deletePeersModal(),visible:()=>!!this.getPeerUUID()};this.tableActions=[l,d,u,f]}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",headerTemplate:this.localTmpl,flexGrow:2},{prop:"image_remote_count",name:"# Remote",headerTemplate:this.remoteTmpl,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 se.E(t.status)})}ngOnDestroy(){this.subs.unsubscribe()}refresh(){this.rbdMirroringService.refresh()}editModeModal(){this.router.navigate(["/block/mirroring",{outlets:{modal:[D.MQ.EDIT,this.selection.first().name]}}])}editPeersModal(t){const o={poolName:this.selection.first().name,mode:t};"edit"===t&&(o.peerUUID=this.getPeerUUID()),this.modalRef=this.modalService.show(Li,o)}deletePeersModal(){const t=this.selection.first().name,o=this.getPeerUUID();this.modalRef=this.modalService.show(pe.M,{itemDescription:"mirror peer",itemNames:[`${t} (${o})`],submitActionObservable:()=>new Mt.y(i=>{this.taskWrapper.wrapTaskAroundCall({task:new R.R("rbd/mirroring/peer/delete",{pool_name:t}),call:this.rbdMirroringService.deletePeer(t,o)}).subscribe({error:_=>i.error(_),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(de.Z),e.Y36(m.P),e.Y36(g.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-mirroring-pools"]],viewQuery:function(t,o){if(1&t&&(e.Gf($i,7),e.Gf(Bi,7),e.Gf(Gi,7)),2&t){let i;e.iGM(i=e.CRH())&&(o.healthTmpl=i.first),e.iGM(i=e.CRH())&&(o.localTmpl=i.first),e.iGM(i=e.CRH())&&(o.remoteTmpl=i.first)}},decls:9,vars:7,consts:function(){let s,t,o,i;return s="Local image count",t="# Local",o="Remote image count",i="# Remote",[["columnMode","flex","identifier","name","forceIdentifier","true","selectionType","single",3,"data","columns","autoReload","status","fetchData","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["healthTmpl",""],["localTmpl",""],["remoteTmpl",""],["name","modal"],[3,"ngClass"],["ngbTooltip",s],t,["ngbTooltip",o],i]},template:function(t,o){1&t&&(e.TgZ(0,"cd-table",0),e.NdJ("fetchData",function(){return o.refresh()})("updateSelection",function(_){return o.updateSelection(_)}),e._UZ(1,"cd-table-actions",1),e.qZA(),e.YNc(2,yi,3,4,"ng-template",null,2,e.W1O),e.YNc(4,xi,2,0,"ng-template",null,3,e.W1O),e.YNc(6,Zi,2,0,"ng-template",null,4,e.W1O),e._UZ(8,"router-outlet",5)),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:[W.a,Re.K,c.mk,v._L,g.lC],pipes:[st],styles:[""]}),n})();var Ot=p(59376);const ki=["stateTmpl"],qi=["syncTmpl"],Ki=["progressTmpl"];function Xi(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"cd-table",13),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 Qi(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"cd-table",13),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 zi(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"cd-table",13),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 Ji(n,s){if(1&n&&(e.TgZ(0,"span",14),e.ALo(1,"mirrorHealthColor"),e._uU(2),e.qZA()),2&n){const o=s.value;e.Q6J("ngClass",e.lcZ(1,2,s.row.state_color)),e.xp6(2),e.Oqu(o)}}function Yi(n,s){1&n&&e._UZ(0,"div")}function Vi(n,s){if(1&n&&e._UZ(0,"ngb-progressbar",17),2&n){const t=e.oxw().value;e.Q6J("value",t)("showValue",!0)}}function Ui(n,s){if(1&n&&(e.YNc(0,Yi,1,0,"div",15),e.YNc(1,Vi,1,2,"ngb-progressbar",16)),2&n){const t=s.row;e.Q6J("ngIf","Replaying"===t.state),e.xp6(1),e.Q6J("ngIf","Syncing"===t.state)}}let ji=(()=>{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 se.E}ngOnInit(){this.image_error.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"state",name:"State",cellTemplate:this.stateTmpl,flexGrow:1},{prop:"description",name:"Issue",flexGrow:4}],this.image_syncing.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"state",name:"State",cellTemplate:this.stateTmpl,flexGrow:1},{prop:"progress",name:"Progress",cellTemplate:this.progressTmpl,flexGrow:2},{prop:"bytes_per_second",name:"Bytes per second",flexGrow:2},{prop:"entries_behind_primary",name:"Entries behind primary",flexGrow:2}],this.image_ready.columns=[{prop:"pool_name",name:"Pool",flexGrow:2},{prop:"name",name:"Image",flexGrow:2},{prop:"state",name:"State",cellTemplate:this.stateTmpl,flexGrow:1},{prop:"description",name:"Description",flexGrow:4}],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 se.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(ki,7),e.Gf(qi,7),e.Gf(Ki,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:19,vars:4,consts:function(){let s,t,o;return s="Issues (" + "\ufffd0\ufffd" + ")",t="Syncing (" + "\ufffd0\ufffd" + ")",o="Ready (" + "\ufffd0\ufffd" + ")",[["ngbNav","","cdStatefulTab","image-list",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","issues"],["ngbNavLink",""],s,["ngbNavContent",""],["ngbNavItem","syncing"],t,["ngbNavItem","ready"],o,[3,"ngbNavOutlet"],["stateTmpl",""],["progressTmpl",""],["columnMode","flex",3,"data","columns","autoReload","status","fetchData"],[3,"ngClass"],[4,"ngIf"],["type","info",3,"value","showValue",4,"ngIf"],["type","info",3,"value","showValue"]]},template:function(t,o){if(1&t&&(e.TgZ(0,"nav",0,1),e.ynx(2,2),e.TgZ(3,"a",3),e.SDv(4,4),e.qZA(),e.YNc(5,Xi,1,4,"ng-template",5),e.BQk(),e.ynx(6,6),e.TgZ(7,"a",3),e.SDv(8,7),e.qZA(),e.YNc(9,Qi,1,4,"ng-template",5),e.BQk(),e.ynx(10,8),e.TgZ(11,"a",3),e.SDv(12,9),e.qZA(),e.YNc(13,zi,1,4,"ng-template",5),e.BQk(),e.qZA(),e._UZ(14,"div",10),e.YNc(15,Ji,3,4,"ng-template",null,11,e.W1O),e.YNc(17,Ui,2,2,"ng-template",null,12,e.W1O)),2&t){const i=e.MAs(1);e.xp6(4),e.pQV(o.image_error.data.length),e.QtT(4),e.xp6(4),e.pQV(o.image_syncing.data.length),e.QtT(8),e.xp6(4),e.pQV(o.image_ready.data.length),e.QtT(12),e.xp6(2),e.Q6J("ngbNavOutlet",i)}},directives:[v.Pz,Ot.m,v.nv,v.Vx,v.uN,W.a,v.tO,c.mk,c.O5,v.Ly],pipes:[st],styles:[""]}),n})();function Wi(n,s){if(1&n&&e._UZ(0,"i",19),2&n){const t=e.oxw();e.Q6J("ngClass",t.icons.edit)}}function es(n,s){if(1&n&&e._UZ(0,"i",19),2&n){const t=e.oxw();e.Q6J("ngClass",t.icons.check)}}let ts=(()=>{class n{constructor(t,o,i,_){this.authStorageService=t,this.rbdMirroringService=o,this.modalService=i,this.taskWrapper=_,this.selection=new Ee.r,this.peersExist=!0,this.subs=new si.w,this.editing=!1,this.icons=T.P,this.permission=this.authStorageService.getPermissions().rbdMirroring;const r={permission:"update",icon:T.P.upload,click:()=>this.createBootstrapModal(),name:"Create Bootstrap Token",canBePrimary:()=>!0,disable:()=>!1},l={permission:"update",icon:T.P.download,click:()=>this.importBootstrapModal(),name:"Import Bootstrap Token",disable:()=>!1};this.tableActions=[r,l]}ngOnInit(){this.createForm(),this.subs.add(this.rbdMirroringService.startPolling()),this.subs.add(this.rbdMirroringService.subscribeSummary(t=>{this.status=t.content_data.status,this.peersExist=!!t.content_data.pools.find(o=>o.peer_uuids.length>0)})),this.rbdMirroringService.getSiteName().subscribe(t=>{this.siteName=t.site_name,this.rbdmirroringForm.get("siteName").setValue(this.siteName)})}createForm(){this.rbdmirroringForm=new Z.d({siteName:new a.NI({value:"",disabled:!0})})}ngOnDestroy(){this.subs.unsubscribe()}updateSiteName(){this.editing&&this.taskWrapper.wrapTaskAroundCall({task:new R.R("rbd/mirroring/site_name/edit",{}),call:this.rbdMirroringService.setSiteName(this.rbdmirroringForm.getValue("siteName"))}).subscribe({complete:()=>{this.rbdMirroringService.refresh()}}),this.editing=!this.editing}createBootstrapModal(){this.modalRef=this.modalService.show(mi,{siteName:this.siteName})}importBootstrapModal(){this.modalRef=this.modalService.show(Ri,{siteName:this.siteName})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(K),e.Y36(de.Z),e.Y36(m.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-mirroring"]],decls:31,vars:10,consts:function(){let s,t,o,i;return s="Site Name",t="Daemons",o="Pools",i="Images",[["name","rbdmirroringForm","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"row","mb-3"],[1,"col-md-auto"],["for","siteName",1,"col-form-label"],s,[1,"col-sm-4","d-flex"],["type","text","id","siteName","name","siteName","formControlName","siteName",1,"form-control"],["id","editSiteName",1,"btn","btn-light",3,"click"],[3,"ngClass",4,"ngIf"],[3,"source","byId"],[1,"col"],[1,"table-actions","float-end",3,"permission","selection","tableActions"],[1,"row"],[1,"col-sm-6"],t,o,[1,"col-md-12"],i,[3,"ngClass"]]},template:function(t,o){1&t&&(e.TgZ(0,"form",0,1)(2,"div",2)(3,"div",3)(4,"label",4),e.SDv(5,5),e.qZA()(),e.TgZ(6,"div",6),e._UZ(7,"input",7),e.TgZ(8,"button",8),e.NdJ("click",function(){return o.updateSiteName()}),e.YNc(9,Wi,1,1,"i",9),e.YNc(10,es,1,1,"i",9),e.qZA(),e._UZ(11,"cd-copy-2-clipboard-button",10),e.qZA(),e.TgZ(12,"div",11),e._UZ(13,"cd-table-actions",12),e.qZA()()(),e.TgZ(14,"div",13)(15,"div",14)(16,"legend"),e.SDv(17,15),e.qZA(),e.TgZ(18,"div"),e._UZ(19,"cd-mirroring-daemons"),e.qZA()(),e.TgZ(20,"div",14)(21,"legend"),e.SDv(22,16),e.qZA(),e.TgZ(23,"div"),e._UZ(24,"cd-mirroring-pools"),e.qZA()()(),e.TgZ(25,"div",13)(26,"div",17)(27,"legend"),e.SDv(28,18),e.qZA(),e.TgZ(29,"div"),e._UZ(30,"cd-mirroring-images"),e.qZA()()()),2&t&&(e.Q6J("formGroup",o.rbdmirroringForm),e.xp6(7),e.uIk("disabled",!o.editing||null),e.xp6(1),e.uIk("title",o.editing?"Save":"Edit"),e.xp6(1),e.Q6J("ngIf",!o.editing),e.xp6(1),e.Q6J("ngIf",o.editing),e.xp6(1),e.Q6J("source",o.siteName)("byId",!1),e.xp6(2),e.Q6J("permission",o.permission)("selection",o.selection)("tableActions",o.tableActions))},directives:[a._Y,a.JL,A.V,a.sg,$.o,a.Fj,X.b,a.JJ,a.u,c.O5,c.mk,Ye.s,Re.K,Ai,Hi,ji],styles:[""]}),n})();class os{}function ns(n,s){if(1&n&&(e.TgZ(0,"option",16),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.Q6J("value",t.id),e.xp6(1),e.Oqu(t.name)}}function is(n,s){1&n&&(e.TgZ(0,"span",17),e.SDv(1,18),e.qZA())}let ss=(()=>{class n{constructor(t,o,i,_,r,l){this.activeModal=t,this.actionLabels=o,this.rbdMirroringService=i,this.taskWrapper=_,this.route=r,this.location=l,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 Z.d({mirrorMode:new a.NI("",{validators:[a.kI.required,this.validateMode.bind(this)]})})}ngOnInit(){this.route.params.subscribe(t=>{this.poolName=t.pool_name}),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(_=>this.poolName===_.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 os;t.mirror_mode=this.editModeForm.getValue("mirrorMode"),this.taskWrapper.wrapTaskAroundCall({task:new R.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.location.back()}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(v.Kz),e.Y36(D.p4),e.Y36(K),e.Y36(m.P),e.Y36(g.gz),e.Y36(c.Ye))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-pool-edit-mode-modal"]],decls:21,vars:7,consts:function(){let s,t,o,i;return s="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.",[["pageURL","mirroring",3,"modalRef"],[1,"modal-title"],s,[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-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)(6,"div",6)(7,"p"),e.ynx(8),e.tHW(9,7),e._UZ(10,"kbd")(11,"kbd"),e.N_p(),e.BQk(),e.qZA(),e.TgZ(12,"div",8)(13,"label",9)(14,"span"),e.SDv(15,10),e.qZA()(),e.TgZ(16,"select",11),e.YNc(17,ns,2,2,"option",12),e.qZA(),e.YNc(18,is,2,0,"span",13),e.qZA()(),e.TgZ(19,"div",14)(20,"cd-form-button-panel",15),e.NdJ("submitActionEvent",function(){return o.update()}),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:[C.z,a._Y,a.JL,A.V,a.sg,O.P,$.o,a.EJ,a.JJ,a.u,c.sg,a.YN,a.Kr,c.O5,j.p],styles:[""]}),n})();var ht=p(7357),_s=p(28049),as=p(43190),Ve=p(80842),_t=p(30633),$e=p(47557),rs=p(28211);class ls{}var Ie=(()=>{return(n=Ie||(Ie={}))[n.V1=1]="V1",n[n.V2=2]="V2",Ie;var n})();class cs{constructor(){this.features=[]}}class ds{constructor(){this.features=[]}}class us extends class ps{}{constructor(){super(...arguments),this.features=[]}}class at{constructor(){this.features=[],this.remove_scheduling=!1}}var Ue=(()=>{return(n=Ue||(Ue={})).editing="editing",n.cloning="cloning",n.copying="copying",Ue;var n})(),ms=p(18372),gs=p(17932),Ts=p(60950);function fs(n,s){if(1&n&&(e.TgZ(0,"div",9)(1,"label",58),e.SDv(2,59),e.ALo(3,"titlecase"),e.qZA(),e.TgZ(4,"div",12),e._UZ(5,"input",60)(6,"hr"),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(3),e.pQV(e.lcZ(3,1,t.action)),e.QtT(2)}}function Cs(n,s){1&n&&(e.TgZ(0,"span",61),e.ynx(1),e.SDv(2,62),e.BQk(),e.qZA())}function Ss(n,s){1&n&&(e.TgZ(0,"span",61),e.ynx(1),e.SDv(2,63),e.BQk(),e.qZA())}function Es(n,s){1&n&&e._UZ(0,"input",64)}function Rs(n,s){1&n&&(e.TgZ(0,"option",50),e.SDv(1,67),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Ms(n,s){1&n&&(e.TgZ(0,"option",50),e.SDv(1,68),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Os(n,s){1&n&&(e.TgZ(0,"option",50),e.SDv(1,69),e.qZA()),2&n&&e.Q6J("ngValue",null)}function hs(n,s){if(1&n&&(e.TgZ(0,"option",70),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.Q6J("value",t.pool_name),e.xp6(1),e.Oqu(t.pool_name)}}function As(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"select",65),e.NdJ("change",function(){return e.CHM(t),e.oxw(2).setPoolMirrorMode()}),e.YNc(1,Rs,2,1,"option",66),e.YNc(2,Ms,2,1,"option",66),e.YNc(3,Os,2,1,"option",66),e.YNc(4,hs,2,2,"option",46),e.qZA()}if(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 Ps(n,s){1&n&&(e.TgZ(0,"span",61),e.SDv(1,71),e.qZA())}const Is=function(n,s){return[n,s]};function bs(n,s){if(1&n&&(e.TgZ(0,"div",9)(1,"div",20),e._UZ(2,"i",72),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.Q6J("ngClass",e.WLB(1,Is,t.icons.spinner,t.icons.spin))}}function Ns(n,s){1&n&&e._UZ(0,"input",76)}function Fs(n,s){1&n&&(e.TgZ(0,"option",50),e.SDv(1,78),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Ds(n,s){1&n&&(e.TgZ(0,"option",50),e.SDv(1,79),e.qZA()),2&n&&e.Q6J("ngValue",null)}function vs(n,s){1&n&&(e.TgZ(0,"option",50),e.SDv(1,80),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Ls(n,s){if(1&n&&(e.TgZ(0,"option",70),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t)}}function $s(n,s){if(1&n&&(e.TgZ(0,"select",77),e.YNc(1,Fs,2,1,"option",66),e.YNc(2,Ds,2,1,"option",66),e.YNc(3,vs,2,1,"option",66),e.YNc(4,Ls,2,2,"option",46),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 Bs(n,s){if(1&n&&(e.TgZ(0,"div",9)(1,"label",73),e._uU(2," Namespace "),e.qZA(),e.TgZ(3,"div",12),e.YNc(4,Ns,1,0,"input",74),e.YNc(5,$s,5,4,"select",75),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 Gs(n,s){1&n&&(e.TgZ(0,"cd-helper")(1,"span"),e.SDv(2,81),e.qZA()())}function ys(n,s){1&n&&e._UZ(0,"input",87)}function xs(n,s){1&n&&(e.TgZ(0,"option",50),e.SDv(1,89),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Zs(n,s){1&n&&(e.TgZ(0,"option",50),e.SDv(1,90),e.qZA()),2&n&&e.Q6J("ngValue",null)}function ws(n,s){1&n&&(e.TgZ(0,"option",50),e._uU(1,"-- Select a data pool -- "),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Hs(n,s){if(1&n&&(e.TgZ(0,"option",70),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.Q6J("value",t.pool_name),e.xp6(1),e.Oqu(t.pool_name)}}function ks(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"select",88),e.NdJ("change",function(i){return e.CHM(t),e.oxw(3).onDataPoolChange(i.target.value)}),e.YNc(1,xs,2,1,"option",66),e.YNc(2,Zs,2,1,"option",66),e.YNc(3,ws,2,1,"option",66),e.YNc(4,Hs,2,2,"option",46),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 qs(n,s){1&n&&(e.TgZ(0,"span",61),e.SDv(1,91),e.qZA())}const je=function(n){return{required:n}};function Ks(n,s){if(1&n&&(e.TgZ(0,"div",9)(1,"label",82)(2,"span",72),e.SDv(3,83),e.qZA(),e._UZ(4,"cd-helper",84),e.qZA(),e.TgZ(5,"div",12),e.YNc(6,ys,1,0,"input",85),e.YNc(7,ks,5,4,"select",86),e.YNc(8,qs,2,0,"span",14),e.qZA()()),2&n){e.oxw();const t=e.MAs(2),o=e.oxw();e.xp6(2),e.Q6J("ngClass",e.VKq(4,je,"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 Xs(n,s){1&n&&(e.TgZ(0,"span",61),e.SDv(1,92),e.qZA())}function Qs(n,s){1&n&&(e.TgZ(0,"span",61),e.SDv(1,93),e.qZA())}function zs(n,s){if(1&n&&e._UZ(0,"cd-helper",97),2&n){const t=e.oxw().$implicit;e.s9C("html",t.helperHtml)}}function Js(n,s){if(1&n&&(e.TgZ(0,"div",21),e._UZ(1,"input",94),e.TgZ(2,"label",95),e._uU(3),e.qZA(),e.YNc(4,zs,1,1,"cd-helper",96),e.qZA()),2&n){const t=s.$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)}}const At=function(n){return["edit",n]},Pt=function(n){return{modal:n}},It=function(n){return{outlets:n}},bt=function(n){return["/block/mirroring",n]};function Ys(n,s){if(1&n&&(e.TgZ(0,"cd-helper")(1,"span"),e.tHW(2,98),e._UZ(3,"b")(4,"a",99),e.N_p(),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("routerLink",e.VKq(7,bt,e.VKq(5,It,e.VKq(3,Pt,e.VKq(1,At,t.currentPoolName)))))}}function Vs(n,s){if(1&n&&(e.TgZ(0,"cd-helper")(1,"span"),e.tHW(2,104),e._UZ(3,"b")(4,"a",99),e.N_p(),e.qZA()()),2&n){const t=e.oxw(4);e.xp6(4),e.Q6J("routerLink",e.VKq(7,bt,e.VKq(5,It,e.VKq(3,Pt,e.VKq(1,At,t.currentPoolName)))))}}function Us(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div",101)(1,"input",102),e.NdJ("change",function(){return e.CHM(t),e.oxw(3).setExclusiveLock()}),e.qZA(),e.TgZ(2,"label",103),e._uU(3),e.ALo(4,"titlecase"),e.qZA(),e.YNc(5,Vs,5,9,"cd-helper",25),e.qZA()}if(2&n){const t=s.$implicit,o=e.oxw(3);e.xp6(1),e.Q6J("id",t)("value",t),e.uIk("disabled","pool"===o.poolMirrorMode&&"snapshot"===t||null),e.xp6(1),e.Q6J("for",t),e.xp6(1),e.Oqu(e.lcZ(4,6,t)),e.xp6(2),e.Q6J("ngIf","pool"===o.poolMirrorMode&&"snapshot"===t)}}function js(n,s){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Us,6,8,"div",100),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.mirroringOptions)}}function Ws(n,s){if(1&n&&(e.TgZ(0,"div",9)(1,"label",105),e.tHW(2,106),e._UZ(3,"cd-helper",107),e.N_p(),e.qZA(),e.TgZ(4,"div",12),e._UZ(5,"input",108),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(5),e.uIk("disabled",!1===t.peerConfigured||null)}}function e_(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"a",109),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).advancedEnabled=!0,!1}),e.SDv(1,110),e.qZA()}}function t_(n,s){if(1&n&&(e.TgZ(0,"option",70),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t)}}function o_(n,s){if(1&n&&(e.TgZ(0,"option",70),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t)}}function n_(n,s){1&n&&(e.TgZ(0,"span",61),e.SDv(1,111),e.qZA())}function i_(n,s){1&n&&(e.TgZ(0,"span",61),e.SDv(1,112),e.qZA())}function s_(n,s){1&n&&(e.TgZ(0,"span",61),e.SDv(1,113),e.qZA())}function __(n,s){1&n&&(e.TgZ(0,"span",61),e.SDv(1,114),e.qZA())}function a_(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div",1)(1,"form",2,3)(3,"div",4)(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,fs,7,3,"div",8),e.TgZ(10,"div",9)(11,"label",10),e.SDv(12,11),e.qZA(),e.TgZ(13,"div",12),e._UZ(14,"input",13),e.YNc(15,Cs,3,0,"span",14),e.YNc(16,Ss,3,0,"span",14),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,Es,1,0,"input",18),e.YNc(22,As,5,4,"select",19),e.YNc(23,Ps,2,0,"span",14),e.qZA()(),e.YNc(24,bs,3,4,"div",8),e.YNc(25,Bs,6,2,"div",8),e.TgZ(26,"div",9)(27,"div",20)(28,"div",21)(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,Gs,3,0,"cd-helper",25),e.qZA()()(),e.YNc(33,Ks,9,6,"div",8),e.TgZ(34,"div",9)(35,"label",26),e.SDv(36,27),e.qZA(),e.TgZ(37,"div",12),e._UZ(38,"input",28),e.YNc(39,Xs,2,0,"span",14),e.YNc(40,Qs,2,0,"span",14),e.qZA()(),e.TgZ(41,"div",29)(42,"label",30),e.SDv(43,31),e.qZA(),e.TgZ(44,"div",12),e.YNc(45,Js,5,6,"div",32),e.qZA()(),e.TgZ(46,"div",9)(47,"div",20)(48,"div",21)(49,"input",33),e.NdJ("change",function(){return e.CHM(t),e.oxw().setMirrorMode()}),e.qZA(),e.TgZ(50,"label",34),e._uU(51,"Mirroring"),e.qZA(),e.YNc(52,Ys,5,9,"cd-helper",25),e.qZA(),e.YNc(53,js,2,1,"div",25),e.qZA()(),e.YNc(54,Ws,6,1,"div",8),e.TgZ(55,"div",35)(56,"div",36),e.YNc(57,e_,2,0,"a",37),e.qZA()(),e.TgZ(58,"div",38)(59,"legend",39),e.SDv(60,40),e.qZA(),e.TgZ(61,"div",41)(62,"h4",39),e.SDv(63,42),e.qZA(),e.TgZ(64,"div",9)(65,"label",43),e.tHW(66,44),e._UZ(67,"cd-helper"),e.N_p(),e.qZA(),e.TgZ(68,"div",12)(69,"select",45),e.YNc(70,t_,2,2,"option",46),e.qZA()()(),e.TgZ(71,"div",9)(72,"label",47),e.tHW(73,48),e._UZ(74,"cd-helper"),e.N_p(),e.qZA(),e.TgZ(75,"div",12)(76,"select",49)(77,"option",50),e.SDv(78,51),e.qZA(),e.YNc(79,o_,2,2,"option",46),e.qZA(),e.YNc(80,n_,2,0,"span",14),e.YNc(81,i_,2,0,"span",14),e.qZA()(),e.TgZ(82,"div",9)(83,"label",52),e.tHW(84,53),e._UZ(85,"cd-helper"),e.N_p(),e.qZA(),e.TgZ(86,"div",12),e._UZ(87,"input",54),e.YNc(88,s_,2,0,"span",14),e.YNc(89,__,2,0,"span",14),e.qZA()()(),e.TgZ(90,"cd-rbd-configuration-form",55),e.NdJ("changes",function(i){return e.CHM(t),e.oxw().getDirtyConfigurationValues=i}),e.qZA()()(),e.TgZ(91,"div",56)(92,"cd-form-button-panel",57),e.NdJ("submitActionEvent",function(){return e.CHM(t),e.oxw().submit()}),e.ALo(93,"titlecase"),e.ALo(94,"upperFirst"),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,35,o.action))(e.lcZ(7,37,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(43,je,"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(7),e.Q6J("ngIf",!1===o.mirroring&&o.currentPoolName),e.xp6(1),e.Q6J("ngIf",o.mirroring),e.xp6(1),e.Q6J("ngIf","snapshot"===o.rbdForm.getValue("mirroringMode")&&o.mirroring),e.xp6(3),e.Q6J("ngIf",!o.advancedEnabled),e.xp6(1),e.Q6J("hidden",!o.advancedEnabled),e.xp6(12),e.Q6J("ngForOf",o.objectSizes),e.xp6(2),e.Q6J("ngClass",e.VKq(45,je,o.rbdForm.getValue("stripingCount"))),e.xp6(5),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(47,je,o.rbdForm.getValue("stripingUnit"))),e.xp6(5),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(93,39,o.action)+" "+e.lcZ(94,41,o.resource))}}let Be=(()=>{class n extends k.E{constructor(t,o,i,_,r,l,d,u,f,I){super(),this.authStorageService=t,this.route=o,this.poolService=i,this.rbdService=_,this.formatter=r,this.taskWrapper=l,this.dimlessBinaryPipe=d,this.actionLabels=u,this.router=f,this.rbdMirroringService=I,this.namespaces=[],this.namespacesByPoolCache={},this.pools=null,this.allPools=null,this.dataPools=null,this.allDataPools=[],this.featuresList=[],this.initializeConfigData=new ht.t(1),this.peerConfigured=!1,this.advancedEnabled=!1,this.rbdFormMode=Ue,this.defaultObjectSize="4 MiB",this.mirroringOptions=["journal","snapshot"],this.mirroring=!1,this.currentPoolName="",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.defaultStripingUnit="4 MiB",this.defaultStripingCount=1,this.rbdImage=new ht.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},"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 S().map(t,(o,i)=>Object.assign(o,{key:i}))}createForm(){this.rbdForm=new Z.d({parent:new a.NI(""),name:new a.NI("",{validators:[a.kI.required,a.kI.pattern(/^[^@/]+?$/)]}),pool:new a.NI(null,{validators:[a.kI.required]}),namespace:new a.NI(null),useDataPool:new a.NI(!1),dataPool:new a.NI(null),size:new a.NI(null,{updateOn:"blur"}),obj_size:new a.NI(this.defaultObjectSize),features:new Z.d(this.featuresList.reduce((t,o)=>(t[o.key]=new a.NI({value:!1,disabled:!!o.initDisabled}),t),{})),mirroring:new a.NI(""),schedule:new a.NI("",{validators:[a.kI.pattern(/^([0-9]+)d|([0-9]+)h|([0-9]+)m$/)]}),mirroringMode:new a.NI(""),stripingUnit:new a.NI(this.defaultStripingUnit),stripingCount:new a.NI(this.defaultStripingCount,{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===Ie.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))}setExclusiveLock(){this.mirroring&&"journal"===this.rbdForm.get("mirroringMode").value?(this.rbdForm.get("exclusive-lock").setValue(!0),this.rbdForm.get("exclusive-lock").disable()):(this.rbdForm.get("exclusive-lock").enable(),"pool"===this.poolMirrorMode&&this.rbdForm.get("mirroringMode").setValue(this.mirroringOptions[0]))}setMirrorMode(){this.mirroring=!this.mirroring,this.setExclusiveLock(),this.checkPeersConfigured()}checkPeersConfigured(t){const o=t||this.rbdForm.get("pool").value;this.rbdMirroringService.getPeerForPool(o).subscribe(i=>{i.length>0&&(this.peerConfigured=!0)})}setPoolMirrorMode(){var t;this.currentPoolName=this.mode===this.rbdFormMode.editing?null===(t=this.response)||void 0===t?void 0:t.pool_name:this.rbdForm.getValue("pool"),this.currentPoolName&&(this.rbdMirroringService.refresh(),this.rbdMirroringService.subscribeSummary(o=>{const i=o.content_data.pools.find(_=>_.name===this.currentPoolName);this.poolMirrorMode=i.mirror_mode,"disabled"===i.mirror_mode&&(this.mirroring=!1,this.rbdForm.get("mirroring").setValue(this.mirroring),this.rbdForm.get("mirroring").disable())})),this.setExclusiveLock()}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,S().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=L.N.fromString(decodeURIComponent(o.image_spec));o.snap&&(this.snapName=decodeURIComponent(o.snap)),t.rbd=this.rbdService.get(i),this.checkPeersConfigured(i.poolName)}):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,le.D)(t)}handleExternalData(t){if(this.handlePoolData(t.pools),this.setPoolMirrorMode(),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 _ of t)this.rbdService.isRBDPool(_)&&("replicated"===_.type?(o.push(_),i.push(_)):"erasure"===_.type&&-1!==_.flags_names.indexOf("ec_overwrites")&&i.push(_));if(this.pools=o,this.allPools=o,this.dataPools=i,this.allDataPools=i,1===this.pools.length){const _=this.pools[0].pool_name;this.rbdForm.get("pool").setValue(_),this.onPoolChange(_)}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(_=>_.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"),_=o.get("dataPool");let r=null;i.value&&null==_.value&&(r={required:!0}),_.setErrors(r);const l=o.get("size"),d=o.get("obj_size"),u=t.toBytes(null!=d.value?d.value:this.defaultObjectSize),f=o.get("stripingCount"),I=null!=f.value?f.value:this.defaultStripingCount;let P=null;null===l.value?P={required:!0}:I*u>t.toBytes(l.value)&&(P={invalidSizeObject:!0}),l.setErrors(P);const B=o.get("stripingUnit");let x=null;null===B.value&&null!==f.value?x={required:!0}:null!==B.value&&t.toBytes(B.value)>u&&(x={invalidStripingUnit:!0}),B.setErrors(x);let q=null;return null===f.value&&null!==B.value?q={required:!0}:I<1&&(q={min:!0}),f.setErrors(q),null}}deepBoxCheck(t,o){this.getDependentChildFeatures(t).forEach(_=>{const r=this.rbdForm.get(_.key);o?r.enable({emitEvent:!1}):(r.disable({emitEvent:!1}),r.setValue(!1,{emitEvent:!1}),this.deepBoxCheck(_.key,o));const l=this.rbdForm.get("features");this.mode===this.rbdFormMode.editing&&l.get(_.key).enabled&&(-1!==this.response.features_name.indexOf(_.key)&&!_.allowDisable||-1===this.response.features_name.indexOf(_.key)&&!_.allowEnable)&&l.get(_.key).disable()})}getDependentChildFeatures(t){return S().filter(this.features,o=>o.requires===t)||[]}interlockCheck(t,o){const i=this.featuresList.find(_=>_.key===t);if(this.response){const _=null!=i.interlockedWith,r=this.featuresList.find(d=>d.interlockedWith===i.key),l=!!this.response.features_name.find(d=>d===i.key);if(_){if(l!==!!this.response.features_name.find(u=>u===i.interlockedWith))return}else if(r&&!!this.response.features_name.find(u=>u===r.key)!==l)return}o?S().filter(this.features,_=>_.interlockedWith===t).forEach(_=>this.rbdForm.get(_.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");S().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 L.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 _=t.parent;this.rbdForm.get("parent").setValue(`${_.pool_name}/${_.image_name}@${_.snap_name}`)}this.mode===this.rbdFormMode.editing&&(this.rbdForm.get("name").setValue(t.name),"snapshot"===(null==t?void 0:t.mirror_mode)||t.features_name.includes("journaling")?(this.mirroring=!0,this.rbdForm.get("mirroring").setValue(this.mirroring),this.rbdForm.get("mirroringMode").setValue(null==t?void 0:t.mirror_mode),this.rbdForm.get("schedule").setValue(null==t?void 0:t.schedule_interval)):(this.mirroring=!1,this.rbdForm.get("mirroring").setValue(this.mirroring)),this.setPoolMirrorMode()),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:_t.h.image})}createRequest(){const t=new us;return t.pool_name=this.rbdForm.getValue("pool"),t.namespace=this.rbdForm.getValue("namespace"),t.name=this.rbdForm.getValue("name"),t.schedule_interval=this.rbdForm.getValue("schedule"),t.size=this.formatter.toBytes(this.rbdForm.getValue("size")),"image"===this.poolMirrorMode&&(t.mirror_mode=this.rbdForm.getValue("mirroringMode")),this.addObjectSizeAndStripingToRequest(t),t.configuration=this.getDirtyConfigurationValues(),t}addObjectSizeAndStripingToRequest(t){t.obj_size=this.formatter.toBytes(this.rbdForm.getValue("obj_size")),S().forIn(this.features,o=>{this.rbdForm.getValue(o.key)&&t.features.push(o.key)}),this.mirroring&&"journal"===this.rbdForm.getValue("mirroringMode")&&t.features.push("journaling"),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 R.R("rbd/create",{pool_name:t.pool_name,namespace:t.namespace,image_name:t.name,schedule_interval:t.schedule_interval,start_time:t.start_time}),call:this.rbdService.create(t)})}editRequest(){const t=new at;if(t.name=this.rbdForm.getValue("name"),t.schedule_interval=this.rbdForm.getValue("schedule"),t.name=this.rbdForm.getValue("name"),t.size=this.formatter.toBytes(this.rbdForm.getValue("size")),S().forIn(this.features,o=>{this.rbdForm.getValue(o.key)&&t.features.push(o.key)}),t.enable_mirror=this.rbdForm.getValue("mirroring"),t.enable_mirror)"journal"===this.rbdForm.getValue("mirroringMode")&&t.features.push("journaling"),"image"===this.poolMirrorMode&&(t.mirror_mode=this.rbdForm.getValue("mirroringMode"));else{const o=t.features.indexOf("journaling",0);o>-1&&t.features.splice(o,1)}return t.configuration=this.getDirtyConfigurationValues(),t}cloneRequest(){const t=new cs;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,_t.h.image),t}editAction(){const t=new L.N(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new R.R("rbd/edit",{image_spec:t.toString()}),call:this.rbdService.update(t,this.editRequest())})}cloneAction(){const t=this.cloneRequest(),o=new L.N(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new R.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 ds;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,_t.h.image),t}copyAction(){const t=this.copyRequest(),o=new L.N(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new R.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,_s.P)(),(0,as.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(g.gz),e.Y36(Ve.q),e.Y36(H),e.Y36(rs.H),e.Y36(m.P),e.Y36($e.$),e.Y36(D.p4),e.Y36(g.F0),e.Y36(K))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-form"]],features:[e.qOj],decls:1,vars:1,consts:function(){let s,t,o,i,_,r,l,d,u,f,I,P,B,x,q,J,ee,te,w,_e,ae,M,ue,me,ge,Te,fe,Ce,Se,G,ye,xe,Ze,we,He,ke,qe,Ke,Xe,Qe,ze;return s="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",o="Pool",i="Use a dedicated data pool",_="Size",r="e.g., 10GiB",l="Features",d="Advanced",u="Striping",f="Object size" + "\ufffd#67\ufffd" + "Objects in the Ceph Storage Cluster have a maximum configurable size (e.g., 2MB, 4MB, etc.). The object size should be large enough to accommodate many stripe units, and should be a multiple of the stripe unit." + "\ufffd/#67\ufffd" + "",I="Stripe unit" + "\ufffd#74\ufffd" + "Stripes have a configurable unit size (e.g., 64kb). The Ceph Client divides the data it will write to objects into equally sized stripe units, except for the last stripe unit. A stripe width, should be a fraction of the Object Size so that an object may contain many stripe units." + "\ufffd/#74\ufffd" + "",P="-- Select stripe unit --",B="Stripe count" + "\ufffd#85\ufffd" + "The Ceph Client writes a sequence of stripe units over a series of objects determined by the stripe count. The series of objects is called an object set. After the Ceph Client writes to the last object in the object set, it returns to the first object in the object set." + "\ufffd/#85\ufffd" + "",x="" + "\ufffd0\ufffd" + " from",q="This field is required.",J="'/' and '@' are not allowed.",ee="Loading...",te="-- No rbd pools available --",w="-- Select a pool --",_e="This field is required.",ae="Loading...",M="-- 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.",ge="Data pool",Te="Dedicated pool that stores the object-data of the RBD.",fe="Loading...",Ce="-- No data pools available --",Se="This field is required.",G="This field is required.",ye="You have to increase the size.",xe="You need to enable a " + "\ufffd#3\ufffd" + "mirror mode" + "\ufffd/#3\ufffd" + " in the selected pool. Please " + "\ufffd#4\ufffd" + "click here to select a mode and enable it in this pool." + "\ufffd/#4\ufffd" + "",Ze="You need to enable " + "\ufffd#3\ufffd" + "image mirror mode" + "\ufffd/#3\ufffd" + " in the selected pool. Please " + "\ufffd#4\ufffd" + "click here to select a mode and enable it in this pool." + "\ufffd/#4\ufffd" + "",we="Create Mirror-Snapshots automatically on a periodic basis. The interval can be specified in days, hours, or minutes using d, h, m suffix respectively. To create mirror snapshots, you must import or create and have available peers to mirror",He="Schedule Interval " + "\ufffd#3\ufffd" + "" + "\ufffd/#3\ufffd" + "",ke="e.g., 12h or 1d or 10m",qe="Advanced...",Ke="This field is required because stripe count is defined!",Xe="Stripe unit is greater than object size.",Qe="This field is required because stripe unit is defined!",ze="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"],s,[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-select","formControlName","pool",3,"change",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"],_,["id","size","name","size","type","text","formControlName","size","placeholder",r,"defaultUnit","GiB","cdDimlessBinary","",1,"form-control"],["formGroupName","features",1,"form-group","row"],["for","features",1,"cd-col-form-label"],l,["class","custom-control custom-checkbox",4,"ngFor","ngForOf"],["type","checkbox","id","mirroring","name","mirroring","formControlName","mirroring",1,"custom-control-input",3,"change"],["for","mirroring",1,"custom-control-label"],[1,"row"],[1,"col-sm-12"],["class","float-end margin-right-md","href","",3,"click",4,"ngIf"],[3,"hidden"],[1,"cd-header"],d,[1,"col-md-12"],u,["for","size",1,"cd-col-form-label"],f,["id","obj_size","name","obj_size","formControlName","obj_size",1,"form-select"],[3,"value",4,"ngFor","ngForOf"],["for","stripingUnit",1,"cd-col-form-label",3,"ngClass"],I,["id","stripingUnit","name","stripingUnit","formControlName","stripingUnit",1,"form-select"],[3,"ngValue"],P,["for","stripingCount",1,"cd-col-form-label",3,"ngClass"],B,["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"],x,["type","text","id","parent","name","parent","formControlName","parent",1,"form-control"],[1,"invalid-feedback"],q,J,["type","text","placeholder","Pool name...","id","pool","name","pool","formControlName","pool",1,"form-control"],["id","pool","name","pool","formControlName","pool",1,"form-select",3,"change"],[3,"ngValue",4,"ngIf"],ee,te,w,[3,"value"],_e,[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-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-select"],ae,M,ue,me,["for","dataPool",1,"cd-col-form-label"],ge,["html",Te],["class","form-control","type","text","placeholder","Data pool name...","id","dataPool","name","dataPool","formControlName","dataPool",4,"ngIf"],["id","dataPool","name","dataPool","class","form-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-select",3,"change"],fe,Ce,Se,G,ye,["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],[3,"html",4,"ngIf"],[3,"html"],xe,[3,"routerLink"],["class","custom-control custom-radio ms-2",4,"ngFor","ngForOf"],[1,"custom-control","custom-radio","ms-2"],["type","radio","name","mirroringMode","formControlName","mirroringMode",1,"form-check-input",3,"id","value","change"],[1,"form-check-label",3,"for"],Ze,[1,"cd-col-form-label"],He,["html",we],["id","schedule","name","schedule","type","text","formControlName","schedule","placeholder",ke,1,"form-control"],["href","",1,"float-end","margin-right-md",3,"click"],qe,Ke,Xe,Qe,ze]},template:function(t,o){1&t&&e.YNc(0,a_,95,49,"div",0),2&t&&e.Q6J("cdFormLoading",o.loading)},directives:[ut.y,a._Y,a.JL,a.sg,A.V,c.O5,O.P,$.o,a.Fj,X.b,a.JJ,a.u,Me.U,c.mk,a.EJ,a.YN,a.Kr,c.sg,a.Wl,ms.S,gs.Q,a.x0,g.yS,a._,a.wV,Ts.d,j.p],pipes:[c.rS,tt.m],styles:[""]}),n})();var Nt=p(71225),Ft=p(36169);let r_=(()=>{class n{constructor(){}static getCount(t){var o;return Number(null===(o=t.headers)||void 0===o?void 0:o.get("X-Total-Count"))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var rt=p(51847),l_=p(16738),Oe=p.n(l_),lt=p(62862),c_=p(52266);function d_(n,s){1&n&&(e.TgZ(0,"div",18)(1,"span"),e.SDv(2,19),e.qZA()())}function p_(n,s){1&n&&(e.TgZ(0,"span",20),e.SDv(1,21),e.qZA())}function u_(n,s){1&n&&(e.TgZ(0,"span",20),e.SDv(1,22),e.qZA())}function m_(n,s){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 g_=(()=>{class n{constructor(t,o,i,_,r){this.rbdService=t,this.activeModal=o,this.actionLabels=i,this.fb=_,this.taskWrapper=r,this.createForm()}createForm(){this.moveForm=this.fb.group({expiresAt:["",[z.h.custom("format",t=>!(""===t||Oe()(t,"YYYY-MM-DD HH:mm:ss").isValid())),z.h.custom("expired",t=>Oe()().isAfter(t))]]})}ngOnInit(){this.imageSpec=new L.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=Oe()(o,"YYYY-MM-DD HH:mm:ss").diff(Oe()(),"seconds",!0)),t<0&&(t=0),this.taskWrapper.wrapTaskAroundCall({task:new R.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(H),e.Y36(v.Kz),e.Y36(D.p4),e.Y36(lt.O),e.Y36(m.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-trash-move-modal"]],decls:23,vars:9,consts:function(){let s,t,o,i,_,r,l;return s="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",_="This image contains snapshot(s), which will prevent it from being removed after moved to trash.",r="Wrong date format. Please use \"YYYY-MM-DD HH:mm:ss\".",l="Protection has already expired. Please pick a future date or leave it empty.",[[3,"modalRef"],[1,"modal-title"],s,[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"],_,[1,"invalid-feedback"],r,l,[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)(6,"div",6),e.YNc(7,d_,3,0,"div",7),e.TgZ(8,"p"),e.tHW(9,8),e._UZ(10,"kbd")(11,"kbd"),e.N_p(),e.qZA(),e.TgZ(12,"div",9)(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,p_,2,0,"span",14),e.YNc(18,u_,2,0,"span",14),e.qZA()(),e.TgZ(19,"div",15)(20,"cd-form-button-panel",16),e.NdJ("submitActionEvent",function(){return o.moveImage()}),e.qZA()()(),e.BQk(),e.qZA(),e.YNc(21,m_,1,1,"ng-template",null,17,e.W1O)}if(2&t){const i=e.MAs(5),_=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",_),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:[C.z,a._Y,a.JL,a.sg,A.V,c.O5,O.P,$.o,a.Fj,X.b,a.JJ,a.u,v.o8,j.p,c_.J],styles:[""]}),n})();const We=function(){return{exact:!0}};function T_(n,s){1&n&&(e.TgZ(0,"li",1)(1,"a",9),e.SDv(2,10),e.qZA()()),2&n&&(e.xp6(1),e.Q6J("routerLinkActiveOptions",e.DdM(1,We)))}let et=(()=>{class n{constructor(t){this.authStorageService=t,this.grafanaPermission=this.authStorageService.getPermissions().grafana}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-tabs"]],decls:11,vars:7,consts:function(){let s,t,o,i;return s="Images",t="Namespaces",o="Trash",i="Overall Performance",[[1,"nav","nav-tabs"],[1,"nav-item"],["routerLink","/block/rbd","routerLinkActive","active","ariaCurrentWhenActive","page",1,"nav-link",3,"routerLinkActiveOptions"],s,["routerLink","/block/rbd/namespaces","routerLinkActive","active","ariaCurrentWhenActive","page",1,"nav-link",3,"routerLinkActiveOptions"],t,["routerLink","/block/rbd/trash","routerLinkActive","active","ariaCurrentWhenActive","page",1,"nav-link",3,"routerLinkActiveOptions"],o,["class","nav-item",4,"ngIf"],["routerLink","/block/rbd/performance","routerLinkActive","active","ariaCurrentWhenActive","page",1,"nav-link",3,"routerLinkActiveOptions"],i]},template:function(t,o){1&t&&(e.TgZ(0,"ul",0)(1,"li",1)(2,"a",2),e.SDv(3,3),e.qZA()(),e.TgZ(4,"li",1)(5,"a",4),e.SDv(6,5),e.qZA()(),e.TgZ(7,"li",1)(8,"a",6),e.SDv(9,7),e.qZA()(),e.YNc(10,T_,3,2,"li",8),e.qZA()),2&t&&(e.xp6(2),e.Q6J("routerLinkActiveOptions",e.DdM(4,We)),e.xp6(3),e.Q6J("routerLinkActiveOptions",e.DdM(5,We)),e.xp6(3),e.Q6J("routerLinkActiveOptions",e.DdM(6,We)),e.xp6(2),e.Q6J("ngIf",o.grafanaPermission.read))},directives:[g.yS,g.Od,c.O5],styles:[""]}),n})();var f_=p(25917),Dt=p(51295),ct=p(60737),C_=p(74255),vt=p(71099),Lt=p(79765);function S_(n,s){1&n&&(e.TgZ(0,"span",16),e.SDv(1,17),e.qZA())}function E_(n,s){if(1&n&&(e.TgZ(0,"span"),e.tHW(1,18),e._UZ(2,"b"),e.N_p(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.pQV(t.imageName),e.QtT(1)}}let R_=(()=>{class n{constructor(t,o,i,_,r){this.activeModal=t,this.rbdService=o,this.taskManagerService=i,this.notificationService=_,this.actionLabels=r,this.editing=!1,this.onSubmit=new Lt.xQ,this.action=this.actionLabels.CREATE,this.resource="RBD Snapshot",this.createForm()}createForm(){this.snapshotForm=new Z.d({snapshotName:new a.NI("",{validators:[a.kI.required]})})}setSnapName(t){this.snapName=t,"snapshot"!==this.mirroring?this.snapshotForm.get("snapshotName").setValue(t):this.snapshotForm.get("snapshotName").clearValidators()}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 L.N(this.poolName,this.namespace,this.imageName),i=new R.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,_=>{this.notificationService.notifyTask(_)}),this.activeModal.close(),this.onSubmit.next(this.snapName)}).catch(()=>{this.snapshotForm.setErrors({cdSubmitButton:!0})})}createAction(){const t=this.snapshotForm.getValue("snapshotName"),o=new L.N(this.poolName,this.namespace,this.imageName),i=new R.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,_=>{this.notificationService.notifyTask(_)}),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(v.Kz),e.Y36(H),e.Y36(vt.k),e.Y36(Le.g),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-snapshot-form-modal"]],decls:22,vars:17,consts:function(){let s,t,o,i;return s="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="Name",o="This field is required.",i="Snapshot mode is enabled on image " + "\ufffd#2\ufffd" + "" + "\ufffd0\ufffd" + "" + "\ufffd/#2\ufffd" + ": snapshot names are auto generated",[[3,"modalRef"],[1,"modal-title"],s,[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"],[4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],o,i]},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)(8,"div",6)(9,"div",7)(10,"label",8),e.SDv(11,9),e.qZA(),e.TgZ(12,"div",10),e._UZ(13,"input",11),e.YNc(14,S_,2,0,"span",12),e._UZ(15,"br")(16,"br"),e.YNc(17,E_,3,1,"span",13),e.qZA()()(),e.TgZ(18,"div",14)(19,"cd-form-button-panel",15),e.NdJ("submitActionEvent",function(){return o.submit()}),e.ALo(20,"titlecase"),e.ALo(21,"upperFirst"),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,9,o.action))(e.lcZ(4,11,o.resource)),e.QtT(2),e.xp6(2),e.Q6J("formGroup",o.snapshotForm),e.xp6(7),e.uIk("disabled","snapshot"===o.mirroring||null),e.xp6(1),e.Q6J("ngIf",o.snapshotForm.showError("snapshotName",i,"required")),e.xp6(3),e.Q6J("ngIf","snapshot"===o.mirroring),e.xp6(2),e.Q6J("form",o.snapshotForm)("submitText",e.lcZ(20,13,o.action)+" "+e.lcZ(21,15,o.resource))}},directives:[C.z,a._Y,a.JL,a.sg,A.V,O.P,$.o,a.Fj,X.b,a.JJ,a.u,Me.U,c.O5,j.p],pipes:[c.rS,tt.m],styles:[""]}),n})();class M_{constructor(s,t,o){this.featuresName=t,this.cloneFormatVersion=1,o.cloneFormatVersion().subscribe(i=>{this.cloneFormatVersion=i}),this.create={permission:"create",icon:T.P.add,name:s.CREATE},this.rename={permission:"update",icon:T.P.edit,name:s.RENAME,disable:i=>this.disableForMirrorSnapshot(i)},this.protect={permission:"update",icon:T.P.lock,visible:i=>i.hasSingleSelection&&!i.first().is_protected,name:s.PROTECT,disable:i=>this.disableForMirrorSnapshot(i)},this.unprotect={permission:"update",icon:T.P.unlock,visible:i=>i.hasSingleSelection&&i.first().is_protected,name:s.UNPROTECT,disable:i=>this.disableForMirrorSnapshot(i)},this.clone={permission:"create",canBePrimary:i=>i.hasSingleSelection,disable:i=>this.getCloneDisableDesc(i,this.featuresName)||this.disableForMirrorSnapshot(i),icon:T.P.clone,name:s.CLONE},this.copy={permission:"create",canBePrimary:i=>i.hasSingleSelection,disable:i=>!i.hasSingleSelection||i.first().cdExecuting||this.disableForMirrorSnapshot(i),icon:T.P.copy,name:s.COPY},this.rollback={permission:"update",icon:T.P.undo,name:s.ROLLBACK,disable:i=>this.disableForMirrorSnapshot(i)},this.deleteSnap={permission:"delete",icon:T.P.destroy,disable:i=>{const _=i.first();return!i.hasSingleSelection||_.cdExecuting||_.is_protected||this.disableForMirrorSnapshot(i)},name:s.DELETE},this.ordering=[this.create,this.rename,this.protect,this.unprotect,this.clone,this.copy,this.rollback,this.deleteSnap]}getCloneDisableDesc(s,t){return!(s.hasSingleSelection&&!s.first().cdExecuting)||((null==t?void 0:t.includes("layering"))?1===this.cloneFormatVersion&&!s.first().is_protected&&"Snapshot must be protected in order to clone.":"Parent image must support Layering")}disableForMirrorSnapshot(s){return s.hasSingleSelection&&"snapshot"===s.first().mirror_mode&&s.first().name.includes(".mirror.")}}class O_{}var Ge=p(96102);const h_=["nameTpl"],A_=["rollbackTpl"];function P_(n,s){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=s.$implicit;e.xp6(3),e.hij(" ",t.snapName,"")}}let I_=(()=>{class n{constructor(t,o,i,_,r,l,d,u,f,I,P,B){this.authStorageService=t,this.modalService=o,this.dimlessBinaryPipe=i,this.cdDatePipe=_,this.rbdService=r,this.rbdMirrorService=l,this.taskManagerService=d,this.notificationService=u,this.summaryService=f,this.taskListService=I,this.actionLabels=P,this.cdr=B,this.snapshots=[],this.selection=new Ee.r,this.peerConfigured=!1,this.builders={"rbd/snap/create":x=>{const q=new O_;return q.name=x.snapshot_name,q}},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.rbdMirrorService.getPeerForPool(this.poolName).subscribe(_=>{_.length>0&&(this.peerConfigured=!0)}),this.imageSpec=new L.N(this.poolName,this.namespace,this.rbdName),this.rbdTableActions=new M_(this.actionLabels,this.featuresName,this.rbdService),this.rbdTableActions.create.disable=()=>!this.primary||!this.peerConfigured&&"snapshot"===this.mirroring,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,f_.of)(this.snapshots),null,_=>{Dt.T.updateChanged(this,{data:_})&&(this.cdr.detectChanges(),this.data=[...this.data])},()=>{Dt.T.updateChanged(this,{data:this.snapshots})&&(this.cdr.detectChanges(),this.data=[...this.data])},_=>["rbd/snap/create","rbd/snap/delete","rbd/snap/edit","rbd/snap/rollback"].includes(_.name)&&this.imageSpec.toString()===_.metadata.image_spec,(_,r)=>_.name===r.metadata.snapshot_name,this.builders)}ngOnChanges(){this.columns&&(this.imageSpec=new L.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(R_,{mirroring:this.mirroring}),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}_${Oe()().toISOString(!0)}`,this.modalRef.componentInstance.setSnapName(o),this.modalRef.componentInstance.onSubmit.subscribe(_=>{const r=new ct.o;r.name=t,r.metadata={image_spec:this.imageSpec.toString(),snapshot_name:_},this.summaryService.addRunningTask(r)})}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 R.R;i.name="rbd/snap/edit";const _=new L.N(this.poolName,this.namespace,this.rbdName);i.metadata={image_spec:_.toString(),snapshot_name:t},this.rbdService.protectSnapshot(_,t,!o).toPromise().then(()=>{const r=new ct.o;r.name=i.name,r.metadata=i.metadata,this.summaryService.addRunningTask(r),this.taskManagerService.subscribe(i.name,i.metadata,l=>{this.notificationService.notifyTask(l)})})}_asyncTask(t,o,i){const _=new R.R;_.name=o,_.metadata={image_spec:new L.N(this.poolName,this.namespace,this.rbdName).toString(),snapshot_name:i};const r=new L.N(this.poolName,this.namespace,this.rbdName);this.rbdService[t](r,i).toPromise().then(()=>{const l=new ct.o;l.name=_.name,l.metadata=_.metadata,this.summaryService.addRunningTask(l),this.modalRef.close(),this.taskManagerService.subscribe(l.name,l.metadata,d=>{this.notificationService.notifyTask(d)})}).catch(()=>{this.modalRef.componentInstance.stopLoadingSpinner()})}rollbackModal(){const t=this.selection.selected[0].name,o=new L.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(pe.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(de.Z),e.Y36($e.$),e.Y36(Ge.N),e.Y36(H),e.Y36(K),e.Y36(vt.k),e.Y36(Le.g),e.Y36(C_.J),e.Y36(ce.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(h_,5),e.Gf(A_,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",mirroring:"mirroring",primary:"primary",rbdName:"rbdName"},features:[e._Bn([ce.j]),e.TTD],decls:4,vars:5,consts:function(){let s;return s="You are about to rollback",[["columnMode","flex","selectionType","single",3,"data","columns","updateSelection"],[1,"table-actions",3,"permission","selection","tableActions"],["rollbackTpl",""],s]},template:function(t,o){1&t&&(e.TgZ(0,"cd-table",0),e.NdJ("updateSelection",function(_){return o.updateSelection(_)}),e._UZ(1,"cd-table-actions",1),e.qZA(),e.YNc(2,P_,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:[W.a,Re.K],styles:[""],changeDetection:0}),n})();var b_=p(42176),$t=p(76317),N_=p(41039);const F_=["poolConfigurationSourceTpl"];function D_(n,s){1&n&&(e.ynx(0),e.tHW(1,3),e._UZ(2,"strong"),e.N_p(),e.BQk())}function v_(n,s){if(1&n&&(e.TgZ(0,"span")(1,"span",38),e._uU(2),e.qZA()()),2&n){const t=s.$implicit;e.xp6(2),e.Oqu(t)}}function L_(n,s){if(1&n&&(e.TgZ(0,"span")(1,"span",39),e.SDv(2,40),e.qZA()()),2&n){e.oxw(3);const t=e.MAs(1);e.xp6(1),e.Q6J("ngbTooltip",t)}}function $_(n,s){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 B_(n,s){if(1&n&&(e.TgZ(0,"span")(1,"span",39),e.SDv(2,41),e.qZA()()),2&n){e.oxw(3);const t=e.MAs(1);e.xp6(1),e.Q6J("ngbTooltip",t)}}function G_(n,s){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 y_(n,s){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 x_(n,s){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.YNc(2,y_,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 Z_(n,s){1&n&&(e.TgZ(0,"span"),e._uU(1,"-"),e.qZA())}function w_(n,s){if(1&n&&(e.TgZ(0,"table",17)(1,"tbody")(2,"tr")(3,"td",18),e.SDv(4,19),e.qZA(),e.TgZ(5,"td",20),e._uU(6),e.qZA()(),e.TgZ(7,"tr")(8,"td",21),e.SDv(9,22),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.qZA()(),e.TgZ(12,"tr")(13,"td",21),e.SDv(14,23),e.qZA(),e.TgZ(15,"td"),e._uU(16),e.ALo(17,"empty"),e.qZA()(),e.TgZ(18,"tr")(19,"td",21),e.SDv(20,24),e.qZA(),e.TgZ(21,"td"),e._uU(22),e.ALo(23,"cdDate"),e.qZA()(),e.TgZ(24,"tr")(25,"td",21),e.SDv(26,25),e.qZA(),e.TgZ(27,"td"),e._uU(28),e.ALo(29,"dimlessBinary"),e.qZA()(),e.TgZ(30,"tr")(31,"td",21),e.SDv(32,26),e.qZA(),e.TgZ(33,"td"),e._uU(34),e.ALo(35,"dimless"),e.qZA()(),e.TgZ(36,"tr")(37,"td",21),e.SDv(38,27),e.qZA(),e.TgZ(39,"td"),e._uU(40),e.ALo(41,"dimlessBinary"),e.qZA()(),e.TgZ(42,"tr")(43,"td",21),e.SDv(44,28),e.qZA(),e.TgZ(45,"td"),e.YNc(46,v_,3,1,"span",29),e.qZA()(),e.TgZ(47,"tr")(48,"td",21),e.SDv(49,30),e.qZA(),e.TgZ(50,"td"),e.YNc(51,L_,3,1,"span",1),e.YNc(52,$_,3,3,"span",1),e.qZA()(),e.TgZ(53,"tr")(54,"td",21),e.SDv(55,31),e.qZA(),e.TgZ(56,"td"),e.YNc(57,B_,3,1,"span",1),e.YNc(58,G_,3,3,"span",1),e.qZA()(),e.TgZ(59,"tr")(60,"td",21),e.SDv(61,32),e.qZA(),e.TgZ(62,"td"),e._uU(63),e.ALo(64,"dimlessBinary"),e.qZA()(),e.TgZ(65,"tr")(66,"td",21),e.SDv(67,33),e.qZA(),e.TgZ(68,"td"),e._uU(69),e.qZA()(),e.TgZ(70,"tr")(71,"td",21),e.SDv(72,34),e.qZA(),e.TgZ(73,"td"),e.YNc(74,x_,4,4,"span",1),e.YNc(75,Z_,2,0,"span",1),e.qZA()(),e.TgZ(76,"tr")(77,"td",21),e.SDv(78,35),e.qZA(),e.TgZ(79,"td"),e._uU(80),e.qZA()(),e.TgZ(81,"tr")(82,"td",21),e.SDv(83,36),e.qZA(),e.TgZ(84,"td"),e._uU(85),e.qZA()(),e.TgZ(86,"tr")(87,"td",21),e.SDv(88,37),e.qZA(),e.TgZ(89,"td"),e._uU(90),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 H_(n,s){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)("primary",t.selection.primary)("namespace",t.selection.namespace)("mirroring",t.selection.mirror_mode)("rbdName",t.selection.name)}}function k_(n,s){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 q_(n,s){if(1&n&&e._UZ(0,"cd-grafana",44),2&n){const t=e.oxw(2);e.Q6J("grafanaPath",t.rbdDashboardUrl)("type","metrics")}}function K_(n,s){if(1&n&&(e.ynx(0),e.TgZ(1,"nav",4,5),e.ynx(3,6),e.TgZ(4,"a",7),e.SDv(5,8),e.qZA(),e.YNc(6,w_,91,31,"ng-template",9),e.BQk(),e.ynx(7,10),e.TgZ(8,"a",7),e.SDv(9,11),e.qZA(),e.YNc(10,H_,1,7,"ng-template",9),e.BQk(),e.ynx(11,12),e.TgZ(12,"a",7),e.SDv(13,13),e.qZA(),e.YNc(14,k_,1,1,"ng-template",9),e.BQk(),e.ynx(15,14),e.TgZ(16,"a",7),e.SDv(17,15),e.qZA(),e.YNc(18,q_,1,2,"ng-template",9),e.BQk(),e.qZA(),e._UZ(19,"div",16),e.BQk()),2&n){const t=e.MAs(2);e.xp6(19),e.Q6J("ngbNavOutlet",t)}}function X_(n,s){1&n&&(e.ynx(0),e.TgZ(1,"cd-alert-panel",45),e.SDv(2,46),e.qZA(),e.BQk())}function Q_(n,s){1&n&&(e.ynx(0),e.TgZ(1,"strong",49),e.SDv(2,50),e.qZA(),e.BQk())}function z_(n,s){1&n&&(e.TgZ(0,"span",51),e.SDv(1,52),e.qZA())}function J_(n,s){if(1&n&&(e.YNc(0,Q_,3,0,"ng-container",47),e.YNc(1,z_,2,0,"ng-template",null,48,e.W1O)),2&n){const t=s.value,o=e.MAs(2);e.Q6J("ngIf",+t)("ngIfElse",o)}}let Y_=(()=>{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(F_,7),e.Gf(v.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 s,t,o,i,_,r,l,d,u,f,I,P,B,x,q,J,ee,te,w,_e,ae,M,ue,me,ge,Te,fe,Ce,Se;return s="Only available for RBD images with " + "\ufffd#2\ufffd" + "fast-diff" + "\ufffd/#2\ufffd" + " enabled",t="Details",o="Snapshots",i="Configuration",_="Performance",r="Name",l="Pool",d="Data Pool",u="Created",f="Size",I="Objects",P="Object size",B="Features",x="Provisioned",q="Total provisioned",J="Striping unit",ee="Striping count",te="Parent",w="Block name prefix",_e="Order",ae="Format Version",M="N/A",ue="N/A",me="RBD details",ge="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",""],s,["ngbNav","","cdStatefulTab","rbd-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],t,["ngbNavContent",""],["ngbNavItem","snapshots"],o,["ngbNavItem","configuration"],i,["ngbNavItem","performance"],_,[3,"ngbNavOutlet"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],r,[1,"w-75"],[1,"bold"],l,d,u,f,I,P,B,[4,"ngFor","ngForOf"],x,q,J,ee,te,w,_e,ae,[1,"badge","badge-dark","me-2"],["placement","top",1,"form-text","text-muted",3,"ngbTooltip"],M,ue,[3,"snapshots","featuresName","poolName","primary","namespace","mirroring","rbdName"],[3,"data"],["title",me,"uid","YhCYGcuZz","grafanaStyle","one",3,"grafanaPath","type"],["type","warning"],ge,[4,"ngIf","ngIfElse"],["global",""],["ngbTooltip",Te],fe,["ngbTooltip",Ce],Se]},template:function(t,o){1&t&&(e.YNc(0,D_,3,0,"ng-template",null,0,e.W1O),e.YNc(2,K_,20,1,"ng-container",1),e.YNc(3,X_,3,0,"ng-container",1),e.YNc(4,J_,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:[c.O5,v.Pz,Ot.m,v.nv,v.Vx,v.uN,c.sg,v._L,I_,b_.P,$t.F,v.tO,St.G],pipes:[N_.W,Ge.N,$e.$,nt.n],styles:[""]}),n})();const V_=["usageTpl"],U_=["parentTpl"],j_=["nameTpl"],W_=["scheduleTpl"],ea=["mirroringTpl"],ta=["flattenTpl"],oa=["deleteTpl"],na=["removingStatTpl"],ia=["provisionedNotAvailableTooltipTpl"],sa=["totalProvisionedNotAvailableTooltipTpl"];function _a(n,s){1&n&&e._UZ(0,"div",13),2&n&&e.Q6J("innerHtml","Only available for RBD images with <strong>fast-diff</strong> enabled",e.oJD)}function aa(n,s){if(1&n&&(e.TgZ(0,"span",16),e.SDv(1,17),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("ngbTooltip",t.usageNotAvailableTooltipTpl)}}function ra(n,s){if(1&n&&(e.SDv(0,18),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 la(n,s){if(1&n&&(e.YNc(0,aa,2,1,"span",14),e.YNc(1,ra,2,3,"ng-template",null,15,e.W1O)),2&n){const t=s.row,o=e.MAs(2);e.Q6J("ngIf",null===t.disk_usage&&!t.features_name.includes("fast-diff"))("ngIfElse",o)}}function ca(n,s){if(1&n&&(e.TgZ(0,"span",16),e.SDv(1,20),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("ngbTooltip",t.usageNotAvailableTooltipTpl)}}function da(n,s){if(1&n&&(e.SDv(0,21),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 pa(n,s){if(1&n&&(e.YNc(0,ca,2,1,"span",14),e.YNc(1,da,2,3,"ng-template",null,19,e.W1O)),2&n){const t=s.row,o=e.MAs(2);e.Q6J("ngIf",null===t.total_disk_usage&&!t.features_name.includes("fast-diff"))("ngIfElse",o)}}function ua(n,s){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 ma(n,s){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.YNc(2,ua,2,1,"span",22),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 ga(n,s){1&n&&(e.TgZ(0,"span"),e._uU(1,"-"),e.qZA())}function Ta(n,s){if(1&n&&(e.YNc(0,ma,4,4,"span",22),e.YNc(1,ga,2,0,"span",22)),2&n){const t=s.value;e.Q6J("ngIf",t),e.xp6(1),e.Q6J("ngIf",!t)}}function fa(n,s){if(1&n&&(e.TgZ(0,"span",26),e._uU(1),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.Oqu(t[0])}}function Ca(n,s){if(1&n&&(e.TgZ(0,"span",26),e._uU(1),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.Oqu(t[1])}}function Sa(n,s){1&n&&(e.TgZ(0,"span",26),e.SDv(1,27),e.qZA())}function Ea(n,s){1&n&&(e.TgZ(0,"span",26),e.SDv(1,28),e.qZA())}function Ra(n,s){if(1&n&&(e.TgZ(0,"span",26),e._uU(1),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.Oqu(t)}}function Ma(n,s){if(1&n&&(e.YNc(0,fa,2,1,"span",23),e._uU(1,"\xa0 "),e.YNc(2,Ca,2,1,"span",24),e._uU(3,"\xa0 "),e.YNc(4,Sa,2,0,"span",24),e.YNc(5,Ea,2,0,"span",24),e.YNc(6,Ra,2,1,"ng-template",null,25,e.W1O)),2&n){const t=s.value,o=s.row,i=e.MAs(7);e.Q6J("ngIf",3===t.length)("ngIfElse",i),e.xp6(2),e.Q6J("ngIf",3===t.length),e.xp6(2),e.Q6J("ngIf",!0===o.primary),e.xp6(1),e.Q6J("ngIf",!1===o.primary)}}function Oa(n,s){if(1&n&&(e.TgZ(0,"span",26),e._uU(1),e.ALo(2,"cdDate"),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.Oqu(e.lcZ(2,1,t[2]))}}function ha(n,s){1&n&&e.YNc(0,Oa,3,3,"span",24),2&n&&e.Q6J("ngIf",3===s.value.length)}function Aa(n,s){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")(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=s.$implicit;e.xp6(2),e.Oqu(t.child),e.xp6(6),e.Oqu(t.parent),e.xp6(3),e.Oqu(t.child)}}function Pa(n,s){if(1&n&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.xp6(1),e.Oqu(t)}}function Ia(n,s){if(1&n&&(e.ynx(0),e.TgZ(1,"span"),e.SDv(2,32),e.qZA(),e.TgZ(3,"ul"),e.YNc(4,Pa,2,1,"li",33),e.qZA(),e.BQk()),2&n){const t=e.oxw(2).snapshots;e.xp6(4),e.Q6J("ngForOf",t)}}function ba(n,s){if(1&n&&(e.TgZ(0,"div",30)(1,"span"),e.SDv(2,31),e.qZA(),e._UZ(3,"br"),e.YNc(4,Ia,5,1,"ng-container",22),e.qZA()),2&n){const t=e.oxw().snapshots;e.xp6(4),e.Q6J("ngIf",t.length>0)}}function Na(n,s){1&n&&e.YNc(0,ba,5,1,"div",29),2&n&&e.Q6J("ngIf",s.hasSnapshots)}const Fa=function(n,s){return[n,s]};function Da(n,s){if(1&n&&e._UZ(0,"i",35),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.WLB(1,Fa,t.icons.spinner,t.icons.spin))}}function va(n,s){if(1&n&&(e.TgZ(0,"span",35),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 La(n,s){if(1&n&&e._UZ(0,"i",37),2&n){const t=e.oxw(2);e.Gre("",t.icons.warning," warn")}}function $a(n,s){if(1&n&&(e.YNc(0,Da,1,4,"i",34),e.TgZ(1,"span",35),e._uU(2),e.qZA(),e.YNc(3,va,2,2,"span",34),e.YNc(4,La,1,3,"i",36)),2&n){const t=s.column,o=s.value,i=s.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 Ga=(()=>{class n extends Tt.o{constructor(t,o,i,_,r,l,d,u,f){super(),this.authStorageService=t,this.rbdService=o,this.dimlessBinaryPipe=i,this.dimlessPipe=_,this.modalService=r,this.taskWrapper=l,this.taskListService=d,this.urlBuilder=u,this.actionLabels=f,this.tableStatus=new Nt.c("light"),this.selection=new Ee.r,this.icons=T.P,this.count=0,this.tableContext=null,this.builders={"rbd/create":M=>this.createRbdFromTask(M.pool_name,M.namespace,M.image_name),"rbd/delete":M=>this.createRbdFromTaskImageSpec(M.image_spec),"rbd/clone":M=>this.createRbdFromTask(M.child_pool_name,M.child_namespace,M.child_image_name),"rbd/copy":M=>this.createRbdFromTask(M.dest_pool_name,M.dest_namespace,M.dest_image_name)},this.permission=this.authStorageService.getPermissions().rbdImage;const I=()=>this.selection.first()&&new L.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:M=>!M.hasSingleSelection,name:this.actionLabels.CREATE},{permission:"update",icon:T.P.edit,routerLink:()=>this.urlBuilder.getEdit(I()),name:this.actionLabels.EDIT,disable:M=>this.getRemovingStatusDesc(M)||this.getInvalidNameDisable(M)},{permission:"create",canBePrimary:M=>M.hasSingleSelection,disable:M=>this.getRemovingStatusDesc(M)||this.getInvalidNameDisable(M)||!!M.first().cdExecuting,icon:T.P.copy,routerLink:()=>`/block/rbd/copy/${I()}`,name:this.actionLabels.COPY},{permission:"update",disable:M=>this.getRemovingStatusDesc(M)||this.getInvalidNameDisable(M)||M.first().cdExecuting||!M.first().parent,icon:T.P.flatten,click:()=>this.flattenRbdModal(),name:this.actionLabels.FLATTEN},{permission:"update",icon:T.P.refresh,click:()=>this.resyncRbdModal(),name:this.actionLabels.RESYNC,disable:M=>this.getResyncDisableDesc(M)},{permission:"delete",icon:T.P.destroy,click:()=>this.deleteRbdModal(),name:this.actionLabels.DELETE,disable:M=>this.getDeleteDisableDesc(M)},{permission:"delete",icon:T.P.trash,click:()=>this.trashRbdModal(),name:this.actionLabels.TRASH,disable:M=>this.getRemovingStatusDesc(M)||this.getInvalidNameDisable(M)||M.first().image_format===Ie.V1},{permission:"update",icon:T.P.edit,click:()=>this.removeSchedulingModal(),name:this.actionLabels.REMOVE_SCHEDULING,disable:M=>this.getRemovingStatusDesc(M)||this.getInvalidNameDisable(M)||void 0===M.first().schedule_info},{permission:"update",icon:T.P.edit,click:()=>this.actionPrimary(!0),name:this.actionLabels.PROMOTE,visible:()=>null!=this.selection.first()&&!this.selection.first().primary},{permission:"update",icon:T.P.edit,click:()=>this.actionPrimary(!1),name:this.actionLabels.DEMOTE,visible:()=>null!=this.selection.first()&&this.selection.first().primary}]}createRbdFromTaskImageSpec(t){const o=L.N.fromString(t);return this.createRbdFromTask(o.poolName,o.namespace,o.imageName)}createRbdFromTask(t,o,i){const _=new ls;return _.id="-1",_.unique_id="-1",_.name=i,_.namespace=o,_.pool_name=t,_.image_format=Ie.V2,_}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",sortable:!1,pipe:this.dimlessBinaryPipe},{name:"Objects",prop:"num_objs",flexGrow:1,cellClass:"text-right",sortable:!1,pipe:this.dimlessPipe},{name:"Object size",prop:"obj_size",flexGrow:1,cellClass:"text-right",sortable:!1,pipe:this.dimlessBinaryPipe},{name:"Provisioned",prop:"disk_usage",cellClass:"text-center",flexGrow:1,pipe:this.dimlessBinaryPipe,sortable:!1,cellTemplate:this.provisionedNotAvailableTooltipTpl},{name:"Total provisioned",prop:"total_disk_usage",cellClass:"text-center",flexGrow:1,pipe:this.dimlessBinaryPipe,sortable:!1,cellTemplate:this.totalProvisionedNotAvailableTooltipTpl},{name:"Parent",prop:"parent",flexGrow:2,sortable:!1,cellTemplate:this.parentTpl},{name:"Mirroring",prop:"mirror_mode",flexGrow:3,sortable:!1,cellTemplate:this.mirroringTpl},{name:"Next Scheduled Snapshot",prop:"mirror_mode",flexGrow:3,sortable:!1,cellTemplate:this.scheduleTpl}],this.taskListService.init(i=>this.getRbdImages(i),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,_)=>{let r;switch(_.name){case"rbd/copy":r=new L.N(_.metadata.dest_pool_name,_.metadata.dest_namespace,_.metadata.dest_image_name).toString();break;case"rbd/clone":r=new L.N(_.metadata.child_pool_name,_.metadata.child_namespace,_.metadata.child_image_name).toString();break;case"rbd/create":r=new L.N(_.metadata.pool_name,_.metadata.namespace,_.metadata.image_name).toString();break;default:r=_.metadata.image_spec}return r===new L.N(i.pool_name,i.namespace,i.name).toString()},this.builders)}onFetchError(){this.table.reset(),this.tableStatus=new Nt.c("danger")}getRbdImages(t){var o;return null!==t&&(this.tableContext=t),null==this.tableContext&&(this.tableContext=new h.E(()=>{})),this.rbdService.list(null===(o=this.tableContext)||void 0===o?void 0:o.toParams())}prepareResponse(t){let o=[];return t.forEach(i=>{o=o.concat(i.value)}),o.forEach(i=>{if(void 0!==i.schedule_info){let _=[];const r="scheduled";let l=+new Date(i.schedule_info.schedule_time);const d=(new Date).getTimezoneOffset();l+=6e4*Math.abs(d),_.push(i.mirror_mode,r,l),i.mirror_mode=_,_=[]}}),this.count=o.length>0?r_.getCount(t[0]):0,o}updateSelection(t){this.selection=t}deleteRbdModal(){const t=this.selection.first().pool_name,o=this.selection.first().namespace,i=this.selection.first().name,_=new L.N(t,o,i);this.modalRef=this.modalService.show(pe.M,{itemDescription:"RBD",itemNames:[_],bodyTemplate:this.deleteTpl,bodyContext:{hasSnapshots:this.hasSnapshots(),snapshots:this.listProtectedSnapshots()},submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new R.R("rbd/delete",{image_spec:_.toString()}),call:this.rbdService.delete(_)})})}resyncRbdModal(){const t=this.selection.first().pool_name,o=this.selection.first().namespace,i=this.selection.first().name,_=new L.N(t,o,i);this.modalRef=this.modalService.show(pe.M,{itemDescription:"RBD",itemNames:[_],actionDescription:"resync",submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new R.R("rbd/edit",{image_spec:_.toString()}),call:this.rbdService.update(_,{resync:!0})})})}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(g_,t)}flattenRbd(t){this.taskWrapper.wrapTaskAroundCall({task:new R.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,_=this.selection.first().parent,r=new L.N(_.pool_name,_.pool_namespace,_.image_name),l=new L.N(t,o,i),d={titleText:"RBD flatten",buttonText:"Flatten",bodyTpl:this.flattenTpl,bodyData:{parent:`${r}@${_.snap_name}`,child:l.toString()},onSubmit:()=>{this.flattenRbd(l)}};this.modalRef=this.modalService.show(Ft.Y,d)}editRequest(){const t=new at;return t.remove_scheduling=!t.remove_scheduling,t}removeSchedulingModal(){const t=this.selection.first().name,o=new L.N(this.selection.first().pool_name,this.selection.first().namespace,this.selection.first().name);this.modalRef=this.modalService.show(pe.M,{actionDescription:"remove scheduling on",itemDescription:"image",itemNames:[`${t}`],submitActionObservable:()=>new Mt.y(i=>{this.taskWrapper.wrapTaskAroundCall({task:new R.R("rbd/edit",{image_spec:o.toString()}),call:this.rbdService.update(o,this.editRequest())}).subscribe({error:_=>i.error(_),complete:()=>{this.modalRef.close()}})})})}actionPrimary(t){const o=new at;o.primary=t,o.features=null;const i=new L.N(this.selection.first().pool_name,this.selection.first().namespace,this.selection.first().name);this.taskWrapper.wrapTaskAroundCall({task:new R.R("rbd/edit",{image_spec:i.toString()}),call:this.rbdService.update(i,o)}).subscribe()}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,_)=>(_.is_protected&&i.push(_.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())}getResyncDisableDesc(t){const o=t.first();return o&&this.imageIsPrimary(o)?"Primary RBD images cannot be resynced":this.getInvalidNameDisable(t)}imageIsPrimary(t){return t.primary}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(H),e.Y36($e.$),e.Y36(nt.n),e.Y36(de.Z),e.Y36(m.P),e.Y36(ce.j),e.Y36(rt.F),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-list"]],viewQuery:function(t,o){if(1&t&&(e.Gf(W.a,7),e.Gf(V_,5),e.Gf(U_,7),e.Gf(j_,5),e.Gf(W_,7),e.Gf(ea,7),e.Gf(ta,7),e.Gf(oa,7),e.Gf(na,7),e.Gf(ia,7),e.Gf(sa,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.scheduleTpl=i.first),e.iGM(i=e.CRH())&&(o.mirroringTpl=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([ce.j,{provide:rt.F,useValue:new rt.F("block/rbd")}]),e.qOj],decls:23,vars:13,consts:function(){let s,t,o,i,_,r,l,d,u;return s="N/A",t="" + "\ufffd0\ufffd" + "",o="N/A",i="" + "\ufffd0\ufffd" + "",_="primary",r="secondary",l="Deleting this image will also delete all its snapshots.",d="The following snapshots are currently protected and will be removed:",u="RBD in status 'Removing'",[["columnMode","flex","identifier","unique_id","forceIdentifier","true","selectionType","single",3,"data","columns","searchableObjects","serverSide","count","hasDetails","status","maxLimit","autoReload","fetchData","setExpandedRow","updateSelection"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["scheduleStatus",""],["provisionedNotAvailableTooltipTpl",""],["totalProvisionedNotAvailableTooltipTpl",""],["parentTpl",""],["mirroringTpl",""],["scheduleTpl",""],["flattenTpl",""],["deleteTpl",""],["removingStatTpl",""],[3,"innerHtml"],["placement","top",3,"ngbTooltip",4,"ngIf","ngIfElse"],["provisioned",""],["placement","top",3,"ngbTooltip"],s,t,["totalProvisioned",""],o,i,[4,"ngIf"],["class","badge badge-info",4,"ngIf","ngIfElse"],["class","badge badge-info",4,"ngIf"],["probb",""],[1,"badge","badge-info"],_,r,["class","alert alert-warning","role","alert",4,"ngIf"],["role","alert",1,"alert","alert-warning"],l,d,[4,"ngFor","ngForOf"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],["title",u,3,"class",4,"ngIf"],["title",u]]},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(_){return o.setExpandedRow(_)})("updateSelection",function(_){return o.updateSelection(_)}),e._UZ(3,"cd-table-actions",2)(4,"cd-rbd-details",3),e.qZA(),e.YNc(5,_a,1,1,"ng-template",null,4,e.W1O),e.YNc(7,la,3,2,"ng-template",null,5,e.W1O),e.YNc(9,pa,3,2,"ng-template",null,6,e.W1O),e.YNc(11,Ta,2,2,"ng-template",null,7,e.W1O),e.YNc(13,Ma,8,5,"ng-template",null,8,e.W1O),e.YNc(15,ha,1,1,"ng-template",null,9,e.W1O),e.YNc(17,Aa,13,3,"ng-template",null,10,e.W1O),e.YNc(19,Na,1,1,"ng-template",null,11,e.W1O),e.YNc(21,$a,5,5,"ng-template",null,12,e.W1O)),2&t&&(e.xp6(1),e.Q6J("data",o.images)("columns",o.columns)("searchableObjects",!0)("serverSide",!0)("count",o.count)("hasDetails",!0)("status",o.tableStatus)("maxLimit",25)("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:[et,W.a,Re.K,Y_,c.O5,v._L,c.sg,c.mk],pipes:[$e.$,Ge.N],styles:[".warn[_ngcontent-%COMP%]{color:#d48200}"]}),n})();function ya(n,s){1&n&&e._UZ(0,"input",19)}function xa(n,s){1&n&&(e.TgZ(0,"option",23),e.SDv(1,24),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Za(n,s){1&n&&(e.TgZ(0,"option",23),e.SDv(1,25),e.qZA()),2&n&&e.Q6J("ngValue",null)}function wa(n,s){1&n&&(e.TgZ(0,"option",23),e.SDv(1,26),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Ha(n,s){if(1&n&&(e.TgZ(0,"option",27),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.Q6J("value",t.pool_name),e.xp6(1),e.Oqu(t.pool_name)}}function ka(n,s){if(1&n&&(e.TgZ(0,"select",20),e.YNc(1,xa,2,1,"option",21),e.YNc(2,Za,2,1,"option",21),e.YNc(3,wa,2,1,"option",21),e.YNc(4,Ha,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 qa(n,s){1&n&&(e.TgZ(0,"span",28),e.SDv(1,29),e.qZA())}function Ka(n,s){1&n&&(e.TgZ(0,"span",28),e.SDv(1,30),e.qZA())}function Xa(n,s){1&n&&(e.TgZ(0,"span",28),e.SDv(1,31),e.qZA())}let Qa=(()=>{class n{constructor(t,o,i,_,r,l){this.activeModal=t,this.actionLabels=o,this.authStorageService=i,this.notificationService=_,this.poolService=r,this.rbdService=l,this.pools=null,this.editing=!1,this.poolPermission=this.authStorageService.getPermissions().pool,this.createForm()}createForm(){this.namespaceForm=new Z.d({pool:new a.NI(""),namespace:new a.NI("")},this.validator(),this.asyncValidator())}validator(){return t=>{const o=t.get("pool"),i=t.get("namespace");let _=null;o.value||(_={required:!0}),o.setErrors(_);let r=null;return i.value||(r={required:!0}),i.setErrors(r),null}}asyncValidator(){return t=>new Promise(o=>{const i=t.get("pool"),_=t.get("namespace");this.rbdService.listNamespaces(i.value).subscribe(r=>{if(r.some(l=>l.namespace===_.value)){const l={namespaceExists:!0};_.setErrors(l),o(l)}else o(null)})})}ngOnInit(){this.onSubmit=new Lt.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 R.R;i.name="rbd/namespace/create",i.metadata={pool:t,namespace:o},this.rbdService.createNamespace(t,o).toPromise().then(()=>{this.notificationService.show(ot.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(v.Kz),e.Y36(D.p4),e.Y36(oe.j),e.Y36(Le.g),e.Y36(Ve.q),e.Y36(H))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-namespace-form-modal"]],decls:23,vars:9,consts:function(){let s,t,o,i,_,r,l,d,u;return s="Create Namespace",t="Pool",o="Name",i="Loading...",_="-- No rbd pools available --",r="-- Select a pool --",l="This field is required.",d="This field is required.",u="Namespace already exists.",[[3,"modalRef"],[1,"modal-title"],s,[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-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-select"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"ngValue"],i,_,r,[3,"value"],[1,"invalid-feedback"],l,d,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)(6,"div",6)(7,"div",7)(8,"label",8),e.SDv(9,9),e.qZA(),e.TgZ(10,"div",10),e.YNc(11,ya,1,0,"input",11),e.YNc(12,ka,5,4,"select",12),e.YNc(13,qa,2,0,"span",13),e.qZA()(),e.TgZ(14,"div",7)(15,"label",14),e.SDv(16,15),e.qZA(),e.TgZ(17,"div",10),e._UZ(18,"input",16),e.YNc(19,Ka,2,0,"span",13),e.YNc(20,Xa,2,0,"span",13),e.qZA()()(),e.TgZ(21,"div",17)(22,"cd-form-button-panel",18),e.NdJ("submitActionEvent",function(){return o.submit()}),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:[C.z,a._Y,a.JL,a.sg,A.V,O.P,c.O5,$.o,a.Fj,X.b,a.JJ,a.u,a.EJ,a.YN,a.Kr,c.sg,Me.U,j.p],styles:[""]}),n})(),za=(()=>{class n{constructor(t,o,i,_,r,l){this.authStorageService=t,this.rbdService=o,this.poolService=i,this.modalService=_,this.notificationService=r,this.actionLabels=l,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,le.D)(o).subscribe(i=>{const _=[];for(let r=0;r<i.length;r++){const d=t[r].pool_name;i[r].forEach(u=>{_.push({id:`${d}/${u.namespace}`,pool:d,namespace:u.namespace,num_images:u.num_images})})}this.namespaces=_}):this.namespaces=[]})}updateSelection(t){this.selection=t}createModal(){this.modalRef=this.modalService.show(Qa),this.modalRef.componentInstance.onSubmit.subscribe(()=>{this.refresh()})}deleteModal(){const t=this.selection.first().pool,o=this.selection.first().namespace;this.modalRef=this.modalService.show(pe.M,{itemDescription:"Namespace",itemNames:[`${t}/${o}`],submitAction:()=>this.rbdService.deleteNamespace(t,o).subscribe(()=>{this.notificationService.show(ot.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(H),e.Y36(Ve.q),e.Y36(de.Z),e.Y36(Le.g),e.Y36(D.p4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-namespace-list"]],features:[e._Bn([ce.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(_){return o.updateSelection(_)}),e.TgZ(2,"div",1),e._UZ(3,"cd-table-actions",2),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:[et,W.a,Re.K],styles:[""]}),n})(),Ja=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-performance"]],decls:2,vars:2,consts:function(){let s;return s="RBD overview",[["title",s,"uid","41FrpeUiz","grafanaStyle","two",3,"grafanaPath","type"]]},template:function(t,o){1&t&&e._UZ(0,"cd-rbd-tabs")(1,"cd-grafana",0),2&t&&(e.xp6(1),e.Q6J("grafanaPath","rbd-overview?")("type","metrics"))},directives:[et,$t.F],styles:[""]}),n})();var Ya=p(91801);function Va(n,s){1&n&&e._UZ(0,"input",15)}function Ua(n,s){if(1&n&&(e.TgZ(0,"option",20),e._uU(1),e.qZA()),2&n){const t=s.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t)}}function ja(n,s){if(1&n&&(e.TgZ(0,"select",16)(1,"option",17),e.SDv(2,18),e.qZA(),e.YNc(3,Ua,2,2,"option",19),e.qZA()),2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngForOf",t.pools)}}let Wa=(()=>{class n{constructor(t,o,i,_,r,l,d){this.authStorageService=t,this.rbdService=o,this.activeModal=i,this.actionLabels=_,this.fb=r,this.poolService=l,this.taskWrapper=d,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 R.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(H),e.Y36(v.Kz),e.Y36(D.p4),e.Y36(lt.O),e.Y36(Ve.q),e.Y36(m.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-trash-purge-modal"]],decls:18,vars:6,consts:function(){let s,t,o,i,_;return s="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...",_="All",[[3,"modalRef"],[1,"modal-title"],s,[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","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"],["value",""],_,[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)(6,"div",6)(7,"p"),e.tHW(8,7),e._UZ(9,"kbd")(10,"kbd"),e.N_p(),e.qZA(),e.TgZ(11,"div",8)(12,"label",9),e.SDv(13,10),e.qZA(),e.YNc(14,Va,1,0,"input",11),e.YNc(15,ja,4,1,"select",12),e.qZA()(),e.TgZ(16,"div",13)(17,"cd-form-button-panel",14),e.NdJ("submitActionEvent",function(){return o.purge()}),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:[C.z,a._Y,a.JL,a.sg,A.V,O.P,c.O5,$.o,a.Fj,X.b,a.JJ,a.u,a.EJ,a.YN,a.Kr,c.sg,j.p],styles:[""]}),n})();function er(n,s){1&n&&(e.TgZ(0,"span",15),e.SDv(1,16),e.qZA())}let tr=(()=>{class n{constructor(t,o,i,_,r){this.rbdService=t,this.activeModal=o,this.actionLabels=i,this.fb=_,this.taskWrapper=r}ngOnInit(){this.imageSpec=new L.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 L.N(this.poolName,this.namespace,this.imageId);this.taskWrapper.wrapTaskAroundCall({task:new R.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(H),e.Y36(v.Kz),e.Y36(D.p4),e.Y36(lt.O),e.Y36(m.P))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd-rbd-trash-restore-modal"]],decls:18,vars:7,consts:function(){let s,t,o,i;return s="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"],s,[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)(6,"div",6)(7,"p"),e.tHW(8,7),e._UZ(9,"kbd")(10,"kbd"),e.N_p(),e.qZA(),e.TgZ(11,"div",8)(12,"label",9),e.SDv(13,10),e.qZA(),e._UZ(14,"input",11),e.YNc(15,er,2,0,"span",12),e.qZA()(),e.TgZ(16,"div",13)(17,"cd-form-button-panel",14),e.NdJ("submitActionEvent",function(){return o.restore()}),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:[C.z,a._Y,a.JL,a.sg,A.V,O.P,$.o,a.Fj,X.b,a.JJ,a.u,Me.U,c.O5,j.p],styles:[""]}),n})();const or=["expiresTpl"],nr=["deleteTpl"],ir=function(n){return[n]};function sr(n,s){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,ir,t.icons.destroy))}}function _r(n,s){1&n&&(e.ynx(0),e.SDv(1,10),e.BQk())}function ar(n,s){1&n&&(e.ynx(0),e.SDv(1,11),e.BQk())}function rr(n,s){if(1&n&&(e.YNc(0,_r,2,0,"ng-container",9),e.YNc(1,ar,2,0,"ng-container",9),e._uU(2),e.ALo(3,"cdDate")),2&n){const t=s.row,o=s.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 lr(n,s){if(1&n&&(e.TgZ(0,"p",13)(1,"strong"),e.ynx(2),e.SDv(3,14),e.ALo(4,"cdDate"),e.BQk(),e.qZA()()),2&n){const t=e.oxw().expiresAt;e.xp6(4),e.pQV(e.lcZ(4,1,t)),e.QtT(3)}}function cr(n,s){1&n&&e.YNc(0,lr,5,3,"p",12),2&n&&e.Q6J("ngIf",!s.isExpired)}let dr=(()=>{class n{constructor(t,o,i,_,r,l,d){this.authStorageService=t,this.rbdService=o,this.modalService=i,this.cdDatePipe=_,this.taskListService=r,this.taskWrapper=l,this.actionLabels=d,this.icons=T.P,this.executingTasks=[],this.selection=new Ee.r,this.tableStatus=new se.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,_)=>new L.N(i.pool_name,i.namespace,i.id).toString()===_.metadata.image_id_spec,void 0)}prepareResponse(t){let o=[];const i={};let _;if(t.forEach(r=>{S().isUndefined(i[r.status])&&(i[r.status]=[]),i[r.status].push(r.pool_name),o=o.concat(r.value),this.disablePurgeBtn=!o.length}),i[3]?_=3:i[1]?_=1:i[2]&&(_=2),_){const r=(i[_].length>1?"pools ":"pool ")+i[_].join();this.tableStatus=new se.E(_,r)}else this.tableStatus=new se.E;return o.forEach(r=>{r.cdIsExpired=Oe()().isAfter(r.deferment_end_time)}),o}onFetchError(){this.table.reset(),this.tableStatus=new se.E(Ya.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(tr,t)}deleteModal(){const t=this.selection.first().pool_name,o=this.selection.first().namespace,i=this.selection.first().id,_=this.selection.first().deferment_end_time,r=Oe()().isAfter(_),l=new L.N(t,o,i);this.modalRef=this.modalService.show(pe.M,{itemDescription:"RBD",itemNames:[l],bodyTemplate:this.deleteTpl,bodyContext:{expiresAt:_,isExpired:r},submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new R.R("rbd/trash/remove",{image_id_spec:l.toString()}),call:this.rbdService.removeTrash(l,!0)})})}purgeModal(){this.modalService.show(Wa)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(H),e.Y36(de.Z),e.Y36(Ge.N),e.Y36(ce.j),e.Y36(m.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(W.a,7),e.Gf(or,7),e.Gf(nr,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([ce.j])],decls:9,vars:8,consts:function(){let s,t,o,i;return s="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"],s,[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(_){return o.updateSelection(_)}),e.TgZ(2,"div",1),e._UZ(3,"cd-table-actions",2),e.YNc(4,sr,4,4,"button",3),e.qZA()(),e.YNc(5,rr,4,5,"ng-template",null,4,e.W1O),e.YNc(7,cr,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:[et,W.a,Re.K,c.O5,$.o,c.mk],pipes:[Ge.N],styles:[""]}),n})(),Bt=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[c.ez,ii,a.u5,a.UX,v.Oz,v.dT,v.HK,be.b,Ae.m,g.Bz,ne.xc]]}),n})();const pr=[{path:"",redirectTo:"rbd",pathMatch:"full"},{path:"rbd",canActivate:[U.T,re.P],data:{moduleStatusGuardConfig:{uiApiPath:"block/rbd",redirectTo:"error",header:"No RBD pools available",button_name:"Create RBD pool",button_route:"/pool/create"},breadcrumbs:"Images"},children:[{path:"",component:Ga},{path:"namespaces",component:za,data:{breadcrumbs:"Namespaces"}},{path:"trash",component:dr,data:{breadcrumbs:"Trash"}},{path:"performance",component:Ja,data:{breadcrumbs:"Overall Performance"}},{path:D.MQ.CREATE,component:Be,data:{breadcrumbs:D.Qn.CREATE}},{path:`${D.MQ.EDIT}/:image_spec`,component:Be,data:{breadcrumbs:D.Qn.EDIT}},{path:`${D.MQ.CLONE}/:image_spec/:snap`,component:Be,data:{breadcrumbs:D.Qn.CLONE}},{path:`${D.MQ.COPY}/:image_spec`,component:Be,data:{breadcrumbs:D.Qn.COPY}},{path:`${D.MQ.COPY}/:image_spec/:snap`,component:Be,data:{breadcrumbs:D.Qn.COPY}}]},{path:"mirroring",component:ts,canActivate:[U.T,re.P],data:{moduleStatusGuardConfig:{uiApiPath:"block/mirroring",redirectTo:"error",header:"RBD mirroring is not configured",button_name:"Configure RBD Mirroring",button_title:"This will create rbd-mirror service and a replicated RBD pool",component:"RBD Mirroring",uiConfig:!0},breadcrumbs:"Mirroring"},children:[{path:`${D.MQ.EDIT}/:pool_name`,component:ss,outlet:"modal"}]},{path:"iscsi",canActivate:[U.T],data:{breadcrumbs:"iSCSI"},children:[{path:"",redirectTo:"overview",pathMatch:"full"},{path:"overview",component:ni,data:{breadcrumbs:"Overview"}},{path:"targets",data:{breadcrumbs:"Targets"},children:[{path:"",component:kn},{path:D.MQ.CREATE,component:gt,data:{breadcrumbs:D.Qn.CREATE}},{path:`${D.MQ.EDIT}/:target_iqn`,component:gt,data:{breadcrumbs:D.Qn.EDIT}}]}]}];let ur=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[Bt,g.Bz.forChild(pr)]]}),n})()},60950:(dt,he,p)=>{p.d(he,{d:()=>z});var c=p(89724),a=p(1659),g=p(23815),ne=p.n(g),v=p(7357),be=p(65862),D=p(95463),U=p(30633),re=p(28211),Ae=p(34089),Ne=p(41582),S=p(11048),le=p(56310),F=p(18372),ie=p(87925),Y=p(94276);let e=(()=>{class h{constructor(m,C){this.control=m,this.formatter=C}setValue(m){const C=this.formatter.toMilliseconds(m);this.control.control.setValue(`${C} ms`)}ngOnInit(){this.setValue(this.control.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.control.value))}onUpdate(m){this.setValue(m)}}return h.\u0275fac=function(m){return new(m||h)(c.Y36(a.a5),c.Y36(re.H))},h.\u0275dir=c.lG2({type:h,selectors:[["","cdMilliseconds",""]],hostBindings:function(m,C){1&m&&c.NdJ("blur",function(O){return C.onUpdate(O.target.value)})},inputs:{ngDataReady:"ngDataReady"}}),h})();var Q=p(20044);let Fe=(()=>{class h{constructor(m,C,A,O){this.elementRef=m,this.control=C,this.dimlessBinaryPerSecondPipe=A,this.formatter=O,this.ngModelChange=new c.vpe,this.el=this.elementRef.nativeElement}ngOnInit(){this.setValue(this.el.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.el.value))}setValue(m){/^[\d.]+$/.test(m)&&(m+=this.defaultUnit||"m");const C=this.formatter.toBytes(m,0),A=this.round(C);this.el.value=this.dimlessBinaryPerSecondPipe.transform(A),null!==C?(this.ngModelChange.emit(this.el.value),this.control.control.setValue(this.el.value)):(this.ngModelChange.emit(null),this.control.control.setValue(null))}round(m){if(null!==m&&0!==m){if(!ne().isUndefined(this.minBytes)&&m<this.minBytes)return this.minBytes;if(!ne().isUndefined(this.maxBytes)&&m>this.maxBytes)return this.maxBytes;if(!ne().isUndefined(this.roundPower)){const C=Math.round(Math.log(m)/Math.log(this.roundPower));return Math.pow(this.roundPower,C)}}return m}onBlur(m){this.setValue(m)}}return h.\u0275fac=function(m){return new(m||h)(c.Y36(c.SBq),c.Y36(a.a5),c.Y36(Q.O),c.Y36(re.H))},h.\u0275dir=c.lG2({type:h,selectors:[["","cdDimlessBinaryPerSecond",""]],hostBindings:function(m,C){1&m&&c.NdJ("blur",function(O){return C.onBlur(O.target.value)})},inputs:{ngDataReady:"ngDataReady",minBytes:"minBytes",maxBytes:"maxBytes",roundPower:"roundPower",defaultUnit:"defaultUnit"},outputs:{ngModelChange:"ngModelChange"}}),h})(),De=(()=>{class h{constructor(m,C){this.formatter=m,this.ngControl=C}setValue(m){const C=this.formatter.toIops(m);this.ngControl.control.setValue(`${C} IOPS`)}ngOnInit(){this.setValue(this.ngControl.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.ngControl.value))}onUpdate(m){this.setValue(m)}}return h.\u0275fac=function(m){return new(m||h)(c.Y36(re.H),c.Y36(a.a5))},h.\u0275dir=c.lG2({type:h,selectors:[["","cdIops",""]],hostBindings:function(m,C){1&m&&c.NdJ("blur",function(O){return C.onUpdate(O.target.value)})},inputs:{ngDataReady:"ngDataReady"}}),h})();function L(h,R){if(1&h&&(c.ynx(0),c._UZ(1,"input",17),c.BQk()),2&h){const m=c.oxw().$implicit,C=c.oxw(2);c.xp6(1),c.Q6J("id",m.name)("name",m.name)("formControlName",m.name)("ngDataReady",C.ngDataReady)}}function Pe(h,R){if(1&h&&(c.ynx(0),c._UZ(1,"input",18),c.BQk()),2&h){const m=c.oxw().$implicit,C=c.oxw(2);c.xp6(1),c.Q6J("id",m.name)("name",m.name)("formControlName",m.name)("ngDataReady",C.ngDataReady)}}function H(h,R){if(1&h&&(c.ynx(0),c._UZ(1,"input",19),c.BQk()),2&h){const m=c.oxw().$implicit,C=c.oxw(2);c.xp6(1),c.Q6J("id",m.name)("name",m.name)("formControlName",m.name)("ngDataReady",C.ngDataReady)}}function N(h,R){1&h&&(c.TgZ(0,"span",20),c.SDv(1,21),c.qZA())}const y=function(h){return{active:h}},T=function(h){return[h]};function k(h,R){if(1&h){const m=c.EpF();c.TgZ(0,"div",10)(1,"label",11),c._uU(2),c.TgZ(3,"cd-helper"),c._uU(4),c.qZA()(),c.TgZ(5,"div")(6,"div",12),c.ynx(7,13),c.YNc(8,L,2,4,"ng-container",14),c.YNc(9,Pe,2,4,"ng-container",14),c.YNc(10,H,2,4,"ng-container",14),c.BQk(),c.TgZ(11,"button",15),c.NdJ("click",function(){const O=c.CHM(m).$implicit;return c.oxw(2).reset(O.name)}),c._UZ(12,"i",7),c.qZA()(),c.YNc(13,N,2,0,"span",16),c.qZA()()}if(2&h){const m=R.$implicit,C=c.oxw().$implicit,A=c.oxw(),O=c.MAs(1);c.xp6(1),c.Q6J("for",m.name),c.xp6(1),c.Oqu(m.displayName),c.xp6(2),c.Oqu(m.description),c.xp6(1),c.Gre("cd-col-form-input ",C.heading,""),c.xp6(2),c.Q6J("ngSwitch",m.type),c.xp6(1),c.Q6J("ngSwitchCase",A.configurationType.milliseconds),c.xp6(1),c.Q6J("ngSwitchCase",A.configurationType.bps),c.xp6(1),c.Q6J("ngSwitchCase",A.configurationType.iops),c.xp6(1),c.Q6J("ngClass",c.VKq(13,y,A.isDisabled(m.name))),c.xp6(1),c.Q6J("ngClass",c.VKq(15,T,A.icons.erase)),c.xp6(1),c.Q6J("ngIf",A.form.showError("configuration."+m.name,O,"min"))}}function Z(h,R){if(1&h){const m=c.EpF();c.TgZ(0,"div",4)(1,"h4",5)(2,"span",6),c.NdJ("click",function(){const O=c.CHM(m).$implicit;return c.oxw().toggleSectionVisibility(O.class)}),c._uU(3),c._UZ(4,"i",7),c.qZA()(),c.TgZ(5,"div",8),c.YNc(6,k,14,17,"div",9),c.qZA()()}if(2&h){const m=R.$implicit,C=c.oxw();c.xp6(3),c.hij(" ",m.heading," "),c.xp6(1),c.Q6J("ngClass",C.sectionVisibility[m.class]?C.icons.minusCircle:C.icons.addCircle),c.xp6(1),c.Tol(m.class),c.Q6J("hidden",!C.sectionVisibility[m.class]),c.xp6(1),c.Q6J("ngForOf",m.options)}}let z=(()=>{class h{constructor(m,C){this.formatterService=m,this.rbdConfigurationService=C,this.initializeData=new v.t(1),this.changes=new c.vpe,this.icons=be.P,this.ngDataReady=new c.vpe,this.configurationType=U.r,this.sectionVisibility={}}ngOnInit(){const m=this.createConfigurationFormGroup();this.form.addControl("configuration",m),m.valueChanges.subscribe(()=>{this.changes.emit(this.getDirtyValues.bind(this))}),this.initializeData&&this.initializeData.subscribe(C=>{this.initialData=C.initialData;const A=C.sourceType;this.rbdConfigurationService.getWritableOptionFields().forEach(O=>{const $=C.initialData.filter(X=>X.name===O.name).pop();$&&$.source===A&&this.form.get(`configuration.${O.name}`).setValue($.value)}),this.ngDataReady.emit()}),this.rbdConfigurationService.getWritableSections().forEach(C=>this.sectionVisibility[C.class]=!1)}getDirtyValues(m=!1,C){if(m&&!C)throw new Error("ProgrammingError: If local values shall be included, a proper localFieldType argument has to be provided, too");const A={};return this.rbdConfigurationService.getWritableOptionFields().forEach(O=>{const $=this.form.get("configuration").get(O.name);this.initialData&&this.initialData[O.name]===$.value||($.dirty||m&&$.source===C)&&(A[O.name]=null===$.value?$.value:O.type===U.r.bps?this.formatterService.toBytes($.value):O.type===U.r.milliseconds?this.formatterService.toMilliseconds($.value):O.type===U.r.iops?this.formatterService.toIops($.value):$.value)}),A}createConfigurationFormGroup(){const m=new D.d({});return this.rbdConfigurationService.getWritableOptionFields().forEach(C=>{let A;if(C.type!==U.r.milliseconds&&C.type!==U.r.iops&&C.type!==U.r.bps)throw new Error(`Type ${C.type} is unknown, you may need to add it to RbdConfiguration class`);{let O=0;ne().forEach(this.initialData,$=>{$.name===C.name&&(O=$.value)}),A=new a.NI(O,a.kI.min(0))}m.addControl(C.name,A)}),m}reset(m){const C=this.form.get("configuration").get(m);C.disabled?(C.setValue(C.previousValue||0),C.enable(),C.previousValue||C.markAsPristine()):(C.previousValue=C.value,C.setValue(null),C.markAsDirty(),C.disable())}isDisabled(m){return this.form.get("configuration").get(m).disabled}toggleSectionVisibility(m){this.sectionVisibility[m]=!this.sectionVisibility[m]}}return h.\u0275fac=function(m){return new(m||h)(c.Y36(re.H),c.Y36(Ae.n))},h.\u0275cmp=c.Xpm({type:h,selectors:[["cd-rbd-configuration-form"]],inputs:{form:"form",initializeData:"initializeData"},outputs:{changes:"changes"},decls:5,vars:2,consts:function(){let R,m,C;return R="RBD Configuration",m="Remove the local configuration value. The parent configuration value will be inherited and used instead.",C="The minimum value is 0",[[3,"formGroup"],["cfgFormGroup",""],R,["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"],["type","button","data-toggle","button","title",m,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"],C]},template:function(m,C){1&m&&(c.TgZ(0,"fieldset",0,1)(2,"legend"),c.SDv(3,2),c.qZA(),c.YNc(4,Z,7,7,"div",3),c.qZA()),2&m&&(c.Q6J("formGroup",C.form.get("configuration")),c.xp6(4),c.Q6J("ngForOf",C.rbdConfigurationService.sections))},directives:[a.JL,a.sg,Ne.V,S.sg,S.mk,le.P,F.S,S.RF,S.n9,ie.o,a.Fj,Y.b,e,a.JJ,a.u,Fe,De,S.O5],styles:[".collapsible[_ngcontent-%COMP%]{cursor:pointer;user-select:none}"]}),h})()},42176:(dt,he,p)=>{p.d(he,{P:()=>H});var c=p(83697),a=p(30633),g=p(89724);let ne=(()=>{class N{transform(T){return{0:"global",1:"pool",2:"image"}[T]}}return N.\u0275fac=function(T){return new(T||N)},N.\u0275pipe=g.Yjl({name:"rbdConfigurationSource",type:N,pure:!0}),N})();var v=p(28211),be=p(34089),D=p(11048),U=p(20044),re=p(48537),Ae=p(21766);const Ne=["configurationSourceTpl"],S=["configurationValueTpl"],le=["poolConfTable"];function F(N,y){1&N&&(g.TgZ(0,"span"),g.SDv(1,6),g.qZA())}function ie(N,y){1&N&&(g.TgZ(0,"strong"),g.SDv(1,7),g.qZA())}function Y(N,y){1&N&&(g.TgZ(0,"strong"),g.SDv(1,8),g.qZA())}function e(N,y){1&N&&(g.TgZ(0,"div",4),g.YNc(1,F,2,0,"span",5),g.YNc(2,ie,2,0,"strong",5),g.YNc(3,Y,2,0,"strong",5),g.qZA()),2&N&&(g.Q6J("ngSwitch",y.value),g.xp6(1),g.Q6J("ngSwitchCase","global"),g.xp6(1),g.Q6J("ngSwitchCase","image"),g.xp6(1),g.Q6J("ngSwitchCase","pool"))}function Q(N,y){if(1&N&&(g.TgZ(0,"span"),g._uU(1),g.ALo(2,"dimlessBinaryPerSecond"),g.qZA()),2&N){const T=g.oxw().value;g.xp6(1),g.Oqu(g.lcZ(2,1,T))}}function Fe(N,y){if(1&N&&(g.TgZ(0,"span"),g._uU(1),g.ALo(2,"milliseconds"),g.qZA()),2&N){const T=g.oxw().value;g.xp6(1),g.Oqu(g.lcZ(2,1,T))}}function De(N,y){if(1&N&&(g.TgZ(0,"span"),g._uU(1),g.ALo(2,"iops"),g.qZA()),2&N){const T=g.oxw().value;g.xp6(1),g.Oqu(g.lcZ(2,1,T))}}function L(N,y){if(1&N&&(g.TgZ(0,"span"),g._uU(1),g.qZA()),2&N){const T=g.oxw().value;g.xp6(1),g.Oqu(T)}}function Pe(N,y){if(1&N&&(g.TgZ(0,"div",4),g.YNc(1,Q,3,3,"span",5),g.YNc(2,Fe,3,3,"span",5),g.YNc(3,De,3,3,"span",5),g.YNc(4,L,2,1,"span",9),g.qZA()),2&N){const T=y.row,k=g.oxw();g.Q6J("ngSwitch",T.type),g.xp6(1),g.Q6J("ngSwitchCase",k.typeField.bps),g.xp6(1),g.Q6J("ngSwitchCase",k.typeField.milliseconds),g.xp6(1),g.Q6J("ngSwitchCase",k.typeField.iops)}}let H=(()=>{class N{constructor(T,k){this.formatterService=T,this.rbdConfigurationService=k,this.sourceField=a.h,this.typeField=a.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(T=>this.rbdConfigurationService.getOptionFields().map(k=>k.name).includes(T.name)))}}return N.\u0275fac=function(T){return new(T||N)(g.Y36(v.H),g.Y36(be.n))},N.\u0275cmp=g.Xpm({type:N,selectors:[["cd-rbd-configuration-table"]],viewQuery:function(T,k){if(1&T&&(g.Gf(Ne,7),g.Gf(S,7),g.Gf(le,7)),2&T){let Z;g.iGM(Z=g.CRH())&&(k.configurationSourceTpl=Z.first),g.iGM(Z=g.CRH())&&(k.configurationValueTpl=Z.first),g.iGM(Z=g.CRH())&&(k.poolConfTable=Z.first)}},inputs:{data:"data"},features:[g.TTD],decls:6,vars:2,consts:function(){let y,T,k;return y="Global",T="Image",k="Pool",[["identifier","name",3,"data","columns"],["poolConfTable",""],["configurationSourceTpl",""],["configurationValueTpl",""],[3,"ngSwitch"],[4,"ngSwitchCase"],y,T,k,[4,"ngSwitchDefault"]]},template:function(T,k){1&T&&(g._UZ(0,"cd-table",0,1),g.YNc(2,e,4,4,"ng-template",null,2,g.W1O),g.YNc(4,Pe,5,4,"ng-template",null,3,g.W1O)),2&T&&g.Q6J("data",k.data)("columns",k.poolConfigurationColumns)},directives:[c.a,D.RF,D.n9,D.ED],pipes:[U.O,re.J,Ae.A],styles:[""]}),N})()}}]);
\ No newline at end of file