- // TODO: show pending action indicator
- this.acXappService.getPolicy().subscribe((res: ACAdmissionIntervalControl) => {
- this.acForm.controls['enforce'].setValue(res.enforce);
- this.acForm.controls['window_length'].setValue(res.window_length);
- this.acForm.controls['blocking_rate'].setValue(res.blocking_rate);
- this.acForm.controls['trigger_threshold'].setValue(res.trigger_threshold);
- // TODO: clear pending action indicator
- },
- (error: HttpErrorResponse) => {
- // TODO: clear pending action indicator
- this.errorDialogService.displayError(error.message);
- });
+
+ this.instanceChange = this.instanceSelectorService.getSelectedInstance().subscribe((instance: RicInstance) => {
+ if (instance.key) {
+ // TODO: show pending action indicator
+ this.instanceKey = instance.key;
+ this.acXappService.getPolicy(instance.key).subscribe((res: ACAdmissionIntervalControl) => {
+ this.acForm.controls['class'].setValue(res.class);
+ this.acForm.controls['enforce'].setValue(res.enforce);
+ this.acForm.controls['window_length'].setValue(res.window_length);
+ this.acForm.controls['blocking_rate'].setValue(res.blocking_rate);
+ this.acForm.controls['trigger_threshold'].setValue(res.trigger_threshold);
+ // TODO: clear pending action indicator
+ },
+ (error: HttpErrorResponse) => {
+ // TODO: clear pending action indicator
+ this.errorDialogService.displayError(error.message);
+ });
+ }
+ });
+ }
+
+ ngOnDestroy() {
+ this.instanceChange.unsubscribe();