mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-27 03:37:07 +00:00
Implement Idle-PC finder for IOS templates
This commit is contained in:
parent
aeb26b0f17
commit
4a34007cf4
@ -243,6 +243,7 @@
|
|||||||
placeholder="Idle-PC"
|
placeholder="Idle-PC"
|
||||||
/>
|
/>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<button mat-button class="idlePCFinderButton" (click)="findIdlePC()">Idle-PC finder</button><br /><br />
|
||||||
<mat-form-field class="form-field">
|
<mat-form-field class="form-field">
|
||||||
<input
|
<input
|
||||||
matInput
|
matInput
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
.idlePCFinderButton {
|
||||||
|
width: 100%;
|
||||||
|
}
|
@ -7,6 +7,7 @@ import { IosConfigurationService } from '../../../../services/ios-configuration.
|
|||||||
import { IosService } from '../../../../services/ios.service';
|
import { IosService } from '../../../../services/ios.service';
|
||||||
import { ControllerService } from '../../../../services/controller.service';
|
import { ControllerService } from '../../../../services/controller.service';
|
||||||
import { ToasterService } from '../../../../services/toaster.service';
|
import { ToasterService } from '../../../../services/toaster.service';
|
||||||
|
import { ProgressService } from "../../../../common/progress/progress.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-ios-template-details',
|
selector: 'app-ios-template-details',
|
||||||
@ -41,6 +42,7 @@ export class IosTemplateDetailsComponent implements OnInit {
|
|||||||
private toasterService: ToasterService,
|
private toasterService: ToasterService,
|
||||||
private formBuilder: UntypedFormBuilder,
|
private formBuilder: UntypedFormBuilder,
|
||||||
private iosConfigurationService: IosConfigurationService,
|
private iosConfigurationService: IosConfigurationService,
|
||||||
|
private progressService: ProgressService,
|
||||||
private router: Router
|
private router: Router
|
||||||
) {
|
) {
|
||||||
this.generalSettingsForm = this.formBuilder.group({
|
this.generalSettingsForm = this.formBuilder.group({
|
||||||
@ -95,6 +97,27 @@ export class IosTemplateDetailsComponent implements OnInit {
|
|||||||
this.wicMatrix = this.iosConfigurationService.getWicMatrix();
|
this.wicMatrix = this.iosConfigurationService.getWicMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
findIdlePC() {
|
||||||
|
let data = {
|
||||||
|
"image": this.iosTemplate.image,
|
||||||
|
"platform": this.iosTemplate.platform,
|
||||||
|
"ram": this.iosTemplate.ram
|
||||||
|
};
|
||||||
|
this.progressService.activate();
|
||||||
|
this.iosService.findIdlePC(this.controller, data).subscribe((result: any) => {
|
||||||
|
this.progressService.deactivate();
|
||||||
|
if (result.idlepc !== null) {
|
||||||
|
this.iosTemplate.idlepc = result.idlepc;
|
||||||
|
this.toasterService.success(`Idle-PC value found: ${result.idlepc}`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
this.progressService.deactivate();
|
||||||
|
this.toasterService.error(`Error while finding an idle-PC value`);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
fillSlotsData() {
|
fillSlotsData() {
|
||||||
|
|
||||||
// load network adapters
|
// load network adapters
|
||||||
|
@ -37,4 +37,9 @@ export class IosService {
|
|||||||
iosTemplate
|
iosTemplate
|
||||||
) as Observable<IosTemplate>;
|
) as Observable<IosTemplate>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
findIdlePC(controller:Controller, body: any) {
|
||||||
|
return this.httpController.post(controller, `/computes/${environment.compute_id}/dynamips/auto_idlepc`, body);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user