From 4ec919dfe691ce383e3970b2304f947cb5702eb5 Mon Sep 17 00:00:00 2001 From: AllForNothing Date: Sat, 11 Jul 2020 17:41:56 +0800 Subject: [PATCH] Query preheat instance by name Signed-off-by: AllForNothing --- .../distribution-instances.component.ts | 8 ++++---- .../distribution-setup-modal.component.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.ts b/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.ts index 51e12d240..46e6f8174 100644 --- a/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.ts +++ b/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.ts @@ -169,7 +169,7 @@ export class DistributionInstancesComponent implements OnInit, OnDestroy { this.operationService.publishInfo(operMessage); this.disService.UpdateInstance({ propertySet: {default: true}, - instanceId: this.selectedRow[0].id + preheatInstanceName: this.selectedRow[0].name }) .subscribe( () => { @@ -273,7 +273,7 @@ export class DistributionInstancesComponent implements OnInit, OnDestroy { operMessage.data.name = instance.name; this.operationService.publishInfo(operMessage); - return this.disService.DeleteInstance({instanceId: instance.id}).pipe( + return this.disService.DeleteInstance({preheatInstanceName: instance.name}).pipe( map(() => { this.translate.get('DISTRIBUTION.DELETED_SUCCESS').subscribe(msg => { operateChanges(operMessage, OperationState.success); @@ -305,7 +305,7 @@ export class DistributionInstancesComponent implements OnInit, OnDestroy { return this.disService .UpdateInstance({ propertySet: {enabled: true}, - instanceId: instance.id + preheatInstanceName: instance.name }) .pipe( map(() => { @@ -339,7 +339,7 @@ export class DistributionInstancesComponent implements OnInit, OnDestroy { return this.disService .UpdateInstance({ propertySet: {enabled: false}, - instanceId: instance.id + preheatInstanceName: instance.name }) .pipe( map(() => { diff --git a/src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.ts b/src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.ts index ae372a680..99c1d7f48 100644 --- a/src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.ts +++ b/src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.ts @@ -119,7 +119,7 @@ export class DistributionSetupModalComponent implements OnInit { operMessageForEdit.data.name = this.model.name; this.operationService.publishInfo(operMessageForEdit); this.saveBtnState = ClrLoadingState.LOADING; - this.distributionService.UpdateInstance({instanceId: this.model.id, propertySet: data + this.distributionService.UpdateInstance({preheatInstanceName: this.model.name, propertySet: data }).subscribe( response => { this.translate.get('DISTRIBUTION.UPDATE_SUCCESS').subscribe(msg => {