From: Patrick Seidensal Date: Thu, 12 Sep 2019 10:52:48 +0000 (+0200) Subject: mgr/dashboard: remove dead code X-Git-Tag: v15.1.0~1350^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a369d51c2cb9f7f96409b184c9f22bf3b45d5b09;p=ceph.git mgr/dashboard: remove dead code Signed-off-by: Patrick Seidensal --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts index ae525d533655..71424b84e99b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts @@ -35,31 +35,27 @@ export class MgrModuleFormComponent implements OnInit { ) {} ngOnInit() { - this.route.params.subscribe( - (params: { name: string }) => { - this.moduleName = decodeURIComponent(params.name); - this.loading = true; - const observables = []; - observables.push(this.mgrModuleService.getOptions(this.moduleName)); - observables.push(this.mgrModuleService.getConfig(this.moduleName)); - observableForkJoin(observables).subscribe( - (resp: object) => { - this.loading = false; - this.moduleOptions = resp[0]; - // Create the form dynamically. - this.createForm(); - // Set the form field values. - this.mgrModuleForm.setValue(resp[1]); - }, - (error) => { - this.error = error; - } - ); - }, - (error) => { - this.error = error; - } - ); + this.route.params.subscribe((params: { name: string }) => { + this.moduleName = decodeURIComponent(params.name); + this.loading = true; + const observables = [ + this.mgrModuleService.getOptions(this.moduleName), + this.mgrModuleService.getConfig(this.moduleName) + ]; + observableForkJoin(observables).subscribe( + (resp: object) => { + this.loading = false; + this.moduleOptions = resp[0]; + // Create the form dynamically. + this.createForm(); + // Set the form field values. + this.mgrModuleForm.setValue(resp[1]); + }, + (_error) => { + this.error = true; + } + ); + }); } getValidators(moduleOption): ValidatorFn[] { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html index ce120fbf6009..5508baff5fca 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html @@ -1,11 +1,8 @@ -Loading bucket data... -The bucket data could not be loaded.
+ *ngIf="!loading">
{ - if (!params.hasOwnProperty('bid')) { - return; - } - const bid = decodeURIComponent(params.bid); - this.loading = true; - - this.rgwBucketService.get(bid).subscribe((resp: object) => { - this.loading = false; - // Get the default values. - const defaults = _.clone(this.bucketForm.value); - // Extract the values displayed in the form. - let value = _.pick(resp, _.keys(this.bucketForm.value)); - value['placement-target'] = resp['placement_rule']; - // Append default values. - value = _.merge(defaults, value); - // Update the form. - this.bucketForm.setValue(value); - }); - }, - (error) => { - this.error = error; + this.route.params.subscribe((params: { bid: string }) => { + if (!params.hasOwnProperty('bid')) { + return; } - ); + const bid = decodeURIComponent(params.bid); + this.loading = true; + + this.rgwBucketService.get(bid).subscribe((resp: object) => { + this.loading = false; + // Get the default values. + const defaults = _.clone(this.bucketForm.value); + // Extract the values displayed in the form. + let value = _.pick(resp, _.keys(this.bucketForm.value)); + value['placement-target'] = resp['placement_rule']; + // Append default values. + value = _.merge(defaults, value); + // Update the form. + this.bucketForm.setValue(value); + }); + }); } goToListView() {