1 (window
.webpackJsonp
=window
.webpackJsonp
||[]).push([[6],{OkK6:function(e
,t
,c
){"use strict";c
.r(t
),c
.d(t
,"RgwModule",function(){return Na
}),c
.d(t
,"RoutedRgwModule",function(){return Oa
});var a
=c("SVse"),i
=c("s7LF"),s
=c("iInd"),b
=c("G0yt"),o
=c("zWsK"),n
=c("sne2"),r
=c("PCNd"),l
=c("G6Q+"),u
=c("LvDl"),d
=c
.n(u
),f
=c("cp0P"),m
=c("6HA4"),p
=c("eCU+"),g
=c("mrSG"),h
=c("IheW"),_
=c("LRne"),v
=c("5+tZ"),y
=c("CqXF"),W
=c("JIr8"),k
=c("9xzX"),X
=c("xTzq"),w
=c("8Y7J");let D
=(()=>{let e
=class{constructor(e
,t
){this.http
=e
,this.rgwDaemonService
=t
,this.url
="api/rgw/user"}list(){return this.enumerate().pipe(Object(v
.a
)(e
=>e
.length
>0?Object(f
.a
)(e
.map(e
=>this.get(e
))):Object(_
.a
)([])))}enumerate(){return this.rgwDaemonService
.request(e
=>this.http
.get(this.url
,{params
:e
}))}enumerateEmail(){return this.rgwDaemonService
.request(e
=>this.http
.get(`${this.url}/get_emails`,{params
:e
}))}get(e
){return this.rgwDaemonService
.request(t
=>this.http
.get(`${this.url}/${e}`,{params
:t
}))}getQuota(e
){return this.rgwDaemonService
.request(t
=>this.http
.get(`${this.url}/${e}/quota`,{params
:t
}))}create(e
){return this.rgwDaemonService
.request(t
=>(d
.a
.keys(e
).forEach(c
=>{t
=t
.append(c
,e
[c
])}),this.http
.post(this.url
,null,{params
:t
})))}update(e
,t
){return this.rgwDaemonService
.request(c
=>(d
.a
.keys(t
).forEach(e
=>{c
=c
.append(e
,t
[e
])}),this.http
.put(`${this.url}/${e}`,null,{params
:c
})))}updateQuota(e
,t
){return this.rgwDaemonService
.request(c
=>(d
.a
.keys(t
).forEach(e
=>{c
=c
.append(e
,t
[e
])}),this.http
.put(`${this.url}/${e}/quota`,null,{params
:c
})))}delete(e
){return this.rgwDaemonService
.request(t
=>this.http
.delete(`${this.url}/${e}`,{params
:t
}))}createSubuser(e
,t
){return this.rgwDaemonService
.request(c
=>(d
.a
.keys(t
).forEach(e
=>{c
=c
.append(e
,t
[e
])}),this.http
.post(`${this.url}/${e}/subuser`,null,{params
:c
})))}deleteSubuser(e
,t
){return this.rgwDaemonService
.request(c
=>this.http
.delete(`${this.url}/${e}/subuser/${t}`,{params
:c
}))}addCapability(e
,t
,c
){return this.rgwDaemonService
.request(a
=>(a
=(a
=a
.append("type",t
)).append("perm",c
),this.http
.post(`${this.url}/${e}/capability`,null,{params
:a
})))}deleteCapability(e
,t
,c
){return this.rgwDaemonService
.request(a
=>(a
=(a
=a
.append("type",t
)).append("perm",c
),this.http
.delete(`${this.url}/${e}/capability`,{params
:a
})))}addS3Key(e
,t
){return this.rgwDaemonService
.request(c
=>(c
=c
.append("key_type","s3"),d
.a
.keys(t
).forEach(e
=>{c
=c
.append(e
,t
[e
])}),this.http
.post(`${this.url}/${e}/key`,null,{params
:c
})))}deleteS3Key(e
,t
){return this.rgwDaemonService
.request(c
=>(c
=(c
=c
.append("key_type","s3")).append("access_key",t
),this.http
.delete(`${this.url}/${e}/key`,{params
:c
})))}exists(e
){return this.get(e
).pipe(Object(y
.a
)(!0),Object(W
.a
)(e
=>(d
.a
.isFunction(e
.preventDefault
)&&e
.preventDefault(),Object(_
.a
)(!1))))}emailExists(e
){return e
=decodeURIComponent(e
),this.enumerateEmail().pipe(Object(v
.a
)(t
=>{const c
=d
.a
.indexOf(t
,e
);return Object(_
.a
)(-1!==c
)}))}};return e
.\u0275fac=function(t
){return new(t
||e
)(w
.ic(h
.b
),w
.ic(k
.a
))},e
.\u0275prov=w
.Nb({token
:e
,factory
:e
.\u0275fac,providedIn
:"root"}),e
=Object(g
.b
)([X
.a
,Object(g
.d
)("design:paramtypes",[h
.b
,k
.a
])],e
),e
})();var S
=c("oxzT"),z
=c("mtw6"),I
=c("spCT"),$=c("2EZI"),x
=c("1Ni5"),q
=c("9nlD"),E=function(e
){return e
.ENABLED
="Enabled",e
.DISABLED
="Disabled",e
}({}),F=function(e
){return e
.ENABLED
="Enabled",e
.SUSPENDED
="Suspended",e
}({}),P
=c("zc8c"),T
=c("NwgZ"),C
=c("ocLN"),R
=c("ANnk"),A
=c("f69J"),N
=c("IZUe"),V
=c("p4Cf"),O
=c("6+kj"),B
=c("8xTl");function L(e
,t
){1&e
&&(w
.Xb(0,"div",9),w
.Xb(1,"label",35),w
.bc(2,36),w
.Wb(),w
.Xb(3,"div",12),w
.Sb(4,"input",37),w
.Wb(),w
.Wb())}function j(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,39),w
.Wb())}function U(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,40),w
.Wb())}function M(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,41),w
.Wb())}function G(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,42),w
.Wb())}function K(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,43),w
.Wb())}function Q(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,44),w
.Wb())}function Y(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,45),w
.Wb())}function Z(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,46),w
.Wb())}function J(e
,t
){1&e
&&(w
.Xb(0,"option",47),w
.bc(1,48),w
.Wb()),2&e
&&w
.uc("ngValue",null)}function H(e
,t
){1&e
&&(w
.Xb(0,"option",47),w
.bc(1,49),w
.Wb()),2&e
&&w
.uc("ngValue",null)}function ee(e
,t
){if(1&e
&&(w
.Xb(0,"option",50),w
.Rc(1),w
.Wb()),2&e
){const e
=t
.$implicit
;w
.uc("value",e
),w
.Db(1),w
.Sc(e
)}}function te(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,51),w
.Wb())}function ce(e
,t
){1&e
&&(w
.Xb(0,"option",47),w
.bc(1,53),w
.Wb()),2&e
&&w
.uc("ngValue",null)}function ae(e
,t
){1&e
&&(w
.Xb(0,"option",47),w
.bc(1,54),w
.Wb()),2&e
&&w
.uc("ngValue",null)}function ie(e
,t
){if(1&e
&&(w
.Xb(0,"option",50),w
.Rc(1),w
.Wb()),2&e
){const e
=t
.$implicit
;w
.uc("value",e
.name
),w
.Db(1),w
.Sc(e
.description
)}}function se(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,55),w
.Wb())}function be(e
,t
){if(1&e
&&(w
.Xb(0,"select",52),w
.Pc(1,ce
,2,1,"option",18),w
.Pc(2,ae
,2,1,"option",18),w
.Pc(3,ie
,2,2,"option",19),w
.Wb(),w
.Pc(4,se
,2,0,"span",14)),2&e
){w
.nc();const e
=w
.Fc(2),t
=w
.nc();w
.Db(1),w
.uc("ngIf",null===t
.placementTargets
),w
.Db(1),w
.uc("ngIf",null!==t
.placementTargets
),w
.Db(1),w
.uc("ngForOf",t
.placementTargets
),w
.Db(1),w
.uc("ngIf",t
.bucketForm
.showError("placement-target",e
,"required"))}}function oe(e
,t
){1&e
&&(w
.Vb(0),w
.Sb(1,"input",56),w
.Ub())}function ne(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"fieldset"),w
.Xb(1,"legend",25),w
.bc(2,57),w
.Wb(),w
.Xb(3,"div",9),w
.Xb(4,"div",27),w
.Xb(5,"div",28),w
.Xb(6,"input",58),w
.lc("change",function(){return w
.Ic(e
),w
.nc(2).setMfaDeleteValidators()}),w
.Wb(),w
.Xb(7,"label",59),w
.bc(8,60),w
.Wb(),w
.Xb(9,"cd-helper"),w
.Xb(10,"span"),w
.bc(11,61),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb()}}function re(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,70),w
.Wb())}function le(e
,t
){if(1&e
&&(w
.Xb(0,"div",9),w
.Xb(1,"label",67),w
.bc(2,68),w
.Wb(),w
.Xb(3,"div",12),w
.Sb(4,"input",69),w
.Pc(5,re
,2,0,"span",14),w
.Wb(),w
.Wb()),2&e
){w
.nc(2);const e
=w
.Fc(2),t
=w
.nc();w
.Db(5),w
.uc("ngIf",t
.bucketForm
.showError("mfa-token-serial",e
,"required"))}}function ue(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,74),w
.Wb())}function de(e
,t
){if(1&e
&&(w
.Xb(0,"div",9),w
.Xb(1,"label",71),w
.bc(2,72),w
.Wb(),w
.Xb(3,"div",12),w
.Sb(4,"input",73),w
.Pc(5,ue
,2,0,"span",14),w
.Wb(),w
.Wb()),2&e
){w
.nc(2);const e
=w
.Fc(2),t
=w
.nc();w
.Db(5),w
.uc("ngIf",t
.bucketForm
.showError("mfa-token-pin",e
,"required"))}}function fe(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"fieldset"),w
.Xb(1,"legend",25),w
.bc(2,62),w
.Wb(),w
.Xb(3,"div",9),w
.Xb(4,"div",27),w
.Xb(5,"div",28),w
.Xb(6,"input",63),w
.lc("change",function(){return w
.Ic(e
),w
.nc(2).setMfaDeleteValidators()}),w
.Wb(),w
.Xb(7,"label",64),w
.bc(8,65),w
.Wb(),w
.Xb(9,"cd-helper"),w
.Xb(10,"span"),w
.bc(11,66),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Pc(12,le
,6,1,"div",8),w
.Pc(13,de
,6,1,"div",8),w
.Wb()}if(2&e
){const e
=w
.nc(2);w
.Db(12),w
.uc("ngIf",e
.areMfaCredentialsRequired()),w
.Db(1),w
.uc("ngIf",e
.areMfaCredentialsRequired())}}function me(e
,t
){1&e
&&(w
.Xb(0,"div",9),w
.Xb(1,"label",75),w
.bc(2,76),w
.Wb(),w
.Xb(3,"div",12),w
.Xb(4,"select",77),w
.Xb(5,"option",78),w
.bc(6,79),w
.Wb(),w
.Xb(7,"option",80),w
.bc(8,81),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb())}function pe(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,86),w
.Wb())}function ge(e
,t
){1&e
&&(w
.Xb(0,"span",38),w
.bc(1,87),w
.Wb())}function he(e
,t
){if(1&e
&&(w
.Xb(0,"div",9),w
.Xb(1,"label",82),w
.Vb(2),w
.bc(3,83),w
.Ub(),w
.Xb(4,"cd-helper"),w
.bc(5,84),w
.Wb(),w
.Wb(),w
.Xb(6,"div",12),w
.Sb(7,"input",85),w
.Pc(8,pe
,2,0,"span",14),w
.Pc(9,ge
,2,0,"span",14),w
.Wb(),w
.Wb()),2&e
){w
.nc();const e
=w
.Fc(2),t
=w
.nc();w
.Db(8),w
.uc("ngIf",t
.bucketForm
.showError("lock_retention_period_days",e
,"pattern")),w
.Db(1),w
.uc("ngIf",t
.bucketForm
.showError("lock_retention_period_days",e
,"lockDays"))}}const _e=function(e
){return{required
:e
}};function ve(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"div",1),w
.Xb(1,"form",2,3),w
.Xb(3,"div",4),w
.Xb(4,"div",5),w
.bc(5,6),w
.oc(6,"titlecase"),w
.oc(7,"upperFirst"),w
.Wb(),w
.Xb(8,"div",7),w
.Pc(9,L
,5,0,"div",8),w
.Xb(10,"div",9),w
.Xb(11,"label",10),w
.bc(12,11),w
.Wb(),w
.Xb(13,"div",12),w
.Sb(14,"input",13),w
.Pc(15,j
,2,0,"span",14),w
.Pc(16,U
,2,0,"span",14),w
.Pc(17,M
,2,0,"span",14),w
.Pc(18,G
,2,0,"span",14),w
.Pc(19,K
,2,0,"span",14),w
.Pc(20,Q
,2,0,"span",14),w
.Pc(21,Y
,2,0,"span",14),w
.Pc(22,Z
,2,0,"span",14),w
.Wb(),w
.Wb(),w
.Xb(23,"div",9),w
.Xb(24,"label",15),w
.bc(25,16),w
.Wb(),w
.Xb(26,"div",12),w
.Xb(27,"select",17),w
.Pc(28,J
,2,1,"option",18),w
.Pc(29,H
,2,1,"option",18),w
.Pc(30,ee
,2,2,"option",19),w
.Wb(),w
.Pc(31,te
,2,0,"span",14),w
.Wb(),w
.Wb(),w
.Xb(32,"div",9),w
.Xb(33,"label",20),w
.bc(34,21),w
.Wb(),w
.Xb(35,"div",12),w
.Pc(36,be
,5,4,"ng-template",null,22,w
.Qc
),w
.Pc(38,oe
,2,0,"ng-container",23),w
.Wb(),w
.Wb(),w
.Pc(39,ne
,12,0,"fieldset",24),w
.Pc(40,fe
,14,2,"fieldset",24),w
.Xb(41,"fieldset"),w
.Xb(42,"legend",25),w
.bc(43,26),w
.Wb(),w
.Xb(44,"div",9),w
.Xb(45,"div",27),w
.Xb(46,"div",28),w
.Sb(47,"input",29),w
.Xb(48,"label",30),w
.bc(49,31),w
.Wb(),w
.Xb(50,"cd-helper"),w
.Xb(51,"span"),w
.bc(52,32),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Pc(53,me
,9,0,"div",8),w
.Pc(54,he
,10,2,"div",8),w
.Wb(),w
.Wb(),w
.Xb(55,"div",33),w
.Xb(56,"cd-form-button-panel",34),w
.lc("submitActionEvent",function(){return w
.Ic(e
),w
.nc().submit()}),w
.oc(57,"titlecase"),w
.oc(58,"upperFirst"),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb()}if(2&e
){const e
=w
.Fc(2),t
=w
.Fc(37),c
=w
.nc();w
.Db(1),w
.uc("formGroup",c
.bucketForm
),w
.Db(6),w
.fc(w
.pc(6,29,c
.action
))(w
.pc(7,31,c
.resource
)),w
.cc(5),w
.Db(2),w
.uc("ngIf",c
.editing
),w
.Db(2),w
.uc("ngClass",w
.zc(37,_e
,!c
.editing
)),w
.Db(3),w
.uc("readonly",c
.editing
)("autofocus",!c
.editing
),w
.Db(1),w
.uc("ngIf",c
.bucketForm
.showError("bid",e
,"required")),w
.Db(1),w
.uc("ngIf",c
.bucketForm
.showError("bid",e
,"bucketNameInvalid")),w
.Db(1),w
.uc("ngIf",c
.bucketForm
.showError("bid",e
,"bucketNameNotAllowed")),w
.Db(1),w
.uc("ngIf",c
.bucketForm
.showError("bid",e
,"containsUpperCase")),w
.Db(1),w
.uc("ngIf",c
.bucketForm
.showError("bid",e
,"lowerCaseOrNumber")),w
.Db(1),w
.uc("ngIf",c
.bucketForm
.showError("bid",e
,"ipAddress")),w
.Db(1),w
.uc("ngIf",c
.bucketForm
.showError("bid",e
,"onlyLowerCaseAndNumbers")),w
.Db(1),w
.uc("ngIf",c
.bucketForm
.showError("bid",e
,"shouldBeInRange")),w
.Db(5),w
.uc("autofocus",c
.editing
),w
.Db(1),w
.uc("ngIf",null===c
.owners
),w
.Db(1),w
.uc("ngIf",null!==c
.owners
),w
.Db(1),w
.uc("ngForOf",c
.owners
),w
.Db(1),w
.uc("ngIf",c
.bucketForm
.showError("owner",e
,"required")),w
.Db(2),w
.uc("ngClass",w
.zc(39,_e
,!c
.editing
)),w
.Db(5),w
.uc("ngIf",c
.editing
)("ngIfElse",t
),w
.Db(1),w
.uc("ngIf",c
.editing
),w
.Db(1),w
.uc("ngIf",c
.editing
),w
.Db(13),w
.uc("ngIf",c
.bucketForm
.getValue("lock_enabled")),w
.Db(1),w
.uc("ngIf",c
.bucketForm
.getValue("lock_enabled")),w
.Db(2),w
.uc("form",c
.bucketForm
)("submitText",w
.pc(57,33,c
.action
)+" "+w
.pc(58,35,c
.resource
))}}let ye
=(()=>{class e
extends I
.a
{constructor(e
,t
,c
,a
,i
,s
,b
,o
){super(),this.route
=e
,this.router
=t
,this.formBuilder
=c
,this.rgwBucketService
=a
,this.rgwSiteService
=i
,this.rgwUserService
=s
,this.notificationService
=b
,this.actionLabels
=o
,this.editing
=!1,this.owners
=null,this.placementTargets
=[],this.isVersioningAlreadyEnabled
=!1,this.isMfaDeleteAlreadyEnabled
=!1,this.icons
=S
.a
,this.editing
=this.router
.url
.startsWith(`/rgw/bucket/${n.e.EDIT}`),this.action
=this.editing
?this.actionLabels
.EDIT
:this.actionLabels
.CREATE
,this.resource
="bucket",this.createForm()}get isVersioningEnabled(){return this.bucketForm
.getValue("versioning")}get isMfaDeleteEnabled(){return this.bucketForm
.getValue("mfa-delete")}createForm(){const e
=this,t
=x
.a
.custom("lockDays",()=>{if(!e
.bucketForm
||!d
.a
.get(e
.bucketForm
.getRawValue(),"lock_enabled"))return!1;const t
=Number(e
.bucketForm
.getValue("lock_retention_period_days"));return!Number
.isInteger(t
)||0===t
});this.bucketForm
=this.formBuilder
.group({id
:[null],bid
:[null,[i
.A
.required
],this.editing
?[]:[x
.a
.bucketName(),x
.a
.bucketExistence(!1,this.rgwBucketService
)]],owner
:[null,[i
.A
.required
]],"placement-target":[null,this.editing
?[]:[i
.A
.required
]],versioning
:[null],"mfa-delete":[null],"mfa-token-serial":[""],"mfa-token-pin":[""],lock_enabled
:[{value
:!1,disabled
:this.editing
}],lock_mode
:["COMPLIANCE"],lock_retention_period_days
:[0,[x
.a
.number(!1),t
]]})}ngOnInit(){const e
={owners
:this.rgwUserService
.enumerate()};this.editing
||(e
.getPlacementTargets
=this.rgwSiteService
.get("placement-targets")),this.route
.params
.subscribe(t
=>{if(t
.hasOwnProperty("bid")){const c
=decodeURIComponent(t
.bid
);e
.getBid
=this.rgwBucketService
.get(c
)}Object(f
.a
)(e
).subscribe(e
=>{if(this.owners
=e
.owners
.sort(),e
.getPlacementTargets
){const t
=e
.getPlacementTargets
;this.zonegroup
=t
.zonegroup
,d
.a
.forEach(t
.placement_targets
,e
=>{e
.description
=`${e.name} (${"pool"}: ${e.data_pool})`,this.placementTargets
.push(e
)}),1===this.placementTargets
.length
&&this.bucketForm
.get("placement-target").setValue(this.placementTargets
[0].name
)}if(e
.getBid
){const t
=e
.getBid
,c
=d
.a
.clone(this.bucketForm
.getRawValue());let a
=d
.a
.pick(t
,d
.a
.keys(c
));a
.lock_retention_period_days
=this.rgwBucketService
.getLockDays(t
),a
["placement-target"]=t
.placement_rule
,a
.versioning
=t
.versioning
===F
.ENABLED
,a
["mfa-delete"]=t
.mfa_delete
===E
.ENABLED
,a
=d
.a
.merge(c
,a
),this.bucketForm
.setValue(a
),this.editing
&&(this.isVersioningAlreadyEnabled
=this.isVersioningEnabled
,this.isMfaDeleteAlreadyEnabled
=this.isMfaDeleteEnabled
,this.setMfaDeleteValidators(),a
.lock_enabled
&&this.bucketForm
.controls
.versioning
.disable())}this.loadingReady()})})}goToListView(){this.router
.navigate(["/rgw/bucket"])}submit(){if(this.bucketForm
.pristine
)return void this.goToListView();const e
=this.bucketForm
.value
;if(this.editing
){const t
=this.getVersioningStatus(),c
=this.getMfaDeleteStatus();this.rgwBucketService
.update(e
.bid
,e
.id
,e
.owner
,t
,c
,e
["mfa-token-serial"],e
["mfa-token-pin"],e
.lock_mode
,e
.lock_retention_period_days
).subscribe(()=>{this.notificationService
.show(z
.a
.success
,"Updated Object Gateway bucket '" + e
.bid
+ "'."),this.goToListView()},()=>{this.bucketForm
.setErrors({cdSubmitButton
:!0})})}else this.rgwBucketService
.create(e
.bid
,e
.owner
,this.zonegroup
,e
["placement-target"],e
.lock_enabled
,e
.lock_mode
,e
.lock_retention_period_days
).subscribe(()=>{this.notificationService
.show(z
.a
.success
,"Created Object Gateway bucket '" + e
.bid
+ "'"),this.goToListView()},()=>{this.bucketForm
.setErrors({cdSubmitButton
:!0})})}areMfaCredentialsRequired(){return this.isMfaDeleteEnabled
!==this.isMfaDeleteAlreadyEnabled
||this.isMfaDeleteAlreadyEnabled
&&this.isVersioningEnabled
!==this.isVersioningAlreadyEnabled
}setMfaDeleteValidators(){const e
=this.bucketForm
.get("mfa-token-serial"),t
=this.bucketForm
.get("mfa-token-pin");this.areMfaCredentialsRequired()?(e
.setValidators(i
.A
.required
),t
.setValidators(i
.A
.required
)):(e
.setValidators(null),t
.setValidators(null)),e
.updateValueAndValidity(),t
.updateValueAndValidity()}getVersioningStatus(){return this.isVersioningEnabled
?F
.ENABLED
:F
.SUSPENDED
}getMfaDeleteStatus(){return this.isMfaDeleteEnabled
?E
.ENABLED
:E
.DISABLED
}}return e
.\u0275fac=function(t
){return new(t
||e
)(w
.Rb(s
.a
),w
.Rb(s
.e
),w
.Rb($.a
),w
.Rb(m
.a
),w
.Rb(p
.a
),w
.Rb(D
),w
.Rb(q
.a
),w
.Rb(n
.b
))},e
.\u0275cmp=w
.Lb({type
:e
,selectors
:[["cd-rgw-bucket-form"]],features
:[w
.Ab
],decls
:1,vars
:1,consts:function(){let e
,t
,c
,a
,i
,s
,b
,o
,n
,r
,l
,u
,d
,f
,m
,p
,g
,h
,_
,v
,y
,W
,k
,X
,w
,D
,S
,z
,I
,$,x
,q
,E
,F
,P
,T
,C
,R
,A
,N
;return e
="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t
="Name",c
="Name...",a
="Owner",i
="Placement target",s
="Locking",b
="Enabled",o
="Enables locking for the objects in the bucket. Locking can only be enabled while creating a bucket.",n
="Id",r
="This field is required.",l
="Bucket names can only contain lowercase letters, numbers, periods and hyphens.",u
="The chosen name is already in use.",d
="Bucket names must not contain uppercase characters or underscores.",f
="Each label must start and end with a lowercase letter or a number.",m
="Bucket names cannot be formatted as IP address.",p
="Bucket labels cannot be empty and can only contain lowercase letters, numbers and hyphens.",g
="Bucket names must be 3 to 63 characters long.",h
="Loading...",_
="-- Select a user --",v
="This field is required.",y
="Loading...",W
="-- Select a placement target --",k
="This field is required.",X
="Versioning",w
="Enabled",D
="Enables versioning for the objects in the bucket.",S
="Multi-Factor Authentication",z
="Delete enabled",I
="Enables MFA (multi-factor authentication) Delete, which requires additional authentication for changing the bucket versioning state.",$="Token Serial Number",x
="This field is required.",q
="Token PIN",E
="This field is required.",F
="Mode",P
="Compliance",T
="Governance",C
="Days",R
="The number of days that you want to specify for the default retention period that will be applied to new objects placed in this bucket.",A
="The entered value must be a positive integer.",N
="Retention Days must be a positive integer.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","bucketForm","novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],e
,[1,"card-body"],["class","form-group row",4,"ngIf"],[1,"form-group","row"],["for","bid",1,"cd-col-form-label",3,"ngClass"],t
,[1,"cd-col-form-input"],["id","bid","name","bid","type","text","placeholder",c
,"formControlName","bid",1,"form-control",3,"readonly","autofocus"],["class","invalid-feedback",4,"ngIf"],["for","owner",1,"cd-col-form-label","required"],a
,["id","owner","name","owner","formControlName","owner",1,"form-control","custom-select",3,"autofocus"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],["for","placement-target",1,"cd-col-form-label",3,"ngClass"],i
,["placementTargetSelect",""],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"cd-header"],s
,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","lock_enabled","formControlName","lock_enabled","type","checkbox",1,"custom-control-input"],["for","lock_enabled",1,"custom-control-label"],b
,o
,[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],["for","id",1,"cd-col-form-label"],n
,["id","id","name","id","type","text","formControlName","id","readonly","",1,"form-control"],[1,"invalid-feedback"],r
,l
,u
,d
,f
,m
,p
,g
,[3,"ngValue"],h
,_
,[3,"value"],v
,["id","placement-target","name","placement-target","formControlName","placement-target",1,"form-control","custom-select"],y
,W
,k
,["id","placement-target","name","placement-target","formControlName","placement-target","type","text","readonly","",1,"form-control"],X
,["type","checkbox","id","versioning","name","versioning","formControlName","versioning",1,"custom-control-input",3,"change"],["for","versioning",1,"custom-control-label"],w
,D
,S
,["type","checkbox","id","mfa-delete","name","mfa-delete","formControlName","mfa-delete",1,"custom-control-input",3,"change"],["for","mfa-delete",1,"custom-control-label"],z
,I
,["for","mfa-token-serial",1,"cd-col-form-label"],$,["type","text","id","mfa-token-serial","name","mfa-token-serial","formControlName","mfa-token-serial",1,"form-control"],x
,["for","mfa-token-pin",1,"cd-col-form-label"],q
,["type","text","id","mfa-token-pin","name","mfa-token-pin","formControlName","mfa-token-pin",1,"form-control"],E
,["for","lock_mode",1,"cd-col-form-label"],F
,["formControlName","lock_mode","name","lock_mode","id","lock_mode",1,"form-control","custom-select"],["value","COMPLIANCE"],P
,["value","GOVERNANCE"],T
,["for","lock_retention_period_days",1,"cd-col-form-label"],C
,R
,["type","number","id","lock_retention_period_days","formControlName","lock_retention_period_days","min","0",1,"form-control"],A
,N
]},template:function(e
,t
){1&e
&&w
.Pc(0,ve
,59,41,"div",0),2&e
&&w
.uc("cdFormLoading",t
.loading
)},directives
:[P
.a
,i
.B
,i
.r
,T
.a
,i
.k
,a
.r
,C
.a
,a
.p
,R
.a
,i
.d
,A
.a
,i
.q
,i
.i
,N
.a
,i
.z
,a
.q
,i
.b
,V
.a
,O
.a
,i
.u
,i
.C
,i
.v
],pipes
:[a
.A
,B
.a
],styles
:[""]}),e
})();var We
=c("HDdC"),ke
=c("+fVR"),Xe
=c("0+/T"),we
=c("uIqm"),De
=c("vCyI"),Se
=c("Fgil"),ze
=c("o4+5"),Ie
=c("aexS"),$e
=c("JK/P"),xe
=c("EgGo"),qe
=c("S7zO"),Ee
=c("a0VL"),Fe
=c("iExv");function Pe(e
,t
){1&e
&&(w
.Xb(0,"td"),w
.bc(1,24),w
.Wb())}function Te(e
,t
){if(1&e
&&(w
.Xb(0,"td"),w
.Rc(1),w
.oc(2,"dimless"),w
.Wb()),2&e
){const e
=w
.nc(3);w
.Db(1),w
.Tc(" ",w
.pc(2,1,e
.selection
.bucket_quota
.max_size
)," ")}}function Ce(e
,t
){1&e
&&(w
.Xb(0,"td"),w
.bc(1,25),w
.Wb())}function Re(e
,t
){if(1&e
&&(w
.Xb(0,"td"),w
.Rc(1),w
.Wb()),2&e
){const e
=w
.nc(3);w
.Db(1),w
.Tc(" ",e
.selection
.bucket_quota
.max_objects
," ")}}function Ae(e
,t
){if(1&e
&&(w
.Xb(0,"div"),w
.Xb(1,"legend"),w
.bc(2,20),w
.Wb(),w
.Xb(3,"table",1),w
.Xb(4,"tbody"),w
.Xb(5,"tr"),w
.Xb(6,"td",2),w
.bc(7,21),w
.Wb(),w
.Xb(8,"td",4),w
.Rc(9),w
.oc(10,"booleanText"),w
.Wb(),w
.Wb(),w
.Xb(11,"tr"),w
.Xb(12,"td",5),w
.bc(13,22),w
.Wb(),w
.Pc(14,Pe
,2,0,"td",0),w
.Pc(15,Te
,3,3,"td",0),w
.Wb(),w
.Xb(16,"tr"),w
.Xb(17,"td",5),w
.bc(18,23),w
.Wb(),w
.Pc(19,Ce
,2,0,"td",0),w
.Pc(20,Re
,2,1,"td",0),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb()),2&e
){const e
=w
.nc(2);w
.Db(9),w
.Sc(w
.pc(10,5,e
.selection
.bucket_quota
.enabled
)),w
.Db(5),w
.uc("ngIf",e
.selection
.bucket_quota
.max_size
<=-1),w
.Db(1),w
.uc("ngIf",e
.selection
.bucket_quota
.max_size
>-1),w
.Db(4),w
.uc("ngIf",e
.selection
.bucket_quota
.max_objects
<=-1),w
.Db(1),w
.uc("ngIf",e
.selection
.bucket_quota
.max_objects
>-1)}}function Ne(e
,t
){if(1&e
&&(w
.Vb(0),w
.Xb(1,"tr"),w
.Xb(2,"td",5),w
.bc(3,26),w
.Wb(),w
.Xb(4,"td"),w
.Rc(5),w
.Wb(),w
.Wb(),w
.Xb(6,"tr"),w
.Xb(7,"td",5),w
.bc(8,27),w
.Wb(),w
.Xb(9,"td"),w
.Rc(10),w
.Wb(),w
.Wb(),w
.Ub()),2&e
){const e
=w
.nc(2);w
.Db(5),w
.Sc(e
.selection
.lock_mode
),w
.Db(5),w
.Sc(e
.selection
.lock_retention_period_days
)}}function Ve(e
,t
){if(1&e
&&(w
.Vb(0),w
.Xb(1,"table",1),w
.Xb(2,"tbody"),w
.Xb(3,"tr"),w
.Xb(4,"td",2),w
.bc(5,3),w
.Wb(),w
.Xb(6,"td",4),w
.Rc(7),w
.Wb(),w
.Wb(),w
.Xb(8,"tr"),w
.Xb(9,"td",5),w
.bc(10,6),w
.Wb(),w
.Xb(11,"td"),w
.Rc(12),w
.Wb(),w
.Wb(),w
.Xb(13,"tr"),w
.Xb(14,"td",5),w
.bc(15,7),w
.Wb(),w
.Xb(16,"td"),w
.Rc(17),w
.Wb(),w
.Wb(),w
.Xb(18,"tr"),w
.Xb(19,"td",5),w
.bc(20,8),w
.Wb(),w
.Xb(21,"td"),w
.Rc(22),w
.Wb(),w
.Wb(),w
.Xb(23,"tr"),w
.Xb(24,"td",5),w
.bc(25,9),w
.Wb(),w
.Xb(26,"td"),w
.Rc(27),w
.Wb(),w
.Wb(),w
.Xb(28,"tr"),w
.Xb(29,"td",5),w
.bc(30,10),w
.Wb(),w
.Xb(31,"td"),w
.Rc(32),w
.Wb(),w
.Wb(),w
.Xb(33,"tr"),w
.Xb(34,"td",5),w
.bc(35,11),w
.Wb(),w
.Xb(36,"td"),w
.Rc(37),w
.Wb(),w
.Wb(),w
.Xb(38,"tr"),w
.Xb(39,"td",5),w
.bc(40,12),w
.Wb(),w
.Xb(41,"td"),w
.Rc(42),w
.Wb(),w
.Wb(),w
.Xb(43,"tr"),w
.Xb(44,"td",5),w
.bc(45,13),w
.Wb(),w
.Xb(46,"td"),w
.Rc(47),w
.Wb(),w
.Wb(),w
.Xb(48,"tr"),w
.Xb(49,"td",5),w
.bc(50,14),w
.Wb(),w
.Xb(51,"td"),w
.Rc(52),w
.oc(53,"cdDate"),w
.Wb(),w
.Wb(),w
.Xb(54,"tr"),w
.Xb(55,"td",5),w
.bc(56,15),w
.Wb(),w
.Xb(57,"td"),w
.Rc(58),w
.Wb(),w
.Wb(),w
.Xb(59,"tr"),w
.Xb(60,"td",5),w
.bc(61,16),w
.Wb(),w
.Xb(62,"td"),w
.Rc(63),w
.Wb(),w
.Wb(),w
.Xb(64,"tr"),w
.Xb(65,"td",5),w
.bc(66,17),w
.Wb(),w
.Xb(67,"td"),w
.Rc(68),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Pc(69,Ae
,21,7,"div",0),w
.Xb(70,"legend"),w
.bc(71,18),w
.Wb(),w
.Xb(72,"table",1),w
.Xb(73,"tbody"),w
.Xb(74,"tr"),w
.Xb(75,"td",2),w
.bc(76,19),w
.Wb(),w
.Xb(77,"td",4),w
.Rc(78),w
.oc(79,"booleanText"),w
.Wb(),w
.Wb(),w
.Pc(80,Ne
,11,2,"ng-container",0),w
.Wb(),w
.Wb(),w
.Ub()),2&e
){const e
=w
.nc();w
.Db(7),w
.Sc(e
.selection
.bid
),w
.Db(5),w
.Sc(e
.selection
.id
),w
.Db(5),w
.Sc(e
.selection
.owner
),w
.Db(5),w
.Sc(e
.selection
.index_type
),w
.Db(5),w
.Sc(e
.selection
.placement_rule
),w
.Db(5),w
.Sc(e
.selection
.marker
),w
.Db(5),w
.Sc(e
.selection
.max_marker
),w
.Db(5),w
.Sc(e
.selection
.ver
),w
.Db(5),w
.Sc(e
.selection
.master_ver
),w
.Db(5),w
.Sc(w
.pc(53,16,e
.selection
.mtime
)),w
.Db(6),w
.Sc(e
.selection
.zonegroup
),w
.Db(5),w
.Sc(e
.selection
.versioning
),w
.Db(5),w
.Sc(e
.selection
.mfa_delete
),w
.Db(1),w
.uc("ngIf",e
.selection
.bucket_quota
),w
.Db(9),w
.Sc(w
.pc(79,18,e
.selection
.lock_enabled
)),w
.Db(2),w
.uc("ngIf",e
.selection
.lock_enabled
)}}let Oe
=(()=>{class e
{constructor(e
){this.rgwBucketService
=e
}ngOnChanges(){this.selection
&&this.rgwBucketService
.get(this.selection
.bid
).subscribe(e
=>{e
.lock_retention_period_days
=this.rgwBucketService
.getLockDays(e
),this.selection
=e
})}}return e
.\u0275fac=function(t
){return new(t
||e
)(w
.Rb(m
.a
))},e
.\u0275cmp=w
.Lb({type
:e
,selectors
:[["cd-rgw-bucket-details"]],inputs
:{selection
:"selection"},features
:[w
.Bb
],decls
:1,vars
:1,consts:function(){let e
,t
,c
,a
,i
,s
,b
,o
,n
,r
,l
,u
,d
,f
,m
,p
,g
,h
,_
,v
,y
,W
,k
;return e
="Name",t
="ID",c
="Owner",a
="Index type",i
="Placement rule",s
="Marker",b
="Maximum marker",o
="Version",n
="Master version",r
="Modification time",l
="Zonegroup",u
="Versioning",d
="MFA Delete",f
="Locking",m
="Enabled",p
="Bucket quota",g
="Enabled",h
="Maximum size",_
="Maximum objects",v
="Unlimited",y
="Unlimited",W
="Mode",k
="Days",[[4,"ngIf"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],e
,[1,"w-75"],[1,"bold"],t
,c
,a
,i
,s
,b
,o
,n
,r
,l
,u
,d
,f
,m
,p
,g
,h
,_
,v
,y
,W
,k
]},template:function(e
,t
){1&e
&&w
.Pc(0,Ve
,81,20,"ng-container",0),2&e
&&w
.uc("ngIf",t
.selection
)},directives
:[a
.r
],pipes
:[Ee
.a
,Fe
.a
,ze
.a
],styles
:["table[_ngcontent-%COMP%]{table-layout:fixed}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{word-wrap:break-word}"]}),e
})();var Be
=c("GgAd");const Le
=["bucketSizeTpl"],je
=["bucketObjectTpl"];function Ue(e
,t
){if(1&e
&&w
.Sb(0,"cd-usage-bar",8),2&e
){const e
=w
.nc().row
;w
.uc("total",e
.bucket_quota
.max_size
)("used",e
.bucket_size
)}}function Me(e
,t
){1&e
&&w
.bc(0,9)}function Ge(e
,t
){if(1&e
&&(w
.Pc(0,Ue
,1,2,"cd-usage-bar",6),w
.Pc(1,Me
,1,0,"ng-template",null,7,w
.Qc
)),2&e
){const e
=t
.row
,c
=w
.Fc(2);w
.uc("ngIf",e
.bucket_quota
.max_size
>0&&e
.bucket_quota
.enabled
)("ngIfElse",c
)}}function Ke(e
,t
){if(1&e
&&w
.Sb(0,"cd-usage-bar",12),2&e
){const e
=w
.nc().row
;w
.uc("total",e
.bucket_quota
.max_objects
)("used",e
.num_objects
)("isBinary",!1)}}function Qe(e
,t
){1&e
&&w
.bc(0,13)}function Ye(e
,t
){if(1&e
&&(w
.Pc(0,Ke
,1,3,"cd-usage-bar",10),w
.Pc(1,Qe
,1,0,"ng-template",null,11,w
.Qc
)),2&e
){const e
=t
.row
,c
=w
.Fc(2);w
.uc("ngIf",e
.bucket_quota
.max_objects
>0&&e
.bucket_quota
.enabled
)("ngIfElse",c
)}}let Ze
=(()=>{class e
extends ke
.a
{constructor(e
,t
,c
,a
,i
,s
,b
,o
){super(o
),this.authStorageService
=e
,this.dimlessBinaryPipe
=t
,this.dimlessPipe
=c
,this.rgwBucketService
=a
,this.modalService
=i
,this.urlBuilder
=s
,this.actionLabels
=b
,this.ngZone
=o
,this.columns
=[],this.buckets
=[],this.selection
=new De
.a
}ngOnInit(){this.permission
=this.authStorageService
.getPermissions().rgw
,this.columns
=[{name
:"Name",prop
:"bid",flexGrow
:2},{name
:"Owner",prop
:"owner",flexGrow
:2.5},{name
:"Used Capacity",prop
:"bucket_size",flexGrow
:.6,pipe
:this.dimlessBinaryPipe
},{name
:"Capacity Limit %",prop
:"size_usage",cellTemplate
:this.bucketSizeTpl
,flexGrow
:.8},{name
:"Objects",prop
:"num_objects",flexGrow
:.6,pipe
:this.dimlessPipe
},{name
:"Object Limit %",prop
:"object_usage",cellTemplate
:this.bucketObjectTpl
,flexGrow
:.8}];const e
=()=>this.selection
.first()&&`${encodeURIComponent(this.selection.first().bid)}`;this.tableActions
=[{permission
:"create",icon
:S
.a
.add
,routerLink
:()=>this.urlBuilder
.getCreate(),name
:this.actionLabels
.CREATE
,canBePrimary
:e
=>!e
.hasSelection
},{permission
:"update",icon
:S
.a
.edit
,routerLink
:()=>this.urlBuilder
.getEdit(e()),name
:this.actionLabels
.EDIT
},{permission
:"delete",icon
:S
.a
.destroy
,click
:()=>this.deleteAction(),disable
:()=>!this.selection
.hasSelection
,name
:this.actionLabels
.DELETE
,canBePrimary
:e
=>e
.hasMultiSelection
}],this.setTableRefreshTimeout()}transformBucketData(){d
.a
.forEach(this.buckets
,e
=>{const t
=e
.bucket_quota
.max_size
,c
=e
.bucket_quota
.max_objects
;e
.bucket_size
=0,e
.num_objects
=0,d
.a
.isEmpty(e
.usage
)||(e
.bucket_size
=e
.usage
["rgw.main"].size_actual
,e
.num_objects
=e
.usage
["rgw.main"].num_objects
),e
.size_usage
=t
>0?e
.bucket_size
/t:void 0,e.object_usage=c>0?e.num_objects/c:void 0})}getBucketList(e
){this.setTableRefreshTimeout(),this.rgwBucketService
.list(!0).subscribe(e
=>{this.buckets
=e
,this.transformBucketData()},()=>{e
.error()})}updateSelection(e
){this.selection
=e
}deleteAction(){this.modalService
.show(Xe
.a
,{itemDescription
:this.selection
.hasSingleSelection
?"bucket":"buckets",itemNames
:this.selection
.selected
.map(e
=>e
.bid
),submitActionObservable
:()=>new We
.a(e
=>{Object(f
.a
)(this.selection
.selected
.map(e
=>this.rgwBucketService
.delete(e
.bid
))).subscribe({error
:t
=>{e
.error(t
),this.table
.refreshBtn()},complete
:()=>{e
.complete(),this.table
.refreshBtn()}})})})}}return e
.\u0275fac=function(t
){return new(t
||e
)(w
.Rb(Ie
.a
),w
.Rb(Se
.a
),w
.Rb(ze
.a
),w
.Rb(m
.a
),w
.Rb($e
.a
),w
.Rb(xe
.a
),w
.Rb(n
.b
),w
.Rb(w
.D
))},e
.\u0275cmp=w
.Lb({type
:e
,selectors
:[["cd-rgw-bucket-list"]],viewQuery:function(e
,t
){if(1&e
&&(w
.Wc(we
.a
,3),w
.Wc(Le
,3),w
.Wc(je
,3)),2&e
){let e
;w
.Ec(e
=w
.mc())&&(t
.table
=e
.first
),w
.Ec(e
=w
.mc())&&(t
.bucketSizeTpl
=e
.first
),w
.Ec(e
=w
.mc())&&(t
.bucketObjectTpl
=e
.first
)}},features
:[w
.Cb([{provide
:xe
.a
,useValue
:new xe
.a("rgw/bucket")}]),w
.Ab
],decls
:8,vars
:9,consts:function(){let e
,t
;return e
="No Limit",t
="No Limit",[["columnMode","flex","selectionType","multiClick","identifier","bid",3,"autoReload","data","columns","hasDetails","status","setExpandedRow","updateSelection","fetchData"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["bucketSizeTpl",""],["bucketObjectTpl",""],[3,"total","used",4,"ngIf","ngIfElse"],["noSizeQuota",""],[3,"total","used"],e
,[3,"total","used","isBinary",4,"ngIf","ngIfElse"],["noObjectQuota",""],[3,"total","used","isBinary"],t
]},template:function(e
,t
){1&e
&&(w
.Xb(0,"cd-table",0,1),w
.lc("setExpandedRow",function(e
){return t
.setExpandedRow(e
)})("updateSelection",function(e
){return t
.updateSelection(e
)})("fetchData",function(e
){return t
.getBucketList(e
)}),w
.Sb(2,"cd-table-actions",2),w
.Sb(3,"cd-rgw-bucket-details",3),w
.Wb(),w
.Pc(4,Ge
,3,2,"ng-template",null,4,w
.Qc
),w
.Pc(6,Ye
,3,2,"ng-template",null,5,w
.Qc
)),2&e
&&(w
.uc("autoReload",!1)("data",t
.buckets
)("columns",t
.columns
)("hasDetails",!0)("status",t
.tableStatus
),w
.Db(2),w
.uc("permission",t
.permission
)("selection",t
.selection
)("tableActions",t
.tableActions
),w
.Db(1),w
.uc("selection",t
.expandedRow
))},directives
:[we
.a
,qe
.a
,Oe
,a
.r
,Be
.a
],styles
:[""]}),e
})();var Je
=c("85J/"),He
=c("JP8w"),et
=c("FSuO"),tt
=c("b5OY"),ct
=c("insk");function at(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"cd-table-key-value",11),w
.lc("fetchData",function(){return w
.Ic(e
),w
.nc(2).getMetaData()}),w
.Wb()}if(2&e
){const e
=w
.nc(2);w
.uc("data",e
.metadata
)}}function it(e
,t
){if(1&e
&&w
.Sb(0,"cd-table-performance-counter",12),2&e
){const e
=w
.nc(2);w
.uc("serviceId",e
.serviceMapId
)}}function st(e
,t
){if(1&e
&&w
.Sb(0,"cd-grafana",15),2&e
){const e
=w
.nc(3);w
.uc("grafanaPath","rgw-instance-detail?var-rgw_servers=rgw."+e
.serviceId
)}}function bt(e
,t
){1&e
&&(w
.Xb(0,"li",13),w
.Xb(1,"a",4),w
.bc(2,14),w
.Wb(),w
.Pc(3,st
,1,1,"ng-template",6),w
.Wb())}function ot(e
,t
){if(1&e
&&(w
.Vb(0),w
.Xb(1,"ul",1,2),w
.Xb(3,"li",3),w
.Xb(4,"a",4),w
.bc(5,5),w
.Wb(),w
.Pc(6,at
,1,1,"ng-template",6),w
.Wb(),w
.Xb(7,"li",7),w
.Xb(8,"a",4),w
.bc(9,8),w
.Wb(),w
.Pc(10,it
,1,1,"ng-template",6),w
.Wb(),w
.Pc(11,bt
,4,0,"li",9),w
.Wb(),w
.Sb(12,"div",10),w
.Ub()),2&e
){const e
=w
.Fc(2),t
=w
.nc();w
.Db(11),w
.uc("ngIf",t
.grafanaPermission
.read
),w
.Db(1),w
.uc("ngbNavOutlet",e
)}}let nt
=(()=>{class e
{constructor(e
,t
){this.rgwDaemonService
=e
,this.authStorageService
=t
,this.serviceId
="",this.serviceMapId
="",this.grafanaPermission
=this.authStorageService
.getPermissions().grafana
}ngOnChanges(){this.selection
&&(this.serviceId
=this.selection
.id
,this.serviceMapId
=this.selection
.service_map_id
)}getMetaData(){d
.a
.isEmpty(this.serviceId
)||this.rgwDaemonService
.get(this.serviceId
).subscribe(e
=>{this.metadata
=e
.rgw_metadata
})}}return e
.\u0275fac=function(t
){return new(t
||e
)(w
.Rb(k
.a
),w
.Rb(Ie
.a
))},e
.\u0275cmp=w
.Lb({type
:e
,selectors
:[["cd-rgw-daemon-details"]],inputs
:{selection
:"selection"},features
:[w
.Bb
],decls
:1,vars
:1,consts:function(){let e
,t
,c
;return e
="Details",t
="Performance Counters",c
="Performance Details",[[4,"ngIf"],["ngbNav","","cdStatefulTab","rgw-daemon-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],e
,["ngbNavContent",""],["ngbNavItem","performance-counters"],t
,["ngbNavItem","performance-details",4,"ngIf"],[3,"ngbNavOutlet"],[3,"data","fetchData"],["serviceType","rgw",3,"serviceId"],["ngbNavItem","performance-details"],c
,["uid","x5ARzZtmk","grafanaStyle","one",3,"grafanaPath"]]},template:function(e
,t
){1&e
&&w
.Pc(0,ot
,13,2,"ng-container",0),2&e
&&w
.uc("ngIf",t
.selection
)},directives
:[a
.r
,b
.p
,He
.a
,b
.r
,b
.s
,b
.q
,b
.u
,et
.a
,tt
.a
,ct
.a
],styles
:[""]}),e
})();function rt(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"cd-table",8),w
.lc("setExpandedRow",function(t
){return w
.Ic(e
),w
.nc().setExpandedRow(t
)})("fetchData",function(t
){return w
.Ic(e
),w
.nc().getDaemonList(t
)}),w
.Sb(1,"cd-rgw-daemon-details",9),w
.Wb()}if(2&e
){const e
=w
.nc();w
.uc("data",e
.daemons
)("columns",e
.columns
)("hasDetails",!0),w
.Db(1),w
.uc("selection",e
.expandedRow
)}}function lt(e
,t
){1&e
&&w
.Sb(0,"cd-grafana",11),2&e
&&w
.uc("grafanaPath","rgw-overview?")}function ut(e
,t
){1&e
&&(w
.Xb(0,"li",2),w
.Xb(1,"a",3),w
.bc(2,10),w
.Wb(),w
.Pc(3,lt
,1,1,"ng-template",5),w
.Wb())}function dt(e
,t
){1&e
&&w
.Sb(0,"cd-grafana",13),2&e
&&w
.uc("grafanaPath","radosgw-sync-overview?")}function ft(e
,t
){1&e
&&(w
.Xb(0,"li",2),w
.Xb(1,"a",3),w
.bc(2,12),w
.Wb(),w
.Pc(3,dt
,1,1,"ng-template",5),w
.Wb())}let mt
=(()=>{class e
extends ke
.a
{constructor(e
,t
,c
,a
){super(),this.rgwDaemonService
=e
,this.authStorageService
=t
,this.cephShortVersionPipe
=c
,this.rgwSiteService
=a
,this.columns
=[],this.daemons
=[],this.updateDaemons
=e
=>{this.daemons
=e
}}ngOnInit(){this.grafanaPermission
=this.authStorageService
.getPermissions().grafana
,this.columns
=[{name
:"ID",prop
:"id",flexGrow
:2},{name
:"Hostname",prop
:"server_hostname",flexGrow
:2},{name
:"Zone",prop
:"zone_name",flexGrow
:2},{name
:"Zone Group",prop
:"zonegroup_name",flexGrow
:2},{name
:"Realm",prop
:"realm_name",flexGrow
:2},{name
:"Version",prop
:"version",flexGrow
:1,pipe
:this.cephShortVersionPipe
}],this.rgwSiteService
.get("realms").subscribe(e
=>this.isMultiSite
=e
.length
>0)}getDaemonList(e
){this.rgwDaemonService
.list().subscribe(this.updateDaemons
,()=>{e
.error()})}}return e
.\u0275fac=function(t
){return new(t
||e
)(w
.Rb(k
.a
),w
.Rb(Ie
.a
),w
.Rb(Je
.a
),w
.Rb(p
.a
))},e
.\u0275cmp=w
.Lb({type
:e
,selectors
:[["cd-rgw-daemon-list"]],features
:[w
.Ab
],decls
:9,vars
:3,consts:function(){let e
,t
,c
;return e
="Daemons List",t
="Overall Performance",c
="Sync Performance",[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],e
,["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["columnMode","flex",3,"data","columns","hasDetails","setExpandedRow","fetchData"],["cdTableDetail","",3,"selection"],t
,["uid","WAkugZpiz","grafanaStyle","two",3,"grafanaPath"],c
,["uid","rgw-sync-overview","grafanaStyle","two",3,"grafanaPath"]]},template:function(e
,t
){if(1&e
&&(w
.Xb(0,"ul",0,1),w
.Xb(2,"li",2),w
.Xb(3,"a",3),w
.bc(4,4),w
.Wb(),w
.Pc(5,rt
,2,4,"ng-template",5),w
.Wb(),w
.Pc(6,ut
,4,0,"li",6),w
.Pc(7,ft
,4,0,"li",6),w
.Wb(),w
.Sb(8,"div",7)),2&e
){const e
=w
.Fc(1);w
.Db(6),w
.uc("ngIf",t
.grafanaPermission
.read
),w
.Db(1),w
.uc("ngIf",t
.grafanaPermission
.read
&&t
.isMultiSite
),w
.Db(1),w
.uc("ngbNavOutlet",e
)}},directives
:[b
.p
,b
.r
,b
.s
,b
.q
,a
.r
,b
.u
,we
.a
,nt
,ct
.a
],styles
:[""]}),e
})();var pt
=c("GyhO"),gt
=c("aXbf"),ht=function(e
){return e
.USERS
="users",e
.BUCKETS
="buckets",e
.METADATA
="metadata",e
.USAGE
="usage",e
.ZONE
="zone",e
}({});let _t
=(()=>{class e
{static getAll(){return Object
.values(e
.capabilities
)}}return e
.capabilities
=ht
,e
})();var vt
=c("ajRT");function yt(e
,t
){1&e
&&w
.Sb(0,"input",22),2&e
&&w
.uc("readonly",!0)}function Wt(e
,t
){1&e
&&(w
.Xb(0,"option",17),w
.bc(1,25),w
.Wb()),2&e
&&w
.uc("ngValue",null)}function kt(e
,t
){if(1&e
&&(w
.Xb(0,"option",26),w
.Rc(1),w
.Wb()),2&e
){const e
=t
.$implicit
;w
.uc("value",e
),w
.Db(1),w
.Sc(e
)}}function Xt(e
,t
){if(1&e
&&(w
.Xb(0,"select",23),w
.Pc(1,Wt
,2,1,"option",24),w
.Pc(2,kt
,2,2,"option",19),w
.Wb()),2&e
){const e
=w
.nc();w
.Db(1),w
.uc("ngIf",null!==e
.types
),w
.Db(1),w
.uc("ngForOf",e
.types
)}}function wt(e
,t
){1&e
&&(w
.Xb(0,"span",27),w
.bc(1,28),w
.Wb())}function Dt(e
,t
){if(1&e
&&(w
.Xb(0,"option",26),w
.Rc(1),w
.Wb()),2&e
){const e
=t
.$implicit
;w
.uc("value",e
),w
.Db(1),w
.Tc(" ",e
," ")}}function St(e
,t
){1&e
&&(w
.Xb(0,"span",27),w
.bc(1,29),w
.Wb())}const zt=function(e
){return{required
:e
}},It=function(){return["read","write","*"]};let $t
=(()=>{class e
{constructor(e
,t
,c
){this.formBuilder
=e
,this.activeModal
=t
,this.actionLabels
=c
,this.submitAction
=new w
.p
,this.editing
=!0,this.types
=[],this.resource
="capability",this.createForm()}createForm(){this.formGroup
=this.formBuilder
.group({type
:[null,[i
.A
.required
]],perm
:[null,[i
.A
.required
]]})}setEditing(e
=!0){this.editing
=e
,this.action
=this.editing
?this.actionLabels
.EDIT
:this.actionLabels
.ADD
}setValues(e
,t
){this.formGroup
.setValue({type
:e
,perm
:t
})}setCapabilities(e
){const t
=[];e
.forEach(e
=>{t
.push(e
.type
)}),this.types
=[],_t
.getAll().forEach(e
=>{-1===d
.a
.indexOf(t
,e
)&&this.types
.push(e
)})}onSubmit(){this.submitAction
.emit(this.formGroup
.value
),this.activeModal
.close()}}return e
.\u0275fac=function(t
){return new(t
||e
)(w
.Rb($.a
),w
.Rb(b
.a
),w
.Rb(n
.b
))},e
.\u0275cmp=w
.Lb({type
:e
,selectors
:[["cd-rgw-user-capability-modal"]],outputs
:{submitAction
:"submitAction"},decls
:29,vars
:24,consts:function(){let e
,t
,c
,a
,i
,s
,b
;return e
="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t
="Type",c
="Permission",a
="-- Select a permission --",i
="-- Select a type --",s
="This field is required.",b
="This field is required.",[[3,"modalRef"],[1,"modal-title"],e
,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","type",1,"cd-col-form-label",3,"ngClass"],t
,[1,"cd-col-form-input"],["id","type","class","form-control","type","text","formControlName","type",3,"readonly",4,"ngIf"],["id","type","class","form-control custom-select","formControlName","type","autofocus","",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["for","perm",1,"cd-col-form-label","required"],c
,["id","perm","formControlName","perm",1,"form-control","custom-select"],[3,"ngValue"],a
,[3,"value",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["id","type","type","text","formControlName","type",1,"form-control",3,"readonly"],["id","type","formControlName","type","autofocus","",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],i
,[3,"value"],[1,"invalid-feedback"],s
,b
]},template:function(e
,t
){if(1&e
&&(w
.Xb(0,"cd-modal",0),w
.Vb(1,1),w
.bc(2,2),w
.oc(3,"titlecase"),w
.oc(4,"upperFirst"),w
.Ub(),w
.Vb(5,3),w
.Xb(6,"form",4,5),w
.Xb(8,"div",6),w
.Xb(9,"div",7),w
.Xb(10,"label",8),w
.bc(11,9),w
.Wb(),w
.Xb(12,"div",10),w
.Pc(13,yt
,1,1,"input",11),w
.Pc(14,Xt
,3,2,"select",12),w
.Pc(15,wt
,2,0,"span",13),w
.Wb(),w
.Wb(),w
.Xb(16,"div",7),w
.Xb(17,"label",14),w
.bc(18,15),w
.Wb(),w
.Xb(19,"div",10),w
.Xb(20,"select",16),w
.Xb(21,"option",17),w
.bc(22,18),w
.Wb(),w
.Pc(23,Dt
,2,2,"option",19),w
.Wb(),w
.Pc(24,St
,2,0,"span",13),w
.Wb(),w
.Wb(),w
.Wb(),w
.Xb(25,"div",20),w
.Xb(26,"cd-form-button-panel",21),w
.lc("submitActionEvent",function(){return t
.onSubmit()}),w
.oc(27,"titlecase"),w
.oc(28,"upperFirst"),w
.Wb(),w
.Wb(),w
.Wb(),w
.Ub(),w
.Wb()),2&e
){const e
=w
.Fc(7);w
.uc("modalRef",t
.activeModal
),w
.Db(4),w
.fc(w
.pc(3,13,t
.action
))(w
.pc(4,15,t
.resource
)),w
.cc(2),w
.Db(2),w
.uc("formGroup",t
.formGroup
),w
.Db(4),w
.uc("ngClass",w
.zc(21,zt
,!t
.editing
)),w
.Db(3),w
.uc("ngIf",t
.editing
),w
.Db(1),w
.uc("ngIf",!t
.editing
),w
.Db(1),w
.uc("ngIf",t
.formGroup
.showError("type",e
,"required")),w
.Db(6),w
.uc("ngValue",null),w
.Db(2),w
.uc("ngForOf",w
.yc(23,It
)),w
.Db(1),w
.uc("ngIf",t
.formGroup
.showError("perm",e
,"required")),w
.Db(2),w
.uc("form",t
.formGroup
)("submitText",w
.pc(27,17,t
.action
)+" "+w
.pc(28,19,t
.resource
))}},directives
:[vt
.a
,i
.B
,i
.r
,T
.a
,i
.k
,C
.a
,a
.p
,a
.r
,R
.a
,i
.z
,A
.a
,i
.q
,i
.i
,i
.u
,i
.C
,a
.q
,O
.a
,i
.d
,N
.a
],pipes
:[a
.A
,B
.a
],styles
:[""]}),e
})();var xt
=c("D4zM"),qt
=c("cEzo");function Et(e
,t
){1&e
&&w
.Sb(0,"input",17),2&e
&&w
.uc("readonly",!0)}function Ft(e
,t
){1&e
&&(w
.Xb(0,"option",21),w
.bc(1,22),w
.Wb()),2&e
&&w
.uc("ngValue",null)}function Pt(e
,t
){if(1&e
&&(w
.Xb(0,"option",23),w
.Rc(1),w
.Wb()),2&e
){const e
=t
.$implicit
;w
.uc("value",e
),w
.Db(1),w
.Sc(e
)}}function Tt(e
,t
){if(1&e
&&(w
.Xb(0,"select",18),w
.Pc(1,Ft
,2,1,"option",19),w
.Pc(2,Pt
,2,2,"option",20),w
.Wb()),2&e
){const e
=w
.nc();w
.Db(1),w
.uc("ngIf",null!==e
.userCandidates
),w
.Db(1),w
.uc("ngForOf",e
.userCandidates
)}}function Ct(e
,t
){1&e
&&(w
.Xb(0,"span",24),w
.bc(1,25),w
.Wb())}function Rt(e
,t
){1&e
&&(w
.Xb(0,"div",7),w
.Xb(1,"div",26),w
.Xb(2,"div",27),w
.Sb(3,"input",28),w
.Xb(4,"label",29),w
.bc(5,30),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb())}function At(e
,t
){1&e
&&(w
.Xb(0,"span",24),w
.bc(1,38),w
.Wb())}const Nt=function(e
){return{required
:e
}};function Vt(e
,t
){if(1&e
&&(w
.Xb(0,"div",7),w
.Xb(1,"label",31),w
.bc(2,32),w
.Wb(),w
.Xb(3,"div",10),w
.Xb(4,"div",33),w
.Sb(5,"input",34),w
.Xb(6,"span",35),w
.Sb(7,"button",36),w
.Sb(8,"cd-copy-2-clipboard-button",37),w
.Wb(),w
.Wb(),w
.Pc(9,At
,2,0,"span",13),w
.Wb(),w
.Wb()),2&e
){const e
=w
.nc(),t
=w
.Fc(7);w
.Db(1),w
.uc("ngClass",w
.zc(3,Nt
,!e
.viewing
)),w
.Db(4),w
.uc("readonly",e
.viewing
),w
.Db(4),w
.uc("ngIf",e
.formGroup
.showError("access_key",t
,"required"))}}function Ot(e
,t
){1&e
&&(w
.Xb(0,"span",24),w
.bc(1,44),w
.Wb())}function Bt(e
,t
){if(1&e
&&(w
.Xb(0,"div",7),w
.Xb(1,"label",39),w
.bc(2,40),w
.Wb(),w
.Xb(3,"div",10),w
.Xb(4,"div",33),w
.Sb(5,"input",41),w
.Xb(6,"span",35),w
.Sb(7,"button",42),w
.Sb(8,"cd-copy-2-clipboard-button",43),w
.Wb(),w
.Wb(),w
.Pc(9,Ot
,2,0,"span",13),w
.Wb(),w
.Wb()),2&e
){const e
=w
.nc(),t
=w
.Fc(7);w
.Db(1),w
.uc("ngClass",w
.zc(3,Nt
,!e
.viewing
)),w
.Db(4),w
.uc("readonly",e
.viewing
),w
.Db(4),w
.uc("ngIf",e
.formGroup
.showError("secret_key",t
,"required"))}}let Lt
=(()=>{class e
{constructor(e
,t
,c
){this.formBuilder
=e
,this.activeModal
=t
,this.actionLabels
=c
,this.submitAction
=new w
.p
,this.viewing
=!0,this.userCandidates
=[],this.resource
="S3 Key",this.createForm()}createForm(){this.formGroup
=this.formBuilder
.group({user
:[null,[i
.A
.required
]],generate_key
:[!0],access_key
:[null,[x
.a
.requiredIf({generate_key
:!1})]],secret_key
:[null,[x
.a
.requiredIf({generate_key
:!1})]]})}setViewing(e
=!0){this.viewing
=e
,this.action
=this.viewing
?this.actionLabels
.SHOW
:this.actionLabels
.CREATE
}setValues(e
,t
,c
){this.formGroup
.setValue({user
:e
,generate_key
:d
.a
.isEmpty(t
),access_key
:t
,secret_key
:c
})}setUserCandidates(e
){this.userCandidates
=e
}onSubmit(){this.submitAction
.emit(this.formGroup
.value
),this.activeModal
.close()}}return e
.\u0275fac=function(t
){return new(t
||e
)(w
.Rb($.a
),w
.Rb(b
.a
),w
.Rb(n
.b
))},e
.\u0275cmp=w
.Lb({type
:e
,selectors
:[["cd-rgw-user-s3-key-modal"]],outputs
:{submitAction
:"submitAction"},decls
:23,vars
:24,consts:function(){let e
,t
,c
,a
,i
,s
,b
,o
,n
;return e
="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t
="Username",c
="-- Select a username --",a
="This field is required.",i
="Auto-generate key",s
="Access key",b
="This field is required.",o
="Secret key",n
="This field is required.",[[3,"modalRef"],[1,"modal-title"],e
,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","user",1,"cd-col-form-label",3,"ngClass"],t
,[1,"cd-col-form-input"],["id","user","class","form-control","type","text","formControlName","user",3,"readonly",4,"ngIf"],["id","user","class","form-control custom-select","formControlName","user","autofocus","",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["class","form-group row",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","showSubmit","submitActionEvent"],["id","user","type","text","formControlName","user",1,"form-control",3,"readonly"],["id","user","formControlName","user","autofocus","",1,"form-control","custom-select"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"ngValue"],c
,[3,"value"],[1,"invalid-feedback"],a
,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","generate_key","type","checkbox","formControlName","generate_key",1,"custom-control-input"],["for","generate_key",1,"custom-control-label"],i
,["for","access_key",1,"cd-col-form-label",3,"ngClass"],s
,[1,"input-group"],["id","access_key","type","password","formControlName","access_key",1,"form-control",3,"readonly"],[1,"input-group-append"],["type","button","cdPasswordButton","access_key",1,"btn","btn-light"],["source","access_key"],b
,["for","secret_key",1,"cd-col-form-label",3,"ngClass"],o
,["id","secret_key","type","password","formControlName","secret_key",1,"form-control",3,"readonly"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],n
]},template:function(e
,t
){if(1&e
&&(w
.Xb(0,"cd-modal",0),w
.Vb(1,1),w
.bc(2,2),w
.oc(3,"titlecase"),w
.oc(4,"upperFirst"),w
.Ub(),w
.Vb(5,3),w
.Xb(6,"form",4,5),w
.Xb(8,"div",6),w
.Xb(9,"div",7),w
.Xb(10,"label",8),w
.bc(11,9),w
.Wb(),w
.Xb(12,"div",10),w
.Pc(13,Et
,1,1,"input",11),w
.Pc(14,Tt
,3,2,"select",12),w
.Pc(15,Ct
,2,0,"span",13),w
.Wb(),w
.Wb(),w
.Pc(16,Rt
,6,0,"div",14),w
.Pc(17,Vt
,10,5,"div",14),w
.Pc(18,Bt
,10,5,"div",14),w
.Wb(),w
.Xb(19,"div",15),w
.Xb(20,"cd-form-button-panel",16),w
.lc("submitActionEvent",function(){return t
.onSubmit()}),w
.oc(21,"titlecase"),w
.oc(22,"upperFirst"),w
.Wb(),w
.Wb(),w
.Wb(),w
.Ub(),w
.Wb()),2&e
){const e
=w
.Fc(7);w
.uc("modalRef",t
.activeModal
),w
.Db(4),w
.fc(w
.pc(3,14,t
.action
))(w
.pc(4,16,t
.resource
)),w
.cc(2),w
.Db(2),w
.uc("formGroup",t
.formGroup
),w
.Db(4),w
.uc("ngClass",w
.zc(22,Nt
,!t
.viewing
)),w
.Db(3),w
.uc("ngIf",t
.viewing
),w
.Db(1),w
.uc("ngIf",!t
.viewing
),w
.Db(1),w
.uc("ngIf",t
.formGroup
.showError("user",e
,"required")),w
.Db(1),w
.uc("ngIf",!t
.viewing
),w
.Db(1),w
.uc("ngIf",!t
.formGroup
.getValue("generate_key")),w
.Db(1),w
.uc("ngIf",!t
.formGroup
.getValue("generate_key")),w
.Db(2),w
.uc("form",t
.formGroup
)("submitText",w
.pc(21,18,t
.action
)+" "+w
.pc(22,20,t
.resource
))("showSubmit",!t
.viewing
)}},directives
:[vt
.a
,i
.B
,i
.r
,T
.a
,i
.k
,C
.a
,a
.p
,a
.r
,O
.a
,R
.a
,i
.d
,A
.a
,i
.q
,i
.i
,i
.z
,N
.a
,a
.q
,i
.u
,i
.C
,i
.b
,xt
.a
,qt
.a
],pipes
:[a
.A
,B
.a
],styles
:[""]}),e
})();class jt
{}function Ut(e
,t
){1&e
&&(w
.Xb(0,"span",29),w
.bc(1,30),w
.Wb())}function Mt(e
,t
){1&e
&&(w
.Xb(0,"span",29),w
.bc(1,31),w
.Wb())}function Gt(e
,t
){if(1&e
&&(w
.Xb(0,"option",32),w
.Rc(1),w
.Wb()),2&e
){const e
=t
.$implicit
;w
.uc("value",e
),w
.Db(1),w
.Tc(" ",e
," ")}}function Kt(e
,t
){1&e
&&(w
.Xb(0,"span",29),w
.bc(1,33),w
.Wb())}function Qt(e
,t
){1&e
&&(w
.Xb(0,"span",29),w
.bc(1,48),w
.Wb())}function Yt(e
,t
){if(1&e
&&(w
.Xb(0,"div",7),w
.Xb(1,"label",41),w
.bc(2,42),w
.Wb(),w
.Xb(3,"div",10),w
.Xb(4,"div",43),w
.Sb(5,"input",44),w
.Xb(6,"span",45),w
.Sb(7,"button",46),w
.Sb(8,"cd-copy-2-clipboard-button",47),w
.Wb(),w
.Wb(),w
.Pc(9,Qt
,2,0,"span",15),w
.Wb(),w
.Wb()),2&e
){const e
=w
.nc(2),t
=w
.Fc(7);w
.Db(9),w
.uc("ngIf",e
.formGroup
.showError("secret_key",t
,"required"))}}function Zt(e
,t
){if(1&e
&&(w
.Xb(0,"fieldset"),w
.Xb(1,"legend"),w
.bc(2,34),w
.Wb(),w
.Xb(3,"div",7),w
.Xb(4,"div",35),w
.Xb(5,"div",36),w
.Sb(6,"input",37),w
.Xb(7,"label",38),w
.bc(8,39),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Pc(9,Yt
,10,1,"div",40),w
.Wb()),2&e
){const e
=w
.nc();w
.Db(9),w
.uc("ngIf",!e
.editing
&&!e
.formGroup
.getValue("generate_secret"))}}const Jt=function(e
){return{required
:e
}},Ht=function(){return["read","write"]};let ec
=(()=>{class e
{constructor(e
,t
,c
){this.formBuilder
=e
,this.bsModalRef
=t
,this.actionLabels
=c
,this.submitAction
=new w
.p
,this.editing
=!0,this.subusers
=[],this.resource
="Subuser",this.createForm()}createForm(){this.formGroup
=this.formBuilder
.group({uid
:[null],subuid
:[null,[i
.A
.required
,this.subuserValidator()]],perm
:[null,[i
.A
.required
]],generate_secret
:[!0],secret_key
:[null,[x
.a
.requiredIf({generate_secret
:!1})]]})}subuserValidator(){const e
=this;return t
=>e
.editing
||Object(x
.b
)(t
.value
)?null:e
.subusers
.some(c
=>d
.a
.isEqual(e
.getSubuserName(c
.id
),t
.value
))?{subuserIdExists
:!0}:null}getSubuserName(e
){if(d
.a
.isEmpty(e
))return e
;const t
=e
.match(/([^:]+)(:(.+))?/);return d
.a
.isUndefined(t
[3])?t
[1]:t
[3]}setEditing(e
=!0){this.editing
=e
,this.action
=this.editing
?this.actionLabels
.EDIT
:this.actionLabels
.CREATE
}setValues(e
,t
="",c
=""){this.formGroup
.setValue({uid
:e
,subuid
:this.getSubuserName(t
),perm
:c
,generate_secret
:!0,secret_key
:null})}setSubusers(e
){this.subusers
=e
}onSubmit(){const e
=this.formGroup
.value
,t
=new jt
;t
.id
=`${e.uid}:${e.subuid}`,t
.permissions
=e
.perm
,t
.generate_secret
=e
.generate_secret
,t
.secret_key
=e
.secret_key
,this.submitAction
.emit(t
),this.bsModalRef
.close()}}return e
.\u0275fac=function(t
){return new(t
||e
)(w
.Rb($.a
),w
.Rb(b
.a
),w
.Rb(n
.b
))},e
.\u0275cmp=w
.Lb({type
:e
,selectors
:[["cd-rgw-user-subuser-modal"]],outputs
:{submitAction
:"submitAction"},decls
:39,vars
:26,consts:function(){let e
,t
,c
,a
,i
,s
,b
,o
,n
,r
,l
,u
,d
,f
;return e
="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t
="Username",c
="Subuser",a
="Permission",i
="-- Select a permission --",s
="read, write",b
="full",o
="This field is required.",n
="The chosen subuser ID is already in use.",r
="This field is required.",l
="Swift key",u
="Auto-generate secret",d
="Secret key",f
="This field is required.",[[3,"modalRef"],[1,"modal-title"],e
,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","uid",1,"cd-col-form-label"],t
,[1,"cd-col-form-input"],["id","uid","type","text","formControlName","uid",1,"form-control",3,"readonly"],["for","subuid",1,"cd-col-form-label",3,"ngClass"],c
,["id","subuid","type","text","formControlName","subuid","autofocus","",1,"form-control",3,"readonly"],["class","invalid-feedback",4,"ngIf"],["for","perm",1,"cd-col-form-label","required"],a
,["id","perm","formControlName","perm",1,"form-control","custom-select"],[3,"ngValue"],i
,[3,"value",4,"ngFor","ngForOf"],["value","read-write"],s
,["value","full-control"],b
,[4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],o
,n
,[3,"value"],r
,l
,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","generate_secret","type","checkbox","formControlName","generate_secret",1,"custom-control-input"],["for","generate_secret",1,"custom-control-label"],u
,["class","form-group row",4,"ngIf"],["for","secret_key",1,"cd-col-form-label","required"],d
,[1,"input-group"],["id","secret_key","type","password","formControlName","secret_key",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],f
]},template:function(e
,t
){if(1&e
&&(w
.Xb(0,"cd-modal",0),w
.Vb(1,1),w
.bc(2,2),w
.oc(3,"titlecase"),w
.oc(4,"upperFirst"),w
.Ub(),w
.Vb(5,3),w
.Xb(6,"form",4,5),w
.Xb(8,"div",6),w
.Xb(9,"div",7),w
.Xb(10,"label",8),w
.bc(11,9),w
.Wb(),w
.Xb(12,"div",10),w
.Sb(13,"input",11),w
.Wb(),w
.Wb(),w
.Xb(14,"div",7),w
.Xb(15,"label",12),w
.bc(16,13),w
.Wb(),w
.Xb(17,"div",10),w
.Sb(18,"input",14),w
.Pc(19,Ut
,2,0,"span",15),w
.Pc(20,Mt
,2,0,"span",15),w
.Wb(),w
.Wb(),w
.Xb(21,"div",7),w
.Xb(22,"label",16),w
.bc(23,17),w
.Wb(),w
.Xb(24,"div",10),w
.Xb(25,"select",18),w
.Xb(26,"option",19),w
.bc(27,20),w
.Wb(),w
.Pc(28,Gt
,2,2,"option",21),w
.Xb(29,"option",22),w
.bc(30,23),w
.Wb(),w
.Xb(31,"option",24),w
.bc(32,25),w
.Wb(),w
.Wb(),w
.Pc(33,Kt
,2,0,"span",15),w
.Wb(),w
.Wb(),w
.Pc(34,Zt
,10,1,"fieldset",26),w
.Wb(),w
.Xb(35,"div",27),w
.Xb(36,"cd-form-button-panel",28),w
.lc("submitActionEvent",function(){return t
.onSubmit()}),w
.oc(37,"titlecase"),w
.oc(38,"upperFirst"),w
.Wb(),w
.Wb(),w
.Wb(),w
.Ub(),w
.Wb()),2&e
){const e
=w
.Fc(7);w
.uc("modalRef",t
.bsModalRef
),w
.Db(4),w
.fc(w
.pc(3,15,t
.action
))(w
.pc(4,17,t
.resource
)),w
.cc(2),w
.Db(2),w
.uc("formGroup",t
.formGroup
),w
.Db(7),w
.uc("readonly",!0),w
.Db(2),w
.uc("ngClass",w
.zc(23,Jt
,!t
.editing
)),w
.Db(3),w
.uc("readonly",t
.editing
),w
.Db(1),w
.uc("ngIf",t
.formGroup
.showError("subuid",e
,"required")),w
.Db(1),w
.uc("ngIf",t
.formGroup
.showError("subuid",e
,"subuserIdExists")),w
.Db(6),w
.uc("ngValue",null),w
.Db(2),w
.uc("ngForOf",w
.yc(25,Ht
)),w
.Db(5),w
.uc("ngIf",t
.formGroup
.showError("perm",e
,"required")),w
.Db(1),w
.uc("ngIf",!t
.editing
),w
.Db(2),w
.uc("form",t
.formGroup
)("submitText",w
.pc(37,19,t
.action
)+" "+w
.pc(38,21,t
.resource
))}},directives
:[vt
.a
,i
.B
,i
.r
,T
.a
,i
.k
,C
.a
,R
.a
,i
.d
,A
.a
,i
.q
,i
.i
,a
.p
,N
.a
,a
.r
,i
.z
,i
.u
,i
.C
,a
.q
,O
.a
,i
.b
,xt
.a
,qt
.a
],pipes
:[a
.A
,B
.a
],styles
:[""]}),e
})();var tc
=c("Z21x");let cc
=(()=>{class e
{constructor(e
,t
){this.activeModal
=e
,this.actionLabels
=t
,this.resource
="Swift Key",this.action
=this.actionLabels
.SHOW
}setValues(e
,t
){this.user
=e
,this.secret_key
=t
}}return e
.\u0275fac=function(t
){return new(t
||e
)(w
.Rb(b
.a
),w
.Rb(n
.b
))},e
.\u0275cmp=w
.Lb({type
:e
,selectors
:[["cd-rgw-user-swift-key-modal"]],decls
:24,vars
:11,consts:function(){let e
,t
,c
;return e
="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t
="Username",c
="Secret key",[[3,"modalRef"],[1,"modal-title"],e
,[1,"modal-content"],[1,"modal-body"],["novalidate",""],[1,"form-group","row"],["for","user",1,"cd-col-form-label"],t
,[1,"cd-col-form-input"],["id","user","name","user","type","text",1,"form-control",3,"readonly","ngModel","ngModelChange"],["for","secret_key",1,"cd-col-form-label"],c
,[1,"input-group"],["id","secret_key","name","secret_key","type","password",1,"form-control",3,"ngModel","readonly","ngModelChange"],[1,"input-group-append"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],[1,"modal-footer"],[3,"backAction"]]},template:function(e
,t
){1&e
&&(w
.Xb(0,"cd-modal",0),w
.Vb(1,1),w
.bc(2,2),w
.oc(3,"titlecase"),w
.oc(4,"upperFirst"),w
.Ub(),w
.Vb(5,3),w
.Xb(6,"div",4),w
.Xb(7,"form",5),w
.Xb(8,"div",6),w
.Xb(9,"label",7),w
.bc(10,8),w
.Wb(),w
.Xb(11,"div",9),w
.Xb(12,"input",10),w
.lc("ngModelChange",function(e
){return t
.user
=e
}),w
.Wb(),w
.Wb(),w
.Wb(),w
.Xb(13,"div",6),w
.Xb(14,"label",11),w
.bc(15,12),w
.Wb(),w
.Xb(16,"div",9),w
.Xb(17,"div",13),w
.Xb(18,"input",14),w
.lc("ngModelChange",function(e
){return t
.secret_key
=e
}),w
.Wb(),w
.Xb(19,"span",15),w
.Sb(20,"button",16),w
.Sb(21,"cd-copy-2-clipboard-button",17),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Xb(22,"div",18),w
.Xb(23,"cd-back-button",19),w
.lc("backAction",function(){return t
.activeModal
.close()}),w
.Wb(),w
.Wb(),w
.Ub(),w
.Wb()),2&e
&&(w
.uc("modalRef",t
.activeModal
),w
.Db(4),w
.fc(w
.pc(3,7,t
.action
))(w
.pc(4,9,t
.resource
)),w
.cc(2),w
.Db(8),w
.uc("readonly",!0)("ngModel",t
.user
),w
.Db(6),w
.uc("ngModel",t
.secret_key
)("readonly",!0))},directives
:[vt
.a
,i
.B
,i
.r
,i
.s
,C
.a
,R
.a
,i
.d
,A
.a
,i
.q
,i
.t
,xt
.a
,qt
.a
,tc
.a
],pipes
:[a
.A
,B
.a
],styles
:[""]}),e
})();var ac
=c("EmSq");function ic(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,50),w
.Wb())}function sc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,51),w
.Wb())}function bc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,52),w
.Wb())}function oc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,56),w
.Wb())}function nc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,57),w
.Wb())}function rc(e
,t
){if(1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"label",53),w
.bc(2,54),w
.Wb(),w
.Xb(3,"div",11),w
.Sb(4,"input",55),w
.Pc(5,oc
,2,0,"span",13),w
.Pc(6,nc
,2,0,"span",13),w
.Wb(),w
.Wb()),2&e
){w
.nc();const e
=w
.Fc(2),t
=w
.nc();w
.Db(4),w
.uc("readonly",t
.editing
),w
.Db(1),w
.uc("ngIf",t
.userForm
.showError("tenant",e
,"pattern")),w
.Db(1),w
.uc("ngIf",t
.userForm
.showError("tenant",e
,"notUnique"))}}function lc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,58),w
.Wb())}function uc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,59),w
.Wb())}function dc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,60),w
.Wb())}function fc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,63),w
.Wb())}function mc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,64),w
.Wb())}function pc(e
,t
){if(1&e
&&(w
.Xb(0,"div",8),w
.Sb(1,"label",61),w
.Xb(2,"div",11),w
.Sb(3,"input",62),w
.Pc(4,fc
,2,0,"span",13),w
.Pc(5,mc
,2,0,"span",13),w
.Wb(),w
.Wb()),2&e
){w
.nc();const e
=w
.Fc(2),t
=w
.nc();w
.Db(4),w
.uc("ngIf",t
.userForm
.showError("max_buckets",e
,"required")),w
.Db(1),w
.uc("ngIf",t
.userForm
.showError("max_buckets",e
,"min"))}}function gc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,76),w
.Wb())}function hc(e
,t
){if(1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"label",69),w
.bc(2,70),w
.Wb(),w
.Xb(3,"div",11),w
.Xb(4,"div",71),w
.Sb(5,"input",72),w
.Xb(6,"span",73),w
.Sb(7,"button",74),w
.Sb(8,"cd-copy-2-clipboard-button",75),w
.Wb(),w
.Wb(),w
.Pc(9,gc
,2,0,"span",13),w
.Wb(),w
.Wb()),2&e
){w
.nc(2);const e
=w
.Fc(2),t
=w
.nc();w
.Db(9),w
.uc("ngIf",t
.userForm
.showError("access_key",e
,"required"))}}function _c(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,82),w
.Wb())}function vc(e
,t
){if(1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"label",77),w
.bc(2,78),w
.Wb(),w
.Xb(3,"div",11),w
.Xb(4,"div",71),w
.Sb(5,"input",79),w
.Xb(6,"span",73),w
.Sb(7,"button",80),w
.Sb(8,"cd-copy-2-clipboard-button",81),w
.Wb(),w
.Wb(),w
.Pc(9,_c
,2,0,"span",13),w
.Wb(),w
.Wb()),2&e
){w
.nc(2);const e
=w
.Fc(2),t
=w
.nc();w
.Db(9),w
.uc("ngIf",t
.userForm
.showError("secret_key",e
,"required"))}}function yc(e
,t
){if(1&e
&&(w
.Xb(0,"fieldset"),w
.Xb(1,"legend"),w
.bc(2,65),w
.Wb(),w
.Xb(3,"div",8),w
.Xb(4,"div",14),w
.Xb(5,"div",15),w
.Sb(6,"input",66),w
.Xb(7,"label",67),w
.bc(8,68),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Pc(9,hc
,10,1,"div",19),w
.Pc(10,vc
,10,1,"div",19),w
.Wb()),2&e
){const e
=w
.nc(2);w
.Db(9),w
.uc("ngIf",!e
.editing
&&!e
.userForm
.getValue("generate_key")),w
.Db(1),w
.uc("ngIf",!e
.editing
&&!e
.userForm
.getValue("generate_key"))}}function Wc(e
,t
){1&e
&&(w
.Xb(0,"span",92),w
.Xb(1,"span",93),w
.bc(2,94),w
.Wb(),w
.Wb())}const kc=function(e
){return[e
]};function Xc(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"span"),w
.Xb(1,"div",71),w
.Xb(2,"div",95),w
.Xb(3,"span",96),w
.Sb(4,"i"),w
.Wb(),w
.Wb(),w
.Sb(5,"input",97),w
.Xb(6,"div",98),w
.Xb(7,"span",96),w
.Sb(8,"i"),w
.Wb(),w
.Wb(),w
.Sb(9,"input",97),w
.Xb(10,"span",73),w
.Xb(11,"button",99),w
.lc("click",function(){w
.Ic(e
);const c
=t
.index
;return w
.nc(3).showSubuserModal(c
)}),w
.Sb(12,"i",89),w
.Wb(),w
.Xb(13,"button",100),w
.lc("click",function(){w
.Ic(e
);const c
=t
.index
;return w
.nc(3).deleteSubuser(c
)}),w
.Sb(14,"i",89),w
.Wb(),w
.Wb(),w
.Wb(),w
.Sb(15,"span",93),w
.Wb()}if(2&e
){const e
=t
.$implicit
,c
=w
.nc(3);w
.Db(4),w
.Fb(c
.icons
.user
),w
.Db(1),w
.vc("value",e
.id
),w
.Db(3),w
.Fb(c
.icons
.share
),w
.Db(1),w
.vc("value","full-control"===e
.permissions
?"full":e
.permissions
),w
.Db(3),w
.uc("ngClass",w
.zc(10,kc
,c
.icons
.edit
)),w
.Db(2),w
.uc("ngClass",w
.zc(12,kc
,c
.icons
.destroy
))}}function wc(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"fieldset"),w
.Xb(1,"legend"),w
.bc(2,83),w
.Wb(),w
.Xb(3,"div",84),w
.Xb(4,"div",14),w
.Pc(5,Wc
,3,0,"span",85),w
.Pc(6,Xc
,16,14,"span",86),w
.Xb(7,"div",84),w
.Xb(8,"div",87),w
.Xb(9,"button",88),w
.lc("click",function(){return w
.Ic(e
),w
.nc(2).showSubuserModal()}),w
.Sb(10,"i",89),w
.Vb(11),w
.bc(12,90),w
.oc(13,"titlecase"),w
.oc(14,"upperFirst"),w
.Ub(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Sb(15,"span",91),w
.Wb(),w
.Wb(),w
.Wb()}if(2&e
){const e
=w
.nc(2);w
.Db(5),w
.uc("ngIf",0===e
.subusers
.length
),w
.Db(1),w
.uc("ngForOf",e
.subusers
),w
.Db(4),w
.uc("ngClass",w
.zc(9,kc
,e
.icons
.add
)),w
.Db(4),w
.fc(w
.pc(13,5,e
.actionLabels
.CREATE
))(w
.pc(14,7,e
.subuserLabel
)),w
.cc(12)}}function Dc(e
,t
){1&e
&&(w
.Xb(0,"span",92),w
.Xb(1,"span",93),w
.bc(2,106),w
.Wb(),w
.Wb())}function Sc(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"span"),w
.Xb(1,"div",71),w
.Xb(2,"div",95),w
.Xb(3,"div",96),w
.Sb(4,"i"),w
.Wb(),w
.Wb(),w
.Sb(5,"input",97),w
.Xb(6,"span",73),w
.Xb(7,"button",107),w
.lc("click",function(){w
.Ic(e
);const c
=t
.index
;return w
.nc(3).showS3KeyModal(c
)}),w
.Sb(8,"i",89),w
.Wb(),w
.Xb(9,"button",108),w
.lc("click",function(){w
.Ic(e
);const c
=t
.index
;return w
.nc(3).deleteS3Key(c
)}),w
.Sb(10,"i",89),w
.Wb(),w
.Wb(),w
.Wb(),w
.Sb(11,"span",93),w
.Wb()}if(2&e
){const e
=t
.$implicit
,c
=w
.nc(3);w
.Db(4),w
.Fb(c
.icons
.key
),w
.Db(1),w
.vc("value",e
.user
),w
.Db(3),w
.uc("ngClass",w
.zc(6,kc
,c
.icons
.show
)),w
.Db(2),w
.uc("ngClass",w
.zc(8,kc
,c
.icons
.destroy
))}}function zc(e
,t
){1&e
&&(w
.Xb(0,"span",92),w
.Xb(1,"span",93),w
.bc(2,109),w
.Wb(),w
.Wb())}function Ic(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"span"),w
.Xb(1,"div",71),w
.Xb(2,"div",95),w
.Xb(3,"span",96),w
.Sb(4,"i"),w
.Wb(),w
.Wb(),w
.Sb(5,"input",97),w
.Xb(6,"span",73),w
.Xb(7,"button",110),w
.lc("click",function(){w
.Ic(e
);const c
=t
.index
;return w
.nc(3).showSwiftKeyModal(c
)}),w
.Sb(8,"i",89),w
.Wb(),w
.Wb(),w
.Wb(),w
.Sb(9,"span",93),w
.Wb()}if(2&e
){const e
=t
.$implicit
,c
=w
.nc(3);w
.Db(4),w
.Fb(c
.icons
.key
),w
.Db(1),w
.vc("value",e
.user
),w
.Db(3),w
.uc("ngClass",w
.zc(5,kc
,c
.icons
.show
))}}function $c(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"fieldset"),w
.Xb(1,"legend"),w
.bc(2,101),w
.Wb(),w
.Xb(3,"div",8),w
.Xb(4,"label",61),w
.bc(5,102),w
.Wb(),w
.Xb(6,"div",11),w
.Pc(7,Dc
,3,0,"span",85),w
.Pc(8,Sc
,12,10,"span",86),w
.Xb(9,"div",84),w
.Xb(10,"div",87),w
.Xb(11,"button",103),w
.lc("click",function(){return w
.Ic(e
),w
.nc(2).showS3KeyModal()}),w
.Sb(12,"i",89),w
.Vb(13),w
.bc(14,104),w
.oc(15,"titlecase"),w
.oc(16,"upperFirst"),w
.Ub(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Sb(17,"span",91),w
.Wb(),w
.Sb(18,"hr"),w
.Wb(),w
.Xb(19,"div",8),w
.Xb(20,"label",61),w
.bc(21,105),w
.Wb(),w
.Xb(22,"div",11),w
.Pc(23,zc
,3,0,"span",85),w
.Pc(24,Ic
,10,7,"span",86),w
.Wb(),w
.Wb(),w
.Wb()}if(2&e
){const e
=w
.nc(2);w
.Db(7),w
.uc("ngIf",0===e
.s3Keys
.length
),w
.Db(1),w
.uc("ngForOf",e
.s3Keys
),w
.Db(4),w
.uc("ngClass",w
.zc(11,kc
,e
.icons
.add
)),w
.Db(4),w
.fc(w
.pc(15,7,e
.actionLabels
.CREATE
))(w
.pc(16,9,e
.s3keyLabel
)),w
.cc(14),w
.Db(7),w
.uc("ngIf",0===e
.swiftKeys
.length
),w
.Db(1),w
.uc("ngForOf",e
.swiftKeys
)}}function xc(e
,t
){1&e
&&(w
.Xb(0,"span",92),w
.Xb(1,"span",93),w
.bc(2,114),w
.Wb(),w
.Wb())}function qc(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"span"),w
.Xb(1,"div",71),w
.Xb(2,"span",95),w
.Xb(3,"div",96),w
.Sb(4,"i"),w
.Wb(),w
.Wb(),w
.Sb(5,"input",97),w
.Xb(6,"span",73),w
.Xb(7,"button",115),w
.lc("click",function(){w
.Ic(e
);const c
=t
.index
;return w
.nc(3).showCapabilityModal(c
)}),w
.Sb(8,"i",89),w
.Wb(),w
.Xb(9,"button",116),w
.lc("click",function(){w
.Ic(e
);const c
=t
.index
;return w
.nc(3).deleteCapability(c
)}),w
.Sb(10,"i",89),w
.Wb(),w
.Wb(),w
.Wb(),w
.Sb(11,"span",93),w
.Wb()}if(2&e
){const e
=t
.$implicit
,c
=w
.nc(3);w
.Db(4),w
.Fb(c
.icons
.share
),w
.Db(1),w
.xc("value","",e
.type
,":",e
.perm
,""),w
.Db(3),w
.uc("ngClass",w
.zc(7,kc
,c
.icons
.edit
)),w
.Db(2),w
.uc("ngClass",w
.zc(9,kc
,c
.icons
.destroy
))}}function Ec(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"fieldset"),w
.Xb(1,"legend"),w
.bc(2,111),w
.Wb(),w
.Xb(3,"div",8),w
.Xb(4,"div",14),w
.Pc(5,xc
,3,0,"span",85),w
.Pc(6,qc
,12,11,"span",86),w
.Xb(7,"div",84),w
.Xb(8,"div",87),w
.Xb(9,"button",112),w
.lc("click",function(){return w
.Ic(e
),w
.nc(2).showCapabilityModal()}),w
.oc(10,"pipeFunction"),w
.oc(11,"pipeFunction"),w
.Sb(12,"i",89),w
.Vb(13),w
.bc(14,113),w
.oc(15,"titlecase"),w
.oc(16,"upperFirst"),w
.Ub(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Sb(17,"span",91),w
.Wb(),w
.Wb(),w
.Wb()}if(2&e
){const e
=w
.nc(2);w
.Db(5),w
.uc("ngIf",0===e
.capabilities
.length
),w
.Db(1),w
.uc("ngForOf",e
.capabilities
),w
.Db(3),w
.uc("disabled",w
.qc(10,7,e
.capabilities
,e
.hasAllCapabilities
))("disableTooltip",!w
.qc(11,10,e
.capabilities
,e
.hasAllCapabilities
)),w
.Db(3),w
.uc("ngClass",w
.zc(17,kc
,e
.icons
.add
)),w
.Db(4),w
.fc(w
.pc(15,13,e
.actionLabels
.ADD
))(w
.pc(16,15,e
.capabilityLabel
)),w
.cc(14)}}function Fc(e
,t
){1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"div",14),w
.Xb(2,"div",15),w
.Sb(3,"input",117),w
.Xb(4,"label",118),w
.bc(5,119),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb())}function Pc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,123),w
.Wb())}function Tc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,124),w
.Wb())}function Cc(e
,t
){if(1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"label",120),w
.bc(2,121),w
.Wb(),w
.Xb(3,"div",11),w
.Sb(4,"input",122),w
.Pc(5,Pc
,2,0,"span",13),w
.Pc(6,Tc
,2,0,"span",13),w
.Wb(),w
.Wb()),2&e
){w
.nc();const e
=w
.Fc(2),t
=w
.nc();w
.Db(5),w
.uc("ngIf",t
.userForm
.showError("user_quota_max_size",e
,"required")),w
.Db(1),w
.uc("ngIf",t
.userForm
.showError("user_quota_max_size",e
,"quotaMaxSize"))}}function Rc(e
,t
){1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"div",14),w
.Xb(2,"div",15),w
.Sb(3,"input",125),w
.Xb(4,"label",126),w
.bc(5,127),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb())}function Ac(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,131),w
.Wb())}function Nc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,132),w
.Wb())}function Vc(e
,t
){if(1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"label",128),w
.bc(2,129),w
.Wb(),w
.Xb(3,"div",11),w
.Sb(4,"input",130),w
.Pc(5,Ac
,2,0,"span",13),w
.Pc(6,Nc
,2,0,"span",13),w
.Wb(),w
.Wb()),2&e
){w
.nc();const e
=w
.Fc(2),t
=w
.nc();w
.Db(5),w
.uc("ngIf",t
.userForm
.showError("user_quota_max_objects",e
,"required")),w
.Db(1),w
.uc("ngIf",t
.userForm
.showError("user_quota_max_objects",e
,"min"))}}function Oc(e
,t
){1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"div",14),w
.Xb(2,"div",15),w
.Sb(3,"input",133),w
.Xb(4,"label",134),w
.bc(5,135),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb())}function Bc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,139),w
.Wb())}function Lc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,140),w
.Wb())}function jc(e
,t
){if(1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"label",136),w
.bc(2,137),w
.Wb(),w
.Xb(3,"div",11),w
.Sb(4,"input",138),w
.Pc(5,Bc
,2,0,"span",13),w
.Pc(6,Lc
,2,0,"span",13),w
.Wb(),w
.Wb()),2&e
){w
.nc();const e
=w
.Fc(2),t
=w
.nc();w
.Db(5),w
.uc("ngIf",t
.userForm
.showError("bucket_quota_max_size",e
,"required")),w
.Db(1),w
.uc("ngIf",t
.userForm
.showError("bucket_quota_max_size",e
,"quotaMaxSize"))}}function Uc(e
,t
){1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"div",14),w
.Xb(2,"div",15),w
.Sb(3,"input",141),w
.Xb(4,"label",142),w
.bc(5,143),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb())}function Mc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,147),w
.Wb())}function Gc(e
,t
){1&e
&&(w
.Xb(0,"span",49),w
.bc(1,148),w
.Wb())}function Kc(e
,t
){if(1&e
&&(w
.Xb(0,"div",8),w
.Xb(1,"label",144),w
.bc(2,145),w
.Wb(),w
.Xb(3,"div",11),w
.Sb(4,"input",146),w
.Pc(5,Mc
,2,0,"span",13),w
.Pc(6,Gc
,2,0,"span",13),w
.Wb(),w
.Wb()),2&e
){w
.nc();const e
=w
.Fc(2),t
=w
.nc();w
.Db(5),w
.uc("ngIf",t
.userForm
.showError("bucket_quota_max_objects",e
,"required")),w
.Db(1),w
.uc("ngIf",t
.userForm
.showError("bucket_quota_max_objects",e
,"min"))}}const Qc=function(e
){return{required
:e
}};function Yc(e
,t
){if(1&e
){const e
=w
.Yb();w
.Xb(0,"div",1),w
.Xb(1,"form",2,3),w
.Xb(3,"div",4),w
.Xb(4,"div",5),w
.bc(5,6),w
.oc(6,"titlecase"),w
.oc(7,"upperFirst"),w
.Wb(),w
.Xb(8,"div",7),w
.Xb(9,"div",8),w
.Xb(10,"label",9),w
.bc(11,10),w
.Wb(),w
.Xb(12,"div",11),w
.Sb(13,"input",12),w
.Pc(14,ic
,2,0,"span",13),w
.Pc(15,sc
,2,0,"span",13),w
.Pc(16,bc
,2,0,"span",13),w
.Wb(),w
.Wb(),w
.Xb(17,"div",8),w
.Xb(18,"div",14),w
.Xb(19,"div",15),w
.Xb(20,"input",16),w
.lc("click",function(){return w
.Ic(e
),w
.nc().updateFieldsWhenTenanted()}),w
.Wb(),w
.Xb(21,"label",17),w
.bc(22,18),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Pc(23,rc
,7,3,"div",19),w
.Xb(24,"div",8),w
.Xb(25,"label",20),w
.bc(26,21),w
.Wb(),w
.Xb(27,"div",11),w
.Sb(28,"input",22),w
.Pc(29,lc
,2,0,"span",13),w
.Wb(),w
.Wb(),w
.Xb(30,"div",8),w
.Xb(31,"label",23),w
.bc(32,24),w
.Wb(),w
.Xb(33,"div",11),w
.Sb(34,"input",25),w
.Pc(35,uc
,2,0,"span",13),w
.Pc(36,dc
,2,0,"span",13),w
.Wb(),w
.Wb(),w
.Xb(37,"div",8),w
.Xb(38,"label",26),w
.bc(39,27),w
.Wb(),w
.Xb(40,"div",11),w
.Xb(41,"select",28),w
.lc("change",function(t
){return w
.Ic(e
),w
.nc().onMaxBucketsModeChange(t
.target
.value
)}),w
.Xb(42,"option",29),w
.bc(43,30),w
.Wb(),w
.Xb(44,"option",31),w
.bc(45,32),w
.Wb(),w
.Xb(46,"option",33),w
.bc(47,34),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Pc(48,pc
,6,2,"div",19),w
.Xb(49,"div",8),w
.Xb(50,"div",14),w
.Xb(51,"div",15),w
.Sb(52,"input",35),w
.Xb(53,"label",36),w
.bc(54,37),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Pc(55,yc
,11,2,"fieldset",38),w
.Pc(56,wc
,16,11,"fieldset",38),w
.Pc(57,$c
,25,13,"fieldset",38),w
.Pc(58,Ec
,18,19,"fieldset",38),w
.Xb(59,"fieldset"),w
.Xb(60,"legend"),w
.bc(61,39),w
.Wb(),w
.Xb(62,"div",8),w
.Xb(63,"div",14),w
.Xb(64,"div",15),w
.Sb(65,"input",40),w
.Xb(66,"label",41),w
.bc(67,42),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Pc(68,Fc
,6,0,"div",19),w
.Pc(69,Cc
,7,2,"div",19),w
.Pc(70,Rc
,6,0,"div",19),w
.Pc(71,Vc
,7,2,"div",19),w
.Wb(),w
.Xb(72,"fieldset"),w
.Xb(73,"legend"),w
.bc(74,43),w
.Wb(),w
.Xb(75,"div",8),w
.Xb(76,"div",14),w
.Xb(77,"div",15),w
.Sb(78,"input",44),w
.Xb(79,"label",45),w
.bc(80,46),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Pc(81,Oc
,6,0,"div",19),w
.Pc(82,jc
,7,2,"div",19),w
.Pc(83,Uc
,6,0,"div",19),w
.Pc(84,Kc
,7,2,"div",19),w
.Wb(),w
.Wb(),w
.Xb(85,"div",47),w
.Xb(86,"cd-form-button-panel",48),w
.lc("submitActionEvent",function(){return w
.Ic(e
),w
.nc().onSubmit()}),w
.oc(87,"titlecase"),w
.oc(88,"upperFirst"),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb(),w
.Wb()}if(2&e
){const e
=w
.Fc(2),t
=w
.nc();w
.Db(1),w
.uc("formGroup",t
.userForm
),w
.Db(6),w
.fc(w
.pc(6,29,t
.action
))(w
.pc(7,31,t
.resource
)),w
.cc(5),w
.Db(3),w
.uc("ngClass",w
.zc(37,Qc
,!t
.editing
)),w
.Db(3),w
.uc("readonly",t
.editing
),w
.Db(1),w
.uc("ngIf",t
.userForm
.showError("user_id",e
,"required")),w
.Db(1),w
.uc("ngIf",t
.userForm
.showError("user_id",e
,"pattern")),w
.Db(1),w
.uc("ngIf",!t
.userForm
.getValue("show_tenant")&&t
.userForm
.showError("user_id",e
,"notUnique")),w
.Db(4),w
.uc("readonly",!0),w
.Db(3),w
.uc("ngIf",t
.userForm
.getValue("show_tenant")),w
.Db(2),w
.uc("ngClass",w
.zc(39,Qc
,!t
.editing
)),w
.Db(4),w
.uc("ngIf",t
.userForm
.showError("display_name",e
,"required")),w
.Db(6),w
.uc("ngIf",t
.userForm
.showError("email",e
,"email")),w
.Db(1),w
.uc("ngIf",t
.userForm
.showError("email",e
,"notUnique")),w
.Db(12),w
.uc("ngIf",1==t
.userForm
.get("max_buckets_mode").value
),w
.Db(7),w
.uc("ngIf",!t
.editing
),w
.Db(1),w
.uc("ngIf",t
.editing
),w
.Db(1),w
.uc("ngIf",t
.editing
),w
.Db(1),w
.uc("ngIf",t
.editing
),w
.Db(10),w
.uc("ngIf",t
.userForm
.controls
.user_quota_enabled
.value
),w
.Db(1),w
.uc("ngIf",t
.userForm
.controls
.user_quota_enabled
.value
&&!t
.userForm
.getValue("user_quota_max_size_unlimited")),w
.Db(1),w
.uc("ngIf",t
.userForm
.controls
.user_quota_enabled
.value
),w
.Db(1),w
.uc("ngIf",t
.userForm
.controls
.user_quota_enabled
.value
&&!t
.userForm
.getValue("user_quota_max_objects_unlimited")),w
.Db(10),w
.uc("ngIf",t
.userForm
.controls
.bucket_quota_enabled
.value
),w
.Db(1),w
.uc("ngIf",t
.userForm
.controls
.bucket_quota_enabled
.value
&&!t
.userForm
.getValue("bucket_quota_max_size_unlimited")),w
.Db(1),w
.uc("ngIf",t
.userForm
.controls
.bucket_quota_enabled
.value
),w
.Db(1),w
.uc("ngIf",t
.userForm
.controls
.bucket_quota_enabled
.value
&&!t
.userForm
.getValue("bucket_quota_max_objects_unlimited")),w
.Db(2),w
.uc("form",t
.userForm
)("submitText",w
.pc(87,33,t
.action
)+" "+w
.pc(88,35,t
.resource
))}}let Zc
=(()=>{class e
extends I
.a
{constructor(e
,t
,c
,a
,i
,s
,b
){super(),this.formBuilder
=e
,this.route
=t
,this.router
=c
,this.rgwUserService
=a
,this.modalService
=i
,this.notificationService
=s
,this.actionLabels
=b
,this.editing
=!1,this.submitObservables
=[],this.icons
=S
.a
,this.subusers
=[],this.s3Keys
=[],this.swiftKeys
=[],this.capabilities
=[],this.showTenant
=!1,this.previousTenant
=null,this.resource
="user",this.subuserLabel
="subuser",this.s3keyLabel
="S3 Key",this.capabilityLabel
="capability",this.editing
=this.router
.url
.startsWith(`/rgw/user/${n.e.EDIT}`),this.action
=this.editing
?this.actionLabels
.EDIT
:this.actionLabels
.CREATE
,this.createForm()}createForm(){this.userForm
=this.formBuilder
.group({user_id
:[null,[i
.A
.required
,i
.A
.pattern(/^[a
-zA
-Z0
-9!@#%^&*()_
-]+$/)],this.editing?[]:[x.a.unique(this.rgwUserService.exists,this.rgwUserService,()=>this.userForm.getValue("tenant"))]],show_tenant:[this.editing],tenant:[null,[i.A.pattern(/^[a
-zA
-Z0
-9!@#%^&*()_
-]+$/)],this.editing?[]:[x.a.unique(this.rgwUserService.exists,this.rgwUserService,()=>this.userForm.getValue("user_id"),!0)]],display_name:[null,[i.A.required]],email:[null,[x.a.email],[x.a.unique(this.rgwUserService.emailExists,this.rgwUserService)]],max_buckets_mode:[1],max_buckets:[1e3,[x.a.requiredIf({max_buckets_mode:"1"}),x.a.number(!1),i.A.min(1)]],suspended:[!1],generate_key:[!0],access_key:[null,[x.a.requiredIf({generate_key:!1})]],secret_key:[null,[x.a.requiredIf({generate_key:!1})]],user_quota_enabled:[!1],user_quota_max_size_unlimited:[!0],user_quota_max_size:[null,[x.a.composeIf({user_quota_enabled:!0,user_quota_max_size_unlimited:!1},[i.A.required,this.quotaMaxSizeValidator])]],user_quota_max_objects_unlimited:[!0],user_quota_max_objects:[null,[i.A.min(0),x.a.requiredIf({user_quota_enabled:!0,user_quota_max_objects_unlimited:!1})]],bucket_quota_enabled:[!1],bucket_quota_max_size_unlimited:[!0],bucket_quota_max_size:[null,[x.a.composeIf({bucket_quota_enabled:!0,bucket_quota_max_size_unlimited:!1},[i.A.required,this.quotaMaxSizeValidator])]],bucket_quota_max_objects_unlimited:[!0],bucket_quota_max_objects:[null,[i.A.min(0),x.a.requiredIf({bucket_quota_enabled:!0,bucket_quota_max_objects_unlimited:!1})]]})}ngOnInit(){this.route.params.subscribe(e=>{if(!e.hasOwnProperty("uid"))return void this.loadingReady();const t=decodeURIComponent(e.uid),c=[];c.push(this.rgwUserService.get(t)),c.push(this.rgwUserService.getQuota(t)),Object(f.a)(c).subscribe(e=>{const t=d.a.clone(this.userForm.value);let c=d.a.pick(e[0],d.a.keys(this.userForm.value));switch(c.max_buckets){case-1:c.max_buckets_mode=-1,c.max_buckets="";break;case 0:c.max_buckets_mode=0,c.max_buckets="";break;default:c.max_buckets_mode=1}["user","bucket"].forEach(t=>{const a=e[1][t+"_quota"];c[t+"_quota_enabled"]=a.enabled,a.max_size<0?(c[t+"_quota_max_size_unlimited"]=!0,c[t+"_quota_max_size"]=null):(c[t+"_quota_max_size_unlimited"]=!1,c[t+"_quota_max_size"]=`${a.max_size} B`),a.max_objects<0?(c[t+"_quota_max_objects_unlimited"]=!0,c[t+"_quota_max_objects"]=null):(c[t+"_quota_max_objects_unlimited"]=!1,c[t+"_quota_max_objects"]=a.max_objects)}),c=d.a.merge(t,c),this.userForm.setValue(c),this.subusers=e[0].subusers,this.s3Keys=e[0].keys,this.swiftKeys=e[0].swift_keys;const a={"read, write":"*"};e[0].caps.forEach(e=>{e.perm in a&&(e.perm=a[e.perm])}),this.capabilities=e[0].caps,this.loadingReady()},()=>{this.loadingError()})})}goToListView(){this.router.navigate(["/rgw
/user"])}onSubmit(){let e;if(this.userForm.pristine)return void this.goToListView();const t=this.getUID();if(this.editing){if(this._isGeneralDirty()){const e=this._getUpdateArgs();this.submitObservables.push(this.rgwUserService.update(t,e))}e="Updated Object Gateway user '" + t + "'"}else{const c=this._getCreateArgs();this.submitObservables.push(this.rgwUserService.create(c)),e="Created Object Gateway user '" + t + "'"}if(this._isUserQuotaDirty()){const e=this._getUserQuotaArgs();this.submitObservables.push(this.rgwUserService.updateQuota(t,e))}if(this._isBucketQuotaDirty()){const e=this._getBucketQuotaArgs();this.submitObservables.push(this.rgwUserService.updateQuota(t,e))}Object(pt.a)(...this.submitObservables).subscribe({error:()=>{this.userForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.notificationService.show(z.a.success,e),this.goToListView()}})}updateFieldsWhenTenanted(){this.showTenant=this.userForm.getValue("show_tenant"),this.showTenant?(this.userForm.get("user_id").markAsTouched(),this.previousTenant=this.userForm.get("tenant").value,this.userForm.get("tenant").patchValue(null)):(this.userForm.get("user_id").markAsUntouched(),this.userForm.get("tenant").patchValue(this.previousTenant))}getUID(){var e;let t=this.userForm.getValue("user_id");const c=null===(e=this.userForm)||void 0===e?void 0:e.getValue("tenant");return c&&c.length>0&&(t=`${this.userForm.getValue("tenant")}$${t}`),t}quotaMaxSizeValidator(e){return Object(x.b)(e.value)?null:null===RegExp("^(\\d+(\\.\\d+)?)\\s*(B|K(B|iB)?|M(B|iB)?|G(B|iB)?|T(B|iB)?)?$","i").exec(e.value)||(new gt.a).toBytes(e.value)<1024?{quotaMaxSize:!0}:null}setSubuser(e,t){const c={"full-control":"full","read-write":"readwrite"},a=this.getUID();this.submitObservables.push(this.rgwUserService.createSubuser(a,{subuser:e.id,access:e.permissions in c?c[e.permissions]:e.permissions,key_type:"swift",secret_key:e.secret_key,generate_secret:e.generate_secret?"true":"false"})),d.a.isNumber(t)?this.subusers[t]=e:(this.subusers.push(e),this.swiftKeys.push({user:e.id,secret_key:e.generate_secret?"Apply your changes first...":e.secret_key})),this.userForm.markAsDirty()}deleteSubuser(e){const t=this.subusers[e];this.submitObservables.push(this.rgwUserService.deleteSubuser(this.getUID(),t.id)),this.s3Keys=this.s3Keys.filter(e=>e.user!==t.id),this.swiftKeys=this.swiftKeys.filter(e=>e.user!==t.id),this.subusers.splice(e,1),this.userForm.markAsDirty()}setCapability(e,t){const c=this.getUID();if(d.a.isNumber(t)){const a=this.capabilities[t];this.submitObservables.push(this.rgwUserService.deleteCapability(c,a.type,a.perm)),this.submitObservables.push(this.rgwUserService.addCapability(c,e.type,e.perm)),this.capabilities[t]=e}else this.submitObservables.push(this.rgwUserService.addCapability(c,e.type,e.perm)),this.capabilities=[...this.capabilities,e];this.userForm.markAsDirty()}deleteCapability(e){const t=this.capabilities[e];this.submitObservables.push(this.rgwUserService.deleteCapability(this.getUID(),t.type,t.perm)),this.capabilities.splice(e,1),this.capabilities=[...this.capabilities],this.userForm.markAsDirty()}hasAllCapabilities(e){return!d.a.difference(_t.getAll(),d.a.map(e,"type")).length}setS3Key(e,t){if(d.a.isNumber(t));else{const t=e.user.match(/([^:]+)(:(.+))?/),c=t[1],a={subuser:t[2]?t[3]:"",generate_key:e.generate_key?"true":"false"};"false"===a.generate_key&&(d.a.isNil(e.access_key)||(a.access_key=e.access_key),d.a.isNil(e.secret_key)||(a.secret_key=e.secret_key)),this.submitObservables.push(this.rgwUserService.addS3Key(c,a)),this.s3Keys.push({user:e.user,access_key:e.generate_key?"Apply your changes first...":e.access_key,secret_key:e.generate_key?"Apply your changes first...":e.secret_key})}this.userForm.markAsDirty()}deleteS3Key(e){const t=this.s3Keys[e];this.submitObservables.push(this.rgwUserService.deleteS3Key(this.getUID(),t.access_key)),this.s3Keys.splice(e,1),this.userForm.markAsDirty()}showSubuserModal(e){const t=this.getUID(),c=this.modalService.show(ec);if(d.a.isNumber(e)){const a=this.subusers[e];c.componentInstance.setEditing(),c.componentInstance.setValues(t,a.id,a.permissions)}else c.componentInstance.setEditing(!1),c.componentInstance.setValues(t),c.componentInstance.setSubusers(this.subusers);c.componentInstance.submitAction.subscribe(t=>{this.setSubuser(t,e)})}showS3KeyModal(e){const t=this.modalService.show(Lt);if(d.a.isNumber(e)){const c=this.s3Keys[e];t.componentInstance.setViewing(),t.componentInstance.setValues(c.user,c.access_key,c.secret_key)}else{const e=this._getS3KeyUserCandidates();t.componentInstance.setViewing(!1),t.componentInstance.setUserCandidates(e),t.componentInstance.submitAction.subscribe(e=>{this.setS3Key(e)})}}showSwiftKeyModal(e){const t=this.modalService.show(cc),c=this.swiftKeys[e];t.componentInstance.setValues(c.user,c.secret_key)}showCapabilityModal(e){const t=this.modalService.show($t);if(d.a.isNumber(e)){const c=this.capabilities[e];t.componentInstance.setEditing(),t.componentInstance.setValues(c.type,c.perm)}else t.componentInstance.setEditing(!1),t.componentInstance.setCapabilities(this.capabilities);t.componentInstance.submitAction.subscribe(t=>{this.setCapability(t,e)})}_isGeneralDirty(){return["display_name","email","max_buckets_mode","max_buckets","suspended"].some(e=>this.userForm.get(e).dirty)}_isUserQuotaDirty(){return["user_quota_enabled","user_quota_max_size_unlimited","user_quota_max_size","user_quota_max_objects_unlimited","user_quota_max_objects"].some(e=>this.userForm.get(e).dirty)}_isBucketQuotaDirty(){return["bucket_quota_enabled","bucket_quota_max_size_unlimited","bucket_quota_max_size","bucket_quota_max_objects_unlimited","bucket_quota_max_objects"].some(e=>this.userForm.get(e).dirty)}_getCreateArgs(){const e={uid:this.getUID(),display_name:this.userForm.getValue("display_name"),suspended:this.userForm.getValue("suspended"),email:"",max_buckets:this.userForm.getValue("max_buckets"),generate_key:this.userForm.getValue("generate_key"),access_key:"",secret_key:""},t=this.userForm.getValue("email");d.a.isString(t)&&t.length>0&&d.a.merge(e,{email:t}),this.userForm.getValue("generate_key")||d.a.merge(e,{generate_key:!1,access_key:this.userForm.getValue("access_key"),secret_key:this.userForm.getValue("secret_key")});const c=parseInt(this.userForm.getValue("max_buckets_mode"),10);return d.a.includes([-1,0],c)&&d.a.merge(e,{max_buckets:c}),e}_getUpdateArgs(){const e={},t=["display_name","email","max_buckets","suspended"];for(const a of t)e[a]=this.userForm.getValue(a);const c=parseInt(this.userForm.getValue("max_buckets_mode"),10);return d.a.includes([-1,0],c)&&(e.max_buckets=c),e}_getUserQuotaArgs(){const e={quota_type:"user",enabled:this.userForm.getValue("user_quota_enabled"),max_size_kb:-1,max_objects:-1};if(!this.userForm.getValue("user_quota_max_size_unlimited")){const t=(new gt.a).toBytes(this.userForm.getValue("user_quota_max_size"));e.max_size_kb=(t/1024).toFixed(0)}return this.userForm
.getValue("user_quota_max_objects_unlimited")||(e
.max_objects
=this.userForm
.getValue("user_quota_max_objects")),e
}_getBucketQuotaArgs(){const e
={quota_type
:"bucket",enabled
:this.userForm
.getValue("bucket_quota_enabled"),max_size_kb
:-1,max_objects
:-1};if(!this.userForm
.getValue("bucket_quota_max_size_unlimited")){const t
=(new gt
.a
).toBytes(this.userForm
.getValue("bucket_quota_max_size"));e
.max_size_kb
=(t
/1024).toFixed(0)}return this.userForm.getValue("bucket_quota_max_objects_unlimited")||(e.max_objects=this.userForm.getValue("bucket_quota_max_objects")),e}_getS3KeyUserCandidates(){let e=[];const t=this.getUID();return d.a.isString(t)&&!d.a.isEmpty(t)&&e.push(t),this.subusers.forEach(t=>{e.push(t.id)}),this.s3Keys.forEach(t=>{e.push(t.user)}),e=d.a.uniq(e),e}onMaxBucketsModeChange(e){"1"===e&&(this.userForm.get("max_buckets").valid||this.userForm.patchValue({max_buckets:1e3}))}}return e.\u0275fac=function(t){return new(t||e)(w.Rb($.a),w.Rb(s.a),w.Rb(s.e),w.Rb(D),w.Rb($e.a),w.Rb(q.a),w.Rb(n.b))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-user-form"]],features:[w.Ab],decls:1,vars:1,consts:function(){let e,t,c,a,i,s,b,o,n,r,l,u,d,f,m,p,g,h,_,v,y,W,k,X,w,D,S,z,I,$,x,q,E,F,P,T,C,R,A,N,V,O,B,L,j,U,M,G,K,Q,Y,Z,J,H,ee,te,ce,ae,ie,se,be,oe,ne,re,le,ue,de;return e="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",t="User ID",c="Show Tenant",a="Full name",i="Email address",s="Max. buckets",b="Disabled",o="Unlimited",n="Custom",r="Suspended",l="User quota",u="Enabled",d="Bucket quota",f="Enabled",m="This field is required.",p="The value is not valid.",g="The chosen user ID is already in use.",h="Tenant",_="The value is not valid.",v="The chosen user ID exists in this tenant.",y="This field is required.",W="This is not a valid email address.",k="The chosen email address is already in use.",X="This field is required.",w="The entered value must be >= 1.",D="S3 key",S="Auto-generate key",z="Access key",I="This field is required.",$="Secret key",x="This field is required.",q="Subusers",E="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",F="There are no subusers.",P="Edit",T="Delete",C="Keys",R="S3",A="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",N="Swift",V="There are no keys.",O="Show",B="Delete",L="There are no keys.",j="Show",U="Capabilities",M="All capabilities are already added.",G="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",K="There are no capabilities.",Q="Edit",Y="Delete",Z="Unlimited size",J="Max. size",H="This field is required.",ee="The value is not valid.",te="Unlimited objects",ce="Max. objects",ae="This field is required.",ie="The entered value must be >= 0.",se="Unlimited size",be="Max. size",oe="This field is required.",ne="The value is not valid.",re="Unlimited objects",le="Max. objects",ue="This field is required.",de="The entered value must be >= 0.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],e,[1,"card-body"],[1,"form-group","row"],["for","user_id",1,"cd-col-form-label",3,"ngClass"],t,[1,"cd-col-form-input"],["id","user_id","type","text","formControlName","user_id",1,"form-control",3,"readonly"],["class","invalid-feedback",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","show_tenant","type","checkbox","formControlName","show_tenant",1,"custom-control-input",3,"readonly","click"],["for","show_tenant",1,"custom-control-label"],c,["class","form-group row",4,"ngIf"],["for","display_name",1,"cd-col-form-label",3,"ngClass"],a,["id","display_name","type","text","formControlName","display_name",1,"form-control"],["for","email",1,"cd-col-form-label"],i,["id","email","type","text","formControlName","email",1,"form-control"],["for","max_buckets_mode",1,"cd-col-form-label"],s,["formControlName","max_buckets_mode","name","max_buckets_mode","id","max_buckets_mode",1,"form-control","custom-select",3,"change"],["value","-1"],b,["value","0"],o,["value","1"],n,["id","suspended","type","checkbox","formControlName","suspended",1,"custom-control-input"],["for","suspended",1,"custom-control-label"],r,[4,"ngIf"],l,["id","user_quota_enabled","type","checkbox","formControlName","user_quota_enabled",1,"custom-control-input"],["for","user_quota_enabled",1,"custom-control-label"],u,d,["id","bucket_quota_enabled","type","checkbox","formControlName","bucket_quota_enabled",1,"custom-control-input"],["for","bucket_quota_enabled",1,"custom-control-label"],f,[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],m,p,g,["for","tenant",1,"cd-col-form-label"],h,["id","tenant","type","text","formControlName","tenant","autofocus","",1,"form-control",3,"readonly"],_,v,y,W,k,[1,"cd-col-form-label"],["id","max_buckets","type","number","formControlName","max_buckets","min","1",1,"form-control"],X,w,D,["id","generate_key","type","checkbox","formControlName","generate_key",1,"custom-control-input"],["for","generate_key",1,"custom-control-label"],S,["for","access_key",1,"cd-col-form-label","required"],z,[1,"input-group"],["id","access_key","type","password","formControlName","access_key",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","access_key",1,"btn","btn-light"],["source","access_key"],I,["for","secret_key",1,"cd-col-form-label","required"],$,["id","secret_key","type","password","formControlName","secret_key",1,"form-control"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],x,q,[1,"row"],["class","no-border",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"col-12"],["type","button",1,"btn","btn-light","float-right","tc_addSubuserButton",3,"click"],[3,"ngClass"],E,[1,"help-block"],[1,"no-border"],[1,"form-text","text-muted"],F,[1,"input-group-prepend"],[1,"input-group-text"],["type","text","readonly","",1,"cd-form-control",3,"value"],[1,"input-group-prepend","border-left-0","border-right-0"],["type","button","ngbTooltip",P,1,"btn","btn-light","tc_showSubuserButton",3,"click"],["type","button","ngbTooltip",T,1,"btn","btn-light","tc_deleteSubuserButton",3,"click"],C,R,["type","button",1,"btn","btn-light","float-right","tc_addS3KeyButton",3,"click"],A,N,V,["type","button","ngbTooltip",O,1,"btn","btn-light","tc_showS3KeyButton",3,"click"],["type","button","ngbTooltip",B,1,"btn","btn-light","tc_deleteS3KeyButton",3,"click"],L,["type","button","ngbTooltip",j,1,"btn","btn-light","tc_showSwiftKeyButton",3,"click"],U,["type","button","ngbTooltip",M,"triggers","pointerenter:pointerleave",1,"btn","btn-light","float-right","tc_addCapButton",3,"disabled","disableTooltip","click"],G,K,["type","button","ngbTooltip",Q,1,"btn","btn-light","tc_editCapButton",3,"click"],["type","button","ngbTooltip",Y,1,"btn","btn-light","tc_deleteCapButton",3,"click"],["id","user_quota_max_size_unlimited","type","checkbox","formControlName","user_quota_max_size_unlimited",1,"custom-control-input"],["for","user_quota_max_size_unlimited",1,"custom-control-label"],Z,["for","user_quota_max_size",1,"cd-col-form-label","required"],J,["id","user_quota_max_size","type","text","formControlName","user_quota_max_size","cdDimlessBinary","",1,"form-control"],H,ee,["id","user_quota_max_objects_unlimited","type","checkbox","formControlName","user_quota_max_objects_unlimited",1,"custom-control-input"],["for","user_quota_max_objects_unlimited",1,"custom-control-label"],te,["for","user_quota_max_objects",1,"cd-col-form-label","required"],ce,["id","user_quota_max_objects","type","number","formControlName","user_quota_max_objects",1,"form-control"],ae,ie,["id","bucket_quota_max_size_unlimited","type","checkbox","formControlName","bucket_quota_max_size_unlimited",1,"custom-control-input"],["for","bucket_quota_max_size_unlimited",1,"custom-control-label"],se,["for","bucket_quota_max_size",1,"cd-col-form-label","required"],be,["id","bucket_quota_max_size","type","text","formControlName","bucket_quota_max_size","cdDimlessBinary","",1,"form-control"],oe,ne,["id","bucket_quota_max_objects_unlimited","type","checkbox","formControlName","bucket_quota_max_objects_unlimited",1,"custom-control-input"],["for","bucket_quota_max_objects_unlimited",1,"custom-control-label"],re,["for","bucket_quota_max_objects",1,"cd-col-form-label","required"],le,["id","bucket_quota_max_objects","type","number","formControlName","bucket_quota_max_objects",1,"form-control"],ue,de]},template:function(e,t){1&e&&w.Pc(0,Yc,89,41,"div",0),2&e&&w.uc("cdFormLoading",t.loading)},directives:[P.a,i.B,i.r,T.a,i.k,C.a,a.p,R.a,i.d,A.a,i.q,i.i,a.r,i.b,i.z,i.u,i.C,O.a,N.a,i.v,xt.a,qt.a,a.q,b.D,ac.a],pipes:[a.A,B.a,o.b],styles:[""]}),e})();var Jc=c("x38r"),Hc=c("TJUb"),ea=c("FFMq");const ta=["accessKeyTpl"],ca=["secretKeyTpl"];function aa(e,t){if(1&e&&(w.Xb(0,"tr"),w.Xb(1,"td",15),w.bc(2,20),w.Wb(),w.Xb(3,"td"),w.Rc(4),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(4),w.Sc(e.user.email)}}function ia(e,t){if(1&e&&(w.Xb(0,"div"),w.Rc(1),w.Wb()),2&e){const e=t.$implicit;w.Db(1),w.Uc(" ",e.id," (",e.permissions,") ")}}function sa(e,t){if(1&e&&(w.Xb(0,"tr"),w.Xb(1,"td",15),w.bc(2,21),w.Wb(),w.Xb(3,"td"),w.Pc(4,ia,2,2,"div",22),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(4),w.uc("ngForOf",e.user.subusers)}}function ba(e,t){if(1&e&&(w.Xb(0,"div"),w.Rc(1),w.Wb()),2&e){const e=t.$implicit;w.Db(1),w.Uc(" ",e.type," (",e.perm,") ")}}function oa(e,t){if(1&e&&(w.Xb(0,"tr"),w.Xb(1,"td",15),w.bc(2,23),w.Wb(),w.Xb(3,"td"),w.Pc(4,ba,2,2,"div",22),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(4),w.uc("ngForOf",e.user.caps)}}function na(e,t){if(1&e&&(w.Xb(0,"tr"),w.Xb(1,"td",15),w.bc(2,24),w.Wb(),w.Xb(3,"td"),w.Rc(4),w.oc(5,"join"),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(4),w.Sc(w.pc(5,1,e.user.mfa_ids))}}function ra(e,t){1&e&&(w.Xb(0,"td"),w.Rc(1,"-"),w.Wb())}function la(e,t){1&e&&(w.Xb(0,"td"),w.bc(1,29),w.Wb())}function ua(e,t){if(1&e&&(w.Xb(0,"td"),w.Rc(1),w.oc(2,"dimlessBinary"),w.Wb()),2&e){const e=w.nc(5);w.Db(1),w.Tc(" ",w.pc(2,1,e.user.user_quota.max_size)," ")}}function da(e,t){1&e&&(w.Xb(0,"td"),w.Rc(1,"-"),w.Wb())}function fa(e,t){1&e&&(w.Xb(0,"td"),w.bc(1,30),w.Wb())}function ma(e,t){if(1&e&&(w.Xb(0,"td"),w.Rc(1),w.Wb()),2&e){const e=w.nc(5);w.Db(1),w.Tc(" ",e.user.user_quota.max_objects," ")}}function pa(e,t){if(1&e&&(w.Xb(0,"div"),w.Xb(1,"legend"),w.bc(2,25),w.Wb(),w.Xb(3,"table",9),w.Xb(4,"tbody"),w.Xb(5,"tr"),w.Xb(6,"td",10),w.bc(7,26),w.Wb(),w.Xb(8,"td",12),w.Rc(9),w.oc(10,"booleanText"),w.Wb(),w.Wb(),w.Xb(11,"tr"),w.Xb(12,"td",15),w.bc(13,27),w.Wb(),w.Pc(14,ra,2,0,"td",0),w.Pc(15,la,2,0,"td",0),w.Pc(16,ua,3,3,"td",0),w.Wb(),w.Xb(17,"tr"),w.Xb(18,"td",15),w.bc(19,28),w.Wb(),w.Pc(20,da,2,0,"td",0),w.Pc(21,fa,2,0,"td",0),w.Pc(22,ma,2,1,"td",0),w.Wb(),w.Wb(),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(9),w.Sc(w.pc(10,7,e.user.user_quota.enabled)),w.Db(5),w.uc("ngIf",!e.user.user_quota.enabled),w.Db(1),w.uc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_size<=-1),w.Db(1),w.uc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_size>-1),w.Db(4),w.uc("ngIf",!e.user.user_quota.enabled),w.Db(1),w.uc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_objects<=-1),w.Db(1),w.uc("ngIf",e.user.user_quota.enabled&&e.user.user_quota.max_objects>-1)}}function ga(e,t){1&e&&(w.Xb(0,"td"),w.Rc(1,"-"),w.Wb())}function ha(e,t){1&e&&(w.Xb(0,"td"),w.bc(1,35),w.Wb())}function _a(e,t){if(1&e&&(w.Xb(0,"td"),w.Rc(1),w.oc(2,"dimlessBinary"),w.Wb()),2&e){const e=w.nc(5);w.Db(1),w.Tc(" ",w.pc(2,1,e.user.bucket_quota.max_size)," ")}}function va(e,t){1&e&&(w.Xb(0,"td"),w.Rc(1,"-"),w.Wb())}function ya(e,t){1&e&&(w.Xb(0,"td"),w.bc(1,36),w.Wb())}function Wa(e,t){if(1&e&&(w.Xb(0,"td"),w.Rc(1),w.Wb()),2&e){const e=w.nc(5);w.Db(1),w.Tc(" ",e.user.bucket_quota.max_objects," ")}}function ka(e,t){if(1&e&&(w.Xb(0,"div"),w.Xb(1,"legend"),w.bc(2,31),w.Wb(),w.Xb(3,"table",9),w.Xb(4,"tbody"),w.Xb(5,"tr"),w.Xb(6,"td",10),w.bc(7,32),w.Wb(),w.Xb(8,"td",12),w.Rc(9),w.oc(10,"booleanText"),w.Wb(),w.Wb(),w.Xb(11,"tr"),w.Xb(12,"td",15),w.bc(13,33),w.Wb(),w.Pc(14,ga,2,0,"td",0),w.Pc(15,ha,2,0,"td",0),w.Pc(16,_a,3,3,"td",0),w.Wb(),w.Xb(17,"tr"),w.Xb(18,"td",15),w.bc(19,34),w.Wb(),w.Pc(20,va,2,0,"td",0),w.Pc(21,ya,2,0,"td",0),w.Pc(22,Wa,2,1,"td",0),w.Wb(),w.Wb(),w.Wb(),w.Wb()),2&e){const e=w.nc(4);w.Db(9),w.Sc(w.pc(10,7,e.user.bucket_quota.enabled)),w.Db(5),w.uc("ngIf",!e.user.bucket_quota.enabled),w.Db(1),w.uc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_size<=-1),w.Db(1),w.uc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_size>-1),w.Db(4),w.uc("ngIf",!e.user.bucket_quota.enabled),w.Db(1),w.uc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_objects<=-1),w.Db(1),w.uc("ngIf",e.user.bucket_quota.enabled&&e.user.bucket_quota.max_objects>-1)}}function Xa(e,t){if(1&e&&(w.Xb(0,"div"),w.Xb(1,"table",9),w.Xb(2,"tbody"),w.Xb(3,"tr"),w.Xb(4,"td",10),w.bc(5,11),w.Wb(),w.Xb(6,"td",12),w.Rc(7),w.Wb(),w.Wb(),w.Xb(8,"tr"),w.Xb(9,"td",10),w.bc(10,13),w.Wb(),w.Xb(11,"td",12),w.Rc(12),w.Wb(),w.Wb(),w.Xb(13,"tr"),w.Xb(14,"td",10),w.bc(15,14),w.Wb(),w.Xb(16,"td",12),w.Rc(17),w.Wb(),w.Wb(),w.Xb(18,"tr"),w.Xb(19,"td",15),w.bc(20,16),w.Wb(),w.Xb(21,"td"),w.Rc(22),w.Wb(),w.Wb(),w.Pc(23,aa,5,1,"tr",0),w.Xb(24,"tr"),w.Xb(25,"td",15),w.bc(26,17),w.Wb(),w.Xb(27,"td"),w.Rc(28),w.oc(29,"booleanText"),w.Wb(),w.Wb(),w.Xb(30,"tr"),w.Xb(31,"td",15),w.bc(32,18),w.Wb(),w.Xb(33,"td"),w.Rc(34),w.oc(35,"booleanText"),w.Wb(),w.Wb(),w.Xb(36,"tr"),w.Xb(37,"td",15),w.bc(38,19),w.Wb(),w.Xb(39,"td"),w.Rc(40),w.oc(41,"map"),w.Wb(),w.Wb(),w.Pc(42,sa,5,1,"tr",0),w.Pc(43,oa,5,1,"tr",0),w.Pc(44,na,6,3,"tr",0),w.Wb(),w.Wb(),w.Pc(45,pa,23,9,"div",0),w.Pc(46,ka,23,9,"div",0),w.Wb()),2&e){const e=w.nc(3);w.Db(7),w.Sc(e.user.tenant),w.Db(5),w.Sc(e.user.user_id),w.Db(5),w.Sc(e.user.uid),w.Db(5),w.Sc(e.user.display_name),w.Db(1),w.uc("ngIf",null==e.user.email?null:e.user.email.length),w.Db(5),w.Sc(w.pc(29,13,e.user.suspended)),w.Db(6),w.Sc(w.pc(35,15,"true"===e.user.system)),w.Db(6),w.Sc(w.qc(41,17,e.user.max_buckets,e.maxBucketsMap)),w.Db(2),w.uc("ngIf",e.user.subusers&&e.user.subusers.length),w.Db(1),w.uc("ngIf",e.user.caps&&e.user.caps.length),w.Db(1),w.uc("ngIf",null==e.user.mfa_ids?null:e.user.mfa_ids.length),w.Db(1),w.uc("ngIf",e.user.user_quota),w.Db(1),w.uc("ngIf",e.user.bucket_quota)}}function wa(e,t){if(1&e&&w.Pc(0,Xa,47,20,"div",0),2&e){const e=w.nc(2);w.uc("ngIf",e.user)}}const Da=function(e){return[e]};function Sa(e,t){if(1&e){const e=w.Yb();w.Xb(0,"cd-table",39),w.lc("updateSelection",function(t){return w.Ic(e),w.nc(3).updateKeysSelection(t)}),w.Xb(1,"div",40),w.Xb(2,"div",41),w.Xb(3,"button",42),w.lc("click",function(){return w.Ic(e),w.nc(3).showKeyModal()}),w.Sb(4,"i",43),w.Vb(5),w.bc(6,44),w.Ub(),w.Wb(),w.Wb(),w.Wb(),w.Wb()}if(2&e){const e=w.nc(3);w.uc("data",e.keys)("columns",e.keysColumns),w.Db(3),w.uc("disabled",!e.keysSelection.hasSingleSelection),w.Db(1),w.uc("ngClass",w.zc(4,Da,e.icons.show))}}function za(e,t){1&e&&(w.Xb(0,"li",37),w.Xb(1,"a",4),w.bc(2,38),w.Wb(),w.Pc(3,Sa,7,6,"ng-template",6),w.Wb())}function Ia(e,t){if(1&e&&(w.Vb(0),w.Xb(1,"ul",1,2),w.Xb(3,"li",3),w.Xb(4,"a",4),w.bc(5,5),w.Wb(),w.Pc(6,wa,1,1,"ng-template",6),w.Wb(),w.Pc(7,za,4,0,"li",7),w.Wb(),w.Sb(8,"div",8),w.Ub()),2&e){const e=w.Fc(2),t=w.nc();w.Db(7),w.uc("ngIf",t.keys.length),w.Db(1),w.uc("ngbNavOutlet",e)}}let $a=(()=>{class e{constructor(e,t){this.rgwUserService=e,this.modalService=t,this.keys=[],this.keysColumns=[],this.keysSelection=new De.a,this.icons=S.a}ngOnInit(){this.keysColumns=[{name:"Username",prop:"username",flexGrow:1},{name:"Type",prop:"type",flexGrow:1}],this.maxBucketsMap={"-1":"Disabled",0:"Unlimited"}}ngOnChanges(){this.selection&&(this.user=this.selection,this.user.subusers=d.a.sortBy(this.user.subusers,"id"),this.user.caps=d.a.sortBy(this.user.caps,"type"),this.rgwUserService.getQuota(this.user.uid).subscribe(e=>{d.a.extend(this.user,e)}),this.keys=[],this.user.keys&&this.user.keys.forEach(e=>{this.keys.push({id:this.keys.length+1,type:"S3",username:e.user,ref:e})}),this.user.swift_keys&&this.user.swift_keys.forEach(e=>{this.keys.push({id:this.keys.length+1,type:"Swift",username:e.user,ref:e})}),this.keys=d.a.sortBy(this.keys,"user"))}updateKeysSelection(e){this.keysSelection=e}showKeyModal(){const e=this.keysSelection.first(),t=this.modalService.show("S3"===e.type?Lt:cc);switch(e.type){case"S3":t.componentInstance.setViewing(),t.componentInstance.setValues(e.ref.user,e.ref.access_key,e.ref.secret_key);break;case"Swift":t.componentInstance.setValues(e.ref.user,e.ref.secret_key)}}}return e.\u0275fac=function(t){return new(t||e)(w.Rb(D),w.Rb($e.a))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-user-details"]],viewQuery:function(e,t){if(1&e&&(w.Wc(ta,1),w.Wc(ca,1)),2&e){let e;w.Ec(e=w.mc())&&(t.accessKeyTpl=e.first),w.Ec(e=w.mc())&&(t.secretKeyTpl=e.first)}},inputs:{selection:"selection"},features:[w.Bb],decls:1,vars:1,consts:function(){let e,t,c,a,i,s,b,o,n,r,l,u,d,f,m,p,g,h,_,v,y,W,k,X,w,D;return e="Details",t="Tenant",c="User ID",a="Username",i="Full name",s="Suspended",b="System",o="Maximum buckets",n="Email address",r="Subusers",l="Capabilities",u="MFAs(Id)",d="User quota",f="Enabled",m="Maximum size",p="Maximum objects",g="Unlimited",h="Unlimited",_="Bucket quota",v="Enabled",y="Maximum size",W="Maximum objects",k="Unlimited",X="Unlimited",w="Keys",D="Show",[[4,"ngIf"],["ngbNav","","cdStatefulTab","rgw-user-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],e,["ngbNavContent",""],["ngbNavItem","keys",4,"ngIf"],[3,"ngbNavOutlet"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],t,[1,"w-75"],c,a,[1,"bold"],i,s,b,o,n,r,[4,"ngFor","ngForOf"],l,u,d,f,m,p,g,h,_,v,y,W,k,X,["ngbNavItem","keys"],w,["columnMode","flex","selectionType","multi","forceIdentifier","true",3,"data","columns","updateSelection"],[1,"table-actions"],["dropdown","",1,"btn-group"],["type","button",1,"btn","btn-accent",3,"disabled","click"],[3,"ngClass"],D]},template:function(e,t){1&e&&w.Pc(0,Ia,9,2,"ng-container",0),2&e&&w.uc("ngIf",t.selection)},directives:[a.r,b.p,He.a,b.r,b.s,b.q,b.u,a.q,we.a,R.a,a.p],pipes:[Fe.a,Hc.a,ea.a,Se.a],styles:[""]}),e})();const xa=["userSizeTpl"],qa=["userObjectTpl"];function Ea(e,t){if(1&e&&w.Sb(0,"cd-usage-bar",8),2&e){const e=w.nc().row;w.uc("total",e.user_quota.max_size)("used",e.stats.size_actual)}}function Fa(e,t){1&e&&w.bc(0,9)}function Pa(e,t){if(1&e&&(w.Pc(0,Ea,1,2,"cd-usage-bar",6),w.Pc(1,Fa,1,0,"ng-template",null,7,w.Qc)),2&e){const e=t.row,c=w.Fc(2);w.uc("ngIf",e.user_quota.max_size>0&&e.user_quota.enabled)("ngIfElse",c)}}function Ta(e,t){if(1&e&&w.Sb(0,"cd-usage-bar",12),2&e){const e=w.nc().row;w.uc("total",e.user_quota.max_objects)("used",e.stats.num_objects)("isBinary",!1)}}function Ca(e,t){1&e&&w.bc(0,13)}function Ra(e,t){if(1&e&&(w.Pc(0,Ta,1,3,"cd-usage-bar",10),w.Pc(1,Ca,1,0,"ng-template",null,11,w.Qc)),2&e){const e=t.row,c=w.Fc(2);w.uc("ngIf",e.user_quota.max_objects>0&&e.user_quota.enabled)("ngIfElse",c)}}let Aa=(()=>{class e extends ke.a{constructor(e,t,c,a,i,s){super(s),this.authStorageService=e,this.rgwUserService=t,this.modalService=c,this.urlBuilder=a,this.actionLabels=i,this.ngZone=s,this.columns=[],this.users=[],this.selection=new De.a}ngOnInit(){this.permission=this.authStorageService.getPermissions().rgw,this.columns=[{name:"Username",prop:"uid",flexGrow:1},{name:"Tenant",prop:"tenant",flexGrow:1},{name:"Full name",prop:"display_name",flexGrow:1},{name:"Email address",prop:"email",flexGrow:1},{name:"Suspended",prop:"suspended",flexGrow:1,cellClass:"text-center",cellTransformation:Jc.a.checkIcon},{name:"Max. buckets",prop:"max_buckets",flexGrow:1,cellTransformation:Jc.a.map,customTemplateConfig:{"-1":"Disabled",0:"Unlimited"}},{name:"Capacity Limit %",prop:"size_usage",cellTemplate:this.userSizeTpl,flexGrow:.8},{name:"Object Limit %",prop:"object_usage",cellTemplate:this.userObjectTpl,flexGrow:.8}];const e=()=>this.selection.first()&&`${encodeURIComponent(this.selection.first().uid)}`;this.tableActions=[{permission:"create",icon:S.a.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE,canBePrimary:e=>!e.hasSelection},{permission:"update",icon:S.a.edit,routerLink:()=>this.urlBuilder.getEdit(e()),name:this.actionLabels.EDIT},{permission:"delete",icon:S.a.destroy,click:()=>this.deleteAction(),disable:()=>!this.selection.hasSelection,name:this.actionLabels.DELETE,canBePrimary:e=>e.hasMultiSelection}],this.setTableRefreshTimeout()}getUserList(e){this.setTableRefreshTimeout(),this.rgwUserService.list().subscribe(e=>{this.users=e},()=>{e.error()})}updateSelection(e){this.selection=e}deleteAction(){this.modalService.show(Xe.a,{itemDescription:this.selection.hasSingleSelection?"user":"users",itemNames:this.selection.selected.map(e=>e.uid),submitActionObservable:()=>new We.a(e=>{Object(f.a)(this.selection.selected.map(e=>this.rgwUserService.delete(e.uid))).subscribe({error:t=>{e.error(t),this.table.refreshBtn()},complete:()=>{e.complete(),this.table.refreshBtn()}})})})}}return e.\u0275fac=function(t){return new(t||e)(w.Rb(Ie.a),w.Rb(D),w.Rb($e.a),w.Rb(xe.a),w.Rb(n.b),w.Rb(w.D))},e.\u0275cmp=w.Lb({type:e,selectors:[["cd-rgw-user-list"]],viewQuery:function(e,t){if(1&e&&(w.Wc(we.a,3),w.Wc(xa,3),w.Wc(qa,3)),2&e){let e;w.Ec(e=w.mc())&&(t.table=e.first),w.Ec(e=w.mc())&&(t.userSizeTpl=e.first),w.Ec(e=w.mc())&&(t.userObjectTpl=e.first)}},features:[w.Cb([{provide:xe.a,useValue:new xe.a("rgw/user")}]),w.Ab],decls:8,vars:9,consts:function(){let e,t;return e="No Limit
",t="No Limit
",[["columnMode
","flex
","selectionType
","multiClick
","identifier
","uid
",3,"autoReload
","data
","columns
","hasDetails
","status
","setExpandedRow
","updateSelection
","fetchData
"],["table
",""],[1,"table
-actions
",3,"permission
","selection
","tableActions
"],["cdTableDetail
","",3,"selection
"],["userSizeTpl
",""],["userObjectTpl
",""],[3,"total
","used
",4,"ngIf
","ngIfElse
"],["noSizeQuota
",""],[3,"total
","used
"],e,[3,"total
","used
","isBinary
",4,"ngIf
","ngIfElse
"],["noObjectQuota
",""],[3,"total
","used
","isBinary
"],t]},template:function(e,t){1&e&&(w.Xb(0,"cd
-table
",0,1),w.lc("setExpandedRow
",function(e){return t.setExpandedRow(e)})("updateSelection
",function(e){return t.updateSelection(e)})("fetchData
",function(e){return t.getUserList(e)}),w.Sb(2,"cd
-table
-actions
",2),w.Sb(3,"cd
-rgw
-user
-details
",3),w.Wb(),w.Pc(4,Pa,3,2,"ng
-template
",null,4,w.Qc),w.Pc(6,Ra,3,2,"ng
-template
",null,5,w.Qc)),2&e&&(w.uc("autoReload
",!1)("data
",t.users)("columns
",t.columns)("hasDetails
",!0)("status
",t.tableStatus),w.Db(2),w.uc("permission
",t.permission)("selection
",t.selection)("tableActions
",t.tableActions),w.Db(1),w.uc("selection
",t.expandedRow))},directives:[we.a,qe.a,$a,a.r,Be.a],styles:[""]}),e})(),Na=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=w.Pb({type:e}),e.\u0275inj=w.Ob({imports:[[a.c,r.a,i.m,i.x,l.a,b.t,s.i,b.F,o.a]]}),e})();const Va=[{path:""},{path:"daemon
",component:mt,data:{breadcrumbs:"Daemons
"}},{path:"user
",data:{breadcrumbs:"Users
"},children:[{path:"",component:Aa},{path:n.e.CREATE,component:Zc,data:{breadcrumbs:n.a.CREATE}},{path:`${n.e.EDIT}/:uid`,component:Zc,data:{breadcrumbs:n.a.EDIT}}]},{path:"bucket
",data:{breadcrumbs:"Buckets
"},children:[{path:"",component:Ze},{path:n.e.CREATE,component:ye,data:{breadcrumbs:n.a.CREATE}},{path:`${n.e.EDIT}/:bid`,component:ye,data:{breadcrumbs:n.a.EDIT}}]}];let Oa=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=w.Pb({type:e}),e.\u0275inj=w.Ob({imports:[[Na,s.i.forChild(Va)]]}),e})()}}]);