]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/dist/en-US/5.f1a521f29ba388aefe88.js
update dh_systemd restart patch for pacific
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / dist / en-US / 5.f1a521f29ba388aefe88.js
1 (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"5azF":function(e,t,i){"use strict";i.r(t),i.d(t,"PoolModule",(function(){return ta})),i.d(t,"RoutedPoolModule",(function(){return aa}));var a=i("SVse"),o=i("s7LF"),s=i("iInd"),c=i("G0yt"),n=i("sne2"),l=i("PCNd"),r=i("k/xb"),b=i("kJI8"),d=i("LvDl"),u=i.n(d),f=i("jtHE"),p=i("WE5d"),h=i("8Y7J"),m=i("IheW");let g=(()=>{class e{constructor(e){this.http=e,this.apiPath="api/crush_rule",this.formTooltips={root:"The name of the node under which data should be placed.",failure_domain:"The type of CRUSH nodes across which we should separate replicas.",device_class:"The device class data should be placed on."}}create(e){return this.http.post(this.apiPath,e,{observe:"response"})}delete(e){return this.http.delete(`${this.apiPath}/${e}`,{observe:"response"})}getInfo(){return this.http.get(`ui-${this.apiPath}/info`)}}return e.\u0275fac=function(t){return new(t||e)(h.dc(m.b))},e.\u0275prov=h.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),S=(()=>{class e{constructor(e){this.http=e,this.apiPath="api/erasure_code_profile",this.formTooltips={k:"Each object is split in data-chunks parts, each stored on a different OSD.",m:"Compute coding chunks for each object and store them on different OSDs.\n The number of coding chunks is also the number of OSDs that can be down without losing data.",plugins:{jerasure:{description:"The jerasure plugin is the most generic and flexible plugin,\n it is also the default for Ceph erasure coded pools.",technique:"The more flexible technique is reed_sol_van : it is enough to set k\n and m. The cauchy_good technique can be faster but you need to chose the packetsize\n carefully. All of reed_sol_r6_op, liberation, blaum_roth, liber8tion are RAID6 equivalents\n in the sense that they can only be configured with m=2.",packetSize:"The encoding will be done on packets of bytes size at a time.\n Choosing the right packet size is difficult.\n The jerasure documentation contains extensive information on this topic."},lrc:{description:"With the jerasure plugin, when an erasure coded object is stored on\n multiple OSDs, recovering from the loss of one OSD requires reading from all the others.\n For instance if jerasure is configured with k=8 and m=4, losing one OSD requires reading\n from the eleven others to repair.\n\n The lrc erasure code plugin creates local parity chunks to be able to recover using\n less OSDs. For instance if lrc is configured with k=8, m=4 and l=4, it will create\n an additional parity chunk for every four OSDs. When a single OSD is lost, it can be\n recovered with only four OSDs instead of eleven.",l:"Group the coding and data chunks into sets of size locality. For instance,\n for k=4 and m=2, when locality=3 two groups of three are created. Each set can\n be recovered without reading chunks from another set.",crushLocality:"The type of the crush bucket in which each set of chunks defined\n by l will be stored. For instance, if it is set to rack, each group of l chunks will be\n placed in a different rack. It is used to create a CRUSH rule step such as step choose\n rack. If it is not set, no such grouping is done."},isa:{description:"The isa plugin encapsulates the ISA library. It only runs on Intel processors.",technique:"The ISA plugin comes in two Reed Solomon forms.\n If reed_sol_van is set, it is Vandermonde, if cauchy is set, it is Cauchy."},shec:{description:"The shec plugin encapsulates the multiple SHEC library.\n It allows ceph to recover data more efficiently than Reed Solomon codes.",c:"The number of parity chunks each of which includes each data chunk in its\n calculation range. The number is used as a durability estimator. For instance, if c=2,\n 2 OSDs can be down without losing data."},clay:{description:"CLAY (short for coupled-layer) codes are erasure codes designed to\n bring about significant savings in terms of network bandwidth and disk IO when a failed\n node/OSD/rack is being repaired.",d:"Number of OSDs requested to send data during recovery of a single chunk.\n d needs to be chosen such that k+1 <= d <= k+m-1. The larger the d, the better\n the savings.",scalar_mds:"scalar_mds specifies the plugin that is used as a building block\n in the layered construction. It can be one of jerasure, isa, shec.",technique:"technique specifies the technique that will be picked\n within the 'scalar_mds' plugin specified. Supported techniques\n are 'reed_sol_van', 'reed_sol_r6_op', 'cauchy_orig',\n 'cauchy_good', 'liber8tion' for jerasure, 'reed_sol_van',\n 'cauchy' for isa and 'single', 'multiple' for shec."}},crushRoot:"The name of the crush bucket used for the first step of the CRUSH rule.\n For instance step take default.",crushFailureDomain:"Ensure that no two chunks are in a bucket with the same failure\n domain. For instance, if the failure domain is host no two chunks will be stored on the same\n host. It is used to create a CRUSH rule step such as step chooseleaf host.",crushDeviceClass:"Restrict placement to devices of a specific class\n (e.g., ssd or hdd), using the crush device class names in the CRUSH map.",directory:"Set the directory name from which the erasure code plugin is loaded."}}list(){return this.http.get(this.apiPath)}create(e){return this.http.post(this.apiPath,e,{observe:"response"})}delete(e){return this.http.delete(`${this.apiPath}/${e}`,{observe:"response"})}getInfo(){return this.http.get(`ui-${this.apiPath}/info`)}}return e.\u0275fac=function(t){return new(t||e)(h.dc(m.b))},e.\u0275prov=h.Ib({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var v=i("Ekvf");class R{constructor(){this.nodes=[],this.idTree={},this.allDevices=[],this.buckets=[],this.failureDomains={},this.failureDomainKeys=[],this.devices=[],this.deviceCount=0}static searchFailureDomains(e,t){return this.getFailureDomains(this.search(e,t))}static search(e,t){const[i,a]=t.split("~"),o=e.find(e=>["name","id","type"].some(t=>e[t]===i));return o?(e=this.getSubNodes(o,this.createIdTreeFromNodes(e)),a&&(e=this.filterNodesByDeviceType(e,a)),e):[]}static createIdTreeFromNodes(e){const t={};return e.forEach(e=>{t[e.id]=e}),t}static getSubNodes(e,t){let i=[e];return e.children?(e.children.forEach(e=>{i=i.concat(this.getSubNodes(t[e],t))}),i):i}static filterNodesByDeviceType(e,t){let i,a=e.filter(e=>e.device_class&&e.device_class!==t).map(e=>e.id),o=a;do{i=!1,e=e.filter(e=>!a.includes(e.id));const t=[];e.forEach(e=>{e.children&&e.children.every(e=>a.includes(e))&&(t.push(e.id),i=!0)}),i&&(a=t,o=o.concat(t))}while(i);return(e=u.a.cloneDeep(e)).map(e=>e.children?(e.children=e.children.filter(e=>!o.includes(e)),e):e)}static getFailureDomains(e){const t={};return e.forEach(e=>{const i=e.type;t[i]||(t[i]=[]),t[i].push(e)}),t}initCrushNodeSelection(e,t,i,a){this.nodes=e,this.idTree=R.createIdTreeFromNodes(e),e.forEach(e=>{this.idTree[e.id]=e}),this.buckets=u.a.sortBy(e.filter(e=>e.children),"name"),this.controls={root:t,failure:i,device:a},this.preSelectRoot(),this.controls.root.valueChanges.subscribe(()=>this.onRootChange()),this.controls.failure.valueChanges.subscribe(()=>this.onFailureDomainChange()),this.controls.device.valueChanges.subscribe(()=>this.onDeviceChange())}preSelectRoot(){const e=this.nodes.find(e=>"root"===e.type);this.silentSet(this.controls.root,e),this.onRootChange()}silentSet(e,t){e.setValue(t,{emitEvent:!1})}onRootChange(){const e=R.getSubNodes(this.controls.root.value,this.idTree),t=R.getFailureDomains(e);Object.keys(t).forEach(e=>{t[e].length<=1&&delete t[e]}),this.failureDomains=t,this.failureDomainKeys=Object.keys(t).sort(),this.updateFailureDomain()}updateFailureDomain(){let e=this.getIncludedCustomValue(this.controls.failure,Object.keys(this.failureDomains));""===e&&(e=this.setMostCommonDomain(this.controls.failure)),this.updateDevices(e)}getIncludedCustomValue(e,t){return e.dirty&&t.includes(e.value)?e.value:""}setMostCommonDomain(e){let t={n:0,type:""};return Object.keys(this.failureDomains).forEach(e=>{const i=this.failureDomains[e].length;t.n<i&&(t={n:i,type:e})}),this.silentSet(e,t.type),t.type}onFailureDomainChange(){this.updateDevices()}updateDevices(e=this.controls.failure.value){const t=u.a.flatten(this.failureDomains[e].map(e=>R.getSubNodes(e,this.idTree)));this.allDevices=t.filter(e=>e.device_class).map(e=>e.device_class),this.devices=u.a.uniq(this.allDevices).sort();const i=1===this.devices.length?this.devices[0]:this.getIncludedCustomValue(this.controls.device,this.devices);this.silentSet(this.controls.device,i),this.onDeviceChange(i)}onDeviceChange(e=this.controls.device.value){this.deviceCount=""===e?this.allDevices.length:this.allDevices.filter(t=>t===e).length}}var y=i("0+/T"),z=i("a96k"),C=i("oxzT"),I=i("spCT"),N=i("QFaf"),_=i("1Ni5"),M=i("PhyI"),T=i("kvvV"),$=i("Fgil"),w=i("aexS"),D=i("aXbf"),E=i("JK/P"),k=i("kn/O"),P=i("2EZI"),x=i("ajRT"),A=i("NwgZ"),O=i("ocLN"),V=i("ANnk"),W=i("f69J"),F=i("IZUe"),L=i("p4Cf"),q=i("6+kj"),B=i("8xTl");function U(e,t){1&e&&(h.Sb(0,"span",30),h.Wb(1,31),h.Rb())}function G(e,t){1&e&&(h.Sb(0,"span",30),h.Wb(1,32),h.Rb())}function j(e,t){1&e&&(h.Sb(0,"span",30),h.Wb(1,33),h.Rb())}function Q(e,t){1&e&&(h.Sb(0,"option",26),h.Wb(1,34),h.Rb())}function J(e,t){if(1&e&&(h.Sb(0,"option",35),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("ngValue",e),h.yb(1),h.Qc(" ",e.name," ")}}function K(e,t){1&e&&(h.Sb(0,"span",30),h.Wb(1,36),h.Rb())}function Y(e,t){1&e&&(h.Sb(0,"option",26),h.Wb(1,37),h.Rb())}function H(e,t){if(1&e&&(h.Sb(0,"option",35),h.Oc(1),h.Rb()),2&e){const e=t.$implicit,i=h.ic();h.pc("ngValue",e),h.yb(1),h.Rc(" ",e," ( ",i.failureDomains[e].length," ) ")}}function X(e,t){1&e&&(h.Sb(0,"span",30),h.Wb(1,38),h.Rb())}function Z(e,t){if(1&e&&(h.Sb(0,"option",35),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("ngValue",e),h.yb(1),h.Qc(" ",e," ")}}let ee=(()=>{class e extends R{constructor(e,t,i,a,o){super(),this.formBuilder=e,this.activeModal=t,this.taskWrapper=i,this.crushRuleService=a,this.actionLabels=o,this.submitAction=new h.o,this.tooltips=this.crushRuleService.formTooltips,this.action=this.actionLabels.CREATE,this.resource="Crush Rule",this.createForm()}createForm(){this.form=this.formBuilder.group({name:["",[o.A.required,o.A.pattern("[A-Za-z0-9_-]+"),_.a.custom("uniqueName",e=>this.names&&-1!==this.names.indexOf(e))]],root:null,failure_domain:"",device_class:""})}ngOnInit(){this.crushRuleService.getInfo().subscribe(({names:e,nodes:t})=>{this.initCrushNodeSelection(t,this.form.get("root"),this.form.get("failure_domain"),this.form.get("device_class")),this.names=e})}onSubmit(){if(this.form.invalid)return void this.form.setErrors({cdSubmitButton:!0});const e=u.a.cloneDeep(this.form.value);e.root=e.root.name,""===e.device_class&&delete e.device_class,this.taskWrapper.wrapTaskAroundCall({task:new T.a("crushRule/create",e),call:this.crushRuleService.create(e)}).subscribe({error:()=>{this.form.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close(),this.submitAction.emit(e)}})}}return e.\u0275fac=function(t){return new(t||e)(h.Mb(P.a),h.Mb(c.a),h.Mb(k.a),h.Mb(g),h.Mb(n.b))},e.\u0275cmp=h.Gb({type:e,selectors:[["cd-crush-rule-form-modal"]],outputs:{submitAction:"submitAction"},features:[h.vb],decls:55,vars:27,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label"],"Name",[1,"required"],[1,"cd-col-form-input"],["type","text","id","name","name","name","placeholder","Name...","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","root",1,"cd-col-form-label"],"Root",[3,"html"],["id","root","name","root","formControlName","root",1,"form-control","custom-select"],["ngValue","",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],["for","failure_domain",1,"cd-col-form-label"],"Failure domain type",["id","failure_domain","name","failure_domain","formControlName","failure_domain",1,"form-control","custom-select"],["for","device_class",1,"cd-col-form-label"],"Device class",["id","device_class","name","device_class","formControlName","device_class",1,"form-control","custom-select"],["ngValue",""],"Let Ceph decide",[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required!","The name can only consist of alphanumeric characters, dashes and underscores.","The chosen erasure code profile name is already in use.","Loading...",[3,"ngValue"],"This field is required!","Loading...","This field is required!"]},template:function(e,t){if(1&e&&(h.Sb(0,"cd-modal",0),h.Qb(1,1),h.Wb(2,2),h.jc(3,"titlecase"),h.jc(4,"upperFirst"),h.Pb(),h.Qb(5,3),h.Sb(6,"form",4,5),h.Sb(8,"div",6),h.Sb(9,"div",7),h.Sb(10,"label",8),h.Qb(11),h.Wb(12,9),h.Pb(),h.Nb(13,"span",10),h.Rb(),h.Sb(14,"div",11),h.Nb(15,"input",12),h.Mc(16,U,2,0,"span",13),h.Mc(17,G,2,0,"span",13),h.Mc(18,j,2,0,"span",13),h.Rb(),h.Rb(),h.Sb(19,"div",7),h.Sb(20,"label",14),h.Qb(21),h.Wb(22,15),h.Pb(),h.Nb(23,"cd-helper",16),h.Nb(24,"span",10),h.Rb(),h.Sb(25,"div",11),h.Sb(26,"select",17),h.Mc(27,Q,2,0,"option",18),h.Mc(28,J,2,2,"option",19),h.Rb(),h.Mc(29,K,2,0,"span",13),h.Rb(),h.Rb(),h.Sb(30,"div",7),h.Sb(31,"label",20),h.Qb(32),h.Wb(33,21),h.Pb(),h.Nb(34,"cd-helper",16),h.Nb(35,"span",10),h.Rb(),h.Sb(36,"div",11),h.Sb(37,"select",22),h.Mc(38,Y,2,0,"option",18),h.Mc(39,H,2,3,"option",19),h.Rb(),h.Mc(40,X,2,0,"span",13),h.Rb(),h.Rb(),h.Sb(41,"div",7),h.Sb(42,"label",23),h.Qb(43),h.Wb(44,24),h.Pb(),h.Nb(45,"cd-helper",16),h.Rb(),h.Sb(46,"div",11),h.Sb(47,"select",25),h.Sb(48,"option",26),h.Wb(49,27),h.Rb(),h.Mc(50,Z,2,2,"option",19),h.Rb(),h.Rb(),h.Rb(),h.Rb(),h.Sb(51,"div",28),h.Sb(52,"cd-form-button-panel",29),h.gc("submitActionEvent",(function(){return t.onSubmit()})),h.jc(53,"titlecase"),h.jc(54,"upperFirst"),h.Rb(),h.Rb(),h.Rb(),h.Pb(),h.Rb()),2&e){const e=h.Ac(7);h.pc("modalRef",t.activeModal),h.yb(4),h.ac(h.kc(3,19,t.action))(h.kc(4,21,t.resource)),h.Xb(2),h.yb(2),h.pc("formGroup",t.form),h.yb(10),h.pc("ngIf",t.form.showError("name",e,"required")),h.yb(1),h.pc("ngIf",t.form.showError("name",e,"pattern")),h.yb(1),h.pc("ngIf",t.form.showError("name",e,"uniqueName")),h.yb(5),h.pc("html",t.tooltips.root),h.yb(4),h.pc("ngIf",!t.buckets),h.yb(1),h.pc("ngForOf",t.buckets),h.yb(1),h.pc("ngIf",t.form.showError("root",e,"required")),h.yb(5),h.pc("html",t.tooltips.failure_domain),h.yb(4),h.pc("ngIf",!t.failureDomains),h.yb(1),h.pc("ngForOf",t.failureDomainKeys),h.yb(1),h.pc("ngIf",t.form.showError("failure_domain",e,"required")),h.yb(5),h.pc("html",t.tooltips.device_class),h.yb(5),h.pc("ngForOf",t.devices),h.yb(2),h.pc("form",t.form)("submitText",h.kc(53,23,t.action)+" "+h.kc(54,25,t.resource))}},directives:[x.a,o.C,o.r,A.a,o.k,O.a,V.a,o.d,W.a,o.q,o.i,F.a,a.r,L.a,o.z,a.q,o.u,o.B,q.a],pipes:[a.A,B.a],styles:[""]}),e})();class te{}function ie(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,47),h.Rb())}function ae(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,48),h.Rb())}function oe(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,49),h.Rb())}function se(e,t){1&e&&(h.Sb(0,"option",37),h.Wb(1,50),h.Rb())}function ce(e,t){if(1&e&&(h.Sb(0,"option",51),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("ngValue",e),h.yb(1),h.Qc(" ",e," ")}}function ne(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,52),h.Rb())}function le(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,53),h.Rb())}function re(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,54),h.Rb())}function be(e,t){if(1&e&&(h.Sb(0,"span",46),h.Wb(1,55),h.Rb()),2&e){const e=h.ic();h.yb(1),h.ac(e.deviceCount),h.Xb(1)}}function de(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,56),h.Rb())}function ue(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,57),h.Rb())}function fe(e,t){if(1&e&&(h.Sb(0,"span",39),h.Wb(1,58),h.Rb()),2&e){const e=h.ic();h.yb(1),h.ac(e.lrcMultiK),h.Xb(1)}}function pe(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,59),h.Rb())}function he(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,60),h.Rb())}function me(e,t){if(1&e&&(h.Sb(0,"span",46),h.Wb(1,61),h.Rb()),2&e){const e=h.ic();h.yb(1),h.ac(e.deviceCount),h.Xb(1)}}function ge(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,65),h.Rb())}function Se(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,66),h.Rb())}function ve(e,t){if(1&e&&(h.Sb(0,"div",7),h.Sb(1,"label",62),h.Sb(2,"span",14),h.Wb(3,63),h.Rb(),h.Nb(4,"cd-helper",16),h.Rb(),h.Sb(5,"div",10),h.Nb(6,"input",64),h.Mc(7,ge,2,0,"span",12),h.Mc(8,Se,2,0,"span",12),h.Rb(),h.Rb()),2&e){const e=h.ic(),t=h.Ac(7);h.yb(4),h.pc("html",e.tooltips.plugins.shec.c),h.yb(3),h.pc("ngIf",e.form.showError("c",t,"min")),h.yb(1),h.pc("ngIf",e.form.showError("c",t,"cGreaterM"))}}function Re(e,t){1&e&&(h.Sb(0,"span",39),h.Wb(1,76),h.Rb())}function ye(e,t){if(1&e&&(h.Sb(0,"span",39),h.Wb(1,77),h.Rb()),2&e){const e=h.ic(3);h.yb(1),h.ac(e.getDMin())(e.getDMax()),h.Xb(1)}}function ze(e,t){if(1&e&&(h.Sb(0,"span",39),h.Wb(1,78),h.Rb()),2&e){const e=h.ic(3);h.yb(1),h.ac(e.getDMax()),h.Xb(1)}}function Ce(e,t){if(1&e&&(h.Qb(0),h.Mc(1,ye,2,2,"span",23),h.Mc(2,ze,2,1,"span",23),h.Pb()),2&e){const e=h.ic(2);h.yb(1),h.pc("ngIf",e.getDMin()<e.getDMax()),h.yb(1),h.pc("ngIf",e.getDMin()===e.getDMax())}}function Ie(e,t){if(1&e&&(h.Sb(0,"span",46),h.Wb(1,79),h.Rb()),2&e){const e=h.ic(2);h.yb(1),h.ac(e.getDMin()),h.Xb(1)}}function Ne(e,t){if(1&e&&(h.Sb(0,"span",46),h.Wb(1,80),h.Rb()),2&e){const e=h.ic(2);h.yb(1),h.ac(e.getDMax()),h.Xb(1)}}function _e(e,t){if(1&e){const e=h.Tb();h.Sb(0,"div",7),h.Sb(1,"label",67),h.Sb(2,"span",14),h.Wb(3,68),h.Rb(),h.Nb(4,"cd-helper",16),h.Rb(),h.Sb(5,"div",10),h.Sb(6,"div",69),h.Nb(7,"input",70),h.Sb(8,"span",71),h.Sb(9,"button",72),h.Yb(10,73),h.gc("click",(function(){return h.Dc(e),h.ic().toggleDCalc()})),h.Nb(11,"i",74),h.Rb(),h.Rb(),h.Rb(),h.Mc(12,Re,2,0,"span",23),h.Mc(13,Ce,3,2,"ng-container",75),h.Mc(14,Ie,2,1,"span",12),h.Mc(15,Ne,2,1,"span",12),h.Rb(),h.Rb()}if(2&e){const e=h.ic(),t=h.Ac(7);h.yb(4),h.pc("html",e.tooltips.plugins.clay.d),h.yb(7),h.pc("ngClass",e.dCalc?e.icons.unlock:e.icons.lock),h.yb(1),h.pc("ngIf",e.dCalc),h.yb(1),h.pc("ngIf",!e.dCalc),h.yb(1),h.pc("ngIf",e.form.showError("d",t,"dMin")),h.yb(1),h.pc("ngIf",e.form.showError("d",t,"dMax"))}}function Me(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,85),h.Rb())}function Te(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,86),h.Rb())}function $e(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,87),h.Rb())}function we(e,t){if(1&e&&(h.Sb(0,"div",7),h.Sb(1,"label",81),h.Sb(2,"span",14),h.Wb(3,82),h.Rb(),h.Nb(4,"cd-helper",16),h.Rb(),h.Sb(5,"div",10),h.Nb(6,"input",83),h.Mc(7,Me,2,0,"span",12),h.Mc(8,Te,2,0,"span",12),h.Mc(9,$e,2,0,"span",12),h.Sb(10,"span",39),h.Wb(11,84),h.Rb(),h.Rb(),h.Rb()),2&e){const e=h.ic(),t=h.Ac(7);h.yb(4),h.pc("html",e.tooltips.plugins.lrc.l),h.yb(3),h.pc("ngIf",e.form.showError("l",t,"required")),h.yb(1),h.pc("ngIf",e.form.showError("l",t,"min")),h.yb(1),h.pc("ngIf",e.form.showError("l",t,"unequal")),h.yb(2),h.ac(e.lrcGroups),h.Xb(11)}}function De(e,t){1&e&&(h.Sb(0,"option",37),h.Wb(1,88),h.Rb())}function Ee(e,t){if(1&e&&(h.Sb(0,"option",51),h.Oc(1),h.Rb()),2&e){const e=t.$implicit,i=h.ic();h.pc("ngValue",e),h.yb(1),h.Rc(" ",e," ( ",i.failureDomains[e].length," ) ")}}function ke(e,t){1&e&&(h.Sb(0,"option",37),h.Wb(1,92),h.Rb())}function Pe(e,t){1&e&&(h.Sb(0,"option",37),h.Wb(1,93),h.Rb())}function xe(e,t){if(1&e&&(h.Sb(0,"option",51),h.Oc(1),h.Rb()),2&e){const e=t.$implicit,i=h.ic(2);h.pc("ngValue",e),h.yb(1),h.Rc(" ",e," ( ",i.failureDomains[e].length," ) ")}}function Ae(e,t){if(1&e&&(h.Sb(0,"div",7),h.Sb(1,"label",89),h.Qb(2),h.Wb(3,90),h.Pb(),h.Nb(4,"cd-helper",16),h.Rb(),h.Sb(5,"div",10),h.Sb(6,"select",91),h.Mc(7,ke,2,0,"option",18),h.Mc(8,Pe,2,0,"option",18),h.Mc(9,xe,2,3,"option",19),h.Rb(),h.Rb(),h.Rb()),2&e){const e=h.ic();h.yb(4),h.pc("html",e.tooltips.plugins.lrc.crushLocality),h.yb(3),h.pc("ngIf",!e.failureDomains),h.yb(1),h.pc("ngIf",e.failureDomainKeys.length>0),h.yb(1),h.pc("ngForOf",e.failureDomainKeys)}}function Oe(e,t){if(1&e&&(h.Sb(0,"option",51),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("ngValue",e),h.yb(1),h.Qc(" ",e," ")}}const Ve=function(e,t,i){return[e,t,i]};function We(e,t){if(1&e&&(h.Sb(0,"div",7),h.Sb(1,"label",94),h.Qb(2),h.Wb(3,95),h.Pb(),h.Nb(4,"cd-helper",16),h.Rb(),h.Sb(5,"div",10),h.Sb(6,"select",96),h.Mc(7,Oe,2,2,"option",19),h.Rb(),h.Rb(),h.Rb()),2&e){const e=h.ic();h.yb(4),h.pc("html",e.tooltips.plugins.clay.scalar_mds),h.yb(3),h.pc("ngForOf",h.wc(2,Ve,e.PLUGIN.JERASURE,e.PLUGIN.ISA,e.PLUGIN.SHEC))}}function Fe(e,t){if(1&e&&(h.Sb(0,"option",51),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("ngValue",e),h.yb(1),h.Qc(" ",e," ")}}function Le(e,t){if(1&e&&(h.Sb(0,"div",7),h.Sb(1,"label",97),h.Qb(2),h.Wb(3,98),h.Pb(),h.Nb(4,"cd-helper",16),h.Rb(),h.Sb(5,"div",10),h.Sb(6,"select",99),h.Mc(7,Fe,2,2,"option",19),h.Rb(),h.Rb(),h.Rb()),2&e){const e=h.ic();h.yb(4),h.pc("html",e.tooltips.plugins[e.plugin].technique),h.yb(3),h.pc("ngForOf",e.techniques)}}function qe(e,t){1&e&&(h.Sb(0,"span",46),h.Wb(1,103),h.Rb())}function Be(e,t){if(1&e&&(h.Sb(0,"div",7),h.Sb(1,"label",100),h.Qb(2),h.Wb(3,101),h.Pb(),h.Nb(4,"cd-helper",16),h.Rb(),h.Sb(5,"div",10),h.Nb(6,"input",102),h.Mc(7,qe,2,0,"span",12),h.Rb(),h.Rb()),2&e){const e=h.ic(),t=h.Ac(7);h.yb(4),h.pc("html",e.tooltips.plugins.jerasure.packetSize),h.yb(3),h.pc("ngIf",e.form.showError("packetSize",t,"min"))}}function Ue(e,t){1&e&&(h.Sb(0,"option",37),h.Wb(1,104),h.Rb())}function Ge(e,t){if(1&e&&(h.Sb(0,"option",51),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("ngValue",e),h.yb(1),h.Qc(" ",e.name," ")}}function je(e,t){if(1&e&&(h.Sb(0,"option",51),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("ngValue",e),h.yb(1),h.Qc(" ",e," ")}}let Qe=(()=>{class e extends R{constructor(e,t,i,a,o){super(),this.formBuilder=e,this.activeModal=t,this.taskWrapper=i,this.ecpService=a,this.actionLabels=o,this.submitAction=new h.o,this.tooltips=this.ecpService.formTooltips,this.PLUGIN={LRC:"lrc",SHEC:"shec",CLAY:"clay",JERASURE:"jerasure",ISA:"isa"},this.plugin=this.PLUGIN.JERASURE,this.icons=C.a,this.action=this.actionLabels.CREATE,this.resource="EC Profile",this.createForm(),this.setJerasureDefaults()}createForm(){this.form=this.formBuilder.group({name:[null,[o.A.required,o.A.pattern("[A-Za-z0-9_-]+"),_.a.custom("uniqueName",e=>this.names&&-1!==this.names.indexOf(e))]],plugin:[this.PLUGIN.JERASURE,[o.A.required]],k:[4,[o.A.required,o.A.min(2),_.a.custom("max",()=>this.baseValueValidation(!0)),_.a.custom("unequal",e=>this.lrcDataValidation(e)),_.a.custom("kLowerM",e=>this.shecDataValidation(e))]],m:[2,[o.A.required,o.A.min(1),_.a.custom("max",()=>this.baseValueValidation())]],crushFailureDomain:"",crushRoot:null,crushDeviceClass:"",directory:"",technique:"reed_sol_van",packetSize:[2048,[o.A.min(1)]],l:[3,[o.A.required,o.A.min(1),_.a.custom("unequal",e=>this.lrcLocalityValidation(e))]],crushLocality:"",c:[2,[o.A.required,o.A.min(1),_.a.custom("cGreaterM",e=>this.shecDurabilityValidation(e))]],d:[5,[o.A.required,_.a.custom("dMin",e=>this.dMinValidation(e)),_.a.custom("dMax",e=>this.dMaxValidation(e))]],scalar_mds:[this.PLUGIN.JERASURE,[o.A.required]]}),this.toggleDCalc(),this.form.get("k").valueChanges.subscribe(()=>this.updateValidityOnChange(["m","l","d"])),this.form.get("m").valueChanges.subscribe(()=>this.updateValidityOnChange(["k","l","c","d"])),this.form.get("l").valueChanges.subscribe(()=>this.updateValidityOnChange(["k","m"])),this.form.get("plugin").valueChanges.subscribe(e=>this.onPluginChange(e)),this.form.get("scalar_mds").valueChanges.subscribe(()=>this.setClayDefaultsForScalar())}baseValueValidation(e=!1){return this.validValidation(()=>this.getKMSum()>this.deviceCount&&this.form.getValue("k")>this.form.getValue("m")===e)}validValidation(e,t){return!((!this.form||t)&&this.plugin!==t)&&e()}getKMSum(){return this.form.getValue("k")+this.form.getValue("m")}lrcDataValidation(e){return this.validValidation(()=>{const t=this.form.getValue("m"),i=this.form.getValue("l"),a=e+t;return this.lrcMultiK=e/(a/i),e%(a/i)!=0},"lrc")}shecDataValidation(e){return this.validValidation(()=>this.form.getValue("m")>e,"shec")}lrcLocalityValidation(e){return this.validValidation(()=>{const t=this.getKMSum();return this.lrcGroups=e>0?t/e:0,e>0&&t%e!=0},"lrc")}shecDurabilityValidation(e){return this.validValidation(()=>{const t=this.form.getValue("m");return e>t},"shec")}dMinValidation(e){return this.validValidation(()=>this.getDMin()>e,"clay")}getDMin(){return this.form.getValue("k")+1}dMaxValidation(e){return this.validValidation(()=>e>this.getDMax(),"clay")}getDMax(){const e=this.form.getValue("m");return this.form.getValue("k")+e-1}toggleDCalc(){this.dCalc=!this.dCalc,this.form.get("d")[this.dCalc?"disable":"enable"](),this.calculateD()}calculateD(){this.plugin===this.PLUGIN.CLAY&&this.dCalc&&this.form.silentSet("d",this.getDMax())}updateValidityOnChange(e){e.forEach(e=>{"d"===e&&this.calculateD(),this.form.get(e).updateValueAndValidity({emitEvent:!1})})}onPluginChange(e){this.plugin=e,e===this.PLUGIN.JERASURE?this.setJerasureDefaults():e===this.PLUGIN.LRC?this.setLrcDefaults():e===this.PLUGIN.ISA?this.setIsaDefaults():e===this.PLUGIN.SHEC?this.setShecDefaults():e===this.PLUGIN.CLAY&&this.setClayDefaults(),this.updateValidityOnChange(["m"])}setJerasureDefaults(){this.techniques=["reed_sol_van","reed_sol_r6_op","cauchy_orig","cauchy_good","liberation","blaum_roth","liber8tion"],this.setDefaults({k:4,m:2,technique:"reed_sol_van"})}setLrcDefaults(){this.setDefaults({k:4,m:2,l:3})}setIsaDefaults(){this.techniques=["reed_sol_van","cauchy"],this.setDefaults({k:7,m:3,technique:"reed_sol_van"})}setShecDefaults(){this.setDefaults({k:4,m:3,c:2})}setClayDefaults(){this.setDefaults({k:4,m:2,scalar_mds:this.PLUGIN.JERASURE}),this.setClayDefaultsForScalar()}setClayDefaultsForScalar(){const e=this.form.getValue("scalar_mds");let t="reed_sol_van";e===this.PLUGIN.JERASURE?this.techniques=["reed_sol_van","reed_sol_r6_op","cauchy_orig","cauchy_good","liber8tion"]:e===this.PLUGIN.ISA?this.techniques=["reed_sol_van","cauchy"]:(t="single",this.techniques=["single","multiple"]),this.setDefaults({technique:t})}setDefaults(e){Object.keys(e).forEach(t=>{const i=this.form.get(t),a=i.value;i.pristine||"technique"===t&&!this.techniques.includes(a)||"k"===t&&[4,7].includes(a)||"m"===t&&[2,3].includes(a)?i.setValue(e[t]):i.updateValueAndValidity()})}ngOnInit(){this.ecpService.getInfo().subscribe(({plugins:e,names:t,directory:i,nodes:a})=>{this.initCrushNodeSelection(a,this.form.get("crushRoot"),this.form.get("crushFailureDomain"),this.form.get("crushDeviceClass")),this.plugins=e,this.names=t,this.form.silentSet("directory",i),this.preValidateNumericInputFields()})}preValidateNumericInputFields(){const e=["k","m","l","c","d"].map(e=>this.form.get(e));e.forEach(e=>{e.markAsTouched(),e.markAsDirty()}),e[1].updateValueAndValidity()}onSubmit(){if(this.form.invalid)return void this.form.setErrors({cdSubmitButton:!0});const e=this.createJson();this.taskWrapper.wrapTaskAroundCall({task:new T.a("ecp/create",{name:e.name}),call:this.ecpService.create(e)}).subscribe({error:()=>{this.form.setErrors({cdSubmitButton:!0})},complete:()=>{this.activeModal.close(),this.submitAction.emit(e)}})}createJson(){const e={technique:[this.PLUGIN.ISA,this.PLUGIN.JERASURE,this.PLUGIN.CLAY],packetSize:[this.PLUGIN.JERASURE],l:[this.PLUGIN.LRC],crushLocality:[this.PLUGIN.LRC],c:[this.PLUGIN.SHEC],d:[this.PLUGIN.CLAY],scalar_mds:[this.PLUGIN.CLAY]},t=new te,i=this.form.getValue("plugin");return Object.keys(this.form.controls).filter(t=>{const a=e[t],o=this.form.getValue(t);return(a&&a.includes(i)||!a)&&o&&""!==o}).forEach(e=>{this.extendJson(e,t)}),t}extendJson(e,t){const i=this.form.getValue(e);t[{crushFailureDomain:"crush-failure-domain",crushRoot:"crush-root",crushDeviceClass:"crush-device-class",packetSize:"packetsize",crushLocality:"crush-locality"}[e]||e]="crushRoot"===e?i.name:i}}return e.\u0275fac=function(t){return new(t||e)(h.Mb(P.a),h.Mb(c.a),h.Mb(k.a),h.Mb(S),h.Mb(n.b))},e.\u0275cmp=h.Gb({type:e,selectors:[["cd-erasure-code-profile-form-modal"]],outputs:{submitAction:"submitAction"},features:[h.vb],decls:98,vars:53,consts:function(){return[[3,"modalRef"],[1,"modal-title"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label"],"Name",[1,"cd-col-form-input"],["type","text","id","name","name","name","placeholder","Name...","formControlName","name","autofocus","",1,"form-control"],["class","invalid-feedback",4,"ngIf"],["for","plugin",1,"cd-col-form-label"],[1,"required"],"Plugin",[3,"html"],["id","plugin","name","plugin","formControlName","plugin",1,"form-control","custom-select"],["ngValue","",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],["for","k",1,"cd-col-form-label"],"Data chunks (k)",["type","number","id","k","name","k","ng-model","$ctrl.erasureCodeProfile.k","placeholder","Data chunks...","formControlName","k",1,"form-control"],["class","form-text text-muted",4,"ngIf"],["for","m",1,"cd-col-form-label"],"Coding chunks (m)",["type","number","id","m","name","m","placeholder","Coding chunks...","formControlName","m",1,"form-control"],["class","form-group row",4,"ngIf"],["for","crushFailureDomain",1,"cd-col-form-label"],"Crush failure domain",["id","crushFailureDomain","name","crushFailureDomain","formControlName","crushFailureDomain",1,"form-control","custom-select"],["for","crushRoot",1,"cd-col-form-label"],"Crush root",["id","crushRoot","name","crushRoot","formControlName","crushRoot",1,"form-control","custom-select"],["for","crushDeviceClass",1,"cd-col-form-label"],"Crush device class",["id","crushDeviceClass","name","crushDeviceClass","formControlName","crushDeviceClass",1,"form-control","custom-select"],["ngValue",""],"Let Ceph decide",[1,"form-text","text-muted"],"Available OSDs: " + "\ufffd0\ufffd" + "",["for","directory",1,"cd-col-form-label"],"Directory",["type","text","id","directory","name","directory","placeholder","Path...","formControlName","directory",1,"form-control"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required!","The name can only consist of alphanumeric characters, dashes and underscores.","The chosen erasure code profile name is already in use.","Loading...",[3,"ngValue"],"This field is required!","This field is required!","Must be equal to or greater than 2.","Chunks (k+m) have exceeded the available OSDs of " + "\ufffd0\ufffd" + ".","For an equal distribution k has to be a multiple of (k+m)/l.","K has to be equal to or greater than m in order to recover data correctly through c.","Distribution factor: " + "\ufffd0\ufffd" + "","This field is required!","Must be equal to or greater than 1.","Chunks (k+m) have exceeded the available OSDs of " + "\ufffd0\ufffd" + ".",["for","c",1,"cd-col-form-label"],"Durability estimator (c)",["type","number","id","c","name","c","placeholder","Coding chunks...","formControlName","c",1,"form-control"],"Must be equal to or greater than 1.","C has to be equal to or lower than m as m defines the amount of chunks that can be used.",["for","d",1,"cd-col-form-label"],"Helper chunks (d)",[1,"input-group"],["type","number","id","d","name","d","placeholder","Helper chunks...","formControlName","d",1,"form-control"],[1,"input-group-append"],["id","d-calc-btn","type","button",1,"btn","btn-light",3,"click",6,"ngbTooltip"],["ngbTooltip","Set d manually or use the plugin's default calculation that maximizes d."],["aria-hidden","true",3,"ngClass"],[4,"ngIf"],"D is automatically updated on k and m changes","D can be set from " + "\ufffd0\ufffd" + " to " + "\ufffd1\ufffd" + "","D can only be set to " + "\ufffd0\ufffd" + "","D has to be greater than k (" + "\ufffd0\ufffd" + ").","D has to be lower than k + m (" + "\ufffd0\ufffd" + ").",["for","l",1,"cd-col-form-label"],"Locality (l)",["type","number","id","l","name","l","placeholder","Coding chunks...","formControlName","l",1,"form-control"],"Locality groups: " + "\ufffd0\ufffd" + "","This field is required!","Must be equal to or greater than 1.","Can't split up chunks (k+m) correctly with the current locality.","Loading...",["for","crushLocality",1,"cd-col-form-label"],"Crush Locality",["id","crushLocality","name","crushLocality","formControlName","crushLocality",1,"form-control","custom-select"],"Loading...","None",["for","scalar_mds",1,"cd-col-form-label"],"Scalar mds",["id","scalar_mds","name","scalar_mds","formControlName","scalar_mds",1,"form-control","custom-select"],["for","technique",1,"cd-col-form-label"],"Technique",["id","technique","name","technique","formControlName","technique",1,"form-control","custom-select"],["for","packetSize",1,"cd-col-form-label"],"Packetsize",["type","number","id","packetSize","name","packetSize","placeholder","Packetsize...","formControlName","packetSize",1,"form-control"],"Must be equal to or greater than 1.","Loading..."]},template:function(e,t){if(1&e&&(h.Sb(0,"cd-modal",0),h.Qb(1,1),h.Wb(2,2),h.jc(3,"titlecase"),h.jc(4,"upperFirst"),h.Pb(),h.Qb(5,3),h.Sb(6,"form",4,5),h.Sb(8,"div",6),h.Sb(9,"div",7),h.Sb(10,"label",8),h.Wb(11,9),h.Rb(),h.Sb(12,"div",10),h.Nb(13,"input",11),h.Mc(14,ie,2,0,"span",12),h.Mc(15,ae,2,0,"span",12),h.Mc(16,oe,2,0,"span",12),h.Rb(),h.Rb(),h.Sb(17,"div",7),h.Sb(18,"label",13),h.Sb(19,"span",14),h.Wb(20,15),h.Rb(),h.Nb(21,"cd-helper",16),h.Rb(),h.Sb(22,"div",10),h.Sb(23,"select",17),h.Mc(24,se,2,0,"option",18),h.Mc(25,ce,2,2,"option",19),h.Rb(),h.Mc(26,ne,2,0,"span",12),h.Rb(),h.Rb(),h.Sb(27,"div",7),h.Sb(28,"label",20),h.Sb(29,"span",14),h.Wb(30,21),h.Rb(),h.Nb(31,"cd-helper",16),h.Rb(),h.Sb(32,"div",10),h.Nb(33,"input",22),h.Mc(34,le,2,0,"span",12),h.Mc(35,re,2,0,"span",12),h.Mc(36,be,2,1,"span",12),h.Mc(37,de,2,0,"span",12),h.Mc(38,ue,2,0,"span",12),h.Mc(39,fe,2,1,"span",23),h.Rb(),h.Rb(),h.Sb(40,"div",7),h.Sb(41,"label",24),h.Sb(42,"span",14),h.Wb(43,25),h.Rb(),h.Nb(44,"cd-helper",16),h.Rb(),h.Sb(45,"div",10),h.Nb(46,"input",26),h.Mc(47,pe,2,0,"span",12),h.Mc(48,he,2,0,"span",12),h.Mc(49,me,2,1,"span",12),h.Rb(),h.Rb(),h.Mc(50,ve,9,3,"div",27),h.Mc(51,_e,16,6,"div",27),h.Mc(52,we,12,5,"div",27),h.Sb(53,"div",7),h.Sb(54,"label",28),h.Qb(55),h.Wb(56,29),h.Pb(),h.Nb(57,"cd-helper",16),h.Rb(),h.Sb(58,"div",10),h.Sb(59,"select",30),h.Mc(60,De,2,0,"option",18),h.Mc(61,Ee,2,3,"option",19),h.Rb(),h.Rb(),h.Rb(),h.Mc(62,Ae,10,4,"div",27),h.Mc(63,We,8,6,"div",27),h.Mc(64,Le,8,2,"div",27),h.Mc(65,Be,8,2,"div",27),h.Sb(66,"div",7),h.Sb(67,"label",31),h.Qb(68),h.Wb(69,32),h.Pb(),h.Nb(70,"cd-helper",16),h.Rb(),h.Sb(71,"div",10),h.Sb(72,"select",33),h.Mc(73,Ue,2,0,"option",18),h.Mc(74,Ge,2,2,"option",19),h.Rb(),h.Rb(),h.Rb(),h.Sb(75,"div",7),h.Sb(76,"label",34),h.Qb(77),h.Wb(78,35),h.Pb(),h.Nb(79,"cd-helper",16),h.Rb(),h.Sb(80,"div",10),h.Sb(81,"select",36),h.Sb(82,"option",37),h.Wb(83,38),h.Rb(),h.Mc(84,je,2,2,"option",19),h.Rb(),h.Sb(85,"span",39),h.Wb(86,40),h.Rb(),h.Rb(),h.Rb(),h.Sb(87,"div",7),h.Sb(88,"label",41),h.Qb(89),h.Wb(90,42),h.Pb(),h.Nb(91,"cd-helper",16),h.Rb(),h.Sb(92,"div",10),h.Nb(93,"input",43),h.Rb(),h.Rb(),h.Rb(),h.Sb(94,"div",44),h.Sb(95,"cd-form-button-panel",45),h.gc("submitActionEvent",(function(){return t.onSubmit()})),h.jc(96,"titlecase"),h.jc(97,"upperFirst"),h.Rb(),h.Rb(),h.Rb(),h.Pb(),h.Rb()),2&e){const e=h.Ac(7);h.pc("modalRef",t.activeModal),h.yb(4),h.ac(h.kc(3,41,t.action))(h.kc(4,43,t.resource)),h.Xb(2),h.yb(2),h.pc("formGroup",t.form),h.yb(8),h.pc("ngIf",t.form.showError("name",e,"required")),h.yb(1),h.pc("ngIf",t.form.showError("name",e,"pattern")),h.yb(1),h.pc("ngIf",t.form.showError("name",e,"uniqueName")),h.yb(5),h.pc("html",t.tooltips.plugins[t.plugin].description),h.yb(3),h.pc("ngIf",!t.plugins),h.yb(1),h.pc("ngForOf",t.plugins),h.yb(1),h.pc("ngIf",t.form.showError("name",e,"required")),h.yb(5),h.pc("html",t.tooltips.k),h.yb(3),h.pc("ngIf",t.form.showError("k",e,"required")),h.yb(1),h.pc("ngIf",t.form.showError("k",e,"min")),h.yb(1),h.pc("ngIf",t.form.showError("k",e,"max")),h.yb(1),h.pc("ngIf",t.form.showError("k",e,"unequal")),h.yb(1),h.pc("ngIf",t.form.showError("k",e,"kLowerM")),h.yb(1),h.pc("ngIf","lrc"===t.plugin),h.yb(5),h.pc("html",t.tooltips.m),h.yb(3),h.pc("ngIf",t.form.showError("m",e,"required")),h.yb(1),h.pc("ngIf",t.form.showError("m",e,"min")),h.yb(1),h.pc("ngIf",t.form.showError("m",e,"max")),h.yb(1),h.pc("ngIf","shec"===t.plugin),h.yb(1),h.pc("ngIf","clay"===t.plugin),h.yb(1),h.pc("ngIf",t.plugin===t.PLUGIN.LRC),h.yb(5),h.pc("html",t.tooltips.crushFailureDomain),h.yb(3),h.pc("ngIf",!t.failureDomains),h.yb(1),h.pc("ngForOf",t.failureDomainKeys),h.yb(1),h.pc("ngIf",t.plugin===t.PLUGIN.LRC),h.yb(1),h.pc("ngIf",t.PLUGIN.CLAY===t.plugin),h.yb(1),h.pc("ngIf",h.wc(49,Ve,t.PLUGIN.JERASURE,t.PLUGIN.ISA,t.PLUGIN.CLAY).includes(t.plugin)),h.yb(1),h.pc("ngIf",t.plugin===t.PLUGIN.JERASURE),h.yb(5),h.pc("html",t.tooltips.crushRoot),h.yb(3),h.pc("ngIf",!t.buckets),h.yb(1),h.pc("ngForOf",t.buckets),h.yb(5),h.pc("html",t.tooltips.crushDeviceClass),h.yb(5),h.pc("ngForOf",t.devices),h.yb(2),h.ac(t.deviceCount),h.Xb(86),h.yb(5),h.pc("html",t.tooltips.directory),h.yb(4),h.pc("form",t.form)("submitText",h.kc(96,45,t.action)+" "+h.kc(97,47,t.resource))}},directives:[x.a,o.C,o.r,A.a,o.k,O.a,V.a,o.d,W.a,o.q,o.i,F.a,a.r,L.a,o.z,a.q,o.v,o.u,o.B,q.a,c.D,a.p],pipes:[a.A,B.a],styles:[""]}),e})();var Je=i("DNAf");class Ke{constructor(){this.erasureInfo=!1,this.crushInfo=!1,this.pgs=1,this.poolTypes=["erasure","replicated"],this.applications={selected:[],default:["cephfs","rbd","rgw"],available:[],validators:[o.A.pattern("[A-Za-z0-9_]+"),o.A.maxLength(128)],messages:new Je.a({empty:"No applications added",selectionLimit:{text:"Applications limit reached",tooltip:"A pool can only have up to four applications definitions."},customValidations:{pattern:"Allowed characters '_a-zA-Z0-9'",maxlength:"Maximum length is 128 characters"},filter:"Filter or add applications'",add:"Add application"})}}}var Ye=i("zc8c"),He=i("ppaS"),Xe=i("EmSq"),Ze=i("rFfW"),et=i("6qls"),tt=i("FSuO");const it=["crushInfoTabs"],at=["crushDeletionBtn"],ot=["ecpInfoTabs"],st=["ecpDeletionBtn"];function ct(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,43),h.Rb())}function nt(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,44),h.Rb())}function lt(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,45),h.Rb())}function rt(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,46),h.Rb())}function bt(e,t){if(1&e&&(h.Sb(0,"option",47),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("value",e),h.yb(1),h.Qc(" ",e," ")}}function dt(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,48),h.Rb())}function ut(e,t){if(1&e&&(h.Sb(0,"option",47),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("value",e),h.yb(1),h.Qc(" ",e," ")}}function ft(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,60),h.Rb())}function pt(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,61),h.Rb())}function ht(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,62),h.Rb())}function mt(e,t){1&e&&(h.Sb(0,"span",56),h.Wb(1,63),h.Rb())}function gt(e,t){if(1&e){const e=h.Tb();h.Sb(0,"div",8),h.Sb(1,"label",53),h.Wb(2,54),h.Rb(),h.Sb(3,"div",11),h.Sb(4,"input",55),h.gc("focus",(function(){return h.Dc(e),h.ic(3).externalPgChange=!1}))("blur",(function(){return h.Dc(e),h.ic(3).alignPgs()})),h.Rb(),h.Mc(5,ft,2,0,"span",14),h.Mc(6,pt,2,0,"span",14),h.Mc(7,ht,2,0,"span",14),h.Sb(8,"span",56),h.Sb(9,"cd-doc",57),h.Yb(10,58),h.Rb(),h.Rb(),h.Mc(11,mt,2,0,"span",59),h.Rb(),h.Rb()}if(2&e){h.ic(2);const e=h.Ac(2),t=h.ic();h.yb(5),h.pc("ngIf",t.form.showError("pgNum",e,"required")),h.yb(1),h.pc("ngIf",t.form.showError("pgNum",e,"min")),h.yb(1),h.pc("ngIf",t.form.showError("pgNum",e,"34")),h.yb(4),h.pc("ngIf",t.externalPgChange)}}function St(e,t){if(1&e&&(h.Sb(0,"span",42),h.Sb(1,"ul",68),h.Sb(2,"li"),h.Wb(3,69),h.Rb(),h.Sb(4,"li"),h.Wb(5,70),h.Rb(),h.Rb(),h.Rb()),2&e){const e=h.ic(4);h.yb(3),h.ac(e.getMinSize()),h.Xb(3),h.yb(2),h.ac(e.getMaxSize()),h.Xb(5)}}function vt(e,t){if(1&e&&(h.Sb(0,"span",42),h.Wb(1,71),h.Rb()),2&e){const e=h.ic(4);h.yb(1),h.ac(e.getMinSize())(e.getMaxSize()),h.Xb(1)}}function Rt(e,t){1&e&&(h.Sb(0,"span",72),h.Wb(1,73),h.Rb())}function yt(e,t){if(1&e&&(h.Sb(0,"div",8),h.Sb(1,"label",64),h.Wb(2,65),h.Rb(),h.Sb(3,"div",11),h.Nb(4,"input",66),h.Mc(5,St,6,2,"span",14),h.Mc(6,vt,2,2,"span",14),h.Mc(7,Rt,2,0,"span",67),h.Rb(),h.Rb()),2&e){h.ic(2);const e=h.Ac(2),t=h.ic();h.yb(4),h.pc("max",t.getMaxSize())("min",t.getMinSize()),h.yb(1),h.pc("ngIf",t.form.showError("size",e)),h.yb(1),h.pc("ngIf",t.form.showError("size",e)),h.yb(1),h.pc("ngIf",1===t.form.getValue("size"))}}function zt(e,t){1&e&&(h.Sb(0,"div",8),h.Sb(1,"label",74),h.Wb(2,75),h.Rb(),h.Sb(3,"div",11),h.Sb(4,"div",76),h.Nb(5,"input",77),h.Sb(6,"label",78),h.Wb(7,79),h.Rb(),h.Rb(),h.Rb(),h.Rb())}function Ct(e,t){if(1&e&&(h.Sb(0,"div"),h.Sb(1,"div",8),h.Sb(2,"label",49),h.Wb(3,50),h.Rb(),h.Sb(4,"div",11),h.Sb(5,"select",51),h.Mc(6,ut,2,2,"option",20),h.Rb(),h.Rb(),h.Rb(),h.Mc(7,gt,12,4,"div",52),h.Mc(8,yt,8,5,"div",52),h.Mc(9,zt,8,0,"div",52),h.Rb()),2&e){const e=h.ic(2);h.yb(6),h.pc("ngForOf",e.pgAutoscaleModes),h.yb(1),h.pc("ngIf","on"!==e.form.getValue("pgAutoscaleMode")),h.yb(1),h.pc("ngIf",e.isReplicated),h.yb(1),h.pc("ngIf",e.info.is_all_bluestore&&e.isErasure)}}function It(e,t){1&e&&(h.Sb(0,"option",18),h.Wb(1,94),h.Rb())}function Nt(e,t){1&e&&(h.Sb(0,"option",95),h.Wb(1,96),h.Rb()),2&e&&h.pc("ngValue",null)}function _t(e,t){1&e&&(h.Sb(0,"option",95),h.Wb(1,97),h.Rb()),2&e&&h.pc("ngValue",null)}function Mt(e,t){if(1&e&&(h.Sb(0,"option",95),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("ngValue",e),h.yb(1),h.Qc(" ",e.name," ")}}const Tt=function(e){return[e]};function $t(e,t){if(1&e){const e=h.Tb();h.Sb(0,"button",98),h.gc("click",(function(){return h.Dc(e),h.ic(4).addErasureCodeProfile()})),h.Nb(1,"i",90),h.Rb()}if(2&e){const e=h.ic(4);h.yb(1),h.pc("ngClass",h.uc(1,Tt,e.icons.add))}}function wt(e,t){if(1&e){const e=h.Tb();h.Sb(0,"button",99,100),h.Yb(2,101),h.gc("click",(function(){return h.Dc(e),h.ic(4).deleteErasureCodeProfile()})),h.Nb(3,"i",90),h.Rb()}if(2&e){const e=h.ic(4);h.yb(3),h.pc("ngClass",h.uc(1,Tt,e.icons.trash))}}const Dt=function(){return["name"]};function Et(e,t){if(1&e&&h.Nb(0,"cd-table-key-value",112),2&e){const e=h.ic(5);h.pc("renderObjects",!0)("hideKeys",h.tc(4,Dt))("data",e.form.getValue("erasureProfile"))("autoReload",!1)}}function kt(e,t){1&e&&(h.Sb(0,"span"),h.Wb(1,115),h.Rb())}function Pt(e,t){if(1&e&&(h.Sb(0,"li"),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.yb(1),h.Qc(" ",e," ")}}function xt(e,t){if(1&e&&(h.Sb(0,"ul"),h.Mc(1,Pt,2,1,"li",116),h.Rb()),2&e){const e=h.ic(6);h.yb(1),h.pc("ngForOf",e.ecpUsage)}}function At(e,t){if(1&e&&(h.Mc(0,kt,2,0,"ng-template",null,113,h.Nc),h.Mc(2,xt,2,1,"ul",114)),2&e){const e=h.Ac(1),t=h.ic(5);h.yb(2),h.pc("ngIf",t.ecpUsage)("ngIfElse",e)}}function Ot(e,t){if(1&e&&(h.Sb(0,"span",102),h.Sb(1,"ul",103,104),h.Sb(3,"li",105),h.Sb(4,"a",106),h.Wb(5,107),h.Rb(),h.Mc(6,Et,1,5,"ng-template",108),h.Rb(),h.Sb(7,"li",109),h.Sb(8,"a",106),h.Wb(9,110),h.Rb(),h.Mc(10,At,3,2,"ng-template",108),h.Rb(),h.Rb(),h.Nb(11,"div",111),h.Rb()),2&e){const e=h.Ac(2);h.yb(11),h.pc("ngbNavOutlet",e)}}const Vt=function(e){return{active:e}};function Wt(e,t){if(1&e){const e=h.Tb();h.Sb(0,"div",8),h.Sb(1,"label",81),h.Wb(2,82),h.Rb(),h.Sb(3,"div",11),h.Sb(4,"div",83),h.Sb(5,"select",84),h.Mc(6,It,2,0,"option",85),h.Mc(7,Nt,2,1,"option",86),h.Mc(8,_t,2,1,"option",86),h.Mc(9,Mt,2,2,"option",87),h.Rb(),h.Sb(10,"span",88),h.Sb(11,"button",89),h.gc("click",(function(){h.Dc(e);const t=h.ic(3);return t.data.erasureInfo=!t.data.erasureInfo})),h.Nb(12,"i",90),h.Rb(),h.Mc(13,$t,2,3,"button",91),h.Mc(14,wt,4,3,"button",92),h.Rb(),h.Rb(),h.Mc(15,Ot,12,1,"span",93),h.Rb(),h.Rb()}if(2&e){const e=h.ic(3);h.yb(6),h.pc("ngIf",!e.ecProfiles),h.yb(1),h.pc("ngIf",e.ecProfiles&&0===e.ecProfiles.length),h.yb(1),h.pc("ngIf",e.ecProfiles&&e.ecProfiles.length>0),h.yb(1),h.pc("ngForOf",e.ecProfiles),h.yb(2),h.pc("ngClass",h.uc(9,Vt,e.data.erasureInfo)),h.yb(1),h.pc("ngClass",h.uc(11,Tt,e.icons.questionCircle)),h.yb(1),h.pc("ngIf",!e.editing),h.yb(1),h.pc("ngIf",!e.editing),h.yb(1),h.pc("ngIf",e.data.erasureInfo&&e.form.getValue("erasureProfile"))}}function Ft(e,t){1&e&&(h.Sb(0,"div",8),h.Sb(1,"label",117),h.Wb(2,118),h.Rb(),h.Sb(3,"div",11),h.Sb(4,"span",56),h.Wb(5,119),h.Rb(),h.Rb(),h.Rb())}function Lt(e,t){1&e&&(h.Sb(0,"span",56),h.Sb(1,"span"),h.Wb(2,122),h.Rb(),h.Oc(3,"\xa0 "),h.Rb())}function qt(e,t){if(1&e&&(h.Sb(0,"option",95),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("ngValue",e),h.yb(1),h.Qc(" ",e.rule_name," ")}}function Bt(e,t){if(1&e){const e=h.Tb();h.Sb(0,"button",98),h.gc("click",(function(){return h.Dc(e),h.ic(5).addCrushRule()})),h.Nb(1,"i",90),h.Rb()}if(2&e){const e=h.ic(5);h.yb(1),h.pc("ngClass",h.uc(1,Tt,e.icons.add))}}function Ut(e,t){if(1&e){const e=h.Tb();h.Sb(0,"button",99,128),h.Yb(2,129),h.gc("click",(function(){return h.Dc(e),h.ic(5).deleteCrushRule()})),h.Nb(3,"i",90),h.Rb()}if(2&e){const e=h.ic(5);h.yb(3),h.pc("ngClass",h.uc(1,Tt,e.icons.trash))}}const Gt=function(){return["steps","ruleset","type","rule_name"]};function jt(e,t){if(1&e&&h.Nb(0,"cd-table-key-value",112),2&e){const e=h.ic(6);h.pc("renderObjects",!1)("hideKeys",h.tc(4,Gt))("data",e.form.getValue("crushRule"))("autoReload",!1)}}function Qt(e,t){if(1&e&&(h.Sb(0,"li"),h.Oc(1),h.Rb()),2&e){const e=t.$implicit,i=h.ic(7);h.yb(1),h.Qc(" ",i.describeCrushStep(e)," ")}}function Jt(e,t){if(1&e&&(h.Sb(0,"ol"),h.Mc(1,Qt,2,1,"li",116),h.Rb()),2&e){const e=h.ic(6);h.yb(1),h.pc("ngForOf",e.form.get("crushRule").value.steps)}}function Kt(e,t){1&e&&(h.Sb(0,"span"),h.Wb(1,138),h.Rb())}function Yt(e,t){if(1&e&&(h.Sb(0,"li"),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.yb(1),h.Qc(" ",e," ")}}function Ht(e,t){if(1&e&&(h.Sb(0,"ul"),h.Mc(1,Yt,2,1,"li",116),h.Rb()),2&e){const e=h.ic(7);h.yb(1),h.pc("ngForOf",e.crushUsage)}}function Xt(e,t){if(1&e&&(h.Mc(0,Kt,2,0,"ng-template",null,137,h.Nc),h.Mc(2,Ht,2,1,"ul",114)),2&e){const e=h.Ac(1),t=h.ic(6);h.yb(2),h.pc("ngIf",t.crushUsage)("ngIfElse",e)}}function Zt(e,t){if(1&e&&(h.Sb(0,"div",130),h.Sb(1,"ul",103,131),h.Sb(3,"li",132),h.Sb(4,"a",106),h.Wb(5,133),h.Rb(),h.Mc(6,jt,1,5,"ng-template",108),h.Rb(),h.Sb(7,"li",134),h.Sb(8,"a",106),h.Wb(9,135),h.Rb(),h.Mc(10,Jt,2,1,"ng-template",108),h.Rb(),h.Sb(11,"li",109),h.Sb(12,"a",106),h.Wb(13,136),h.Rb(),h.Mc(14,Xt,3,2,"ng-template",108),h.Rb(),h.Rb(),h.Nb(15,"div",111),h.Rb()),2&e){const e=h.Ac(2);h.yb(15),h.pc("ngbNavOutlet",e)}}function ei(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,139),h.Rb())}function ti(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,140),h.Rb())}function ii(e,t){if(1&e){const e=h.Tb();h.Sb(0,"div"),h.Sb(1,"div",83),h.Sb(2,"select",123),h.Sb(3,"option",95),h.Wb(4,124),h.Rb(),h.Mc(5,qt,2,2,"option",87),h.Rb(),h.Sb(6,"span",88),h.Sb(7,"button",125),h.Yb(8,126),h.gc("click",(function(){h.Dc(e);const t=h.ic(4);return t.data.crushInfo=!t.data.crushInfo})),h.Nb(9,"i",90),h.Rb(),h.Mc(10,Bt,2,3,"button",91),h.Mc(11,Ut,4,3,"button",92),h.Rb(),h.Rb(),h.Mc(12,Zt,16,1,"div",127),h.Mc(13,ei,2,0,"span",14),h.Mc(14,ti,2,0,"span",14),h.Rb()}if(2&e){h.ic(3);const e=h.Ac(2),t=h.ic();h.yb(3),h.pc("ngValue",null),h.yb(2),h.pc("ngForOf",t.current.rules),h.yb(2),h.pc("ngClass",h.uc(9,Vt,t.data.crushInfo)),h.yb(2),h.pc("ngClass",h.uc(11,Tt,t.icons.questionCircle)),h.yb(1),h.pc("ngIf",t.isReplicated&&!t.editing),h.yb(1),h.pc("ngIf",t.isReplicated&&!t.editing),h.yb(1),h.pc("ngIf",t.data.crushInfo&&t.form.getValue("crushRule")),h.yb(1),h.pc("ngIf",t.form.showError("crushRule",e,"required")),h.yb(1),h.pc("ngIf",t.form.showError("crushRule",e,"tooFewOsds"))}}function ai(e,t){if(1&e&&(h.Sb(0,"div",8),h.Sb(1,"label",117),h.Wb(2,120),h.Rb(),h.Sb(3,"div",11),h.Mc(4,Lt,4,0,"ng-template",null,121,h.Nc),h.Mc(6,ii,15,13,"div",114),h.Rb(),h.Rb()),2&e){const e=h.Ac(5),t=h.ic(3);h.yb(6),h.pc("ngIf",t.current.rules.length>0)("ngIfElse",e)}}function oi(e,t){if(1&e&&(h.Sb(0,"div"),h.Sb(1,"legend"),h.Wb(2,80),h.Rb(),h.Mc(3,Wt,16,13,"div",52),h.Mc(4,Ft,6,0,"div",52),h.Mc(5,ai,7,2,"div",52),h.Rb()),2&e){const e=h.ic(2);h.yb(3),h.pc("ngIf",e.isErasure),h.yb(1),h.pc("ngIf",e.isErasure&&!e.editing),h.yb(1),h.pc("ngIf",e.isReplicated||e.editing)}}function si(e,t){if(1&e&&(h.Sb(0,"option",47),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("value",e),h.yb(1),h.Qc(" ",e," ")}}function ci(e,t){1&e&&(h.Sb(0,"option",18),h.Wb(1,161),h.Rb())}function ni(e,t){1&e&&(h.Sb(0,"option",18),h.Wb(1,162),h.Rb())}function li(e,t){if(1&e&&(h.Sb(0,"option",47),h.Oc(1),h.Rb()),2&e){const e=t.$implicit;h.pc("value",e),h.yb(1),h.Qc(" ",e," ")}}function ri(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,163),h.Rb())}function bi(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,164),h.Rb())}function di(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,165),h.Rb())}function ui(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,166),h.Rb())}function fi(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,167),h.Rb())}function pi(e,t){if(1&e&&(h.Sb(0,"div"),h.Sb(1,"div",8),h.Sb(2,"label",146),h.Wb(3,147),h.Rb(),h.Sb(4,"div",11),h.Sb(5,"select",148),h.Mc(6,ci,2,0,"option",85),h.Mc(7,ni,2,0,"option",85),h.Mc(8,li,2,2,"option",20),h.Rb(),h.Rb(),h.Rb(),h.Sb(9,"div",8),h.Sb(10,"label",149),h.Wb(11,150),h.Rb(),h.Sb(12,"div",11),h.Sb(13,"input",151),h.Yb(14,152),h.Rb(),h.Mc(15,ri,2,0,"span",14),h.Mc(16,bi,2,0,"span",14),h.Rb(),h.Rb(),h.Sb(17,"div",8),h.Sb(18,"label",153),h.Wb(19,154),h.Rb(),h.Sb(20,"div",11),h.Sb(21,"input",155),h.Yb(22,156),h.Rb(),h.Mc(23,di,2,0,"span",14),h.Mc(24,ui,2,0,"span",14),h.Rb(),h.Rb(),h.Sb(25,"div",8),h.Sb(26,"label",157),h.Wb(27,158),h.Rb(),h.Sb(28,"div",11),h.Sb(29,"input",159),h.Yb(30,160),h.Rb(),h.Mc(31,fi,2,0,"span",14),h.Rb(),h.Rb(),h.Rb()),2&e){h.ic(2);const e=h.Ac(2),t=h.ic();h.yb(6),h.pc("ngIf",!t.info.compression_algorithms),h.yb(1),h.pc("ngIf",t.info.compression_algorithms&&0===t.info.compression_algorithms.length),h.yb(1),h.pc("ngForOf",t.info.compression_algorithms),h.yb(7),h.pc("ngIf",t.form.showError("minBlobSize",e,"min")),h.yb(1),h.pc("ngIf",t.form.showError("minBlobSize",e,"maximum")),h.yb(7),h.pc("ngIf",t.form.showError("maxBlobSize",e,"min")),h.yb(1),h.pc("ngIf",t.form.showError("maxBlobSize",e,"minimum")),h.yb(7),h.pc("ngIf",t.form.showError("ratio",e,"min")||t.form.showError("ratio",e,"max"))}}function hi(e,t){if(1&e&&(h.Sb(0,"div",141),h.Sb(1,"legend"),h.Wb(2,142),h.Rb(),h.Sb(3,"div",8),h.Sb(4,"label",143),h.Wb(5,144),h.Rb(),h.Sb(6,"div",11),h.Sb(7,"select",145),h.Mc(8,si,2,2,"option",20),h.Rb(),h.Rb(),h.Rb(),h.Mc(9,pi,32,8,"div",21),h.Rb()),2&e){const e=h.ic(2);h.yb(8),h.pc("ngForOf",e.info.compression_modes),h.yb(1),h.pc("ngIf",e.hasCompressionEnabled())}}function mi(e,t){1&e&&(h.Sb(0,"span",42),h.Wb(1,168),h.Rb())}function gi(e,t){if(1&e){const e=h.Tb();h.Sb(0,"div",1),h.Sb(1,"form",2,3),h.Sb(3,"div",4),h.Sb(4,"div",5),h.Wb(5,6),h.jc(6,"titlecase"),h.jc(7,"upperFirst"),h.Rb(),h.Sb(8,"div",7),h.Sb(9,"div",8),h.Sb(10,"label",9),h.Wb(11,10),h.Rb(),h.Sb(12,"div",11),h.Sb(13,"input",12),h.Yb(14,13),h.Rb(),h.Mc(15,ct,2,0,"span",14),h.Mc(16,nt,2,0,"span",14),h.Mc(17,lt,2,0,"span",14),h.Mc(18,rt,2,0,"span",14),h.Rb(),h.Rb(),h.Sb(19,"div",8),h.Sb(20,"label",15),h.Wb(21,16),h.Rb(),h.Sb(22,"div",11),h.Sb(23,"select",17),h.Sb(24,"option",18),h.Wb(25,19),h.Rb(),h.Mc(26,bt,2,2,"option",20),h.Rb(),h.Mc(27,dt,2,0,"span",14),h.Rb(),h.Rb(),h.Mc(28,Ct,10,4,"div",21),h.Sb(29,"div",8),h.Sb(30,"label",22),h.Wb(31,23),h.Rb(),h.Sb(32,"div",11),h.Sb(33,"cd-select-badges",24),h.gc("selection",(function(){return h.Dc(e),h.ic().appSelection()})),h.Rb(),h.Rb(),h.Rb(),h.Mc(34,oi,6,3,"div",21),h.Mc(35,hi,10,2,"div",25),h.Sb(36,"div"),h.Sb(37,"legend"),h.Wb(38,26),h.Rb(),h.Sb(39,"div",8),h.Sb(40,"label",27),h.Qb(41),h.Wb(42,28),h.Pb(),h.Sb(43,"cd-helper"),h.Sb(44,"span"),h.Wb(45,29),h.Rb(),h.Nb(46,"br"),h.Sb(47,"span"),h.Wb(48,30),h.Rb(),h.Rb(),h.Rb(),h.Sb(49,"div",11),h.Sb(50,"input",31),h.Yb(51,32),h.Rb(),h.Rb(),h.Rb(),h.Sb(52,"div",8),h.Sb(53,"label",33),h.Qb(54),h.Wb(55,34),h.Pb(),h.Sb(56,"cd-helper"),h.Sb(57,"span"),h.Wb(58,35),h.Rb(),h.Nb(59,"br"),h.Sb(60,"span"),h.Wb(61,36),h.Rb(),h.Rb(),h.Rb(),h.Sb(62,"div",11),h.Nb(63,"input",37),h.Mc(64,mi,2,0,"span",14),h.Rb(),h.Rb(),h.Rb(),h.Sb(65,"div",38),h.Sb(66,"cd-rbd-configuration-form",39),h.gc("changes",(function(t){return h.Dc(e),h.ic().currentConfigurationValues=t()})),h.Rb(),h.Rb(),h.Rb(),h.Sb(67,"div",40),h.Sb(68,"cd-form-button-panel",41),h.gc("submitActionEvent",(function(){return h.Dc(e),h.ic().submit()})),h.jc(69,"titlecase"),h.jc(70,"upperFirst"),h.Rb(),h.Rb(),h.Rb(),h.Rb(),h.Rb()}if(2&e){const e=h.Ac(2),t=h.ic();h.yb(1),h.pc("formGroup",t.form),h.yb(6),h.ac(h.kc(6,24,t.action))(h.kc(7,26,t.resource)),h.Xb(5),h.yb(8),h.pc("ngIf",t.form.showError("name",e,"required")),h.yb(1),h.pc("ngIf",t.form.showError("name",e,"uniqueName")),h.yb(1),h.pc("ngIf",t.form.showError("name",e,"rbdPool")),h.yb(1),h.pc("ngIf",t.form.showError("name",e,"pattern")),h.yb(8),h.pc("ngForOf",t.data.poolTypes),h.yb(1),h.pc("ngIf",t.form.showError("poolType",e,"required")),h.yb(1),h.pc("ngIf",t.isReplicated||t.isErasure),h.yb(5),h.pc("customBadges",!0)("customBadgeValidators",t.data.applications.validators)("messages",t.data.applications.messages)("data",t.data.applications.selected)("options",t.data.applications.available)("selectionLimit",4),h.yb(1),h.pc("ngIf",t.isErasure||t.isReplicated),h.yb(1),h.pc("ngIf",t.info.is_all_bluestore),h.yb(29),h.pc("ngIf",t.form.showError("max_objects",e,"min")),h.yb(1),h.pc("hidden",t.isErasure||-1===t.data.applications.selected.indexOf("rbd")),h.yb(1),h.pc("form",t.form)("initializeData",t.initializeConfigData),h.yb(2),h.pc("form",t.form)("submitText",h.kc(69,28,t.action)+" "+h.kc(70,30,t.resource))}}let Si=(()=>{class e extends I.a{constructor(e,t,i,a,o,s,c,l,r,b,d){super(),this.dimlessBinaryPipe=e,this.route=t,this.router=i,this.modalService=a,this.poolService=o,this.authStorageService=s,this.formatter=c,this.taskWrapper=l,this.ecpService=r,this.crushRuleService=b,this.actionLabels=d,this.editing=!1,this.isReplicated=!1,this.isErasure=!1,this.data=new Ke,this.externalPgChange=!1,this.current={rules:[]},this.initializeConfigData=new f.a(1),this.currentConfigurationValues={},this.icons=C.a,this.crushUsage=void 0,this.ecpUsage=void 0,this.editing=this.router.url.startsWith("/pool/"+n.e.EDIT),this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE,this.resource="pool",this.authenticate(),this.createForm()}authenticate(){if(this.permission=this.authStorageService.getPermissions().pool,!this.permission.read||!this.permission.update&&this.editing||!this.permission.create&&!this.editing)throw new p.b}createForm(){const e=new N.a({mode:new o.h("none"),algorithm:new o.h(""),minBlobSize:new o.h("",{updateOn:"blur"}),maxBlobSize:new o.h("",{updateOn:"blur"}),ratio:new o.h("",{updateOn:"blur"})});this.form=new N.a({name:new o.h("",{validators:[o.A.pattern(/^[.A-Za-z0-9_/-]+$/),o.A.required,_.a.custom("rbdPool",()=>this.form&&this.form.getValue("name").includes("/")&&this.data&&-1!==this.data.applications.selected.indexOf("rbd"))]}),poolType:new o.h("",{validators:[o.A.required]}),crushRule:new o.h(null,{validators:[_.a.custom("tooFewOsds",e=>this.info&&e&&this.info.osd_count<e.min_size),_.a.custom("required",e=>this.isReplicated&&this.info.crush_rules_replicated.length>0&&!e)]}),size:new o.h("",{updateOn:"blur"}),erasureProfile:new o.h(null),pgNum:new o.h("",{validators:[o.A.required,o.A.min(1)]}),pgAutoscaleMode:new o.h(null),ecOverwrites:new o.h(!1),compression:e,max_bytes:new o.h(""),max_objects:new o.h(0,{validators:[o.A.min(0)]})},[_.a.custom("form",()=>null)])}ngOnInit(){this.poolService.getInfo().subscribe(e=>{this.initInfo(e),this.editing?this.initEditMode():(this.setAvailableApps(),this.loadingReady()),this.listenToChanges(),this.setComplexValidators()})}initInfo(e){this.pgAutoscaleModes=e.pg_autoscale_modes,this.form.silentSet("pgAutoscaleMode",e.pg_autoscale_default_mode),this.form.silentSet("algorithm",e.bluestore_compression_algorithm),this.info=e,this.initEcp(e.erasure_code_profiles)}initEcp(e){this.setListControlStatus("erasureProfile",e),this.ecProfiles=e}setListControlStatus(e,t){const i=this.form.get(e),a=i.value;1!==t.length||a&&u.a.isEqual(a,t[0])?0===t.length&&a&&i.setValue(null):i.setValue(t[0]),t.length<=1?i.enabled&&i.disable():i.disabled&&i.enable()}initEditMode(){this.disableForEdit(),this.routeParamsSubscribe=this.route.params.subscribe(e=>this.poolService.get(e.name).subscribe(e=>{this.data.pool=e,this.initEditFormData(e),this.loadingReady()}))}disableForEdit(){["poolType","crushRule","size","erasureProfile","ecOverwrites"].forEach(e=>this.form.get(e).disable())}initEditFormData(e){this.initializeConfigData.next({initialData:e.configuration,sourceType:M.a.pool}),this.poolTypeChange(e.type);const t=this.info.crush_rules_replicated.concat(this.info.crush_rules_erasure),i={name:e.pool_name,poolType:e.type,crushRule:t.find(t=>t.rule_name===e.crush_rule),size:e.size,erasureProfile:this.ecProfiles.find(t=>t.name===e.erasure_code_profile),pgAutoscaleMode:e.pg_autoscale_mode,pgNum:e.pg_num,ecOverwrites:e.flags_names.includes("ec_overwrites"),mode:e.options.compression_mode,algorithm:e.options.compression_algorithm,minBlobSize:this.dimlessBinaryPipe.transform(e.options.compression_min_blob_size),maxBlobSize:this.dimlessBinaryPipe.transform(e.options.compression_max_blob_size),ratio:e.options.compression_required_ratio,max_bytes:this.dimlessBinaryPipe.transform(e.quota_max_bytes),max_objects:e.quota_max_objects};Object.keys(i).forEach(e=>{const t=i[e];u.a.isUndefined(t)||""===t||this.form.silentSet(e,t)}),this.data.pgs=this.form.getValue("pgNum"),this.setAvailableApps(this.data.applications.default.concat(e.application_metadata)),this.data.applications.selected=e.application_metadata}setAvailableApps(e=this.data.applications.default){this.data.applications.available=u.a.uniq(e.sort()).map(e=>new z.a(!1,e,""))}listenToChanges(){this.listenToChangesDuringAddEdit(),this.editing||this.listenToChangesDuringAdd()}listenToChangesDuringAddEdit(){this.form.get("pgNum").valueChanges.subscribe(e=>{const t=e-this.data.pgs;1===Math.abs(t)&&2!==e?this.doPgPowerJump(t):this.data.pgs=e})}doPgPowerJump(e){const t=this.calculatePgPower()+e;this.setPgs(-1===e?Math.round(t):Math.floor(t))}calculatePgPower(e=this.form.getValue("pgNum")){return Math.log(e)/Math.log(2)}setPgs(e){const t=Math.pow(2,e<0?0:e);this.data.pgs=t,this.form.silentSet("pgNum",t)}listenToChangesDuringAdd(){this.form.get("poolType").valueChanges.subscribe(e=>{this.poolTypeChange(e)}),this.form.get("crushRule").valueChanges.subscribe(e=>{this.crushDeletionBtn&&this.crushDeletionBtn.isOpen()&&this.crushDeletionBtn.close(),e&&(this.setCorrectMaxSize(e),this.crushRuleIsUsedBy(e.rule_name),this.replicatedRuleChange(),this.pgCalc())}),this.form.get("size").valueChanges.subscribe(()=>{this.pgCalc()}),this.form.get("erasureProfile").valueChanges.subscribe(e=>{this.ecpDeletionBtn&&this.ecpDeletionBtn.isOpen()&&this.ecpDeletionBtn.close(),e&&(this.ecpIsUsedBy(e.name),this.pgCalc())}),this.form.get("mode").valueChanges.subscribe(()=>{["minBlobSize","maxBlobSize","ratio"].forEach(e=>{this.form.get(e).updateValueAndValidity({emitEvent:!1})})}),this.form.get("minBlobSize").valueChanges.subscribe(()=>{this.form.get("maxBlobSize").updateValueAndValidity({emitEvent:!1})}),this.form.get("maxBlobSize").valueChanges.subscribe(()=>{this.form.get("minBlobSize").updateValueAndValidity({emitEvent:!1})})}poolTypeChange(e){if("replicated"===e?this.setTypeBooleans(!0,!1):this.setTypeBooleans(!1,"erasure"===e),!e||!this.info)return void(this.current.rules=[]);const t=this.info["crush_rules_"+e]||[];this.current.rules=t,this.editing||(this.isReplicated&&this.setListControlStatus("crushRule",t),this.replicatedRuleChange(),this.pgCalc())}setTypeBooleans(e,t){this.isReplicated=e,this.isErasure=t}replicatedRuleChange(){if(!this.isReplicated)return;const e=this.form.get("size");let t=this.form.getValue("size")||3;const i=this.getMinSize(),a=this.getMaxSize();t<i?t=i:t>a&&(t=a),t!==e.value&&this.form.silentSet("size",t)}getMinSize(){if(!this.info||this.info.osd_count<1)return 0;const e=this.form.getValue("crushRule");return e?e.min_size:1}getMaxSize(){const e=this.form.getValue("crushRule");return this.info?e?e.usable_size:Math.min(this.info.osd_count,3):0}pgCalc(){const e=this.form.getValue("poolType");if(!this.info||this.form.get("pgNum").dirty||!e)return;const t=100*this.info.osd_count,i=this.isReplicated?this.replicatedPgCalc(t):this.erasurePgCalc(t);if(!i)return;const a=this.data.pgs;this.alignPgs(i),this.externalPgChange||(this.externalPgChange=a!==this.data.pgs)}setCorrectMaxSize(e=this.form.getValue("crushRule")){if(!e)return;const t=R.searchFailureDomains(this.info.nodes,e.steps[0].item_name)[e.steps[1].type];e.usable_size=Math.min(t?t.length:e.max_size,e.max_size)}replicatedPgCalc(e){const t=this.form.get("size"),i=t.value;return t.valid&&i>0?e/i:0}erasurePgCalc(e){const t=this.form.get("erasureProfile"),i=t.value;return(t.valid||t.disabled)&&i?e/(i.k+i.m):0}alignPgs(e=this.form.getValue("pgNum")){this.setPgs(Math.round(this.calculatePgPower(e<1?1:e)))}setComplexValidators(){this.editing?this.form.get("name").setValidators([this.form.get("name").validator,_.a.custom("uniqueName",e=>this.data.pool&&this.info&&-1!==this.info.pool_names.indexOf(e)&&this.info.pool_names.indexOf(e)!==this.info.pool_names.indexOf(this.data.pool.pool_name))]):(_.a.validateIf(this.form.get("size"),()=>this.isReplicated,[_.a.custom("min",e=>this.form.getValue("size")&&e<this.getMinSize()),_.a.custom("max",e=>this.form.getValue("size")&&this.getMaxSize()<e)]),this.form.get("name").setValidators([this.form.get("name").validator,_.a.custom("uniqueName",e=>this.info&&-1!==this.info.pool_names.indexOf(e))])),this.setCompressionValidators()}setCompressionValidators(){_.a.validateIf(this.form.get("minBlobSize"),()=>this.hasCompressionEnabled(),[o.A.min(0),_.a.custom("maximum",e=>this.oddBlobSize(e,this.form.getValue("maxBlobSize")))]),_.a.validateIf(this.form.get("maxBlobSize"),()=>this.hasCompressionEnabled(),[o.A.min(0),_.a.custom("minimum",e=>this.oddBlobSize(this.form.getValue("minBlobSize"),e))]),_.a.validateIf(this.form.get("ratio"),()=>this.hasCompressionEnabled(),[o.A.min(0),o.A.max(1)])}oddBlobSize(e,t){const i=this.formatter.toBytes(e),a=this.formatter.toBytes(t);return Boolean(i&&a&&i>=a)}hasCompressionEnabled(){return this.form.getValue("mode")&&"none"!==this.form.get("mode").value.toLowerCase()}describeCrushStep(e){return[e.op.replace("_"," "),e.item_name||"",e.type?e.num+" type "+e.type:""].join(" ")}addErasureCodeProfile(){this.addModal(Qe,e=>this.reloadECPs(e))}addModal(e,t){this.hideOpenTooltips(),this.modalService.show(e).componentInstance.submitAction.subscribe(e=>{t(e.name)})}hideOpenTooltips(){const e=e=>e&&e.isOpen()&&e.close();e(this.ecpDeletionBtn),e(this.crushDeletionBtn)}reloadECPs(e){this.reloadList({newItemName:e,getInfo:()=>this.ecpService.list(),initInfo:e=>this.initEcp(e),findNewItem:()=>this.ecProfiles.find(t=>t.name===e),controlName:"erasureProfile"})}reloadList({newItemName:e,getInfo:t,initInfo:i,findNewItem:a,controlName:o}){this.modalSubscription&&this.modalSubscription.unsubscribe(),t().subscribe(t=>{if(i(t),!e)return;const s=a();s&&this.form.get(o).setValue(s)})}deleteErasureCodeProfile(){this.deletionModal({value:this.form.getValue("erasureProfile"),usage:this.ecpUsage,deletionBtn:this.ecpDeletionBtn,dataName:"erasureInfo",getTabs:()=>this.ecpInfoTabs,tabPosition:"used-by-pools",nameAttribute:"name",itemDescription:"erasure code profile",reloadFn:()=>this.reloadECPs(),deleteFn:e=>this.ecpService.delete(e),taskName:"ecp/delete"})}deletionModal({value:e,usage:t,deletionBtn:i,dataName:a,getTabs:o,tabPosition:s,nameAttribute:c,itemDescription:n,reloadFn:l,deleteFn:r,taskName:b}){if(!e)return;if(t)return i.toggle(),this.data[a]=!0,void setTimeout(()=>{const e=o();e&&e.select(s)},50);const d=e[c];this.modalService.show(y.a,{itemDescription:n,itemNames:[d],submitActionObservable:()=>{const e=r(d);return e.subscribe(()=>l()),this.taskWrapper.wrapTaskAroundCall({task:new T.a(b,{name:d}),call:e})}})}addCrushRule(){this.addModal(ee,e=>this.reloadCrushRules(e))}reloadCrushRules(e){this.reloadList({newItemName:e,getInfo:()=>this.poolService.getInfo(),initInfo:e=>{this.initInfo(e),this.poolTypeChange("replicated")},findNewItem:()=>this.info.crush_rules_replicated.find(t=>t.rule_name===e),controlName:"crushRule"})}deleteCrushRule(){this.deletionModal({value:this.form.getValue("crushRule"),usage:this.crushUsage,deletionBtn:this.crushDeletionBtn,dataName:"crushInfo",getTabs:()=>this.crushInfoTabs,tabPosition:"used-by-pools",nameAttribute:"rule_name",itemDescription:"crush rule",reloadFn:()=>this.reloadCrushRules(),deleteFn:e=>this.crushRuleService.delete(e),taskName:"crushRule/delete"})}crushRuleIsUsedBy(e){this.crushUsage=e?this.info.used_rules[e]:void 0}ecpIsUsedBy(e){this.ecpUsage=e?this.info.used_profiles[e]:void 0}submit(){if(this.form.invalid)return void this.form.setErrors({cdSubmitButton:!0});const e={pool:this.form.getValue("name")};this.assignFormFields(e,[{externalFieldName:"pool_type",formControlName:"poolType"},{externalFieldName:"pg_autoscale_mode",formControlName:"pgAutoscaleMode",editable:!0},{externalFieldName:"pg_num",formControlName:"pgNum",replaceFn:e=>"on"===this.form.getValue("pgAutoscaleMode")?1:e,editable:!0},this.isReplicated?{externalFieldName:"size",formControlName:"size"}:{externalFieldName:"erasure_code_profile",formControlName:"erasureProfile",attr:"name"},{externalFieldName:"rule_name",formControlName:"crushRule",replaceFn:e=>this.isReplicated?e&&e.rule_name:void 0},{externalFieldName:"quota_max_bytes",formControlName:"max_bytes",replaceFn:this.formatter.toBytes,editable:!0,resetValue:this.editing?0:void 0},{externalFieldName:"quota_max_objects",formControlName:"max_objects",editable:!0,resetValue:this.editing?0:void 0}]),this.info.is_all_bluestore&&(this.assignFormField(e,{externalFieldName:"flags",formControlName:"ecOverwrites",replaceFn:()=>this.isErasure?["ec_overwrites"]:void 0}),"none"!==this.form.getValue("mode")?this.assignFormFields(e,[{externalFieldName:"compression_mode",formControlName:"mode",editable:!0,replaceFn:e=>this.hasCompressionEnabled()&&e},{externalFieldName:"compression_algorithm",formControlName:"algorithm",editable:!0},{externalFieldName:"compression_min_blob_size",formControlName:"minBlobSize",replaceFn:this.formatter.toBytes,editable:!0,resetValue:0},{externalFieldName:"compression_max_blob_size",formControlName:"maxBlobSize",replaceFn:this.formatter.toBytes,editable:!0,resetValue:0},{externalFieldName:"compression_required_ratio",formControlName:"ratio",editable:!0,resetValue:0}]):this.editing&&this.assignFormFields(e,[{externalFieldName:"compression_mode",formControlName:"mode",editable:!0,replaceFn:()=>"unset"},{externalFieldName:"srcpool",formControlName:"name",editable:!0,replaceFn:()=>this.data.pool.pool_name}]));const t=this.data.applications.selected;(t.length>0||this.editing)&&(e.application_metadata=t),this.isReplicated&&!u.a.isEmpty(this.currentConfigurationValues)&&(e.configuration=this.currentConfigurationValues),this.triggerApiTask(e)}assignFormFields(e,t){t.forEach(t=>this.assignFormField(e,t))}assignFormField(e,{externalFieldName:t,formControlName:i,attr:a,replaceFn:o,editable:s,resetValue:c}){if(this.editing&&(!s||this.form.get(i).pristine))return;const n=this.form.getValue(i);let l=o?o(n):a?u.a.get(n,a):n;if(!n||!l){if(!s||u.a.isUndefined(c))return;l=c}e[t]=l}triggerApiTask(e){this.taskWrapper.wrapTaskAroundCall({task:new T.a("pool/"+(this.editing?n.e.EDIT:n.e.CREATE),{pool_name:e.hasOwnProperty("srcpool")?e.srcpool:e.pool}),call:this.poolService[this.editing?n.e.UPDATE:n.e.CREATE](e)}).subscribe({error:e=>{u.a.isObject(e.error)&&"34"===e.error.code&&this.form.get("pgNum").setErrors({34:!0}),this.form.setErrors({cdSubmitButton:!0})},complete:()=>this.router.navigate(["/pool"])})}appSelection(){this.form.get("name").updateValueAndValidity({emitEvent:!1,onlySelf:!0})}}return e.\u0275fac=function(t){return new(t||e)(h.Mb($.a),h.Mb(s.a),h.Mb(s.e),h.Mb(E.a),h.Mb(v.a),h.Mb(w.a),h.Mb(D.a),h.Mb(k.a),h.Mb(S),h.Mb(g),h.Mb(n.b))},e.\u0275cmp=h.Gb({type:e,selectors:[["cd-pool-form"]],viewQuery:function(e,t){var i;1&e&&(h.Tc(it,!0),h.Tc(at,!0),h.Tc(ot,!0),h.Tc(st,!0)),2&e&&(h.zc(i=h.hc())&&(t.crushInfoTabs=i.first),h.zc(i=h.hc())&&(t.crushDeletionBtn=i.first),h.zc(i=h.hc())&&(t.ecpInfoTabs=i.first),h.zc(i=h.hc())&&(t.ecpDeletionBtn=i.first))},features:[h.vb],decls:1,vars:1,consts:function(){return[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","form","novalidate","",3,"formGroup"],["formDir","ngForm"],[1,"card"],[1,"card-header"],"" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",[1,"card-body"],[1,"form-group","row"],["for","name",1,"cd-col-form-label","required"],"Name",[1,"cd-col-form-input"],["id","name","name","name","type","text","formControlName","name","autofocus","",1,"form-control",6,"placeholder"],["placeholder","Name..."],["class","invalid-feedback",4,"ngIf"],["for","poolType",1,"cd-col-form-label","required"],"Pool type",["id","poolType","formControlName","poolType","name","poolType",1,"form-control","custom-select"],["ngValue",""],"-- Select a pool type --",[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["for","applications",1,"cd-col-form-label"],"Applications",["id","applications",3,"customBadges","customBadgeValidators","messages","data","options","selectionLimit","selection"],["formGroupName","compression",4,"ngIf"],"Quotas",["for","max_bytes",1,"cd-col-form-label"],"Max bytes","Leave it blank or specify 0 to disable this quota.","A valid quota should be greater than 0.",["id","max_bytes","name","max_bytes","type","text","formControlName","max_bytes","defaultUnit","GiB","cdDimlessBinary","",1,"form-control",6,"placeholder"],["placeholder","e.g., 10GiB"],["for","max_objects",1,"cd-col-form-label"],"Max objects","Leave it blank or specify 0 to disable this quota.","A valid quota should be greater than 0.",["id","max_objects","min","0","name","max_objects","type","number","formControlName","max_objects",1,"form-control"],[3,"hidden"],[3,"form","initializeData","changes"],[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],"This field is required!","The chosen Ceph pool name is already in use.","It's not possible to create an RBD pool with '/' in the name. Please change the name or remove 'rbd' from the applications list.","Pool name can only contain letters, numbers, '.', '-', '_' or '/'.",[3,"value"],"This field is required!",["for","pgAutoscaleMode",1,"cd-col-form-label"],"PG Autoscale",["id","pgAutoscaleMode","name","pgAutoscaleMode","formControlName","pgAutoscaleMode",1,"form-control","custom-select"],["class","form-group row",4,"ngIf"],["for","pgNum",1,"cd-col-form-label","required"],"Placement groups",["id","pgNum","name","pgNum","formControlName","pgNum","min","1","type","number","required","",1,"form-control",3,"focus","blur"],[1,"form-text","text-muted"],["section","pgs",6,"docText"],["docText","Calculation help"],["class","form-text text-muted",4,"ngIf"],"This field is required!","At least one placement group is needed!","Your cluster can't handle this many PGs. Please recalculate the PG amount needed.","The current PGs settings were calculated for you, you should make sure the values suit your needs before submit.",["for","size",1,"cd-col-form-label","required"],"Replicated size",["id","size","name","size","type","number","formControlName","size",1,"form-control",3,"max","min"],["class","text-warning-dark",4,"ngIf"],[1,"list-inline"],"Minimum: " + "\ufffd0\ufffd" + "","Maximum: " + "\ufffd0\ufffd" + "","The size specified is out of range. A value from " + "\ufffd0\ufffd" + " to " + "\ufffd1\ufffd" + " is usable.",[1,"text-warning-dark"],"A size of 1 will not create a replication of the object. The 'Replicated size' includes the object itself.",[1,"cd-col-form-label"],"Flags",[1,"custom-control","custom-checkbox"],["type","checkbox","id","ec-overwrites","formControlName","ecOverwrites",1,"custom-control-input"],["for","ec-overwrites",1,"custom-control-label"],"EC Overwrites","CRUSH",["for","erasureProfile",1,"cd-col-form-label"],"Erasure code profile",[1,"input-group"],["id","erasureProfile","name","erasureProfile","formControlName","erasureProfile",1,"form-control","custom-select"],["ngValue","",4,"ngIf"],[3,"ngValue",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"input-group-append"],["id","ecp-info-button","type","button",1,"btn","btn-light",3,"ngClass","click"],["aria-hidden","true",3,"ngClass"],["class","btn btn-light","type","button",3,"click",4,"ngIf"],["class","btn btn-light","type","button","triggers","manual",3,"click",4,"ngIf",6,"ngbTooltip"],["class","form-text text-muted","id","ecp-info-block",4,"ngIf"],"Loading...",[3,"ngValue"],"-- No erasure code profile available --","-- Select an erasure code profile --",["type","button",1,"btn","btn-light",3,"click"],["type","button","triggers","manual",1,"btn","btn-light",3,"click",6,"ngbTooltip"],["ecpDeletionBtn","ngbTooltip"],["ngbTooltip","This profile can't be deleted as it is in use."],["id","ecp-info-block",1,"form-text","text-muted"],["ngbNav","",1,"nav-tabs"],["ecpInfoTabs","ngbNav"],["ngbNavItem","ecp-info"],["ngbNavLink",""],"Profile",["ngbNavContent",""],["ngbNavItem","used-by-pools"],"Used by pools",[3,"ngbNavOutlet"],[3,"renderObjects","hideKeys","data","autoReload"],["ecpIsNotUsed",""],[4,"ngIf","ngIfElse"],"Profile is not in use.",[4,"ngFor","ngForOf"],["for","crushRule",1,"cd-col-form-label"],"Crush ruleset","A new crush ruleset will be implicitly created.","Crush ruleset",["noRules",""],"There are no rules.",["id","crushRule","formControlName","crushRule","name","crushSet",1,"form-control","custom-select"],"-- Select a crush rule --",["id","crush-info-button","type","button",1,"btn","btn-light",3,"ngClass","click",6,"ngbTooltip"],["ngbTooltip","Placement and\n replication strategies or distribution policies that allow to\n specify how CRUSH places data replicas."],["class","form-text text-muted","id","crush-info-block",4,"ngIf"],["crushDeletionBtn","ngbTooltip"],["ngbTooltip","This rule can't be deleted as it is in use."],["id","crush-info-block",1,"form-text","text-muted"],["crushInfoTabs","ngbNav"],["ngbNavItem","crush-rule-info"],"Crush rule",["ngbNavItem","crush-rule-steps"],"Crush steps","Used by pools",["ruleIsNotUsed",""],"Rule is not in use.","This field is required!","The rule can't be used in the current cluster as it has too few OSDs to meet the minimum required OSD by this rule.",["formGroupName","compression"],"Compression",["for","mode",1,"cd-col-form-label"],"Mode",["id","mode","name","mode","formControlName","mode",1,"form-control","custom-select"],["for","algorithm",1,"cd-col-form-label"],"Algorithm",["id","algorithm","name","algorithm","formControlName","algorithm",1,"form-control","custom-select"],["for","minBlobSize",1,"cd-col-form-label"],"Minimum blob size",["id","minBlobSize","name","minBlobSize","formControlName","minBlobSize","type","text","min","0","defaultUnit","KiB","cdDimlessBinary","",1,"form-control",6,"placeholder"],["placeholder","e.g., 128KiB"],["for","maxBlobSize",1,"cd-col-form-label"],"Maximum blob size",["id","maxBlobSize","type","text","min","0","formControlName","maxBlobSize","defaultUnit","KiB","cdDimlessBinary","",1,"form-control",6,"placeholder"],["placeholder","e.g., 512KiB"],["for","ratio",1,"cd-col-form-label"],"Ratio",["id","ratio","name","ratio","formControlName","ratio","type","number","min","0","max","1","step","0.1",1,"form-control",6,"placeholder"],["placeholder","Compression ratio"],"Loading...","-- No erasure compression algorithm available --","Value should be greater than 0","Value should be less than the maximum blob size","Value should be greater than 0","Value should be greater than the minimum blob size","Value should be between 0.0 and 1.0","The value should be greater or equal to 0"]},template:function(e,t){1&e&&h.Mc(0,gi,71,32,"div",0),2&e&&h.pc("cdFormLoading",t.loading)},directives:[Ye.a,o.C,o.r,A.a,o.k,O.a,V.a,o.d,W.a,o.q,o.i,F.a,a.r,o.z,o.u,o.B,a.q,He.a,L.a,Xe.a,o.v,Ze.a,q.a,o.y,et.a,o.b,a.p,c.D,c.p,c.r,c.s,c.q,c.u,tt.a,o.l],pipes:[a.A,B.a],styles:[""]}),e})();var vi=i("5+tZ"),Ri=i("d+Og"),yi=i("MuvH"),zi=i("+fVR"),Ci=i("VxPD"),Ii=i("uIqm"),Ni=i("x38r"),_i=i("yJti"),Mi=i("vCyI"),Ti=i("o4+5"),$i=i("VTlA"),wi=i("EgGo");class Di{constructor(e){this.pool_name=e}}var Ei=i("S7zO"),ki=i("nQ07"),Pi=(i("jKX/"),i("JP8w")),xi=i("insk"),Ai=i("aAWM");function Oi(e,t){if(1&e&&h.Nb(0,"cd-table-key-value",12),2&e){const e=h.ic(2);h.pc("renderObjects",!0)("data",e.poolDetails)("autoReload",!1)}}function Vi(e,t){if(1&e&&h.Nb(0,"cd-grafana",15),2&e){const e=h.ic(3);h.rc("grafanaPath","ceph-pool-detail?var-pool_name=",e.selection.pool_name,"")}}function Wi(e,t){1&e&&(h.Sb(0,"li",13),h.Sb(1,"a",5),h.Wb(2,14),h.Rb(),h.Mc(3,Vi,1,1,"ng-template",7),h.Rb())}function Fi(e,t){if(1&e&&h.Nb(0,"cd-rbd-configuration-table",18),2&e){const e=h.ic(3);h.pc("data",e.selectedPoolConfiguration)}}function Li(e,t){1&e&&(h.Sb(0,"li",16),h.Sb(1,"a",5),h.Wb(2,17),h.Rb(),h.Mc(3,Fi,1,1,"ng-template",7),h.Rb())}function qi(e,t){if(1&e&&h.Nb(0,"cd-table",21),2&e){const e=h.ic(3);h.pc("data",e.cacheTiers)("columns",e.cacheTierColumns)("autoSave",!1)}}function Bi(e,t){1&e&&(h.Sb(0,"li",19),h.Sb(1,"a",5),h.Wb(2,20),h.Rb(),h.Mc(3,qi,1,3,"ng-template",7),h.Rb())}function Ui(e,t){if(1&e&&(h.Qb(0,1),h.Sb(1,"ul",2,3),h.Sb(3,"li",4),h.Sb(4,"a",5),h.Wb(5,6),h.Rb(),h.Mc(6,Oi,1,3,"ng-template",7),h.Rb(),h.Mc(7,Wi,4,0,"li",8),h.Mc(8,Li,4,0,"li",9),h.Mc(9,Bi,4,0,"li",10),h.Rb(),h.Nb(10,"div",11),h.Pb()),2&e){const e=h.Ac(2),t=h.ic();h.yb(7),h.pc("ngIf",t.permissions.grafana.read),h.yb(1),h.pc("ngIf","replicated"===t.selection.type),h.yb(1),h.pc("ngIf",(null==t.selection.tiers?null:t.selection.tiers.length)>0),h.yb(1),h.pc("ngbNavOutlet",e)}}let Gi=(()=>{class e{constructor(e){this.poolService=e,this.cacheTierColumns=[],this.omittedPoolAttributes=["cdExecuting","cdIsBinary","stats"],this.cacheTierColumns=[{prop:"pool_name",name:"Name",flexGrow:3},{prop:"cache_mode",name:"Cache Mode",flexGrow:2},{prop:"cache_min_evict_age",name:"Min Evict Age",flexGrow:2},{prop:"cache_min_flush_age",name:"Min Flush Age",flexGrow:2},{prop:"target_max_bytes",name:"Target Max Bytes",flexGrow:2},{prop:"target_max_objects",name:"Target Max Objects",flexGrow:2}]}ngOnChanges(){this.selection&&(this.poolService.getConfiguration(this.selection.pool_name).subscribe(e=>{ki.a.updateChanged(this,{selectedPoolConfiguration:e})}),ki.a.updateChanged(this,{poolDetails:u.a.omit(this.selection,this.omittedPoolAttributes)}))}}return e.\u0275fac=function(t){return new(t||e)(h.Mb(v.a))},e.\u0275cmp=h.Gb({type:e,selectors:[["cd-pool-details"]],inputs:{cacheTiers:"cacheTiers",permissions:"permissions",selection:"selection"},features:[h.wb],decls:1,vars:1,consts:function(){return[["cdTableDetail","",4,"ngIf"],["cdTableDetail",""],["ngbNav","","cdStatefulTab","pool-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],"Details",["ngbNavContent",""],["ngbNavItem","performance-details",4,"ngIf"],["ngbNavItem","configuration",4,"ngIf"],["ngbNavItem","cache-tiers-details",4,"ngIf"],[3,"ngbNavOutlet"],[3,"renderObjects","data","autoReload"],["ngbNavItem","performance-details"],"Performance Details",["uid","-xyV8KCiz","grafanaStyle","three",3,"grafanaPath"],["ngbNavItem","configuration"],"Configuration",[3,"data"],["ngbNavItem","cache-tiers-details"],"Cache Tiers Details",["columnMode","flex",3,"data","columns","autoSave"]]},template:function(e,t){1&e&&h.Mc(0,Ui,11,4,"ng-container",0),2&e&&h.pc("ngIf",t.selection)},directives:[a.r,c.p,Pi.a,c.r,c.s,c.q,c.u,tt.a,xi.a,Ai.a,Ii.a],styles:[""],changeDetection:0}),e})();var ji=i("GgAd");const Qi=["poolUsageTpl"],Ji=["poolConfigurationSourceTpl"];function Ki(e,t){if(1&e){const e=h.Tb();h.Sb(0,"cd-table",9,10),h.gc("fetchData",(function(){return h.Dc(e),h.ic().taskListService.fetch()}))("setExpandedRow",(function(t){return h.Dc(e),h.ic().setExpandedRow(t)}))("updateSelection",(function(t){return h.Dc(e),h.ic().updateSelection(t)})),h.Nb(2,"cd-table-actions",11),h.Nb(3,"cd-pool-details",12),h.Rb()}if(2&e){const e=h.ic();h.pc("data",e.pools)("columns",e.columns)("hasDetails",!0)("status",e.tableStatus)("autoReload",-1),h.yb(2),h.pc("permission",e.permissions.pool)("selection",e.selection)("tableActions",e.tableActions),h.yb(1),h.pc("selection",e.expandedRow)("permissions",e.permissions)("cacheTiers",e.cacheTiers)}}function Yi(e,t){1&e&&h.Nb(0,"cd-grafana",14),2&e&&h.pc("grafanaPath","ceph-pools-overview?")}function Hi(e,t){1&e&&(h.Sb(0,"li",2),h.Sb(1,"a",3),h.Wb(2,13),h.Rb(),h.Mc(3,Yi,1,1,"ng-template",5),h.Rb())}function Xi(e,t){if(1&e&&h.Nb(0,"cd-usage-bar",16),2&e){const e=h.ic().row;h.pc("total",e.stats.bytes_used.latest+e.stats.avail_raw.latest)("used",e.stats.bytes_used.latest)}}function Zi(e,t){if(1&e&&h.Mc(0,Xi,1,2,"cd-usage-bar",15),2&e){const e=t.row;h.pc("ngIf",null==e.stats||null==e.stats.avail_raw?null:e.stats.avail_raw.latest)}}let ea=(()=>{class e extends zi.a{constructor(e,t,i,a,o,s,c,n,l,r,b){super(),this.poolService=e,this.taskWrapper=t,this.ecpService=i,this.authStorageService=a,this.taskListService=o,this.modalService=s,this.pgCategoryService=c,this.dimlessPipe=n,this.urlBuilder=l,this.configurationService=r,this.actionLabels=b,this.selection=new Mi.a,this.executingTasks=[],this.tableStatus=new Ci.a,this.cacheTiers=[],this.monAllowPoolDelete=!1,this.permissions=this.authStorageService.getPermissions(),this.tableActions=[{permission:"create",icon:C.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE},{permission:"update",icon:C.a.edit,routerLink:()=>this.urlBuilder.getEdit(encodeURIComponent(this.selection.first().pool_name)),name:this.actionLabels.EDIT},{permission:"delete",icon:C.a.destroy,click:()=>this.deletePoolModal(),name:this.actionLabels.DELETE,disable:this.getDisableDesc.bind(this)}],this.permissions.configOpt.read&&this.configurationService.get("mon_allow_pool_delete").subscribe(e=>{if(u.a.has(e,"value")){const t=u.a.find(e.value,e=>"mon"===e.section)||{value:!1};this.monAllowPoolDelete="true"===t.value}})}ngOnInit(){const e=(e,t,i)=>u.a.get(t,e)>u.a.get(i,e)?1:-1;this.columns=[{prop:"pool_name",name:"Name",flexGrow:4,cellTransformation:Ni.a.executing},{prop:"data_protection",name:"Data Protection",cellTransformation:Ni.a.badge,customTemplateConfig:{class:"badge-background-gray"},flexGrow:1.3},{prop:"application_metadata",name:"Applications",cellTransformation:Ni.a.badge,customTemplateConfig:{class:"badge-background-primary"},flexGrow:1.5},{prop:"pg_status",name:"PG Status",flexGrow:1.2,cellClass:({row:e,column:t,value:i})=>this.getPgStatusCellClass(e,t,i)},{prop:"crush_rule",name:"Crush Ruleset",isHidden:!0,flexGrow:2},{name:"Usage",prop:"usage",cellTemplate:this.poolUsageTpl,flexGrow:1.2},{prop:"stats.rd_bytes.rates",name:"Read bytes",comparator:(t,i,a,o)=>e("stats.rd_bytes.latest",a,o),cellTransformation:Ni.a.sparkline,flexGrow:1.5},{prop:"stats.wr_bytes.rates",name:"Write bytes",comparator:(t,i,a,o)=>e("stats.wr_bytes.latest",a,o),cellTransformation:Ni.a.sparkline,flexGrow:1.5},{prop:"stats.rd.rate",name:"Read ops",flexGrow:1,pipe:this.dimlessPipe,cellTransformation:Ni.a.perSecond},{prop:"stats.wr.rate",name:"Write ops",flexGrow:1,pipe:this.dimlessPipe,cellTransformation:Ni.a.perSecond}],this.taskListService.init(()=>this.ecpService.list().pipe(Object(vi.a)(e=>(this.ecProfileList=e,this.poolService.getList()))),void 0,e=>{this.pools=this.transformPoolsData(e),this.tableStatus=new Ci.a},()=>{this.table.reset(),this.tableStatus=new Ci.a(_i.a.ValueException)},e=>e.name.startsWith("pool/"),(e,t)=>t.metadata.pool_name===e.pool_name,{default:e=>new Di(e.pool_name)})}updateSelection(e){this.selection=e}deletePoolModal(){const e=this.selection.first().pool_name;this.modalService.show(y.a,{itemDescription:"Pool",itemNames:[e],submitActionObservable:()=>this.taskWrapper.wrapTaskAroundCall({task:new T.a("pool/"+n.e.DELETE,{pool_name:e}),call:this.poolService.delete(e)})})}getPgStatusCellClass(e,t,i){return{"text-right":!0,["pg-"+this.pgCategoryService.getTypeByStates(i)]:!0}}getErasureCodeProfile(e){let t="";return u.a.forEach(this.ecProfileList,i=>{i.name===e&&(t=`EC: ${i.k}+${i.m}`)}),t}transformPoolsData(e){const t=["bytes_used","max_avail","avail_raw","percent_used","rd_bytes","wr_bytes","rd","wr"],i={latest:0,rate:0,rates:[]};return u.a.forEach(e,e=>{e.pg_status=this.transformPgStatus(e.pg_status);const a={};u.a.forEach(t,t=>{a[t]=e.stats&&e.stats[t]?e.stats[t]:i}),e.stats=a,e.usage=a.percent_used.latest,e.cdExecuting||e.pg_num+e.pg_placement_num===e.pg_num_target+e.pg_placement_num_target||(e.cdExecuting="Updating"),["rd_bytes","wr_bytes"].forEach(t=>{e.stats[t].rates=e.stats[t].rates.map(e=>e[1])}),e.cdIsBinary=!0,"erasure"===e.type&&(e.data_protection=this.getErasureCodeProfile(e.erasure_code_profile)),"replicated"===e.type&&(e.data_protection="replica: \xd7"+e.size)}),e}transformPgStatus(e){const t=[];return u.a.forEach(e,(e,i)=>{t.push(`${e} ${i}`)}),t.join(", ")}getSelectionTiers(){if(void 0!==this.expandedRow){const e=this.expandedRow.tiers;this.cacheTiers=this.pools.filter(t=>e.includes(t.pool))}}getDisableDesc(){var e;return!(null===(e=this.selection)||void 0===e?void 0:e.hasSelection)||!this.monAllowPoolDelete&&"Pool deletion is disabled by the mon_allow_pool_delete configuration setting."}setExpandedRow(e){super.setExpandedRow(e),this.getSelectionTiers()}}return e.\u0275fac=function(t){return new(t||e)(h.Mb(v.a),h.Mb(k.a),h.Mb(S),h.Mb(w.a),h.Mb($i.a),h.Mb(E.a),h.Mb(Ri.a),h.Mb(Ti.a),h.Mb(wi.a),h.Mb(yi.a),h.Mb(n.b))},e.\u0275cmp=h.Gb({type:e,selectors:[["cd-pool-list"]],viewQuery:function(e,t){var i;1&e&&(h.Tc(Ii.a,!0),h.Jc(Qi,!0),h.Tc(Ji,!0)),2&e&&(h.zc(i=h.hc())&&(t.table=i.first),h.zc(i=h.hc())&&(t.poolUsageTpl=i.first),h.zc(i=h.hc())&&(t.poolConfigurationSourceTpl=i.first))},features:[h.xb([$i.a,{provide:wi.a,useValue:new wi.a("pool")}]),h.vb],decls:10,vars:2,consts:function(){return[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],"Pools List",["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["poolUsageTpl",""],["id","pool-list","selectionType","single",3,"data","columns","hasDetails","status","autoReload","fetchData","setExpandedRow","updateSelection"],["table",""],["id","pool-list-actions",1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","","id","pool-list-details",3,"selection","permissions","cacheTiers"],"Overall Performance",["uid","z99hzWtmk","grafanaStyle","two",3,"grafanaPath"],["decimals","2",3,"total","used",4,"ngIf"],["decimals","2",3,"total","used"]]},template:function(e,t){if(1&e&&(h.Sb(0,"ul",0,1),h.Sb(2,"li",2),h.Sb(3,"a",3),h.Wb(4,4),h.Rb(),h.Mc(5,Ki,4,11,"ng-template",5),h.Rb(),h.Mc(6,Hi,4,0,"li",6),h.Rb(),h.Nb(7,"div",7),h.Mc(8,Zi,1,1,"ng-template",null,8,h.Nc)),2&e){const e=h.Ac(1);h.yb(6),h.pc("ngIf",t.permissions.grafana.read),h.yb(1),h.pc("ngbNavOutlet",e)}},directives:[c.p,c.r,c.s,c.q,a.r,c.u,Ii.a,Ei.a,Gi,xi.a,ji.a],styles:["cd-pool-list .pg-clean{color:#0b0} cd-pool-list .pg-working{color:#2b99a8} cd-pool-list .pg-warning{color:#ffc200} cd-pool-list .pg-unknown{color:#ef5c55}"]}),e})(),ta=(()=>{class e{}return e.\u0275mod=h.Kb({type:e}),e.\u0275inj=h.Jb({factory:function(t){return new(t||e)},imports:[[b.a,a.c,c.t,l.a,s.i,o.x,c.F,r.BlockModule]]}),e})();const ia=[{path:"",component:ea},{path:n.e.CREATE,component:Si,data:{breadcrumbs:n.a.CREATE}},{path:n.e.EDIT+"/:name",component:Si,data:{breadcrumbs:n.a.EDIT}}];let aa=(()=>{class e{}return e.\u0275mod=h.Kb({type:e}),e.\u0275inj=h.Jb({factory:function(t){return new(t||e)},imports:[[ta,s.i.forChild(ia)]]}),e})()}}]);