1 "use strict";(self
.webpackChunkceph_dashboard
=self
.webpackChunkceph_dashboard
||[]).push([[43],{21043:(ut
,he
,p
)=>{p
.r(he
),p
.d(he
,{BlockModule
:()=>Gt
,RoutedBlockModule
:()=>Cr
});var c
=p(11048),a
=p(1659),g
=p(55860),ne
=p(62946),L
=p(71334),be
=p(37496),D
=p(79512),U
=p(4222),re
=p(54462),Ae
=p(44466),Ne
=p(23815),C
=p
.n(Ne
),le
=p(35758),F
=p(64762),ie
=p(19725),Y
=p(93523),e
=p(89724);let X
=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")}};X
.\u0275fac=function(s
){return new(s
||X
)(e
.LFG(ie
.eN
))},X
.\u0275prov=e
.Yz7({token
:X
,factory
:X
.\u0275fac,providedIn
:"root"}),X
=(0,F
.gn
)([Y
.o
,(0,F
.w6
)("design:paramtypes",[ie
.eN
])],X
);var Fe
=p(88002),De
=p(76189),v
=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!==C().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
,o
){const i
={snapshot_name
:t
,mirrorImageSnapshot
:o
};return this.http
.post(`api/block/image/${s.toStringEncoded()}/snap`,i
,{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",[v
.N
,String
,Boolean
]),(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",[v
.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",[v
.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",[v
.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),x
=p(14745),T
=p(65862),k
=p(93614),Z
=p(95463),z
=p(90070),A
=p(48168),M
=p(76111),m
=p(32337),f
=p(60312),P
=p(41582),h
=p(56310),$=p(87925),K
=p(94276);function no(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 io(n
,s
){if(1&n
&&(e
.TgZ(0,"select",5),e
._UZ(1,"option",6),e
.YNc(2,no
,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 so(n
,s
){if(1&n
&&e
._UZ(0,"input",10),2&n
){const t
=e
.oxw(2);e
.Q6J("formControlName",t
.setting
)}}function _o(n
,s
){if(1&n
&&e
._UZ(0,"input",11),2&n
){const t
=e
.oxw(2);e
.Q6J("formControlName",t
.setting
)}}function ao(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 ro(n
,s
){if(1&n
&&(e
.TgZ(0,"span"),e
.YNc(1,so
,1,1,"input",8),e
.YNc(2,_o
,1,1,"input",9),e
.YNc(3,ao
,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 lo(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 co(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 mt
=(()=>{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,io
,3,5,"select",2),e
.YNc(4,ro
,4,3,"span",3),e
.YNc(5,lo
,3,1,"span",4),e
.YNc(6,co
,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
:[h
.P
,a
.JL
,a
.sg
,P
.V
,c
.O5
,$.o
,a
.EJ
,K
.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 po(n
,s
){1&n
&&(e
.TgZ(0,"span",29),e
.SDv(1,30),e
.qZA())}function uo(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,po
,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 mo(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 go(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 To(n
,s
){if(1&n
&&(e
.ynx(0),e
.YNc(1,go
,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 fo(n
,s
){if(1&n
&&(e
.ynx(0),e
.YNc(1,To
,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 Co
=(()=>{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
)};C().forEach(this.backstores
,o
=>{const i
=this.imagesSettings
[this.image
][o
]||{};C().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
,_
={};C().forIn(this.settingsForm
.controls
,(r
,l
)=>{""!==r
.value
&&null!==r
.value
&&l
in this.disk_default_controls
[this.settingsForm
.value
.backstore
]&&(_
[l
]=r
.value
,C().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(L
.Kz
),e
.Y36(X
),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,uo
,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,mo
,3,4,"option",17),e
.qZA()()(),e
.YNc(22,fo
,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
:[f
.z
,a
._Y
,a
.JL
,a
.sg
,P
.V
,c
.O5
,h
.P
,$.o
,a
.wV
,a
.Fj
,K
.b
,a
.JJ
,a
.u
,a
.EJ
,c
.sg
,a
.YN
,a
.Kr
,mt
,j
.p
],pipes
:[Je
.V
,c
.Nd
],styles
:[""]}),n
})();function So(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 Ro
=(()=>{class n
{constructor(t
,o
,i
){this.activeModal
=t
,this.iscsiService
=o
,this.actionLabels
=i
}ngOnInit(){const t
={};C().forIn(this.target_default_controls
,(o
,i
)=>{t
[i
]=new a
.NI(this.target_controls
.value
[i
])}),this.settingsForm
=new Z
.d(t
)}save(){const t
={};C().forIn(this.settingsForm
.controls
,(o
,i
)=>{""===o
.value
||null===o
.value
||(t
[i
]=o
.value
)}),this.target_controls
.setValue(t
),this.activeModal
.close()}getTargetControlLimits(t
){return this.target_controls_limits
?this.target_controls_limits
[t
]:["Yes","No"].includes(this.target_default_controls
[t
])?{type
:"bool"}:{type
:"int"}}}return n
.\u0275fac=function(t
){return new(t
||n
)(e
.Y36(L
.Kz
),e
.Y36(X
),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,So
,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
:[f
.z
,a
._Y
,a
.JL
,a
.sg
,P
.V
,c
.sg
,h
.P
,mt
,j
.p
],pipes
:[c
.Nd
],styles
:[""]}),n
})();var de
=p(63285),gt
=p(63622);let Eo
=(()=>{class n
{constructor(t
){this.ngControl
=t
}onInput(t
){this.setValue(t
)}setValue(t
){t
=C().isString(t
)?t
.trim():t
,this.ngControl
.control
.setValue(t
)}}return n
.\u0275fac=function(t
){return new(t
||n
)(e
.Y36(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 Mo
=p(39092),Tt
=p(4416),Ye
=p(58039),tt
=p(10545);function Oo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,41),e
.qZA())}function ho(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,42),e
.qZA())}function Ao(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 Po(n
,s
){1&n
&&(e
.TgZ(0,"span",47),e
.SDv(1,48),e
.qZA())}const V=function(n
){return[n
]};function Io(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 bo(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 No(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 Fo(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 Do(n
,s
){1&n
&&(e
.ynx(0),e
.SDv(1,57),e
.BQk())}function Lo(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,No
,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,Fo
,3,3,"ng-container",54),e
.YNc(10,Do
,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 $o(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,59),e
.qZA())}function Bo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,77),e
.qZA())}function Go(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,78),e
.qZA())}function yo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,79),e
.qZA())}function xo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,80),e
.qZA())}function Zo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,81),e
.qZA())}function wo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,82),e
.qZA())}function Ho(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,83),e
.qZA())}function ko(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,84),e
.qZA())}function qo(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,Bo
,2,0,"span",16),e
.YNc(8,Go
,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,yo
,2,0,"span",16),e
.YNc(19,xo
,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,Zo
,2,0,"span",16),e
.YNc(27,wo
,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,Ho
,2,0,"span",16),e
.YNc(38,ko
,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 Ko(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,114),e
.qZA())}function Xo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,115),e
.qZA())}function Qo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,116),e
.qZA())}function zo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,117),e
.qZA())}function Jo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,118),e
.qZA())}function Yo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,119),e
.qZA())}function Vo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,120),e
.qZA())}function Uo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,121),e
.qZA())}function jo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,122),e
.qZA())}function Wo(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,123),e
.qZA())}function en(n
,s
){1&n
&&(e
.TgZ(0,"span",40),e
.SDv(1,124),e
.qZA())}function tn(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 on(n
,s
){1&n
&&(e
.TgZ(0,"span"),e
.SDv(1,125),e
.qZA())}function nn(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 sn(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,Ko
,2,0,"span",16),e
.YNc(13,Xo
,2,0,"span",16),e
.YNc(14,Qo
,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,zo
,2,0,"span",16),e
.YNc(22,Jo
,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,Yo
,2,0,"span",16),e
.YNc(32,Vo
,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,Uo
,2,0,"span",16),e
.YNc(40,jo
,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,Wo
,2,0,"span",16),e
.YNc(50,en
,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,tn
,5,4,"ng-container",20),e
.YNc(56,on
,2,0,"span",54),e
.YNc(57,nn
,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 _n(n
,s
){1&n
&&(e
.TgZ(0,"span",47),e
.SDv(1,128),e
.qZA())}function an(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,sn
,58,24,"div",88),e
.TgZ(5,"div",21)(6,"div",22),e
.YNc(7,_n
,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 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).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 ln(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 cn(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,rn
,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,ln
,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 dn(n
,s
){1&n
&&(e
.TgZ(0,"span",47),e
.SDv(1,141),e
.qZA())}function pn(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,cn
,38,16,"div",88),e
.TgZ(5,"div",21)(6,"div",22),e
.YNc(7,dn
,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 un(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,Oo
,2,0,"span",16),e
.YNc(18,ho
,2,0,"span",16),e
.YNc(19,Ao
,9,0,"span",16),e
.YNc(20,Po
,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,Io
,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,bo
,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,Lo
,11,10,"ng-container",20),e
._UZ(41,"input",29),e
.YNc(42,vo
,2,0,"span",16),e
.YNc(43,$o
,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,qo
,39,8,"div",36),e
.YNc(59,an
,13,5,"div",37),e
.YNc(60,pn
,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 ft
=(()=>{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 A
.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 _
=C()(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
=C()(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 x
.$(!1,`${l.pool_name}/${l.name}`,""));const r
=[];i
[2].forEach(l
=>{l
.ip_addresses
.forEach(d
=>{r
.push(new x
.$(!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
=>C().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
!==C().uniq(o
).length
}),z
.h
.custom("dupWwn",t
=>{const o
=this.getWwns(t
);return o
.length
!==C().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
=[];C().forEach(t
.portals
,_
=>{o
.push(`${_.host}:${_.ip}`)}),this.targetForm
.patchValue({portals
:o
});const i
=[];C().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
}),C().forEach(t
.clients
,_
=>{const r
=this.addInitiator();_
.luns
=C().map(_
.luns
,l
=>`${l.pool}/${l.image}`),r
.patchValue(_
)}),t
.groups
.forEach((_
,r
)=>{const l
=this.addGroup();_
.disks
=C().map(_
.disks
,d
=>`${d.pool}/${d.image}`),l
.patchValue(_
),C().forEach(_
.members
,d
=>{this.onGroupMemberSelection({option
:new x
.$(!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
)}),C().forEach(this.imagesInitiatorSelections
,(o
,i
)=>{this.imagesInitiatorSelections
[i
]=o
.filter(_
=>_
.name
!==t
)}),C().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 C().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 C().map(t
,i
=>this.imagesSettings
[i
].wwn
).filter(i
=>C().isString(i
)&&""!==i
)}onImageSelection(t
){const o
=t
.option
;if(o
.selected
){if(this.imagesSettings
[o
.name
])this.isLunIdInUse(this.imagesSettings
[o
.name
].lun
,o
.name
)&&(this.imagesSettings
[o
.name
].lun
=this.nextLunId(o
.name
));else{const i
=this.getDefaultBackstore(o
.name
);this.imagesSettings
[o
.name
]={backstore
:i
,lun
:this.nextLunId(o
.name
)},this.imagesSettings
[o
.name
][i
]={}}C().forEach(this.imagesInitiatorSelections
,(i
,_
)=>{i
.push(new x
.$(!1,o
.name
,"")),this.imagesInitiatorSelections
[_
]=[...i
]}),C().forEach(this.groupDiskSelections
,(i
,_
)=>{i
.push(new x
.$(!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
),C().forEach(this.groupMembersSelections
,(i
,_
)=>{i
.push(new x
.$(!1,"","")),this.groupMembersSelections
[_
]=[...i
]});const o
=C().map(this.targetForm
.getValue("disks"),i
=>new x
.$(!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
),C().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})}),C().forEach(this.groupMembersSelections
,(t
,o
)=>{C().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
=C().map(this.targetForm
.getValue("disks"),_
=>new x
.$(!1,_
,""));this.groupDiskSelections
.push(o
);const i
=C().map(this.initiators
.value
,_
=>new x
.$(!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
),C().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 x
.$(!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
=C().cloneDeep(this.targetForm
.value
),o
={target_iqn
:this.targetForm
.getValue("target_iqn"),target_controls
:this.targetForm
.getValue("target_controls"),acl_enabled
:this.targetForm
.getValue("acl_enabled"),portals
:[],disks
:[],clients
:[],groups
:[]};if(this.cephIscsiConfigVersion
>10){const _
=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 M
.R("iscsi/target/edit",{target_iqn
:o
.target_iqn
}),call
:this.iscsiService
.updateTarget(this.target_iqn
,o
)})):i
=this.taskWrapper
.wrapTaskAroundCall({task
:new M
.R("iscsi/target/create",{target_iqn
:o
.target_iqn
}),call
:this.iscsiService
.createTarget(o
)}),i
.subscribe({error
:()=>{this.targetForm
.setErrors({cdSubmitButton
:!0})},complete
:()=>this.router
.navigate(["/block/iscsi/targets"])})}targetSettingsModal(){const t
={target_controls
:this.targetForm
.get("target_controls"),target_default_controls
:this.target_default_controls
,target_controls_limits
:this.target_controls_limits
};this.modalRef
=this.modalService
.show(Ro
,t
)}imageSettingsModal(t
){const o
={imagesSettings
:this.imagesSettings
,image
:t
,api_version
:this.api_version
,disk_default_controls
:this.disk_default_controls
,disk_controls_limits
:this.disk_controls_limits
,backstores
:this.getValidBackstores(this.getImageById(t
)),control
:this.targetForm
.get("disks")};this.modalRef
=this.modalService
.show(Co
,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(X
),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
,S
,E
,I
,B
,y
,Q
,J
,ee
,te
,w
,_e
,ae
,O
,ue
,me
,ge
,Te
,fe
,Ce
,Se
,G
,ye
,xe
,Ze
,we
,He
,ke
,qe
,Ke
,Xe
,Qe
,ze
,b
,yt
,xt
,Zt
,wt
,Ht
,kt
,qt
,Kt
,Xt
,Qt
,zt
,Jt
,Yt
,Vt
,Ut
,jt
,Wt
,eo
,to
,oo
;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.",S
="An IQN has the following notation 'iqn.$year-$month.$reversedAddress:$definedName'",E
="For example: iqn.2016-06.org.dashboard:storage:disk.sn-a8675309",I
="More information",B
="This target has modified advanced settings.",y
="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",O
="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.",yt
="This field is required.",xt
="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",Zt
="This field is required.",wt
="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",Ht
="This field is required.",kt
="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",qt
="This field is required.",Kt
="Passwords must have a length of 12 to 16 characters and can contain alphanumeric characters, '@', '-', '_' or '/'.",Xt
="Initiator belongs to a group. Images will be configure in the group.",Qt
="Add image",zt
="No items added.",Jt
="Groups",Yt
="Add group",Vt
="Group",Ut
="Name",jt
="Initiators",Wt
="Add initiator",eo
="Images",to
="Add image",oo
="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
,S
,E
,["target","_blank","href","https://en.wikipedia.org/wiki/ISCSI#Addressing"],I
,[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"],y
,["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"],O
,["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
,yt
,xt
,Zt
,wt
,Ht
,kt
,qt
,Kt
,Xt
,["elemClass","btn btn-light float-end",3,"data","options","messages"],Qt
,zt
,Jt
,["formArrayName","groups",1,"cd-col-form-input"],Yt
,Vt
,["for","group_id",1,"cd-col-form-label","required"],Ut
,["type","text","formControlName","group_id",1,"form-control"],["for","members",1,"cd-col-form-label"],jt
,Wt
,eo
,to
,oo
]},template:function(t
,o
){1&t
&&e
.YNc(0,un
,65,40,"div",0),2&t
&&e
.Q6J("cdFormLoading",o
.loading
)},directives
:[gt
.y
,a
._Y
,a
.JL
,a
.sg
,P
.V
,h
.P
,$.o
,a
.Fj
,K
.b
,a
.JJ
,a
.u
,Eo
,c
.mk
,c
.O5
,c
.sg
,Mo
.H
,a
.Wl
,a
.x0
,Tt
.C
,Ye
.s
,a
.CE
,j
.p
],pipes
:[c
.rS
,tt
.m
,Je
.V
],styles
:[".cd-mb[_ngcontent-%COMP%]{margin-bottom:10px}"]}),n
})();var Ct
=p(68136),pe
=p(30982),W
=p(83697),Le
=p(99466),Re
=p(68774),St
=p(55657),ce
=p(38047),ot
=p(18001),ve
=p(97161),oe
=p(47640);function mn(n
,s
){1&n
&&(e
.TgZ(0,"span",29),e
.SDv(1,30),e
.qZA())}function gn(n
,s
){1&n
&&(e
.TgZ(0,"span",29),e
.SDv(1,31),e
.qZA())}function Tn(n
,s
){1&n
&&(e
.TgZ(0,"span",29),e
.SDv(1,32),e
.qZA())}function fn(n
,s
){1&n
&&(e
.TgZ(0,"span",29),e
.SDv(1,33),e
.qZA())}function Cn(n
,s
){1&n
&&(e
.TgZ(0,"span",29),e
.SDv(1,34),e
.qZA())}function Sn(n
,s
){1&n
&&(e
.TgZ(0,"span",29),e
.SDv(1,35),e
.qZA())}function Rn(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 Mn
=(()=>{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(L
.Kz
),e
.Y36(D
.p4
),e
.Y36(X
),e
.Y36(ve
.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
,S
,E
,I
,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 '/'.",S
="This field is required.",E
="User names must have a length of 8 to 64 characters and can contain alphanumeric characters, '.', '@', '-', '_' or ':'.",I
="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
,S
,E
,I
,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,mn
,2,0,"span",12),e
.YNc(13,gn
,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,Tn
,2,0,"span",12),e
.YNc(23,fn
,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,Cn
,2,0,"span",12),e
.YNc(31,Sn
,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,Rn
,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
:[f
.z
,a
._Y
,a
.JL
,a
.sg
,P
.V
,h
.P
,$.o
,a
.Fj
,K
.b
,a
.JJ
,a
.u
,c
.O5
,Tt
.C
,Ye
.s
,j
.p
],styles
:[""]}),n
})();var On
=p(86969);let Rt
=(()=>{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 nt
=p(34501),hn
=p(30490),Ee
=p(94928),An
=p(68962);const Pn
=["highlightTpl"],In
=["detailTable"],bn
=["tree"],Nn=function(){return["logged_in"]},Fn=function(){return["logged_out"]},Dn=function(n
,s
){return{"badge-success":n
,"badge-danger":s
}};function Ln(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,Dn
,e
.DdM(5,Nn
).includes(t
.data
.status
),e
.DdM(6,Fn
).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 $n(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 Bn(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 Gn(n
,s
){if(1&n
&&(e
.YNc(0,$n
,2,1,"span",12),e
.YNc(1,Bn
,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 yn
=(()=>{class n
{constructor(t
,o
){this.iscsiBackstorePipe
=t
,this.booleanTextPipe
=o
,this.icons
=T
.P
,this.metadata
={},this.nodes
=[],this.treeOptions
={useVirtualScroll
:!0,actionMapping
:{mouse
:{click
:this.onNodeSelected
.bind(this)}}}}set content(t
){this.detailTable
=t
,t
&&t
.updateColumns()}ngOnInit(){this.columns
=[{prop
:"displayName",name
:"Name",flexGrow
:1,cellTemplate
:this.highlightTpl
},{prop
:"current",name
:"Current",flexGrow
:1,cellTemplate
:this.highlightTpl
},{prop
:"default",name
:"Default",flexGrow
:1,cellTemplate
:this.highlightTpl
}]}ngOnChanges(){this.selection
&&(this.selectedItem
=this.selection
,this.generateTree()),this.data
=void 0}generateTree(){const t
=C().cloneDeep(this.selectedItem
.target_controls
);this.cephIscsiConfigVersion
>10&&C().extend(t
,C().cloneDeep(this.selectedItem
.auth
)),this.metadata
={root
:t
};const o
={target
:{expanded
:C().join(this.selectedItem
.cdExecuting
?[T
.P
.large
,T
.P
.spinner
,T
.P
.spin
]:[T
.P
.large
,T
.P
.bullseye
]," ")},initiators
:{expanded
:C().join([T
.P
.large
,T
.P
.user
]," "),leaf
:C().join([T
.P
.user
]," ")},groups
:{expanded
:C().join([T
.P
.large
,T
.P
.users
]," "),leaf
:C().join([T
.P
.users
]," ")},disks
:{expanded
:C().join([T
.P
.large
,T
.P
.disk
]," "),leaf
:C().join([T
.P
.disk
]," ")},portals
:{expanded
:C().join([T
.P
.large
,T
.P
.server
]," "),leaf
:C().join([T
.P
.server
]," ")}},i
=[];C().forEach(this.selectedItem
.disks
,d
=>{const u
="disk_"+d
.pool
+"_"+d
.image
;this.metadata
[u
]={controls
:d
.controls
,backstore
:d
.backstore
},["wwn","lun"].forEach(S
=>{S
in d
&&(this.metadata
[u
][S
]=d
[S
])}),i
.push({name
:`${d.pool}/${d.image}`,cdId
:u
,cdIcon
:o
.disks
.leaf
})});const _
=[];C().forEach(this.selectedItem
.portals
,d
=>{_
.push({name
:`${d.host}:${d.ip}`,cdIcon
:o
.portals
.leaf
})});const r
=[];C().forEach(this.selectedItem
.clients
,d
=>{const u
=C().cloneDeep(d
.auth
);d
.info
&&(C().extend(u
,d
.info
),delete u
.state
,C().forEach(Object
.keys(d
.info
.state
),I
=>{u
[I
.toLowerCase()]=d
.info
.state
[I
]})),this.metadata
["client_"+d
.client_iqn
]=u
;const S
=[];d
.luns
.forEach(I
=>{S
.push({name
:`${I.pool}/${I.image}`,cdId
:"disk_"+I
.pool
+"_"+I
.image
,cdIcon
:o
.disks
.leaf
})});let E
="";d
.info
&&(E
=Object
.keys(d
.info
.state
).includes("LOGGED_IN")?"logged_in":"logged_out"),r
.push({name
:d
.client_iqn
,status
:E
,cdId
:"client_"+d
.client_iqn
,children
:S
,cdIcon
:o
.initiators
.leaf
})});const l
=[];C().forEach(this.selectedItem
.groups
,d
=>{const u
=[];d
.disks
.forEach(E
=>{u
.push({name
:`${E.pool}/${E.image}`,cdId
:"disk_"+E
.pool
+"_"+E
.image
,cdIcon
:o
.disks
.leaf
})});const S
=[];d
.members
.forEach(E
=>{S
.push({name
:E
,cdId
:"client_"+E
})}),l
.push({name
:d
.group_id
,cdIcon
:o
.groups
.leaf
,children
:[{name
:"Disks",children
:u
,cdIcon
:o
.disks
.expanded
},{name
:"Initiators",children
:S
,cdIcon
:o
.initiators
.expanded
}]})}),this.nodes
=[{name
:this.selectedItem
.target_iqn
,cdId
:"root",isExpanded
:!0,cdIcon
:o
.target
.expanded
,children
:[{name
:"Disks",isExpanded
:!0,children
:i
,cdIcon
:o
.disks
.expanded
},{name
:"Portals",isExpanded
:!0,children
:_
,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
=C().map(this.settings
.target_default_controls
,(u
,S
)=>({displayName
:S
,default:u
=this.format(u
),current
:C().isUndefined(d
[S
])?u
:this.format(d
[S
])})),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
=C().map(this.settings
.disk_default_controls
[d
.backstore
],(u
,S
)=>({displayName
:S
,default:u
=this.format(u
),current
:C().isUndefined(d
.controls
[S
])?u
:this.format(d
.controls
[S
])})),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
=C().map(d
,(u
,S
)=>({displayName
:S
,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(An
.T
))},n
.\u0275cmp=e
.Xpm({type
:n
,selectors
:[["cd-iscsi-target-details"]],viewQuery:function(t
,o
){if(1&t
&&(e
.Gf(Pn
,7),e
.Gf(In
,5),e
.Gf(bn
,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,Ln
,6,10,"ng-template",null,5,e
.W1O
),e
.qZA()(),e
.YNc(8,vn
,5,4,"div",6),e
.qZA(),e
.YNc(9,Gn
,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 xn(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 Zn(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,xn
,6,1,"ng-container",5),e
.qZA()),2&n
){const t
=e
.oxw();e
.xp6(4),e
.Q6J("ngIf",t
.status
)}}function wn(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 Hn=function(n
){return[n
]};function kn(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,wn
,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,Hn
,t
.icons
.key
)),e
.xp6(3),e
.Q6J("ngIf",t
.expandedRow
)}}let qn
=(()=>{class n
extends Ct
.o
{constructor(t
,o
,i
,_
,r
,l
,d
,u
,S
){super(S
),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
=S
,this.available
=void 0,this.selection
=new Re
.r
,this.targets
=[],this.icons
=T
.P
,this.builders
={"iscsi/target/create":E
=>({target_iqn
:E
.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
:Le
.e
.executing
},{name
:"Portals",prop
:"cdPortals",pipe
:this.joinPipe
,flexGrow
:2},{name
:"Images",prop
:"cdImages",pipe
:this.joinPipe
,flexGrow
:2},{name
:"# Sessions",prop
:"info.num_sessions",pipe
:this.notAvailablePipe
,flexGrow
:1}],this.iscsiService
.status().subscribe(t
=>{this.available
=t
.available
,t
.available
||(this.status
=t
.message
)})}getTargets(){this.available
&&(this.setTableRefreshTimeout(),this.iscsiService
.version().subscribe(t
=>{this.cephIscsiConfigVersion
=t
.ceph_iscsi_config_version
}),this.taskListService
.init(()=>this.iscsiService
.listTargets(),t
=>this.prepareResponse(t
),t
=>this.targets
=t
,()=>this.onFetchError(),this.taskFilter
,this.itemFilter
,this.builders
),this.iscsiService
.settings().subscribe(t
=>{this.settings
=t
}))}ngOnDestroy(){this.summaryDataSubscription
&&this.summaryDataSubscription
.unsubscribe()}getEditDisableDesc(){const t
=this.selection
.first();return t
&&(null==t
?void 0:t
.cdExecuting
)?t
.cdExecuting
:t
&&C().isUndefined(null==t
?void 0:t
.info
)?"Unavailable gateway(s)":!t
}getDeleteDisableDesc(){var t
;const o
=this.selection
.first();return(null==o
?void 0:o
.cdExecuting
)?o
.cdExecuting
:o
&&C().isUndefined(null==o
?void 0:o
.info
)?"Unavailable gateway(s)":o
&&(null===(t
=null==o
?void 0:o
.info
)||void 0===t
?void 0:t
.num_sessions
)?"Target has active sessions":!o
}prepareResponse(t
){return t
.forEach(o
=>{o
.cdPortals
=o
.portals
.map(i
=>`${i.host}:${i.ip}`),o
.cdImages
=o
.disks
.map(i
=>`${i.pool}/${i.image}`)}),t
}onFetchError(){this.table
.reset()}itemFilter(t
,o
){return t
.target_iqn
===o
.metadata
.target_iqn
}taskFilter(t
){return["iscsi/target/create","iscsi/target/edit","iscsi/target/delete"].includes(t
.name
)}updateSelection(t
){this.selection
=t
}deleteIscsiTargetModal(){const t
=this.selection
.first().target_iqn
;this.modalRef
=this.modalService
.show(pe
.M
,{itemDescription
:"iSCSI target",itemNames
:[t
],submitActionObservable
:()=>this.taskWrapper
.wrapTaskAroundCall({task
:new M
.R("iscsi/target/delete",{target_iqn
:t
}),call
:this.iscsiService
.deleteTarget(t
)})})}configureDiscoveryAuth(){this.modalService
.show(Mn
)}}return n
.\u0275fac=function(t
){return new(t
||n
)(e
.Y36(oe
.j
),e
.Y36(X
),e
.Y36(On
.A
),e
.Y36(ce
.j
),e
.Y36(St
.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,Zn
,5,1,"cd-alert-panel",0),e
.YNc(2,kn
,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
:[Rt
,c
.O5
,nt
.G
,hn
.K
,W
.a
,Ee
.K
,$.o
,c
.mk
,yn
],styles
:[""]}),n
})();var it
=p(66369),Kn
=p(76446),Xn
=p(90068);const Qn
=["iscsiSparklineTpl"],zn
=["iscsiPerSecondTpl"],Jn
=["iscsiRelativeDateTpl"];function Yn(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 Vn(n
,s
){1&n
&&(e
.TgZ(0,"span",10),e
._uU(1," n/a "),e
.qZA())}function Un(n
,s
){if(1&n
&&(e
.YNc(0,Yn
,2,2,"span",7),e
.YNc(1,Vn
,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 jn(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 Wn(n
,s
){1&n
&&(e
.TgZ(0,"span",10),e
._uU(1," n/a "),e
.qZA())}function ei(n
,s
){if(1&n
&&(e
.YNc(0,jn
,2,1,"span",7),e
.YNc(1,Wn
,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 ti(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 oi(n
,s
){1&n
&&(e
.TgZ(0,"span",10),e
._uU(1," n/a "),e
.qZA())}function ni(n
,s
){if(1&n
&&(e
.YNc(0,ti
,4,5,"span",7),e
.YNc(1,oi
,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 ii
=(()=>{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
:Le
.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(X
),e
.Y36(it
.n
),e
.Y36(Je
.V
))},n
.\u0275cmp=e
.Xpm({type
:n
,selectors
:[["cd-iscsi"]],viewQuery:function(t
,o
){if(1&t
&&(e
.Gf(Qn
,7),e
.Gf(zn
,7),e
.Gf(Jn
,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,Un
,2,2,"ng-template",null,4,e
.W1O
),e
.YNc(11,ei
,2,2,"ng-template",null,5,e
.W1O
),e
.YNc(13,ni
,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
:[Rt
,W
.a
,c
.O5
,Kn
.l
],pipes
:[St
.g
,Xn
.h
],styles
:[""]}),n
})(),si
=(()=>{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
,L
.Oz
,g
.Bz
,a
.u5
,a
.UX
,L
.ZQ
,L
.HK
]]}),n
})();var _i
=p(13464),ai
=p(26215),ri
=p(45435),Et
=p(36848);let q
=class{constructor(s
,t
){this.http
=s
,this.timerService
=t
,this.REFRESH_INTERVAL
=3e4
,this.summaryDataSource
=new ai
.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,ri
.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"})}};q
.\u0275fac=function(s
){return new(s
||q
)(e
.LFG(ie
.eN
),e
.LFG(Et
.f
))},q
.\u0275prov=e
.Yz7({token
:q
,factory
:q
.\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)],q
.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)],q
.prototype,"importBootstrapToken",null),q
=(0,F
.gn
)([Y
.o
,(0,F
.w6
)("design:paramtypes",[ie
.eN
,Et
.f
])],q
);var st
=p(6481),li
=p(68307),Mt
=p(12627),Me
=p(82945),ci
=p(39749),di
=p(13472);function pi(n
,s
){1&n
&&(e
.TgZ(0,"span",25),e
.SDv(1,26),e
.qZA())}function ui(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 mi(n
,s
){1&n
&&(e
.TgZ(0,"span",25),e
.SDv(1,30),e
.qZA())}let gi
=(()=>{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");C().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 C().each(t
.controls
,i
=>{!0===i
.value
&&++o
}),o
>0?null:{requirePool
:!0}}}generate(){this.createBootstrapForm
.get("token").setValue("");let t
="";const o
=[],i
=this.createBootstrapForm
.get("pools");C().each(i
.controls
,(u
,S
)=>{!0===u
.value
&&(t
=S
,u
.disabled
||o
.push(S
))});const _
={mirror_mode
:"image"},r
=(0,st
.z
)(this.rbdMirroringService
.setSiteName(this.createBootstrapForm
.getValue("siteName")),(0,le
.D
)(o
.map(u
=>this.rbdMirroringService
.updatePool(u
,_
))),this.rbdMirroringService
.createBootstrapToken(t
).pipe((0,li
.b
)(u
=>this.createBootstrapForm
.get("token").setValue(u
.token
)))).pipe((0,Mt
.Z
)()),l
=()=>{this.rbdMirroringService
.refresh(),this.createBootstrapForm
.setErrors({cdSubmitButton
:!0})};this.taskWrapper
.wrapTaskAroundCall({task
:new M
.R("rbd/mirroring/bootstrap/create",{}),call
:r
}).subscribe({error
:l
,complete
:l
})}}return n
.\u0275fac=function(t
){return new(t
||n
)(e
.Y36(L
.Kz
),e
.Y36(q
),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
,S
,E
;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",S
="This field is required.",E
="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"],S
,[1,"custom-control","custom-checkbox"],["type","checkbox",1,"custom-control-input",3,"id","name","formControlName"],[1,"custom-control-label",3,"for"],E
]},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,pi
,2,0,"span",12),e
.qZA(),e
.TgZ(16,"div",13)(17,"label",14),e
.SDv(18,15),e
.qZA(),e
.YNc(19,ui
,4,5,"div",16),e
.YNc(20,mi
,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
:[f
.z
,a
._Y
,a
.JL
,P
.V
,a
.sg
,h
.P
,$.o
,a
.Fj
,K
.b
,a
.JJ
,a
.u
,Me
.U
,c
.O5
,a
.x0
,c
.sg
,a
.Wl
,ci
.w
,Ye
.s
,di
.W
],styles
:[".form-group.ng-invalid[_ngcontent-%COMP%] .invalid-feedback[_ngcontent-%COMP%]{display:block}"]}),n
})();function Ti(n
,s
){1&n
&&(e
.TgZ(0,"span",26),e
.SDv(1,27),e
.qZA())}function fi(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 Ci(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 Si(n
,s
){1&n
&&(e
.TgZ(0,"span",26),e
.SDv(1,32),e
.qZA())}function Ri(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 Mi
=(()=>{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");C().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 C().each(t
.controls
,i
=>{!0===i
.value
&&++o
}),o
>0?null:{requirePool
:!0}}}validateToken(){return t
=>{try{if(JSON
.parse(atob(t
.value
)))return null}catch(o
){}return{invalidToken
:!0}}}import(){const t
=[],o
=[],i
=this.importBootstrapForm
.get("pools");C().each(i
.controls
,(u
,S
)=>{!0===u
.value
&&(t
.push(S
),u
.disabled
||o
.push(S
))});const _
={mirror_mode
:"image"};let r
=(0,st
.z
)(this.rbdMirroringService
.setSiteName(this.importBootstrapForm
.getValue("siteName")),(0,le
.D
)(o
.map(u
=>this.rbdMirroringService
.updatePool(u
,_
))));r
=t
.reduce((u
,S
)=>(0,st
.z
)(u
,this.rbdMirroringService
.importBootstrapToken(S
,this.importBootstrapForm
.getValue("direction"),this.importBootstrapForm
.getValue("token"))),r
).pipe((0,Mt
.Z
)());const l
=()=>{this.rbdMirroringService
.refresh(),this.importBootstrapForm
.setErrors({cdSubmitButton
:!0})};this.taskWrapper
.wrapTaskAroundCall({task
:new M
.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(L
.Kz
),e
.Y36(D
.p4
),e
.Y36(q
),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
,S
,E
,I
;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.",S
="At least one pool is required.",E
="This field is required.",I
="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"],S
,E
,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,Ti
,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,fi
,2,2,"option",16),e
.qZA()(),e
.TgZ(22,"div",17)(23,"label",18),e
.SDv(24,19),e
.qZA(),e
.YNc(25,Ci
,4,5,"div",20),e
.YNc(26,Si
,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,Ri
,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
:[f
.z
,a
._Y
,a
.JL
,P
.V
,a
.sg
,h
.P
,$.o
,a
.Fj
,K
.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),Oi
=p(58111);let _t
=(()=>{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 hi
=["healthTmpl"];function Ai(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 Pi
=(()=>{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(q
),e
.Y36(Oi
.F
))},n
.\u0275cmp=e
.Xpm({type
:n
,selectors
:[["cd-mirroring-daemons"]],viewQuery:function(t
,o
){if(1&t
&&e
.Gf(hi
,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,Ai
,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
:[_t
],styles
:[""]}),n
})();var Ot
=p(70882);class Ii
{}function bi(n
,s
){1&n
&&(e
.TgZ(0,"span",24),e
.SDv(1,25),e
.qZA())}function Ni(n
,s
){1&n
&&(e
.TgZ(0,"span",24),e
.SDv(1,26),e
.qZA())}function Fi(n
,s
){1&n
&&(e
.TgZ(0,"span",24),e
.SDv(1,27),e
.qZA())}function Di(n
,s
){1&n
&&(e
.TgZ(0,"span",24),e
.SDv(1,28),e
.qZA())}function Li(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 $i
=(()=>{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 Ii;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 M.R("rbd/mirroring/peer/edit
",{pool_name:this.poolName}),call:this.rbdMirroringService.updatePeer(this.poolName,this.peerUUID,t)}:{task:new M.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(L.Kz),e.Y36(D.p4),e.Y36(q),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,S,E,I,B,y,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",S="Comma-delimited addresses...",E="CephX Key",I="Base64-encoded key...",B="This field is required.",y="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",S,"id","monAddr","name","monAddr","formControlName","monAddr",1,"form-control"],["for","key",1,"col-form-label"],E,["type","text","placeholder",I,"id","key","name","key","formControlName","key",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],B,y,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,bi,2,0,"span",12),e.YNc(17,Ni,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,Fi,2,0,"span",12),e.YNc(23,Di,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,Li,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:[f.z,a._Y,a.JL,P.V,a.sg,h.P,$.o,a.Fj,K.b,a.JJ,a.u,Me.U,c.O5,j.p],styles:[""]}),n})();const Bi=["healthTmpl"],Gi=["localTmpl"],yi=["remoteTmpl"];function xi(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 Zi(n,s){1&n&&(e.TgZ(0,"span",7),e.SDv(1,8),e.qZA())}function wi(n,s){1&n&&(e.TgZ(0,"span",9),e.SDv(1,10),e.qZA())}let ki=(()=>{class n{constructor(t,o,i,_,r){this.authStorageService=t,this.rbdMirroringService=o,this.modalService=i,this.taskWrapper=_,this.router=r,this.selection=new Re.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()},S={permission:"delete",icon:T.P.destroy,name:"Delete Peer",click:()=>this.deletePeersModal(),visible:()=>!!this.getPeerUUID()};this.tableActions=[l,d,u,S]}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($i,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 Ot.y(i=>{this.taskWrapper.wrapTaskAroundCall({task:new M.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(q),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(Bi,7),e.Gf(Gi,7),e.Gf(yi,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,xi,3,4,"ng
-template
",null,2,e.W1O),e.YNc(4,Zi,2,0,"ng
-template
",null,3,e.W1O),e.YNc(6,wi,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,Ee.K,c.mk,L._L,g.lC],pipes:[_t],styles:[""]}),n})();var ht=p(59376);const qi=["stateTmpl
"],Ki=["syncTmpl
"],Xi=["progressTmpl
"];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_error.data)("columns
",t.image_error.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_syncing.data)("columns
",t.image_syncing.columns)("autoReload
",-1)("status
",t.tableStatus)}}function Ji(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 Yi(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 Vi(n,s){1&n&&e._UZ(0,"div
")}function Ui(n,s){if(1&n&&e._UZ(0,"ngb
-progressbar
",18),2&n){const t=e.oxw().value;e.Q6J("value
",t)("showValue
",!0)}}function ji(n,s){if(1&n&&(e.YNc(0,Vi,1,0,"div
",15),e.TgZ(1,"div
",16),e.YNc(2,Ui,1,2,"ngb
-progressbar
",17),e.qZA()),2&n){const t=s.row;e.Q6J("ngIf
","Replaying
"===t.state),e.xp6(2),e.Q6J("ngIf
","Replaying
"===t.state)}}let Wi=(()=>{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:"syncing_percent
",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(q))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd
-mirroring
-images
"]],viewQuery:function(t,o){if(1&t&&(e.Gf(qi,7),e.Gf(Ki,7),e.Gf(Xi,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
"],[1,"w
-100","h
-100","d
-flex
","justify
-content
-center
","align
-items
-center
"],["type
","info
","class","w
-100",3,"value
","showValue
",4,"ngIf
"],["type
","info
",1,"w
-100",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,Qi,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,zi,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,Ji,1,4,"ng
-template
",5),e.BQk(),e.qZA(),e._UZ(14,"div
",10),e.YNc(15,Yi,3,4,"ng
-template
",null,11,e.W1O),e.YNc(17,ji,3,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:[L.Pz,ht.m,L.nv,L.Vx,L.uN,W.a,L.tO,c.mk,c.O5,L.Ly],pipes:[_t],styles:[""]}),n})();function es(n,s){if(1&n&&e._UZ(0,"i
",19),2&n){const t=e.oxw();e.Q6J("ngClass
",t.icons.edit)}}function ts(n,s){if(1&n&&e._UZ(0,"i
",19),2&n){const t=e.oxw();e.Q6J("ngClass
",t.icons.check)}}let os=(()=>{class n{constructor(t,o,i,_){this.authStorageService=t,this.rbdMirroringService=o,this.modalService=i,this.taskWrapper=_,this.selection=new Re.r,this.peersExist=!0,this.subs=new _i.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 M.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(gi,{siteName:this.siteName})}importBootstrapModal(){this.modalRef=this.modalService.show(Mi,{siteName:this.siteName})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe.j),e.Y36(q),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,es,1,1,"i",9),e.YNc(10,ts,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,P.V,a.sg,$.o,a.Fj,K.b,a.JJ,a.u,c.O5,c.mk,Ye.s,Ee.K,Pi,ki,Wi],styles:[""]}),n})();class ns{}function is(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 ss(n,s){1&n&&(e.TgZ(0,"span",17),e.SDv(1,18),e.qZA())}let _s=(()=>{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 ns;t.mirror_mode=this.editModeForm.getValue("mirrorMode"),this.taskWrapper.wrapTaskAroundCall({task:new M.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(L.Kz),e.Y36(D.p4),e.Y36(q),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,is,2,2,"option
",12),e.qZA(),e.YNc(18,ss,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:[f.z,a._Y,a.JL,P.V,a.sg,h.P,$.o,a.EJ,a.JJ,a.u,c.sg,a.YN,a.Kr,c.O5,j.p],styles:[""]}),n})();var At=p(7357),as=p(28049),rs=p(43190),Ve=p(80842),at=p(30633),$e=p(47557),ls=p(28211);class cs{}var Ie=(()=>{return(n=Ie||(Ie={}))[n.V1=1]="V1
",n[n.V2=2]="V2
",Ie;var n})();class ds{constructor(){this.features=[]}}class ps{constructor(){this.features=[]}}class ms extends class us{}{constructor(){super(...arguments),this.features=[]}}class rt{constructor(){this.features=[],this.remove_scheduling=!1}}var Ue=(()=>{return(n=Ue||(Ue={})).editing="editing
",n.cloning="cloning
",n.copying="copying
",Ue;var n})(),Pt=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 Rs(n,s){1&n&&e._UZ(0,"input
",64)}function Es(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,Es,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 Ls(n,s){1&n&&(e.TgZ(0,"option
",50),e.SDv(1,80),e.qZA()),2&n&&e.Q6J("ngValue
",null)}function vs(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,Ls,2,1,"option
",66),e.YNc(4,vs,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 It=function(n){return["edit
",n]},bt=function(n){return{modal:n}},Nt=function(n){return{outlets:n}},Ft=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,Ft,e.VKq(5,Nt,e.VKq(3,bt,e.VKq(1,It,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,Ft,e.VKq(5,Nt,e.VKq(3,bt,e.VKq(1,It,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,Rs,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,S,E){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=S,this.rbdMirroringService=E,this.namespaces=[],this.namespacesByPoolCache={},this.pools=null,this.allPools=null,this.dataPools=null,this.allDataPools=[],this.featuresList=[],this.initializeConfigData=new At.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 At.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 C().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){var 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,C().each(this.features,o=>{this.rbdForm.get("features
").get(o.key).valueChanges.subscribe(i=>this.featureFormUpdate(o.key,i))})}gatherNeededData(){const t={};return this.mode?this.route.params.subscribe(o=>{const i=v.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),S=o.get("stripingCount
"),E=null!=S.value?S.value:this.defaultStripingCount;let I=null;null===l.value?I={required:!0}:E*u>t.toBytes(l.value)&&(I={invalidSizeObject:!0}),l.setErrors(I);const B=o.get("stripingUnit
");let y=null;null===B.value&&null!==S.value?y={required:!0}:null!==B.value&&t.toBytes(B.value)>u&&(y={invalidStripingUnit:!0}),B.setErrors(y);let Q=null;return null===S.value&&null!==B.value?Q={required:!0}:E<1&&(Q={min:!0}),S.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 C().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?C().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
");C().forIn(this.features,i=>{-1!==t.indexOf(i.key)&&o.get(i.key).setValue(!0),this.featureFormUpdate(i.key,o.get(i.key).value)})}setResponse(t,o){this.response=t;const i=new v.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:at.h.image})}createRequest(){const t=new ms;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
")),C().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 M.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 rt;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
")),C().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 ds;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,at.h.image),t}editAction(){const t=new v.N(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new M.R("rbd
/edit",{image_spec:t.toString()}),call:this.rbdService.update(t,this.editRequest())})}cloneAction(){const t=this.cloneRequest(),o=new v.N(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new M.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 ps;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,at.h.image),t}copyAction(){const t=this.copyRequest(),o=new v.N(this.response.pool_name,this.response.namespace,this.response.name);return this.taskWrapper.wrapTaskAroundCall({task:new M.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,as.P)(),(0,rs.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(ls.H),e.Y36(m.P),e.Y36($e.$),e.Y36(D.p4),e.Y36(g.F0),e.Y36(q))},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,S,E,I,B,y,Q,J,ee,te,w,_e,ae,O,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",S="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" + "",E="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" + "",I="-- 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" + "",y="" + "\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
...",O="-- 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
"],S,["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
"],E,["id
","stripingUnit
","name
","stripingUnit
","formControlName
","stripingUnit
",1,"form
-select
"],[3,"ngValue
"],I,["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
"],y,["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,O,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:[gt.y,a._Y,a.JL,a.sg,P.V,c.O5,h.P,$.o,a.Fj,K.b,a.JJ,a.u,Me.U,c.mk,a.EJ,a.YN,a.Kr,c.sg,a.Wl,Pt.S,gs.Q,a.x0,g.yS,a._,a.wV,Ts.d,j.p],pipes:[c.rS,tt.m],styles:[""]}),n})();var Dt=p(71225),lt=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 ct=p(51847),l_=p(16738),Oe=p.n(l_),dt=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 v.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 M.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(L.Kz),e.Y36(D.p4),e.Y36(dt.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:[f.z,a._Y,a.JL,a.sg,P.V,c.O5,h.P,$.o,a.Fj,K.b,a.JJ,a.u,L.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),Lt=p(51295),pt=p(60737),C_=p(74255),vt=p(71099),$t=p(79765);function S_(n,s){1&n&&(e.TgZ(0,"span
",16),e.SDv(1,17),e.qZA())}function R_(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)}}function E_(n,s){1&n&&(e.TgZ(0,"cd
-helper
"),e.SDv(1,25),e.qZA())}function M_(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div
",7)(1,"div
",20)(2,"div
",21)(3,"input
",22),e.NdJ("change
",function(){return e.CHM(t),e.oxw(2).onMirrorCheckBoxChange()}),e.qZA(),e.TgZ(4,"label
",23),e.SDv(5,24),e.qZA(),e.YNc(6,E_,2,0,"cd
-helper
",13),e.qZA()()()}if(2&n){const t=s.ngIf;e.xp6(3),e.uIk("disabled
",!(t.length>0)||null),e.xp6(3),e.Q6J("ngIf
",!t.length>0)}}function O_(n,s){if(1&n&&(e.ynx(0),e.YNc(1,M_,7,2,"div
",19),e.ALo(2,"async
"),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf
",e.lcZ(2,1,t.peerConfigured$))}}let h_=(()=>{class n{constructor(t,o,i,_,r,l){this.activeModal=t,this.rbdService=o,this.taskManagerService=i,this.notificationService=_,this.actionLabels=r,this.rbdMirrorService=l,this.editing=!1,this.onSubmit=new $t.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]}),mirrorImageSnapshot:new a.NI(!1,{})})}ngOnInit(){this.peerConfigured$=this.rbdMirrorService.getPeerForPool(this.poolName)}setSnapName(t){this.snapName=t,this.snapshotForm.get("snapshotName
").setValue(t)}onMirrorCheckBoxChange(){!0===this.snapshotForm.getValue("mirrorImageSnapshot
")?(this.snapshotForm.get("snapshotName
").setValue(""),this.snapshotForm.get("snapshotName
").clearValidators()):(this.snapshotForm.get("snapshotName
").setValue(this.snapName),this.snapshotForm.get("snapshotName
").setValidators([a.kI.required]))}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 v.N(this.poolName,this.namespace,this.imageName),i=new M.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=this.snapshotForm.getValue("mirrorImageSnapshot
"),i=new v.N(this.poolName,this.namespace,this.imageName),_=new M.R;_.name="rbd
/snap/create",_.metadata={image_spec:i.toString(),snapshot_name:t},this.rbdService.createSnapshot(i,t,o).toPromise().then(()=>{this.taskManagerService.subscribe(_.name,_.metadata,r=>{this.notificationService.notifyTask(r)}),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(L.Kz),e.Y36(H),e.Y36(vt.k),e.Y36(ve.g),e.Y36(D.p4),e.Y36(q))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cd
-rbd
-snapshot
-form
-modal
"]],decls:21,vars:18,consts:function(){let s,t,o,i,_,r;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",_="Mirror Image Snapshot",r="The peer must be registered to do this action.",[[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,["class","form-group row",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","mirrorImageSnapshot","name","mirrorImageSnapshot","id","mirrorImageSnapshot",1,"custom-control-input",3,"change"],["for","mirrorImageSnapshot",1,"custom-control-label"],_,r]},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.YNc(15,R_,3,1,"span",13),e.qZA()(),e.YNc(16,O_,3,3,"ng-container",13),e.qZA(),e.TgZ(17,"div",14)(18,"cd-form-button-panel",15),e.NdJ("submitActionEvent",function(){return o.submit()}),e.ALo(19,"titlecase"),e.ALo(20,"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,10,o.action))(e.lcZ(4,12,o.resource)),e.QtT(2),e.xp6(2),e.Q6J("formGroup",o.snapshotForm),e.xp6(7),e.uIk("disabled","snapshot"===o.mirroring&&!0===o.snapshotForm.getValue("mirrorImageSnapshot")||null),e.xp6(1),e.Q6J("ngIf",o.snapshotForm.showError("snapshotName",i,"required")),e.xp6(1),e.Q6J("ngIf","snapshot"===o.mirroring&&!0===o.snapshotForm.getValue("mirrorImageSnapshot")||null),e.xp6(1),e.Q6J("ngIf","snapshot"===o.mirroring||null),e.xp6(2),e.Q6J("form",o.snapshotForm)("submitText",e.lcZ(19,14,o.action)+" "+e.lcZ(20,16,o.resource))}},directives:[f.z,a._Y,a.JL,a.sg,P.V,h.P,$.o,a.Fj,K.b,a.JJ,a.u,Me.U,c.O5,a.Wl,Pt.S,j.p],pipes:[c.rS,tt.m,c.Ov],styles:[""]}),n})();class A_{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)||!i.hasSingleSelection},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)||!i.hasSingleSelection},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 P_{}var Ge=p(96102);const I_=["nameTpl"],b_=["rollbackTpl"];function N_(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 F_=(()=>{class n{constructor(t,o,i,_,r,l,d,u,S,E,I){this.authStorageService=t,this.modalService=o,this.dimlessBinaryPipe=i,this.cdDatePipe=_,this.rbdService=r,this.taskManagerService=l,this.notificationService=d,this.summaryService=u,this.taskListService=S,this.actionLabels=E,this.cdr=I,this.snapshots=[],this.selection=new Re.r,this.builders={"rbd/snap/create":B=>{const y=new P_;return y.name=B.snapshot_name,y}},this.permission=this.authStorageService.getPermissions().rbdImage}ngOnInit(){this.columns=[{name:"Name",prop:"name",cellTransformation:Le.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:Le.e.badge,customTemplateConfig:{map:{true:{value:"PROTECTED",class:"badge-success"},false:{value:"UNPROTECTED",class:"badge-info"}}}},{name:"Created",prop:"timestamp",flexGrow:1,pipe:this.cdDatePipe}],this.imageSpec=new v.N(this.poolName,this.namespace,this.rbdName),this.rbdTableActions=new A_(this.actionLabels,this.featuresName,this.rbdService),this.rbdTableActions.create.click=()=>this.openCreateSnapshotModal(),this.rbdTableActions.rename.click=()=>this.openEditSnapshotModal(),this.rbdTableActions.protect.click=()=>this.toggleProtection(),this.rbdTableActions.unprotect.click=()=>this.toggleProtection();const t=()=>this.selection.first()&&`${this.imageSpec.toStringEncoded()}/${encodeURIComponent(this.selection.first().name)}
`;this.rbdTableActions.clone.routerLink=()=>`/block/rbd
/clone/${t()}
`,this.rbdTableActions.copy.routerLink=()=>`/block/rbd
/copy/${t()}
`,this.rbdTableActions.rollback.click=()=>this.rollbackModal(),this.rbdTableActions.deleteSnap.click=()=>this.deleteSnapshotModal(),this.tableActions=this.rbdTableActions.ordering,this.taskListService.init(()=>(0,f_.of)(this.snapshots),null,_=>{Lt.T.updateChanged(this,{data:_})&&(this.cdr.detectChanges(),this.data=[...this.data])},()=>{Lt.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 v.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(h_,{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 pt.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 M.R;i.name="rbd/snap/edit";const _=new v.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 pt.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 M.R;_.name=o,_.metadata={image_spec:new v.N(this.poolName,this.namespace,this.rbdName).toString(),snapshot_name:i};const r=new v.N(this.poolName,this.namespace,this.rbdName);this.rbdService[t](r,i).toPromise().then(()=>{const l=new pt.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 v.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(lt.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(vt.k),e.Y36(ve.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(I_,5),e.Gf(b_,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,N_,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,Ee.K],styles:[""],changeDetection:0}),n})();var D_=p(42176),Bt=p(76317),L_=p(41039);const v_=["poolConfigurationSourceTpl"];function $_(n,s){1&n&&(e.ynx(0),e.tHW(1,3),e._UZ(2,"strong"),e.N_p(),e.BQk())}function B_(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 G_(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 y_(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 x_(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 Z_(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 w_(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 H_(n,s){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.YNc(2,w_,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 k_(n,s){1&n&&(e.TgZ(0,"span"),e._uU(1,"-"),e.qZA())}function q_(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,B_,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,G_,3,1,"span",1),e.YNc(52,y_,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,x_,3,1,"span",1),e.YNc(58,Z_,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,H_,4,4,"span",1),e.YNc(75,k_,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 K_(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 X_(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 z_(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,q_,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,K_,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,X_,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 J_(n,s){1&n&&(e.ynx(0),e.TgZ(1,"cd-alert-panel",45),e.SDv(2,46),e.qZA(),e.BQk())}function Y_(n,s){1&n&&(e.ynx(0),e.TgZ(1,"strong",49),e.SDv(2,50),e.qZA(),e.BQk())}function V_(n,s){1&n&&(e.TgZ(0,"span",51),e.SDv(1,52),e.qZA())}function U_(n,s){if(1&n&&(e.YNc(0,Y_,3,0,"ng-container",47),e.YNc(1,V_,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 j_=(()=>{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(v_,7),e.Gf(L.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,S,E,I,B,y,Q,J,ee,te,w,_e,ae,O,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",S="Size",E="Objects",I="Object size",B="Features",y="Provisioned",Q="Total provisioned",J="Striping unit",ee="Striping count",te="Parent",w="Block name prefix",_e="Order",ae="Format Version",O="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,S,E,I,B,[4,"ngFor","ngForOf"],y,Q,J,ee,te,w,_e,ae,[1,"badge","badge-dark","me-2"],["placement","top",1,"form-text","text-muted",3,"ngbTooltip"],O,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,$_,3,0,"ng-template",null,0,e.W1O),e.YNc(2,z_,20,1,"ng-container",1),e.YNc(3,J_,3,0,"ng-container",1),e.YNc(4,U_,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,L.Pz,ht.m,L.nv,L.Vx,L.uN,c.sg,L._L,F_,D_.P,Bt.F,L.tO,nt.G],pipes:[L_.W,Ge.N,$e.$,it.n],styles:[""]}),n})();const W_=["usageTpl"],ea=["parentTpl"],ta=["nameTpl"],oa=["ScheduleTpl"],na=["mirroringTpl"],ia=["flattenTpl"],sa=["deleteTpl"],_a=["removingStatTpl"],aa=["provisionedNotAvailableTooltipTpl"],ra=["totalProvisionedNotAvailableTooltipTpl"],la=["forcePromoteConfirmation"];function ca(n,s){1&n&&e._UZ(0,"div",14),2&n&&e.Q6J("innerHtml","Only available for RBD images with <strong>fast-diff</strong> enabled",e.oJD)}function da(n,s){if(1&n&&(e.TgZ(0,"span",17),e.SDv(1,18),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("ngbTooltip",t.usageNotAvailableTooltipTpl)}}function pa(n,s){if(1&n&&(e.SDv(0,19),e.ALo(1,"dimlessBinary")),2&n){const t=e.oxw().row;e.xp6(1),e.pQV(e.lcZ(1,1,t.disk_usage)),e.QtT(0)}}function ua(n,s){if(1&n&&(e.YNc(0,da,2,1,"span",15),e.YNc(1,pa,2,3,"ng-template",null,16,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 ma(n,s){if(1&n&&(e.TgZ(0,"span",17),e.SDv(1,21),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("ngbTooltip",t.usageNotAvailableTooltipTpl)}}function ga(n,s){if(1&n&&(e.SDv(0,22),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 Ta(n,s){if(1&n&&(e.YNc(0,ma,2,1,"span",15),e.YNc(1,ga,2,3,"ng-template",null,20,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 fa(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 Ca(n,s){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.YNc(2,fa,2,1,"span",23),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 Sa(n,s){1&n&&(e.TgZ(0,"span"),e._uU(1,"-"),e.qZA())}function Ra(n,s){if(1&n&&(e.YNc(0,Ca,4,4,"span",23),e.YNc(1,Sa,2,0,"span",23)),2&n){const t=s.value;e.Q6J("ngIf",t),e.xp6(1),e.Q6J("ngIf",!t)}}function Ea(n,s){if(1&n&&(e.TgZ(0,"span",27),e._uU(1),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.Oqu(t[0])}}function Ma(n,s){if(1&n&&(e.TgZ(0,"span",27),e._uU(1),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.Oqu(t[1])}}function Oa(n,s){1&n&&(e.TgZ(0,"span",27),e.SDv(1,28),e.qZA())}function ha(n,s){1&n&&(e.TgZ(0,"span",27),e.SDv(1,29),e.qZA())}function Aa(n,s){if(1&n&&(e.TgZ(0,"span",27),e._uU(1),e.qZA()),2&n){const t=e.oxw().value;e.xp6(1),e.Oqu(t)}}function Pa(n,s){if(1&n&&(e.YNc(0,Ea,2,1,"span",24),e._uU(1,"\xa0 "),e.YNc(2,Ma,2,1,"span",25),e._uU(3,"\xa0 "),e.YNc(4,Oa,2,0,"span",25),e.YNc(5,ha,2,0,"span",25),e.YNc(6,Aa,2,1,"ng-template",null,26,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 Ia(n,s){if(1&n&&(e.TgZ(0,"span",27),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 ba(n,s){1&n&&e.YNc(0,Ia,3,3,"span",25),2&n&&e.Q6J("ngIf",3===s.value.length)}function Na(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 Fa(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 Da(n,s){if(1&n&&(e.ynx(0),e.TgZ(1,"span"),e.SDv(2,33),e.qZA(),e.TgZ(3,"ul"),e.YNc(4,Fa,2,1,"li",34),e.qZA(),e.BQk()),2&n){const t=e.oxw(2).snapshots;e.xp6(4),e.Q6J("ngForOf",t)}}function La(n,s){if(1&n&&(e.TgZ(0,"div",31)(1,"span"),e.SDv(2,32),e.qZA(),e._UZ(3,"br"),e.YNc(4,Da,5,1,"ng-container",23),e.qZA()),2&n){const t=e.oxw().snapshots;e.xp6(4),e.Q6J("ngIf",t.length>0)}}function va(n,s){1&n&&e.YNc(0,La,5,1,"div",30),2&n&&e.Q6J("ngIf",s.hasSnapshots)}const $a=function(n,s){return[n,s]};function Ba(n,s){if(1&n&&e._UZ(0,"i",36),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.WLB(1,$a,t.icons.spinner,t.icons.spin))}}function Ga(n,s){if(1&n&&(e.TgZ(0,"span",36),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 ya(n,s){if(1&n&&e._UZ(0,"i",38),2&n){const t=e.oxw(2);e.Gre("",t.icons.warning," warn")}}function xa(n,s){if(1&n&&(e.YNc(0,Ba,1,4,"i",35),e.TgZ(1,"span",36),e._uU(2),e.qZA(),e.YNc(3,Ga,2,2,"span",35),e.YNc(4,ya,1,3,"i",37)),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)}}function Za(n,s){if(1&n&&(e.TgZ(0,"cd-alert-panel",39),e._uU(1),e.qZA(),e.TgZ(2,"div",40),e.tHW(3,41),e._UZ(4,"strong"),e.N_p(),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.errorMessage)}}let Ha=(()=>{class n extends Ct.o{constructor(t,o,i,_,r,l,d,u,S){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=S,this.tableStatus=new Dt.c("light"),this.selection=new Re.r,this.icons=T.P,this.count=0,this.tableContext=null,this.builders={"rbd/create":O=>this.createRbdFromTask(O.pool_name,O.namespace,O.image_name),"rbd/delete":O=>this.createRbdFromTaskImageSpec(O.image_spec),"rbd/clone":O=>this.createRbdFromTask(O.child_pool_name,O.child_namespace,O.child_image_name),"rbd/copy":O=>this.createRbdFromTask(O.dest_pool_name,O.dest_namespace,O.dest_image_name)},this.permission=this.authStorageService.getPermissions().rbdImage;const E=()=>this.selection.first()&&new v.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:O=>!O.hasSingleSelection,name:this.actionLabels.CREATE},{permission:"update",icon:T.P.edit,routerLink:()=>this.urlBuilder.getEdit(E()),name:this.actionLabels.EDIT,disable:O=>this.getRemovingStatusDesc(O)||this.getInvalidNameDisable(O)},{permission:"create",canBePrimary:O=>O.hasSingleSelection,disable:O=>this.getRemovingStatusDesc(O)||this.getInvalidNameDisable(O)||!!O.first().cdExecuting,icon:T.P.copy,routerLink:()=>`/block/rbd
/copy/${E()}
`,name:this.actionLabels.COPY},{permission:"update",disable:O=>this.getRemovingStatusDesc(O)||this.getInvalidNameDisable(O)||O.first().cdExecuting||!O.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:O=>this.getResyncDisableDesc(O)},{permission:"delete",icon:T.P.destroy,click:()=>this.deleteRbdModal(),name:this.actionLabels.DELETE,disable:O=>this.getDeleteDisableDesc(O)},{permission:"delete",icon:T.P.trash,click:()=>this.trashRbdModal(),name:this.actionLabels.TRASH,disable:O=>this.getRemovingStatusDesc(O)||this.getInvalidNameDisable(O)||O.first().image_format===Ie.V1},{permission:"update",icon:T.P.edit,click:()=>this.removeSchedulingModal(),name:this.actionLabels.REMOVE_SCHEDULING,disable:O=>this.getRemovingStatusDesc(O)||this.getInvalidNameDisable(O)||void 0===O.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=v.N.fromString(t);return this.createRbdFromTask(o.poolName,o.namespace,o.imageName)}createRbdFromTask(t,o,i){const _=new cs;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 v.N(_.metadata.dest_pool_name,_.metadata.dest_namespace,_.metadata.dest_image_name).toString();break;case"rbd/clone":r=new v.N(_.metadata.child_pool_name,_.metadata.child_namespace,_.metadata.child_image_name).toString();break;case"rbd/create":r=new v.N(_.metadata.pool_name,_.metadata.namespace,_.metadata.image_name).toString();break;default:r=_.metadata.image_spec}return r===new v.N(i.pool_name,i.namespace,i.name).toString()},this.builders)}onFetchError(){this.table.reset(),this.tableStatus=new Dt.c("danger")}getRbdImages(t){var o;return null!==t&&(this.tableContext=t),null==this.tableContext&&(this.tableContext=new A.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 v.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 M.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 v.N(t,o,i);this.modalRef=this.modalService.show(pe.M,{itemDescription:"RBD",itemNames:[_],actionDescription:"resync",submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new M.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 M.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 v.N(_.pool_name,_.pool_namespace,_.image_name),l=new v.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(lt.Y,d)}editRequest(){const t=new rt;return t.remove_scheduling=!t.remove_scheduling,t}removeSchedulingModal(){const t=this.selection.first().name,o=new v.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 Ot.y(i=>{this.taskWrapper.wrapTaskAroundCall({task:new M.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 rt;o.primary=t,o.features=null;const i=new v.N(this.selection.first().pool_name,this.selection.first().namespace,this.selection.first().name);this.taskWrapper.wrapTaskAroundCall({task:new M.R("rbd/edit",{image_spec:i.toString()}),call:this.rbdService.update(i,o)}).subscribe(()=>{},_=>{_.preventDefault(),t&&(this.errorMessage=_.error.detail.replace(/\[.*?\]\s*/,""),o.force=!0,this.modalRef=this.modalService.show(lt.Y,{titleText:"Warning",buttonText:"Enforce",warning:!0,bodyTpl:this.forcePromoteConfirmation,onSubmit:()=>{this.rbdService.update(i,o).subscribe(()=>{this.modalRef.close()},()=>{this.modalRef.close()})}}))})}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(it.n),e.Y36(de.Z),e.Y36(m.P),e.Y36(ce.j),e.Y36(ct.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(W_,5),e.Gf(ea,7),e.Gf(ta,5),e.Gf(oa,7),e.Gf(na,7),e.Gf(ia,7),e.Gf(sa,7),e.Gf(_a,7),e.Gf(aa,7),e.Gf(ra,7),e.Gf(la,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),e.iGM(i=e.CRH())&&(o.forcePromoteConfirmation=i.first)}},features:[e._Bn([ce.j,{provide:ct.F,useValue:new ct.F("block/rbd")}]),e.qOj],decls:25,vars:13,consts:function(){let s,t,o,i,_,r,l,d,u,S;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'",S="" + "\ufffd#4\ufffd" + " Do you want to force the operation? " + "\ufffd/#4\ufffd" + "",[["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",""],["forcePromoteConfirmation",""],[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],["type","warning"],[1,"m-4"],S]},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,ca,1,1,"ng-template",null,4,e.W1O),e.YNc(7,ua,3,2,"ng-template",null,5,e.W1O),e.YNc(9,Ta,3,2,"ng-template",null,6,e.W1O),e.YNc(11,Ra,2,2,"ng-template",null,7,e.W1O),e.YNc(13,Pa,8,5,"ng-template",null,8,e.W1O),e.YNc(15,ba,1,1,"ng-template",null,9,e.W1O),e.YNc(17,Na,13,3,"ng-template",null,10,e.W1O),e.YNc(19,va,1,1,"ng-template",null,11,e.W1O),e.YNc(21,xa,5,5,"ng-template",null,12,e.W1O),e.YNc(23,Za,5,1,"ng-template",null,13,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,Ee.K,j_,c.O5,L._L,c.sg,c.mk,nt.G],pipes:[$e.$,Ge.N],styles:[".warn[_ngcontent-%COMP%]{color:#d48200}"]}),n})();function ka(n,s){1&n&&e._UZ(0,"input",19)}function qa(n,s){1&n&&(e.TgZ(0,"option",23),e.SDv(1,24),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Ka(n,s){1&n&&(e.TgZ(0,"option",23),e.SDv(1,25),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Xa(n,s){1&n&&(e.TgZ(0,"option",23),e.SDv(1,26),e.qZA()),2&n&&e.Q6J("ngValue",null)}function Qa(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 za(n,s){if(1&n&&(e.TgZ(0,"select",20),e.YNc(1,qa,2,1,"option",21),e.YNc(2,Ka,2,1,"option",21),e.YNc(3,Xa,2,1,"option",21),e.YNc(4,Qa,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 Ja(n,s){1&n&&(e.TgZ(0,"span",28),e.SDv(1,29),e.qZA())}function Ya(n,s){1&n&&(e.TgZ(0,"span",28),e.SDv(1,30),e.qZA())}function Va(n,s){1&n&&(e.TgZ(0,"span",28),e.SDv(1,31),e.qZA())}let Ua=(()=>{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 $t.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 M.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(L.Kz),e.Y36(D.p4),e.Y36(oe.j),e.Y36(ve.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,ka,1,0,"input",11),e.YNc(12,za,5,4,"select",12),e.YNc(13,Ja,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,Ya,2,0,"span",13),e.YNc(20,Va,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:[f.z,a._Y,a.JL,a.sg,P.V,h.P,c.O5,$.o,a.Fj,K.b,a.JJ,a.u,a.EJ,a.YN,a.Kr,c.sg,Me.U,j.p],styles:[""]}),n})(),ja=(()=>{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 Re.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(Ua),this.modalRef.componentInstance.onSubmit.subscribe(()=>{this.refresh()})}deleteModal(){const t=this.selection.first().pool,o=this.selection.first().namespace;this.modalRef=this.modalService.show(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(ve.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,Ee.K],styles:[""]}),n})(),Wa=(()=>{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,Bt.F],styles:[""]}),n})();var er=p(91801);function tr(n,s){1&n&&e._UZ(0,"input",15)}function or(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 nr(n,s){if(1&n&&(e.TgZ(0,"select",16)(1,"option",17),e.SDv(2,18),e.qZA(),e.YNc(3,or,2,2,"option",19),e.qZA()),2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngForOf",t.pools)}}let ir=(()=>{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 M.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(L.Kz),e.Y36(D.p4),e.Y36(dt.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,tr,1,0,"input",11),e.YNc(15,nr,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:[f.z,a._Y,a.JL,a.sg,P.V,h.P,c.O5,$.o,a.Fj,K.b,a.JJ,a.u,a.EJ,a.YN,a.Kr,c.sg,j.p],styles:[""]}),n})();function sr(n,s){1&n&&(e.TgZ(0,"span",15),e.SDv(1,16),e.qZA())}let _r=(()=>{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 v.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 v.N(this.poolName,this.namespace,this.imageId);this.taskWrapper.wrapTaskAroundCall({task:new M.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(L.Kz),e.Y36(D.p4),e.Y36(dt.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,sr,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:[f.z,a._Y,a.JL,a.sg,P.V,h.P,$.o,a.Fj,K.b,a.JJ,a.u,Me.U,c.O5,j.p],styles:[""]}),n})();const ar=["expiresTpl"],rr=["deleteTpl"],lr=function(n){return[n]};function cr(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,lr,t.icons.destroy))}}function dr(n,s){1&n&&(e.ynx(0),e.SDv(1,10),e.BQk())}function pr(n,s){1&n&&(e.ynx(0),e.SDv(1,11),e.BQk())}function ur(n,s){if(1&n&&(e.YNc(0,dr,2,0,"ng-container",9),e.YNc(1,pr,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 mr(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 gr(n,s){1&n&&e.YNc(0,mr,5,3,"p",12),2&n&&e.Q6J("ngIf",!s.isExpired)}let Tr=(()=>{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 Re.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:Le.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 v.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=>{C().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(er.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(_r,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 v.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 M.R("rbd/trash/remove",{image_id_spec:l.toString()}),call:this.rbdService.removeTrash(l,!0)})})}purgeModal(){this.modalService.show(ir)}}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(ar,7),e.Gf(rr,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,cr,4,4,"button",3),e.qZA()(),e.YNc(5,ur,4,5,"ng-template",null,4,e.W1O),e.YNc(7,gr,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,Ee.K,c.O5,$.o,c.mk],pipes:[Ge.N],styles:[""]}),n})(),Gt=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[c.ez,si,a.u5,a.UX,L.Oz,L.dT,L.HK,be.b,Ae.m,g.Bz,ne.xc]]}),n})();const fr=[{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:Ha},{path:"namespaces",component:ja,data:{breadcrumbs:"Namespaces"}},{path:"trash",component:Tr,data:{breadcrumbs:"Trash"}},{path:"performance",component:Wa,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:os,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:_s,outlet:"modal"}]},{path:"iscsi",canActivate:[U.T],data:{breadcrumbs:"iSCSI"},children:[{path:"",redirectTo:"overview",pathMatch:"full"},{path:"overview",component:ii,data:{breadcrumbs:"Overview"}},{path:"targets",data:{breadcrumbs:"Targets"},children:[{path:"",component:qn},{path:D.MQ.CREATE,component:ft,data:{breadcrumbs:D.Qn.CREATE}},{path:`${D.MQ.EDIT}
/:target_iqn`,component:ft,data:{breadcrumbs:D.Qn.EDIT}}]}]}];let Cr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[Gt,g.Bz.forChild(fr)]]}),n})()},60950:(ut,he,p)=>{p.d(he,{d:()=>z});var c=p(89724),a=p(1659),g=p(23815),ne=p.n(g),L=p(7357),be=p(65862),D=p(95463),U=p(30633),re=p(28211),Ae=p(34089),Ne=p(41582),C=p(11048),le=p(56310),F=p(18372),ie=p(87925),Y=p(94276);let e=(()=>{class A{constructor(m,f){this.control=m,this.formatter=f}setValue(m){const f=this.formatter.toMilliseconds(m);this.control.control.setValue(`${f} ms`)}ngOnInit(){this.setValue(this.control.value),this.ngDataReady&&this.ngDataReady.subscribe(()=>this.setValue(this.control.value))}onUpdate(m){this.setValue(m)}}return A.\u0275fac=function(m){return new(m||A)(c.Y36(a.a5),c.Y36(re.H))},A.\u0275dir=c.lG2({type:A,selectors:[["","cdMilliseconds",""]],hostBindings:function(m,f){1&m&&c.NdJ("blur",function(h){return f.onUpdate(h.target.value)})},inputs:{ngDataReady:"ngDataReady"}}),A})();var X=p(20044);let Fe=(()=>{class A{constructor(m,f,P,h){this.elementRef=m,this.control=f,this.dimlessBinaryPerSecondPipe=P,this.formatter=h,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 f=this.formatter.toBytes(m,0),P=this.round(f);this.el.value=this.dimlessBinaryPerSecondPipe.transform(P),null!==f?(this.ngModelChange.emit(this.el.value),this.control.control.setValue(this.el.value)):(this.ngModelChange.emit(null),this.control.control.setValue(null))}round(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 f=Math.round(Math.log(m)/Math
.log(this.roundPower
));return Math
.pow(this.roundPower
,f
)}}return m
}onBlur(m
){this.setValue(m
)}}return A
.\u0275fac=function(m
){return new(m
||A
)(c
.Y36(c
.SBq
),c
.Y36(a
.a5
),c
.Y36(X
.O
),c
.Y36(re
.H
))},A
.\u0275dir=c
.lG2({type
:A
,selectors
:[["","cdDimlessBinaryPerSecond",""]],hostBindings:function(m
,f
){1&m
&&c
.NdJ("blur",function(h
){return f
.onBlur(h
.target
.value
)})},inputs
:{ngDataReady
:"ngDataReady",minBytes
:"minBytes",maxBytes
:"maxBytes",roundPower
:"roundPower",defaultUnit
:"defaultUnit"},outputs
:{ngModelChange
:"ngModelChange"}}),A
})(),De
=(()=>{class A
{constructor(m
,f
){this.formatter
=m
,this.ngControl
=f
}setValue(m
){const f
=this.formatter
.toIops(m
);this.ngControl
.control
.setValue(`${f} IOPS`)}ngOnInit(){this.setValue(this.ngControl
.value
),this.ngDataReady
&&this.ngDataReady
.subscribe(()=>this.setValue(this.ngControl
.value
))}onUpdate(m
){this.setValue(m
)}}return A
.\u0275fac=function(m
){return new(m
||A
)(c
.Y36(re
.H
),c
.Y36(a
.a5
))},A
.\u0275dir=c
.lG2({type
:A
,selectors
:[["","cdIops",""]],hostBindings:function(m
,f
){1&m
&&c
.NdJ("blur",function(h
){return f
.onUpdate(h
.target
.value
)})},inputs
:{ngDataReady
:"ngDataReady"}}),A
})();function v(A
,M
){if(1&A
&&(c
.ynx(0),c
._UZ(1,"input",17),c
.BQk()),2&A
){const m
=c
.oxw().$implicit
,f
=c
.oxw(2);c
.xp6(1),c
.Q6J("id",m
.name
)("name",m
.name
)("formControlName",m
.name
)("ngDataReady",f
.ngDataReady
)}}function Pe(A
,M
){if(1&A
&&(c
.ynx(0),c
._UZ(1,"input",18),c
.BQk()),2&A
){const m
=c
.oxw().$implicit
,f
=c
.oxw(2);c
.xp6(1),c
.Q6J("id",m
.name
)("name",m
.name
)("formControlName",m
.name
)("ngDataReady",f
.ngDataReady
)}}function H(A
,M
){if(1&A
&&(c
.ynx(0),c
._UZ(1,"input",19),c
.BQk()),2&A
){const m
=c
.oxw().$implicit
,f
=c
.oxw(2);c
.xp6(1),c
.Q6J("id",m
.name
)("name",m
.name
)("formControlName",m
.name
)("ngDataReady",f
.ngDataReady
)}}function N(A
,M
){1&A
&&(c
.TgZ(0,"span",20),c
.SDv(1,21),c
.qZA())}const x=function(A
){return{active
:A
}},T=function(A
){return[A
]};function k(A
,M
){if(1&A
){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,v
,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 h
=c
.CHM(m
).$implicit
;return c
.oxw(2).reset(h
.name
)}),c
._UZ(12,"i",7),c
.qZA()(),c
.YNc(13,N
,2,0,"span",16),c
.qZA()()}if(2&A
){const m
=M
.$implicit
,f
=c
.oxw().$implicit
,P
=c
.oxw(),h
=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 ",f
.heading
,""),c
.xp6(2),c
.Q6J("ngSwitch",m
.type
),c
.xp6(1),c
.Q6J("ngSwitchCase",P
.configurationType
.milliseconds
),c
.xp6(1),c
.Q6J("ngSwitchCase",P
.configurationType
.bps
),c
.xp6(1),c
.Q6J("ngSwitchCase",P
.configurationType
.iops
),c
.xp6(1),c
.Q6J("ngClass",c
.VKq(13,x
,P
.isDisabled(m
.name
))),c
.xp6(1),c
.Q6J("ngClass",c
.VKq(15,T
,P
.icons
.erase
)),c
.xp6(1),c
.Q6J("ngIf",P
.form
.showError("configuration."+m
.name
,h
,"min"))}}function Z(A
,M
){if(1&A
){const m
=c
.EpF();c
.TgZ(0,"div",4)(1,"h4",5)(2,"span",6),c
.NdJ("click",function(){const h
=c
.CHM(m
).$implicit
;return c
.oxw().toggleSectionVisibility(h
.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&A
){const m
=M
.$implicit
,f
=c
.oxw();c
.xp6(3),c
.hij(" ",m
.heading
," "),c
.xp6(1),c
.Q6J("ngClass",f
.sectionVisibility
[m
.class]?f
.icons
.minusCircle
:f
.icons
.addCircle
),c
.xp6(1),c
.Tol(m
.class),c
.Q6J("hidden",!f
.sectionVisibility
[m
.class]),c
.xp6(1),c
.Q6J("ngForOf",m
.options
)}}let z
=(()=>{class A
{constructor(m
,f
){this.formatterService
=m
,this.rbdConfigurationService
=f
,this.initializeData
=new L
.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(f
=>{this.initialData
=f
.initialData
;const P
=f
.sourceType
;this.rbdConfigurationService
.getWritableOptionFields().forEach(h
=>{const $=f
.initialData
.filter(K
=>K
.name
===h
.name
).pop();$&&$.source
===P
&&this.form
.get(`configuration.${h.name}`).setValue($.value
)}),this.ngDataReady
.emit()}),this.rbdConfigurationService
.getWritableSections().forEach(f
=>this.sectionVisibility
[f
.class]=!1)}getDirtyValues(m
=!1,f
){if(m
&&!f
)throw new Error("ProgrammingError: If local values shall be included, a proper localFieldType argument has to be provided, too");const P
={};return this.rbdConfigurationService
.getWritableOptionFields().forEach(h
=>{const $=this.form
.get("configuration").get(h
.name
);this.initialData
&&this.initialData
[h
.name
]===$.value
||($.dirty
||m
&&$.source
===f
)&&(P
[h
.name
]=null===$.value
?$.value
:h
.type
===U
.r
.bps
?this.formatterService
.toBytes($.value
):h
.type
===U
.r
.milliseconds
?this.formatterService
.toMilliseconds($.value
):h
.type
===U
.r
.iops
?this.formatterService
.toIops($.value
):$.value
)}),P
}createConfigurationFormGroup(){const m
=new D
.d({});return this.rbdConfigurationService
.getWritableOptionFields().forEach(f
=>{let P
;if(f
.type
!==U
.r
.milliseconds
&&f
.type
!==U
.r
.iops
&&f
.type
!==U
.r
.bps
)throw new Error(`Type ${f.type} is unknown, you may need to add it to RbdConfiguration class`);{let h
=0;ne().forEach(this.initialData
,$=>{$.name
===f
.name
&&(h
=$.value
)}),P
=new a
.NI(h
,a
.kI
.min(0))}m
.addControl(f
.name
,P
)}),m
}reset(m
){const f
=this.form
.get("configuration").get(m
);f
.disabled
?(f
.setValue(f
.previousValue
||0),f
.enable(),f
.previousValue
||f
.markAsPristine()):(f
.previousValue
=f
.value
,f
.setValue(null),f
.markAsDirty(),f
.disable())}isDisabled(m
){return this.form
.get("configuration").get(m
).disabled
}toggleSectionVisibility(m
){this.sectionVisibility
[m
]=!this.sectionVisibility
[m
]}}return A
.\u0275fac=function(m
){return new(m
||A
)(c
.Y36(re
.H
),c
.Y36(Ae
.n
))},A
.\u0275cmp=c
.Xpm({type
:A
,selectors
:[["cd-rbd-configuration-form"]],inputs
:{form
:"form",initializeData
:"initializeData"},outputs
:{changes
:"changes"},decls
:5,vars
:2,consts:function(){let M
,m
,f
;return M
="RBD Configuration",m
="Remove the local configuration value. The parent configuration value will be inherited and used instead.",f
="The minimum value is 0",[[3,"formGroup"],["cfgFormGroup",""],M
,["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"],f
]},template:function(m
,f
){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",f
.form
.get("configuration")),c
.xp6(4),c
.Q6J("ngForOf",f
.rbdConfigurationService
.sections
))},directives
:[a
.JL
,a
.sg
,Ne
.V
,C
.sg
,C
.mk
,le
.P
,F
.S
,C
.RF
,C
.n9
,ie
.o
,a
.Fj
,Y
.b
,e
,a
.JJ
,a
.u
,Fe
,De
,C
.O5
],styles
:[".collapsible[_ngcontent-%COMP%]{cursor:pointer;user-select:none}"]}),A
})()},42176:(ut
,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 L
=p(28211),be
=p(34089),D
=p(11048),U
=p(20044),re
=p(48537),Ae
=p(21766);const Ne
=["configurationSourceTpl"],C
=["configurationValueTpl"],le
=["poolConfTable"];function F(N
,x
){1&N
&&(g
.TgZ(0,"span"),g
.SDv(1,6),g
.qZA())}function ie(N
,x
){1&N
&&(g
.TgZ(0,"strong"),g
.SDv(1,7),g
.qZA())}function Y(N
,x
){1&N
&&(g
.TgZ(0,"strong"),g
.SDv(1,8),g
.qZA())}function e(N
,x
){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",x
.value
),g
.xp6(1),g
.Q6J("ngSwitchCase","global"),g
.xp6(1),g
.Q6J("ngSwitchCase","image"),g
.xp6(1),g
.Q6J("ngSwitchCase","pool"))}function X(N
,x
){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
,x
){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
,x
){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 v(N
,x
){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
,x
){if(1&N
&&(g
.TgZ(0,"div",4),g
.YNc(1,X
,3,3,"span",5),g
.YNc(2,Fe
,3,3,"span",5),g
.YNc(3,De
,3,3,"span",5),g
.YNc(4,v
,2,1,"span",9),g
.qZA()),2&N
){const T
=x
.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(L
.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(C
,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 x
,T
,k
;return x
="Global",T
="Image",k
="Pool",[["identifier","name",3,"data","columns"],["poolConfTable",""],["configurationSourceTpl",""],["configurationValueTpl",""],[3,"ngSwitch"],[4,"ngSwitchCase"],x
,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
})()}}]);