CPUs and memory limitation for Docker containers

This commit is contained in:
piotrpekala7 2020-08-12 11:55:16 +02:00
parent cb6cacc557
commit 8d795ebf10
3 changed files with 15 additions and 3 deletions

View File

@ -55,6 +55,7 @@ export class Properties {
environment: string;
extra_hosts: string;
replicate_network_connection_state: boolean;
memory: number;
}
export class Node {

View File

@ -10,9 +10,19 @@
<mat-form-field class="form-field">
<input matInput formControlName="name" type="text" [(ngModel)]="node.name" placeholder="Name">
</mat-form-field>
<mat-form-field class="form-field">
<input formControlName="adapter" matInput type="number" [(ngModel)]="node.properties.adapters" placeholder="Adapters">
</mat-form-field>
<mat-form-field class="form-field">
<input formControlName="memory" matInput type="number" [(ngModel)]="node.properties.memory" placeholder="Maximum memory">
</mat-form-field>
<mat-form-field class="form-field">
<input formControlName="cpus" matInput type="number" [(ngModel)]="node.properties.cpus" placeholder="Maximum CPUs">
</mat-form-field>
<mat-form-field class="select">
<mat-select [ngModelOptions]="{standalone: true}" placeholder="Console type" [(ngModel)]="node.console_type">
<mat-option *ngFor="let type of consoleTypes" [value]="type">

View File

@ -29,7 +29,9 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
) {
this.generalSettingsForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
adapter: new FormControl('', Validators.required)
adapter: new FormControl('', Validators.required),
memory: new FormControl(''),
cpus: new FormControl('')
});
}
@ -38,12 +40,11 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
this.node = node;
this.name = node.name;
this.getConfiguration();
})
});
}
getConfiguration() {
this.consoleTypes = this.dockerConfigurationService.getConsoleTypes();
}
onSaveClick() {