Fix for auto_close

This commit is contained in:
piotrpekala7 2020-06-15 10:39:22 +02:00
parent d6808ba1d7
commit a7f5a5fa09
2 changed files with 6 additions and 1 deletions

View File

@ -33,7 +33,7 @@
Start all nodes when this project is opened Start all nodes when this project is opened
</mat-checkbox> </mat-checkbox>
<mat-checkbox [ngModelOptions]="{standalone: true}" [(ngModel)]="!project.auto_close"> <mat-checkbox [ngModelOptions]="{standalone: true}" [(ngModel)]="auto_close">
Leave this project running in the background after closing Leave this project running in the background after closing
</mat-checkbox> </mat-checkbox>

View File

@ -22,6 +22,8 @@ export class EditProjectDialogComponent implements OnInit {
displayedColumns: string[] = ['name', 'value', 'actions']; displayedColumns: string[] = ['name', 'value', 'actions'];
variables: ProjectVariable[] = []; variables: ProjectVariable[] = [];
auto_close: boolean;
constructor( constructor(
public dialogRef: MatDialogRef<EditProjectDialogComponent>, public dialogRef: MatDialogRef<EditProjectDialogComponent>,
private formBuilder: FormBuilder, private formBuilder: FormBuilder,
@ -52,6 +54,7 @@ export class EditProjectDialogComponent implements OnInit {
if (this.project.variables) { if (this.project.variables) {
this.project.variables.forEach(n => this.variables.push(n)); this.project.variables.forEach(n => this.variables.push(n));
} }
this.auto_close = !this.project.auto_close;
} }
addVariable() { addVariable() {
@ -83,6 +86,8 @@ export class EditProjectDialogComponent implements OnInit {
this.project.grid_size = this.formGroup.get('nodeGridSize').value; this.project.grid_size = this.formGroup.get('nodeGridSize').value;
this.project.variables = this.variables; this.project.variables = this.variables;
this.project.auto_close = !this.project.auto_close;
this.projectService.update(this.server, this.project).subscribe((project: Project) => { this.projectService.update(this.server, this.project).subscribe((project: Project) => {
this.toasterService.success(`Project ${project.name} updated.`); this.toasterService.success(`Project ${project.name} updated.`);
this.onNoClick(); this.onNoClick();