mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-07 18:44:13 +00:00
I change commented files
This commit is contained in:
parent
20fe475791
commit
7c343c51be
@ -11,7 +11,7 @@ Bug Fixes & enhancements
|
||||
- symbol is not properly selected in change symbol dialog
|
||||
- issue when using the scroll wheel on the web console
|
||||
- missing settings for Docker nodes
|
||||
- error on controllers page
|
||||
- error on servers page
|
||||
|
||||
What's new
|
||||
- double click nodes to open the console
|
||||
@ -127,7 +127,7 @@ Bug Fixes
|
||||
- Fix for return command in console
|
||||
- Fix for deleting links
|
||||
- Fix for duplicating any node type
|
||||
- Fix for console errors on controllers page
|
||||
- Fix for console errors on servers page
|
||||
- Fix for console errors on projects page
|
||||
|
||||
GNS3 Web UI 2019.2.0 v10
|
||||
@ -140,12 +140,12 @@ What's New
|
||||
- Filtering devices with packet filters on topology summary
|
||||
- Filtering devices with captures on topology summary
|
||||
- View options taken from map configuration
|
||||
- Controllers summary widget
|
||||
- Servers summary widget
|
||||
- Ability to lock single item on the map
|
||||
- Editing & import & export config files
|
||||
- Context menu for inserted drawings
|
||||
- Ability to drag topology summary & controllers summary & console widgets
|
||||
- Ability to resize topology summary & controllers summary & console widgets
|
||||
- Ability to drag topology summary & servers summary & console widgets
|
||||
- Ability to resize topology summary & servers summary & console widgets
|
||||
- Option to show the grid
|
||||
- Option to snap to grid
|
||||
- Usage instructions available from context menu
|
||||
|
@ -13,7 +13,7 @@ import { ControllerService } from '../../services/controller.service';
|
||||
export class BundledControllerFinderComponent implements OnInit {
|
||||
constructor(
|
||||
private router: Router,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private progressService: ProgressService,
|
||||
@Inject(DOCUMENT) private document
|
||||
) {}
|
||||
@ -31,7 +31,7 @@ export class BundledControllerFinderComponent implements OnInit {
|
||||
port = 80;
|
||||
}
|
||||
|
||||
this.serverService.getLocalController(this.document.location.hostname, port).then((controller:Controller ) => {
|
||||
this.controllerService.getLocalController(this.document.location.hostname, port).then((controller:Controller ) => {
|
||||
this.router.navigate(['/controller', controller.id, 'projects']);
|
||||
this.progressService.deactivate();
|
||||
});
|
||||
|
@ -30,7 +30,7 @@ export class AddControllerDialogComponent implements OnInit {
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<AddControllerDialogComponent>,
|
||||
private electronService: ElectronService,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private toasterService: ToasterService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {}
|
||||
@ -55,7 +55,7 @@ export class AddControllerDialogComponent implements OnInit {
|
||||
}
|
||||
|
||||
async numberOfLocalServers() {
|
||||
const controllers = await this.serverService.findAll();
|
||||
const controllers = await this.controllerService.findAll();
|
||||
|
||||
return controllers.filter((controller) => controller.location === 'local').length;
|
||||
}
|
||||
@ -125,7 +125,7 @@ export class AddControllerDialogComponent implements OnInit {
|
||||
}
|
||||
|
||||
const controller:Controller = Object.assign({}, this.controllerForm.value);
|
||||
this.serverService.checkServerVersion(controller).subscribe(
|
||||
this.controllerService.checkServerVersion(controller).subscribe(
|
||||
(serverInfo) => {
|
||||
if (serverInfo.version.split('.')[0] >= 3) {
|
||||
this.dialogRef.close(controller);
|
||||
|
@ -111,7 +111,7 @@ describe('discovery', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('discoverFirstAvailableServer', () => {
|
||||
describe('discoverFirstAvailableController', () => {
|
||||
let controller:Controller ;
|
||||
|
||||
beforeEach(function () {
|
||||
@ -125,7 +125,7 @@ describe('discoverFirstAvailableServer', () => {
|
||||
|
||||
it('should get first controller from discovered and with no added before', fakeAsync(() => {
|
||||
expect(component.discoveredServer).toBeUndefined();
|
||||
component.discoverFirstAvailableServer();
|
||||
component.discoverFirstAvailableController();
|
||||
tick();
|
||||
expect(component.discoveredServer.host).toEqual('199.111.111.1');
|
||||
expect(component.discoveredServer.port).toEqual(3333);
|
||||
@ -135,7 +135,7 @@ describe('discoverFirstAvailableServer', () => {
|
||||
mockedControllerService.controllers.push(controller);
|
||||
|
||||
expect(component.discoveredServer).toBeUndefined();
|
||||
component.discoverFirstAvailableServer();
|
||||
component.discoverFirstAvailableController();
|
||||
tick();
|
||||
expect(component.discoveredServer).toBeUndefined();
|
||||
}));
|
||||
|
@ -26,14 +26,14 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private versionService: VersionService,
|
||||
private serverService: ControllerService,
|
||||
private serverDatabase: ControllerDatabase,
|
||||
private controllerService: ControllerService,
|
||||
private controllerDatabase: ControllerDatabase,
|
||||
private route: ActivatedRoute
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.serverService.isServiceInitialized) this.discoverFirstServer();
|
||||
this.serverService.serviceInitialized.subscribe(async (value: boolean) => {
|
||||
if (this.controllerService.isServiceInitialized) this.discoverFirstServer();
|
||||
this.controllerService.serviceInitialized.subscribe(async (value: boolean) => {
|
||||
if (value) {
|
||||
this.discoverFirstServer();
|
||||
}
|
||||
@ -42,7 +42,7 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
|
||||
async discoverFirstServer() {
|
||||
let discovered = await this.discoverServers();
|
||||
let local = await this.serverService.findAll();
|
||||
let local = await this.controllerService.findAll();
|
||||
|
||||
local.forEach((added) => {
|
||||
discovered = discovered.filter((controller) => {
|
||||
@ -56,7 +56,7 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
}
|
||||
|
||||
async discoverServers() {
|
||||
let discoveredServers: Controller[] = [];
|
||||
let discoveredControllers: Controller[] = [];
|
||||
this.defaultServers.forEach(async (testServer) => {
|
||||
const controller = new Controller();
|
||||
controller.host = testServer.host;
|
||||
@ -65,13 +65,13 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
.get(controller)
|
||||
.toPromise()
|
||||
.catch((error) => null);
|
||||
if (version) discoveredServers.push(controller);
|
||||
if (version) discoveredControllers.push(controller);
|
||||
});
|
||||
return discoveredServers;
|
||||
return discoveredControllers;
|
||||
}
|
||||
|
||||
discoverFirstAvailableServer() {
|
||||
forkJoin([from(this.serverService.findAll()).pipe(map((s: Controller[]) => s)), this.discovery()]).subscribe(
|
||||
discoverFirstAvailableController() {
|
||||
forkJoin([from(this.controllerService.findAll()).pipe(map((s: Controller[]) => s)), this.discovery()]).subscribe(
|
||||
([local, discovered]) => {
|
||||
local.forEach((added) => {
|
||||
discovered = discovered.filter((controller) => {
|
||||
@ -98,8 +98,8 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
});
|
||||
|
||||
return new Observable<Controller[]>((observer) => {
|
||||
forkJoin(queries).subscribe((discoveredServers) => {
|
||||
observer.next(discoveredServers.filter((s) => s != null));
|
||||
forkJoin(queries).subscribe((discoveredControllers) => {
|
||||
observer.next(discoveredControllers.filter((s) => s != null));
|
||||
observer.complete();
|
||||
});
|
||||
});
|
||||
@ -124,8 +124,8 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
controller.location = 'remote';
|
||||
controller.protocol = location.protocol as ServerProtocol;
|
||||
|
||||
this.serverService.create(controller).then((created: Controller) => {
|
||||
this.serverDatabase.addServer(created);
|
||||
this.controllerService.create(controller).then((created: Controller) => {
|
||||
this.controllerDatabase.addServer(created);
|
||||
this.discoveredServer = null;
|
||||
});
|
||||
}
|
||||
|
@ -14,13 +14,13 @@
|
||||
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<a
|
||||
*ngIf="getServerStatus(row) === 'running' || row.location === 'remote' || row.location === 'bundled'"
|
||||
*ngIf="getControllerStatus(row) === 'running' || row.location === 'remote' || row.location === 'bundled'"
|
||||
[routerLink]="['/controller', row.id, 'login']"
|
||||
class="table-link"
|
||||
>{{ row.name }}</a
|
||||
>
|
||||
<span
|
||||
*ngIf="getServerStatus(row) != 'running' && row.location !== 'remote' && row.location !== 'bundled'"
|
||||
*ngIf="getControllerStatus(row) != 'running' && row.location !== 'remote' && row.location !== 'bundled'"
|
||||
>{{ row.name }}</span
|
||||
>
|
||||
</mat-cell>
|
||||
@ -46,7 +46,7 @@
|
||||
matTooltip="Go to projects"
|
||||
matTooltipClass="custom-tooltip"
|
||||
(click)="openProjects(row)"
|
||||
*ngIf="getServerStatus(row) === 'running' || row.location === 'remote' || row.location === 'bundled'"
|
||||
*ngIf="getControllerStatus(row) === 'running' || row.location === 'remote' || row.location === 'bundled'"
|
||||
>
|
||||
<mat-icon aria-label="Go to projects">arrow_forward</mat-icon>
|
||||
</button>
|
||||
@ -55,8 +55,8 @@
|
||||
mat-icon-button
|
||||
matTooltip="Start controller"
|
||||
matTooltipClass="custom-tooltip"
|
||||
(click)="startServer(row)"
|
||||
*ngIf="row.location === 'local' && getServerStatus(row) === 'stopped'"
|
||||
(click)="startController(row)"
|
||||
*ngIf="row.location === 'local' && getControllerStatus(row) === 'stopped'"
|
||||
>
|
||||
<mat-icon aria-label="Start controller">play_arrow</mat-icon>
|
||||
</button>
|
||||
@ -65,22 +65,22 @@
|
||||
mat-icon-button
|
||||
matTooltip="Stop controller"
|
||||
matTooltipClass="custom-tooltip"
|
||||
(click)="stopServer(row)"
|
||||
*ngIf="row.location === 'local' && getServerStatus(row) === 'running'"
|
||||
(click)="stopController(row)"
|
||||
*ngIf="row.location === 'local' && getControllerStatus(row) === 'running'"
|
||||
>
|
||||
<mat-icon aria-label="Stop controller">stop</mat-icon>
|
||||
</button>
|
||||
|
||||
<mat-spinner
|
||||
[diameter]="24"
|
||||
*ngIf="row.location === 'local' && getServerStatus(row) === 'starting'"
|
||||
*ngIf="row.location === 'local' && getControllerStatus(row) === 'starting'"
|
||||
></mat-spinner>
|
||||
|
||||
<button
|
||||
mat-icon-button
|
||||
matTooltip="Remove controller"
|
||||
matTooltipClass="custom-tooltip"
|
||||
(click)="deleteServer(row)"
|
||||
(click)="deleteController(row)"
|
||||
>
|
||||
<mat-icon aria-label="Remove controller">delete</mat-icon>
|
||||
</button>
|
||||
|
@ -20,15 +20,15 @@ import { AddControllerDialogComponent } from './add-controller-dialog/add-contro
|
||||
styleUrls: ['./controllers.component.scss'],
|
||||
})
|
||||
export class ControllersComponent implements OnInit, OnDestroy {
|
||||
dataSource: ServerDataSource;
|
||||
dataSource: ControllerDataSource;
|
||||
displayedColumns = ['id', 'name', 'ip', 'port', 'actions'];
|
||||
controllerStatusSubscription: Subscription;
|
||||
isElectronApp: boolean = false;
|
||||
|
||||
constructor(
|
||||
private dialog: MatDialog,
|
||||
private serverService: ControllerService,
|
||||
private serverDatabase: ControllerDatabase,
|
||||
private controllerService: ControllerService,
|
||||
private controllerDatabase: ControllerDatabase,
|
||||
private controllerManagement: ControllerManagementService,
|
||||
private changeDetector: ChangeDetectorRef,
|
||||
private electronService: ElectronService,
|
||||
@ -41,7 +41,7 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
getControllers() {
|
||||
const runningServersNames = this.controllerManagement.getRunningServers();
|
||||
|
||||
this.serverService.findAll().then((controllers:Controller []) => {
|
||||
this.controllerService.findAll().then((controllers:Controller []) => {
|
||||
controllers.forEach((controller) => {
|
||||
const serverIndex = runningServersNames.findIndex((controllerName) => controller.name === controllerName);
|
||||
if (serverIndex >= 0) {
|
||||
@ -50,11 +50,11 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
|
||||
controllers.forEach((controller) => {
|
||||
this.serverService.checkServerVersion(controller).subscribe(
|
||||
this.controllerService.checkServerVersion(controller).subscribe(
|
||||
(serverInfo) => {
|
||||
if (serverInfo.version.split('.')[0] >= 3) {
|
||||
if (!controller.protocol) controller.protocol = location.protocol as ServerProtocol;
|
||||
if (!this.serverDatabase.find(controller.name)) this.serverDatabase.addServer(controller);
|
||||
if (!this.controllerDatabase.find(controller.name)) this.controllerDatabase.addServer(controller);
|
||||
}
|
||||
},
|
||||
(error) => { }
|
||||
@ -66,36 +66,36 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
ngOnInit() {
|
||||
this.isElectronApp = this.electronService.isElectronApp;
|
||||
|
||||
if (this.serverService && this.serverService.isServiceInitialized) this.getControllers();
|
||||
if (this.controllerService && this.controllerService.isServiceInitialized) this.getControllers();
|
||||
|
||||
if (this.serverService && this.serverService.isServiceInitialized) {
|
||||
this.serverService.serviceInitialized.subscribe(async (value: boolean) => {
|
||||
if (this.controllerService && this.controllerService.isServiceInitialized) {
|
||||
this.controllerService.serviceInitialized.subscribe(async (value: boolean) => {
|
||||
if (value) {
|
||||
this.getControllers();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.dataSource = new ServerDataSource(this.serverDatabase);
|
||||
this.dataSource = new ControllerDataSource(this.controllerDatabase);
|
||||
|
||||
this.controllerStatusSubscription = this.controllerManagement.controllerStatusChanged.subscribe((serverStatus) => {
|
||||
const controller = this.serverDatabase.find(serverStatus.serverName);
|
||||
this.controllerStatusSubscription = this.controllerManagement.controllerStatusChanged.subscribe((controllerStatus) => {
|
||||
const controller = this.controllerDatabase.find(controllerStatus.controllerName);
|
||||
if (!controller) {
|
||||
return;
|
||||
}
|
||||
if (serverStatus.status === 'starting') {
|
||||
if (controllerStatus.status === 'starting') {
|
||||
controller.status = 'starting';
|
||||
}
|
||||
if (serverStatus.status === 'stopped') {
|
||||
if (controllerStatus.status === 'stopped') {
|
||||
controller.status = 'stopped';
|
||||
}
|
||||
if (serverStatus.status === 'errored') {
|
||||
if (controllerStatus.status === 'errored') {
|
||||
controller.status = 'stopped';
|
||||
}
|
||||
if (serverStatus.status === 'started') {
|
||||
if (controllerStatus.status === 'started') {
|
||||
controller.status = 'running';
|
||||
}
|
||||
this.serverDatabase.update(controller);
|
||||
this.controllerDatabase.update(controller);
|
||||
this.changeDetector.detectChanges();
|
||||
});
|
||||
}
|
||||
@ -105,8 +105,8 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
startLocalController() {
|
||||
const controller = this.serverDatabase.data.find((n) => n.location === 'bundled' || 'local');
|
||||
this.startServer(controller);
|
||||
const controller = this.controllerDatabase.data.find((n) => n.location === 'bundled' || 'local');
|
||||
this.startController(controller);
|
||||
}
|
||||
|
||||
openProjects(controller) {
|
||||
@ -122,14 +122,14 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
|
||||
dialogRef.afterClosed().subscribe((controller) => {
|
||||
if (controller) {
|
||||
this.serverService.create(controller).then((created:Controller ) => {
|
||||
this.serverDatabase.addServer(created);
|
||||
this.controllerService.create(controller).then((created:Controller ) => {
|
||||
this.controllerDatabase.addServer(created);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getServerStatus(controller:Controller ) {
|
||||
getControllerStatus(controller:Controller ) {
|
||||
if (controller.location === 'local') {
|
||||
if (controller.status === undefined) {
|
||||
return 'stopped';
|
||||
@ -138,37 +138,37 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
deleteServer(controller:Controller ) {
|
||||
deleteController(controller:Controller ) {
|
||||
this.bottomSheet.open(ConfirmationBottomSheetComponent);
|
||||
let bottomSheetRef = this.bottomSheet._openedBottomSheetRef;
|
||||
bottomSheetRef.instance.message = 'Do you want to delete the controller?';
|
||||
const bottomSheetSubscription = bottomSheetRef.afterDismissed().subscribe((result: boolean) => {
|
||||
if (result) {
|
||||
this.serverService.delete(controller).then(() => {
|
||||
this.serverDatabase.remove(controller);
|
||||
this.controllerService.delete(controller).then(() => {
|
||||
this.controllerDatabase.remove(controller);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async startServer(controller:Controller ) {
|
||||
async startController(controller:Controller ) {
|
||||
await this.controllerManagement.start(controller);
|
||||
}
|
||||
|
||||
async stopServer(controller:Controller ) {
|
||||
async stopController(controller:Controller ) {
|
||||
await this.controllerManagement.stop(controller);
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerDataSource extends DataSource<Controller> {
|
||||
constructor(private serverDatabase: ControllerDatabase) {
|
||||
export class ControllerDataSource extends DataSource<Controller> {
|
||||
constructor(private controllerDatabase: ControllerDatabase) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable< Controller[] > {
|
||||
return merge(this.serverDatabase.dataChange).pipe(
|
||||
return merge(this.controllerDatabase.dataChange).pipe(
|
||||
map(() => {
|
||||
return this.serverDatabase.data;
|
||||
return this.controllerDatabase.data;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -34,17 +34,17 @@ export class DirectLinkComponent implements OnInit {
|
||||
});
|
||||
|
||||
constructor(
|
||||
private serverService: ControllerService,
|
||||
private serverDatabase: ControllerDatabase,
|
||||
private controllerService: ControllerService,
|
||||
private controllerDatabase: ControllerDatabase,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private toasterService: ToasterService
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
if (this.serverService.isServiceInitialized) this.getControllers();
|
||||
if (this.controllerService.isServiceInitialized) this.getControllers();
|
||||
|
||||
this.serverService.serviceInitialized.subscribe(async (value: boolean) => {
|
||||
this.controllerService.serviceInitialized.subscribe(async (value: boolean) => {
|
||||
if (value) {
|
||||
this.getControllers();
|
||||
}
|
||||
@ -56,7 +56,7 @@ export class DirectLinkComponent implements OnInit {
|
||||
this.controllerPort = +this.route.snapshot.paramMap.get('server_port');
|
||||
this.projectId = this.route.snapshot.paramMap.get('project_id');
|
||||
|
||||
const controllers = await this.serverService.findAll();
|
||||
const controllers = await this.controllerService.findAll();
|
||||
const controller = controllers.filter((controller) => controller.host === this.controllerIp && controller.port === this.controllerPort)[0];
|
||||
|
||||
if (controller) {
|
||||
@ -80,7 +80,7 @@ export class DirectLinkComponent implements OnInit {
|
||||
serverToAdd.location = this.serverForm.get('location').value;
|
||||
serverToAdd.protocol = this.serverForm.get('protocol').value;
|
||||
|
||||
this.serverService.create(serverToAdd).then((addedServer:Controller ) => {
|
||||
this.controllerService.create(serverToAdd).then((addedServer:Controller ) => {
|
||||
this.router.navigate(['/controller', addedServer.id, 'project', this.projectId]);
|
||||
});
|
||||
}
|
||||
|
@ -50,8 +50,8 @@ export class DrawingAddedComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.drawingService
|
||||
.add(this.controller, this.project.project_id, evt.x, evt.y, svgText)
|
||||
.subscribe((serverDrawing: Drawing) => {
|
||||
this.drawingsDataSource.add(serverDrawing);
|
||||
.subscribe((controllerDrawing: Drawing) => {
|
||||
this.drawingsDataSource.add(controllerDrawing);
|
||||
this.drawingSaved.emit(true);
|
||||
});
|
||||
}
|
||||
|
@ -36,8 +36,8 @@ export class DrawingDraggedComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.drawingService
|
||||
.updatePosition(this.controller, this.project, drawing, drawing.x, drawing.y)
|
||||
.subscribe((serverDrawing: Drawing) => {
|
||||
this.drawingsDataSource.update(serverDrawing);
|
||||
.subscribe((controllerDrawing: Drawing) => {
|
||||
this.drawingsDataSource.update(controllerDrawing);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -35,8 +35,8 @@ export class DrawingResizedComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.drawingService
|
||||
.updateSizeAndPosition(this.controller, drawing, resizedEvent.x, resizedEvent.y, svgString)
|
||||
.subscribe((serverDrawing: Drawing) => {
|
||||
this.drawingsDataSource.update(serverDrawing);
|
||||
.subscribe((controllerDrawing: Drawing) => {
|
||||
this.drawingsDataSource.update(controllerDrawing);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -40,8 +40,8 @@ export class InterfaceLabelDraggedComponent {
|
||||
link.nodes[1].label.y += draggedEvent.dy;
|
||||
}
|
||||
|
||||
this.linkService.updateNodes(this.controller, link, link.nodes).subscribe((serverLink: Link) => {
|
||||
this.linksDataSource.update(serverLink);
|
||||
this.linkService.updateNodes(this.controller, link, link.nodes).subscribe((controllerLink: Link) => {
|
||||
this.linksDataSource.update(controllerLink);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -51,8 +51,8 @@ export class TextAddedComponent implements OnInit, OnDestroy {
|
||||
this.context.transformation.k,
|
||||
svgText
|
||||
)
|
||||
.subscribe((serverDrawing: Drawing) => {
|
||||
this.drawingsDataSource.add(serverDrawing);
|
||||
.subscribe((controllerDrawing: Drawing) => {
|
||||
this.drawingsDataSource.add(controllerDrawing);
|
||||
this.drawingSaved.emit(true);
|
||||
});
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ export class TextEditedComponent implements OnInit, OnDestroy {
|
||||
|
||||
let drawing = this.drawingsDataSource.get(evt.textDrawingId);
|
||||
|
||||
this.drawingService.updateText(this.controller, drawing, svgString).subscribe((serverDrawing: Drawing) => {
|
||||
this.drawingsDataSource.update(serverDrawing);
|
||||
this.drawingService.updateText(this.controller, drawing, svgString).subscribe((controllerDrawing: Drawing) => {
|
||||
this.drawingsDataSource.update(controllerDrawing);
|
||||
this.drawingsEventSource.textSaved.emit(true);
|
||||
});
|
||||
}
|
||||
|
@ -20,14 +20,14 @@ export class imageDatabase {
|
||||
}
|
||||
|
||||
export class imageDataSource extends DataSource<Image> {
|
||||
constructor(private serverDatabase: imageDatabase) {
|
||||
constructor(private controllerDatabase: imageDatabase) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<Image[]> {
|
||||
return merge(this.serverDatabase.dataChange).pipe(
|
||||
return merge(this.controllerDatabase.dataChange).pipe(
|
||||
map(() => {
|
||||
return this.serverDatabase.data;
|
||||
return this.controllerDatabase.data;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ export class ImageManagerComponent implements OnInit {
|
||||
private imageService: ImageManagerService,
|
||||
private progressService: ProgressService,
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private versionService: VersionService,
|
||||
private dialog: MatDialog,
|
||||
private toasterService: ToasterService,
|
||||
@ -41,7 +41,7 @@ export class ImageManagerComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
let controller_id = parseInt(this.route.snapshot.paramMap.get('controller_id'));
|
||||
this.serverService.get(controller_id).then((controller:Controller ) => {
|
||||
this.controllerService.get(controller_id).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
if (controller.authToken) {
|
||||
this.getImages()
|
||||
|
@ -33,8 +33,8 @@ export class LoginComponent implements OnInit, DoCheck {
|
||||
|
||||
constructor(
|
||||
private loginService: LoginService,
|
||||
private serverService: ControllerService,
|
||||
private serverDatabase: ControllerDatabase,
|
||||
private controllerService: ControllerService,
|
||||
private controllerDatabase: ControllerDatabase,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private toasterService: ToasterService,
|
||||
@ -45,7 +45,7 @@ export class LoginComponent implements OnInit, DoCheck {
|
||||
async ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/';
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
if (controller.authToken) {
|
||||
@ -85,7 +85,7 @@ export class LoginComponent implements OnInit, DoCheck {
|
||||
controller.username = username;
|
||||
controller.password = password;
|
||||
controller.tokenExpired = false;
|
||||
await this.serverService.update(controller);
|
||||
await this.controllerService.update(controller);
|
||||
|
||||
if (this.returnUrl.length <= 1) {
|
||||
this.router.navigate(['/controller', this.controller.id, 'projects']);
|
||||
|
@ -24,7 +24,7 @@ export class CloudNodesAddTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService,
|
||||
private router: Router,
|
||||
private toasterService: ToasterService,
|
||||
@ -39,7 +39,7 @@ export class CloudNodesAddTemplateComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ export class CloudNodesTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService,
|
||||
private toasterService: ToasterService,
|
||||
private builtInTemplatesConfigurationService: BuiltInTemplatesConfigurationService,
|
||||
@ -49,7 +49,7 @@ export class CloudNodesTemplateDetailsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -18,13 +18,13 @@ export class CloudNodesTemplatesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -24,7 +24,7 @@ export class EthernetHubsAddTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService,
|
||||
private router: Router,
|
||||
private toasterService: ToasterService,
|
||||
@ -40,7 +40,7 @@ export class EthernetHubsAddTemplateComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ export class EthernetHubsTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService,
|
||||
private toasterService: ToasterService,
|
||||
private formBuilder: FormBuilder,
|
||||
@ -41,7 +41,7 @@ export class EthernetHubsTemplateDetailsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.categories = this.builtInTemplatesConfigurationService.getCategoriesForEthernetHubs();
|
||||
|
@ -18,13 +18,13 @@ export class EthernetHubsTemplatesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -24,7 +24,7 @@ export class EthernetSwitchesAddTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService,
|
||||
private router: Router,
|
||||
private toasterService: ToasterService,
|
||||
@ -40,7 +40,7 @@ export class EthernetSwitchesAddTemplateComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ export class EthernetSwitchesTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService,
|
||||
private toasterService: ToasterService,
|
||||
private formBuilder: FormBuilder,
|
||||
@ -42,7 +42,7 @@ export class EthernetSwitchesTemplateDetailsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -18,13 +18,13 @@ export class EthernetSwitchesTemplatesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -34,7 +34,7 @@ export class AddDockerTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private dockerService: DockerService,
|
||||
private toasterService: ToasterService,
|
||||
private router: Router,
|
||||
@ -60,7 +60,7 @@ export class AddDockerTemplateComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.consoleTypes = this.configurationService.getConsoleTypes();
|
||||
|
@ -21,7 +21,7 @@ export class CopyDockerTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private dockerService: DockerService,
|
||||
private toasterService: ToasterService,
|
||||
private router: Router,
|
||||
@ -35,7 +35,7 @@ export class CopyDockerTemplateComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.dockerService.getTemplate(this.controller, template_id).subscribe((dockerTemplate: DockerTemplate) => {
|
||||
|
@ -30,7 +30,7 @@ export class DockerTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private dockerService: DockerService,
|
||||
private toasterService: ToasterService,
|
||||
private configurationService: DockerConfigurationService,
|
||||
@ -48,7 +48,7 @@ export class DockerTemplateDetailsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -18,14 +18,14 @@ export class DockerTemplatesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private dockerService: DockerService,
|
||||
private router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -56,7 +56,7 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private iosService: IosService,
|
||||
private toasterService: ToasterService,
|
||||
private formBuilder: FormBuilder,
|
||||
@ -113,7 +113,7 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
||||
})
|
||||
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getImages();
|
||||
|
@ -21,7 +21,7 @@ export class CopyIosTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private iosService: IosService,
|
||||
private toasterService: ToasterService,
|
||||
private router: Router,
|
||||
@ -35,7 +35,7 @@ export class CopyIosTemplateComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.iosService.getTemplate(this.controller, template_id).subscribe((iosTemplate: IosTemplate) => {
|
||||
|
@ -15,13 +15,13 @@ export class DynamipsPreferencesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private controllerSettingsService: ControllerSettingsService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ export class IosTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private iosService: IosService,
|
||||
private toasterService: ToasterService,
|
||||
private formBuilder: FormBuilder,
|
||||
@ -71,7 +71,7 @@ export class IosTemplateDetailsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -19,14 +19,14 @@ export class IosTemplatesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private iosService: IosService,
|
||||
private router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -40,7 +40,7 @@ export class AddIouTemplateComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private iouService: IouService,
|
||||
private toasterService: ToasterService,
|
||||
private router: Router,
|
||||
@ -85,7 +85,7 @@ export class AddIouTemplateComponent implements OnInit, OnDestroy {
|
||||
};
|
||||
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getImages();
|
||||
this.templateMocksService.getIouTemplate().subscribe((iouTemplate: IouTemplate) => {
|
||||
|
@ -21,7 +21,7 @@ export class CopyIouTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private qemuService: IouService,
|
||||
private toasterService: ToasterService,
|
||||
private router: Router,
|
||||
@ -35,7 +35,7 @@ export class CopyIouTemplateComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.qemuService.getTemplate(this.controller, template_id).subscribe((iouTemplate: IouTemplate) => {
|
||||
|
@ -29,7 +29,7 @@ export class IouTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private iouService: IouService,
|
||||
private toasterService: ToasterService,
|
||||
private configurationService: IouConfigurationService,
|
||||
@ -53,7 +53,7 @@ export class IouTemplateDetailsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -18,14 +18,14 @@ export class IouTemplatesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private iouService: IouService,
|
||||
private router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -47,7 +47,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private qemuService: QemuService,
|
||||
private toasterService: ToasterService,
|
||||
private router: Router,
|
||||
@ -101,7 +101,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
};
|
||||
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.templateMocksService.getQemuTemplate().subscribe((qemuTemplate: QemuTemplate) => {
|
||||
|
@ -23,7 +23,7 @@ export class CopyQemuVmTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private qemuService: QemuService,
|
||||
private toasterService: ToasterService,
|
||||
private router: Router,
|
||||
@ -37,7 +37,7 @@ export class CopyQemuVmTemplateComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.qemuService.getTemplate(this.controller, template_id).subscribe((qemuTemplate: QemuTemplate) => {
|
||||
|
@ -17,14 +17,14 @@ export class QemuPreferencesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private controllerSettingsService: ControllerSettingsService,
|
||||
private toasterService: ToasterService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.controllerSettingsService.getSettingsForQemu(this.controller).subscribe((settings: QemuSettings) => {
|
||||
|
@ -38,7 +38,7 @@ export class QemuVmTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private qemuService: QemuService,
|
||||
private toasterService: ToasterService,
|
||||
private configurationService: QemuConfigurationService,
|
||||
@ -55,7 +55,7 @@ export class QemuVmTemplateDetailsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -18,14 +18,14 @@ export class QemuVmTemplatesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private qemuService: QemuService,
|
||||
private router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -24,7 +24,7 @@ export class AddVirtualBoxTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private virtualBoxService: VirtualBoxService,
|
||||
private toasterService: ToasterService,
|
||||
private templateMocksService: TemplateMocksService,
|
||||
@ -38,7 +38,7 @@ export class AddVirtualBoxTemplateComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.virtualBoxService.getVirtualMachines(this.controller).subscribe((virtualMachines: VirtualBoxVm[]) => {
|
||||
|
@ -12,11 +12,11 @@ export class VirtualBoxPreferencesComponent implements OnInit {
|
||||
controller:Controller ;
|
||||
vboxManagePath: string;
|
||||
|
||||
constructor(private route: ActivatedRoute, private serverService: ControllerService) {}
|
||||
constructor(private route: ActivatedRoute, private controllerService: ControllerService) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ export class VirtualBoxTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private virtualBoxService: VirtualBoxService,
|
||||
private toasterService: ToasterService,
|
||||
private formBuilder: FormBuilder,
|
||||
@ -57,7 +57,7 @@ export class VirtualBoxTemplateDetailsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -19,13 +19,13 @@ export class VirtualBoxTemplatesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private virtualBoxService: VirtualBoxService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -24,7 +24,7 @@ export class AddVmwareTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private vmwareService: VmwareService,
|
||||
private toasterService: ToasterService,
|
||||
private templateMocksService: TemplateMocksService,
|
||||
@ -38,7 +38,7 @@ export class AddVmwareTemplateComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.vmwareService.getVirtualMachines(this.controller).subscribe((virtualMachines: VmwareVm[]) => {
|
||||
|
@ -12,12 +12,12 @@ export class VmwarePreferencesComponent implements OnInit {
|
||||
controller:Controller ;
|
||||
vmrunPath: string;
|
||||
|
||||
constructor(private route: ActivatedRoute, private serverService: ControllerService) {}
|
||||
constructor(private route: ActivatedRoute, private controllerService: ControllerService) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ export class VmwareTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private vmwareService: VmwareService,
|
||||
private toasterService: ToasterService,
|
||||
private formBuilder: FormBuilder,
|
||||
@ -49,7 +49,7 @@ export class VmwareTemplateDetailsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -18,13 +18,13 @@ export class VmwareTemplatesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private vmwareService: VmwareService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -24,7 +24,7 @@ export class AddVpcsTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private vpcsService: VpcsService,
|
||||
private router: Router,
|
||||
private toasterService: ToasterService,
|
||||
@ -39,7 +39,7 @@ export class AddVpcsTemplateComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -12,12 +12,12 @@ export class VpcsPreferencesComponent implements OnInit {
|
||||
controller:Controller ;
|
||||
vpcsExecutable: string;
|
||||
|
||||
constructor(private route: ActivatedRoute, private serverService: ControllerService) {}
|
||||
constructor(private route: ActivatedRoute, private controllerService: ControllerService) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ export class VpcsTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private vpcsService: VpcsService,
|
||||
private toasterService: ToasterService,
|
||||
private formBuilder: FormBuilder,
|
||||
@ -41,7 +41,7 @@ export class VpcsTemplateDetailsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
const template_id = this.route.snapshot.paramMap.get('template_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -16,11 +16,11 @@ export class VpcsTemplatesComponent implements OnInit {
|
||||
vpcsTemplates: VpcsTemplate[] = [];
|
||||
@ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent;
|
||||
|
||||
constructor(private route: ActivatedRoute, private serverService: ControllerService, private vpcsService: VpcsService) {}
|
||||
constructor(private route: ActivatedRoute, private controllerService: ControllerService, private vpcsService: VpcsService) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -17,7 +17,7 @@ export class ConsoleDeviceActionComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private electronService: ElectronService,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private settingsService: SettingsService,
|
||||
private toasterService: ToasterService,
|
||||
private nodeService: NodeService
|
||||
@ -49,7 +49,7 @@ export class ConsoleDeviceActionComponent implements OnInit {
|
||||
name: node.name,
|
||||
project_id: node.project_id,
|
||||
node_id: node.node_id,
|
||||
server_url: this.serverService.getServerUrl(this.controller),
|
||||
server_url: this.controllerService.getServerUrl(this.controller),
|
||||
};
|
||||
await this.openConsole(consoleRequest);
|
||||
}
|
||||
|
@ -88,8 +88,8 @@ export class StyleEditorDialogComponent implements OnInit {
|
||||
|
||||
this.drawing.svg = this.mapDrawingToSvgConverter.convert(mapDrawing);
|
||||
|
||||
this.drawingService.update(this.controller, this.drawing).subscribe((serverDrawing: Drawing) => {
|
||||
this.drawingsDataSource.update(serverDrawing);
|
||||
this.drawingService.update(this.controller, this.drawing).subscribe((controllerDrawing: Drawing) => {
|
||||
this.drawingsDataSource.update(controllerDrawing);
|
||||
this.dialogRef.close();
|
||||
});
|
||||
} else {
|
||||
|
@ -162,8 +162,8 @@ export class TextEditorDialogComponent implements OnInit {
|
||||
|
||||
this.drawing.svg = this.mapDrawingToSvgConverter.convert(mapDrawing);
|
||||
|
||||
this.drawingService.update(this.controller, this.drawing).subscribe((serverDrawing: Drawing) => {
|
||||
this.drawingsDataSource.update(serverDrawing);
|
||||
this.drawingService.update(this.controller, this.drawing).subscribe((controllerDrawing: Drawing) => {
|
||||
this.drawingsDataSource.update(controllerDrawing);
|
||||
this.dialogRef.close();
|
||||
});
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ describe('LogConsoleComponent', () => {
|
||||
let mapSettingsService: MapSettingsService;
|
||||
let toasterService: ToasterService;
|
||||
|
||||
let httpServer = new HttpController({} as HttpClient, {} as ControllerErrorHandler);
|
||||
let httpController = new HttpController({} as HttpClient, {} as ControllerErrorHandler);
|
||||
|
||||
beforeEach(async() => {
|
||||
await TestBed.configureTestingModule({
|
||||
@ -49,7 +49,7 @@ describe('LogConsoleComponent', () => {
|
||||
{ provide: NodeService, useValue: mockedNodeService },
|
||||
{ provide: NodesDataSource, useValue: mockedNodesDataSource },
|
||||
{ provide: LogEventsDataSource, useClass: LogEventsDataSource },
|
||||
{ provide: HttpController, useValue: httpServer },
|
||||
{ provide: HttpController, useValue: httpController },
|
||||
NodeConsoleService,
|
||||
ToasterService,
|
||||
MapSettingsService
|
||||
|
@ -27,7 +27,7 @@ export class NodesMenuComponent {
|
||||
private nodeConsoleService: NodeConsoleService,
|
||||
private nodesDataSource: NodesDataSource,
|
||||
private toasterService: ToasterService,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private settingsService: SettingsService,
|
||||
private mapSettingsService: MapSettingsService,
|
||||
private electronService: ElectronService,
|
||||
@ -50,7 +50,7 @@ export class NodesMenuComponent {
|
||||
name: node.name,
|
||||
project_id: node.project_id,
|
||||
node_id: node.node_id,
|
||||
server_url: this.serverService.getServerUrl(this.controller),
|
||||
server_url: this.controllerService.getServerUrl(this.controller),
|
||||
};
|
||||
await this.electronService.remote.require('./console-executor.js').openConsole(request);
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private projectService: ProjectService,
|
||||
private nodeService: NodeService,
|
||||
public drawingService: DrawingService,
|
||||
@ -199,11 +199,11 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
this.getSettings();
|
||||
this.progressService.activate();
|
||||
|
||||
if (this.serverService.isServiceInitialized) {
|
||||
if (this.controllerService.isServiceInitialized) {
|
||||
this.getData();
|
||||
} else {
|
||||
this.projectMapSubscription.add(
|
||||
this.serverService.serviceInitialized.subscribe((val) => {
|
||||
this.controllerService.serviceInitialized.subscribe((val) => {
|
||||
if (val) this.getData();
|
||||
})
|
||||
);
|
||||
@ -331,7 +331,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
const routeSub = this.route.paramMap.subscribe((paramMap: ParamMap) => {
|
||||
const controller_id = parseInt(paramMap.get('controller_id'), 10);
|
||||
|
||||
from(this.serverService.get(controller_id))
|
||||
from(this.controllerService.get(controller_id))
|
||||
.pipe(
|
||||
mergeMap((controller:Controller ) => {
|
||||
if (!controller) this.router.navigate(['/controllers']);
|
||||
|
@ -32,7 +32,7 @@ xdescribe('ProjectsComponent', () => {
|
||||
let fixture: ComponentFixture<ProjectsComponent>;
|
||||
let settingsService: SettingsService;
|
||||
let projectService: ProjectService;
|
||||
let serverService: ControllerService;
|
||||
let controllerService: ControllerService;
|
||||
let controller:Controller ;
|
||||
let progressService: ProgressService;
|
||||
let mockedProjectService: MockedProjectService = new MockedProjectService();
|
||||
@ -81,7 +81,7 @@ xdescribe('ProjectsComponent', () => {
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
serverService = TestBed.inject(ControllerService);
|
||||
controllerService = TestBed.inject(ControllerService);
|
||||
settingsService = TestBed.inject(SettingsService);
|
||||
projectService = TestBed.inject(ProjectService);
|
||||
progressService = TestBed.inject(ProgressService);
|
||||
@ -91,7 +91,7 @@ xdescribe('ProjectsComponent', () => {
|
||||
|
||||
const settings = {} as Settings;
|
||||
|
||||
spyOn(serverService, 'get').and.returnValue(Promise.resolve(controller));
|
||||
spyOn(controllerService, 'get').and.returnValue(Promise.resolve(controller));
|
||||
spyOn(settingsService, 'getAll').and.returnValue(settings);
|
||||
spyOn(projectService, 'list').and.returnValue(of([]));
|
||||
|
||||
|
@ -19,7 +19,7 @@ export class StatusInfoComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private computeService: ComputeService,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private toasterService: ToasterService
|
||||
) {}
|
||||
|
||||
@ -29,7 +29,7 @@ export class StatusInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
getStatistics() {
|
||||
this.serverService.get(Number(this.controllerId)).then((controller:Controller ) => {
|
||||
this.controllerService.get(Number(this.controllerId)).then((controller:Controller ) => {
|
||||
this.computeService.getStatistics(controller).subscribe((statistics: ComputeStatistics[]) => {
|
||||
this.computeStatistics = statistics;
|
||||
setTimeout(() => {
|
||||
|
@ -17,14 +17,14 @@ export class LoggedUserComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private userService: UserService,
|
||||
private toasterService: ToasterService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
let controllerId = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(+controllerId).then((controller:Controller ) => {
|
||||
this.controllerService.get(+controllerId).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.userService.getInformationAboutLoggedUser(controller).subscribe((response: any) => {
|
||||
this.user = response;
|
||||
|
@ -32,18 +32,18 @@ export class WebConsoleFullWindowComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private consoleService: NodeConsoleService,
|
||||
private serverService: ControllerService,
|
||||
private controllerService: ControllerService,
|
||||
private route: ActivatedRoute,
|
||||
private title: Title,
|
||||
private nodeService: NodeService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.serverService.isServiceInitialized) {
|
||||
if (this.controllerService.isServiceInitialized) {
|
||||
this.getData();
|
||||
} else {
|
||||
this.subscriptions.add(
|
||||
this.serverService.serviceInitialized.subscribe((val) => {
|
||||
this.controllerService.serviceInitialized.subscribe((val) => {
|
||||
if (val) this.getData();
|
||||
})
|
||||
);
|
||||
@ -59,7 +59,7 @@ export class WebConsoleFullWindowComponent implements OnInit {
|
||||
this.fitAddon.fit();
|
||||
});
|
||||
|
||||
this.serverService.get(+this.controllerId).then((controller:Controller ) => {
|
||||
this.controllerService.get(+this.controllerId).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.nodeService.getNodeById(this.controller, this.projectId, this.nodeId).subscribe((node: Node) => {
|
||||
this.node = node;
|
||||
|
@ -11,13 +11,13 @@ import { environment } from 'environments/environment';
|
||||
export class AuthImageFilter implements PipeTransform {
|
||||
|
||||
constructor(
|
||||
private httpServer: HttpController,
|
||||
private httpController: HttpController,
|
||||
private domSanitizer: DomSanitizer
|
||||
) { }
|
||||
|
||||
async transform(src: string, controller:Controller ) {
|
||||
let url = src.split(`${environment.current_version}`)[1];
|
||||
const imageBlob: Blob = await this.httpServer.getBlob(controller, url).toPromise();
|
||||
const imageBlob: Blob = await this.httpController.getBlob(controller, url).toPromise();
|
||||
const reader = new FileReader();
|
||||
return new Promise((resolve, reject) => {
|
||||
reader.onloadend = () => resolve(this.domSanitizer.bypassSecurityTrustUrl(reader.result as string));
|
||||
|
@ -6,16 +6,16 @@ import { ControllerService } from '../services/controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class LoginGuard implements CanActivate {
|
||||
constructor(private serverService: ControllerService, private loginService: LoginService, private router: Router) {}
|
||||
constructor(private controllerService: ControllerService, private loginService: LoginService, private router: Router) {}
|
||||
|
||||
async canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
|
||||
const controller_id = next.paramMap.get('controller_id');
|
||||
this.loginService.controller_id = controller_id;
|
||||
let controller = await this.serverService.get(parseInt(controller_id, 10));
|
||||
let controller = await this.controllerService.get(parseInt(controller_id, 10));
|
||||
try {
|
||||
await this.loginService.getLoggedUser(controller);
|
||||
} catch (e) {}
|
||||
return this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
return this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
if (controller.authToken && !controller.tokenExpired) {
|
||||
return true;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class HttpRequestsInterceptor implements HttpInterceptor {
|
||||
constructor(private serverService: ControllerService, private loginService: LoginService) {}
|
||||
constructor(private controllerService: ControllerService, private loginService: LoginService) {}
|
||||
intercept(httpRequest: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
return next.handle(httpRequest).pipe(
|
||||
catchError((err) => {
|
||||
@ -23,15 +23,15 @@ export class HttpRequestsInterceptor implements HttpInterceptor {
|
||||
async call() {
|
||||
let getCurrentUser = JSON.parse(localStorage.getItem(`isRememberMe`)) ?? null;
|
||||
const controller_id = this.loginService.controller_id;
|
||||
let controller = await this.serverService.get(parseInt(controller_id, 10));
|
||||
let controller = await this.controllerService.get(parseInt(controller_id, 10));
|
||||
controller.tokenExpired = true;
|
||||
await this.serverService.update(controller);
|
||||
await this.controllerService.update(controller);
|
||||
try {
|
||||
if (getCurrentUser && getCurrentUser.isRememberMe) {
|
||||
let response = await this.loginService.getLoggedUserRefToken(controller, getCurrentUser);
|
||||
controller.authToken = response.access_token;
|
||||
controller.tokenExpired = false;
|
||||
await this.serverService.update(controller);
|
||||
await this.controllerService.update(controller);
|
||||
await this.loginService.getLoggedUser(controller);
|
||||
this.reloadCurrentRoute();
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ describe('DefaultLayoutComponent', () => {
|
||||
let fixture: ComponentFixture<DefaultLayoutComponent>;
|
||||
let electronServiceMock: ElectronServiceMock;
|
||||
let serverManagementService = new MockedServerManagementService();
|
||||
let serverService: ControllerService;
|
||||
let httpServer: HttpController;
|
||||
let controllerService: ControllerService;
|
||||
let httpController: HttpController;
|
||||
let errorHandler: ControllerErrorHandler;
|
||||
|
||||
beforeEach(async() => {
|
||||
@ -67,8 +67,8 @@ describe('DefaultLayoutComponent', () => {
|
||||
}).compileComponents();
|
||||
|
||||
errorHandler = TestBed.inject(ControllerErrorHandler);
|
||||
httpServer = TestBed.inject(HttpController);
|
||||
serverService = TestBed.inject(ControllerService);
|
||||
httpController = TestBed.inject(HttpController);
|
||||
controllerService = TestBed.inject(ControllerService);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
@ -37,7 +37,7 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy {
|
||||
private toasterService: ToasterService,
|
||||
private progressService: ProgressService,
|
||||
public router: Router,
|
||||
private serverService: ControllerService
|
||||
private controllerService: ControllerService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@ -54,14 +54,14 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy {
|
||||
this.isInstalledSoftwareAvailable = this.electronService.isElectronApp;
|
||||
|
||||
// attach to notification stream when any of running local controllers experienced issues
|
||||
this.controllerStatusSubscription = this.controllerManagement.controllerStatusChanged.subscribe((serverStatus) => {
|
||||
if (serverStatus.status === 'errored') {
|
||||
console.error(serverStatus.message);
|
||||
this.toasterService.error(serverStatus.message);
|
||||
this.controllerStatusSubscription = this.controllerManagement.controllerStatusChanged.subscribe((controllerStatus) => {
|
||||
if (controllerStatus.status === 'errored') {
|
||||
console.error(controllerStatus.message);
|
||||
this.toasterService.error(controllerStatus.message);
|
||||
}
|
||||
if (serverStatus.status === 'stderr') {
|
||||
console.error(serverStatus.message);
|
||||
this.toasterService.error(serverStatus.message);
|
||||
if (controllerStatus.status === 'stderr') {
|
||||
console.error(controllerStatus.message);
|
||||
this.toasterService.error(controllerStatus.message);
|
||||
}
|
||||
});
|
||||
|
||||
@ -71,14 +71,14 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy {
|
||||
|
||||
goToUserInfo() {
|
||||
let controllerId = this.router.url.split("/controller/")[1].split("/")[0];
|
||||
this.serverService.get(+controllerId).then((controller:Controller ) => {
|
||||
this.controllerService.get(+controllerId).then((controller:Controller ) => {
|
||||
this.router.navigate(['/controller', controller.id, 'loggeduser']);
|
||||
});
|
||||
}
|
||||
|
||||
goToDocumentation() {
|
||||
let controllerId = this.router.url.split("/controller/")[1].split("/")[0];
|
||||
this.serverService.get(+controllerId).then((controller:Controller ) => {
|
||||
this.controllerService.get(+controllerId).then((controller:Controller ) => {
|
||||
(window as any).open(`http://${controller.host}:${controller.port}/docs`);
|
||||
});
|
||||
}
|
||||
@ -93,9 +93,9 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy {
|
||||
|
||||
logout() {
|
||||
let controllerId = this.router.url.split("/controller/")[1].split("/")[0];
|
||||
this.serverService.get(+controllerId).then((controller:Controller ) => {
|
||||
this.controllerService.get(+controllerId).then((controller:Controller ) => {
|
||||
controller.authToken = null;
|
||||
this.serverService.update(controller).then(val => this.router.navigate(['/controller', controller.id, 'login']));
|
||||
this.controllerService.update(controller).then(val => this.router.navigate(['/controller', controller.id, 'login']));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,9 @@ import { ControllerService } from '../services/controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class ControllerResolve implements Resolve<Controller> {
|
||||
constructor(private serverService: ControllerService) {}
|
||||
constructor(private controllerService: ControllerService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot) {
|
||||
return this.serverService.get(parseInt(route.params['controller_id']));
|
||||
return this.controllerService.get(parseInt(route.params['controller_id']));
|
||||
}
|
||||
}
|
||||
|
@ -7,14 +7,14 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class ApplianceService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
getAppliances(controller:Controller ): Observable<Appliance[]> {
|
||||
return this.httpServer.get<Appliance[]>(controller, '/appliances') as Observable<Appliance[]>;
|
||||
return this.httpController.get<Appliance[]>(controller, '/appliances') as Observable<Appliance[]>;
|
||||
}
|
||||
|
||||
getAppliance(controller:Controller , url): Observable<Appliance> {
|
||||
return this.httpServer.get<Appliance>(controller, url) as Observable<Appliance>;
|
||||
return this.httpController.get<Appliance>(controller, url) as Observable<Appliance>;
|
||||
}
|
||||
|
||||
getUploadPath(controller:Controller , emulator: string, filename: string) {
|
||||
@ -22,6 +22,6 @@ export class ApplianceService {
|
||||
}
|
||||
|
||||
updateAppliances(controller:Controller ): Observable<Appliance[]> {
|
||||
return this.httpServer.get<Appliance[]>(controller, '/appliances?update=yes') as Observable<Appliance[]>;
|
||||
return this.httpController.get<Appliance[]>(controller, '/appliances?update=yes') as Observable<Appliance[]>;
|
||||
}
|
||||
}
|
||||
|
@ -8,12 +8,12 @@ import { EthernetHubTemplate } from '../models/templates/ethernet-hub-template';
|
||||
import { AppTestingModule } from '../testing/app-testing/app-testing.module';
|
||||
import { BuiltInTemplatesService } from './built-in-templates.service';
|
||||
import { HttpController } from './http-controller.service';
|
||||
import { getTestServer } from './testing';
|
||||
import { getTestController } from './testing';
|
||||
|
||||
describe('BuiltInTemplatesService', () => {
|
||||
let httpClient: HttpClient;
|
||||
let httpTestingController: HttpTestingController;
|
||||
let httpServer: HttpController;
|
||||
let httpController: HttpController;
|
||||
let controller:Controller ;
|
||||
|
||||
beforeEach(() => {
|
||||
@ -24,8 +24,8 @@ describe('BuiltInTemplatesService', () => {
|
||||
|
||||
httpClient = TestBed.get(HttpClient);
|
||||
httpTestingController = TestBed.get(HttpTestingController);
|
||||
httpServer = TestBed.get(HttpController);
|
||||
controller = getTestServer();
|
||||
httpController = TestBed.get(HttpController);
|
||||
controller = getTestController();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -5,22 +5,22 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class BuiltInTemplatesService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
getTemplates(controller:Controller ): Observable<any[]> {
|
||||
return this.httpServer.get<any[]>(controller, '/templates') as Observable<any[]>;
|
||||
return this.httpController.get<any[]>(controller, '/templates') as Observable<any[]>;
|
||||
}
|
||||
|
||||
getTemplate(controller:Controller , template_id: string): Observable<any> {
|
||||
return this.httpServer.get<any>(controller, `/templates/${template_id}`) as Observable<any>;
|
||||
return this.httpController.get<any>(controller, `/templates/${template_id}`) as Observable<any>;
|
||||
}
|
||||
|
||||
addTemplate(controller:Controller , builtInTemplate: any): Observable<any> {
|
||||
return this.httpServer.post<any>(controller, `/templates`, builtInTemplate) as Observable<any>;
|
||||
return this.httpController.post<any>(controller, `/templates`, builtInTemplate) as Observable<any>;
|
||||
}
|
||||
|
||||
saveTemplate(controller:Controller , builtInTemplate: any): Observable<any> {
|
||||
return this.httpServer.put<any>(
|
||||
return this.httpController.put<any>(
|
||||
controller,
|
||||
`/templates/${builtInTemplate.template_id}`,
|
||||
builtInTemplate
|
||||
|
@ -8,10 +8,10 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class ComputeService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
getComputes(controller:Controller ): Observable<Compute[]> {
|
||||
return this.httpServer.get<Compute[]>(controller, '/computes') as Observable<Compute[]>;
|
||||
return this.httpController.get<Compute[]>(controller, '/computes') as Observable<Compute[]>;
|
||||
}
|
||||
|
||||
getUploadPath(controller:Controller , emulator: string, filename: string) {
|
||||
@ -19,6 +19,6 @@ export class ComputeService {
|
||||
}
|
||||
|
||||
getStatistics(controller:Controller ): Observable<ComputeStatistics[]> {
|
||||
return this.httpServer.get(controller, `/statistics`);
|
||||
return this.httpController.get(controller, `/statistics`);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import { Subject } from 'rxjs';
|
||||
import{ Controller } from '../models/controller';
|
||||
|
||||
export interface ControllerStateEvent {
|
||||
serverName: string;
|
||||
controllerName: string;
|
||||
status: 'starting' | 'started' | 'errored' | 'stopped' | 'stderr';
|
||||
message: string;
|
||||
}
|
||||
@ -27,7 +27,7 @@ export class ControllerManagementService implements OnDestroy {
|
||||
|
||||
async start(controller:Controller ) {
|
||||
var startingEvent: ControllerStateEvent = {
|
||||
serverName: controller.name,
|
||||
controllerName: controller.name,
|
||||
status: 'starting',
|
||||
message: '',
|
||||
};
|
||||
|
@ -18,7 +18,7 @@ export class MockedControllerSettingsService {
|
||||
}
|
||||
|
||||
describe('ControllerSettingsService', () => {
|
||||
let httpServer: HttpController;
|
||||
let httpController: HttpController;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@ -26,7 +26,7 @@ describe('ControllerSettingsService', () => {
|
||||
providers: [HttpController, ControllerSettingsService],
|
||||
});
|
||||
|
||||
httpServer = TestBed.get(HttpController);
|
||||
httpController = TestBed.get(HttpController);
|
||||
});
|
||||
|
||||
it('should be created', inject([ControllerSettingsService], (service: ControllerSettingsService) => {
|
||||
|
@ -6,22 +6,22 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class ControllerSettingsService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
get(controller:Controller ) {
|
||||
return this.httpServer.get<ServerSettings>(controller, `/settings`);
|
||||
return this.httpController.get<ServerSettings>(controller, `/settings`);
|
||||
}
|
||||
|
||||
update(controller:Controller , serverSettings: ServerSettings) {
|
||||
return this.httpServer.post<ServerSettings>(controller, `/settings`, serverSettings);
|
||||
return this.httpController.post<ServerSettings>(controller, `/settings`, serverSettings);
|
||||
}
|
||||
|
||||
getSettingsForQemu(controller:Controller ) {
|
||||
return this.httpServer.get<QemuSettings>(controller, `/settings/qemu`);
|
||||
return this.httpController.get<QemuSettings>(controller, `/settings/qemu`);
|
||||
}
|
||||
|
||||
updateSettingsForQemu(controller:Controller , qemuSettings: QemuSettings) {
|
||||
return this.httpServer.put<QemuSettings>(controller, `/settings/qemu`, {
|
||||
return this.httpController.put<QemuSettings>(controller, `/settings/qemu`, {
|
||||
enable_hardware_acceleration: qemuSettings.enable_hardware_acceleration,
|
||||
require_hardware_acceleration: qemuSettings.require_hardware_acceleration,
|
||||
});
|
||||
|
@ -9,7 +9,7 @@ export class ControllerService {
|
||||
public serviceInitialized: Subject<boolean> = new Subject<boolean>();
|
||||
public isServiceInitialized: boolean;
|
||||
|
||||
constructor(private httpServer: HttpController) {
|
||||
constructor(private httpController: HttpController) {
|
||||
this.controllerIds = this.getcontrollerIds();
|
||||
this.isServiceInitialized = true;
|
||||
this.serviceInitialized.next(this.isServiceInitialized);
|
||||
@ -87,7 +87,7 @@ export class ControllerService {
|
||||
}
|
||||
|
||||
public checkServerVersion(controller:Controller ): Observable<any> {
|
||||
return this.httpServer.get(controller, '/version');
|
||||
return this.httpController.get(controller, '/version');
|
||||
}
|
||||
|
||||
public getLocalController(host: string, port: number) {
|
||||
|
@ -8,26 +8,26 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class DockerService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
getTemplates(controller:Controller ): Observable<DockerTemplate[]> {
|
||||
return this.httpServer.get<DockerTemplate[]>(controller, '/templates') as Observable<DockerTemplate[]>;
|
||||
return this.httpController.get<DockerTemplate[]>(controller, '/templates') as Observable<DockerTemplate[]>;
|
||||
}
|
||||
|
||||
getTemplate(controller:Controller , template_id: string): Observable<any> {
|
||||
return this.httpServer.get<DockerTemplate>(controller, `/templates/${template_id}`) as Observable<DockerTemplate>;
|
||||
return this.httpController.get<DockerTemplate>(controller, `/templates/${template_id}`) as Observable<DockerTemplate>;
|
||||
}
|
||||
|
||||
getImages(controller:Controller ): Observable<DockerImage[]> {
|
||||
return this.httpServer.get<DockerImage[]>(controller, `/computes/${environment.compute_id}/docker/images`) as Observable<DockerImage[]>;
|
||||
return this.httpController.get<DockerImage[]>(controller, `/computes/${environment.compute_id}/docker/images`) as Observable<DockerImage[]>;
|
||||
}
|
||||
|
||||
addTemplate(controller:Controller , dockerTemplate: any): Observable<any> {
|
||||
return this.httpServer.post<DockerTemplate>(controller, `/templates`, dockerTemplate) as Observable<DockerTemplate>;
|
||||
return this.httpController.post<DockerTemplate>(controller, `/templates`, dockerTemplate) as Observable<DockerTemplate>;
|
||||
}
|
||||
|
||||
saveTemplate(controller:Controller , dockerTemplate: any): Observable<any> {
|
||||
return this.httpServer.put<DockerTemplate>(
|
||||
return this.httpController.put<DockerTemplate>(
|
||||
controller,
|
||||
`/templates/${dockerTemplate.template_id}`,
|
||||
dockerTemplate
|
||||
|
@ -9,12 +9,12 @@ import{ Controller } from '../models/controller';
|
||||
import { AppTestingModule } from '../testing/app-testing/app-testing.module';
|
||||
import { DrawingService } from './drawing.service';
|
||||
import { HttpController } from './http-controller.service';
|
||||
import { getTestServer } from './testing';
|
||||
import { getTestController } from './testing';
|
||||
|
||||
describe('DrawingService', () => {
|
||||
let httpClient: HttpClient;
|
||||
let httpTestingController: HttpTestingController;
|
||||
let httpServer: HttpController;
|
||||
let httpController: HttpController;
|
||||
let controller:Controller ;
|
||||
let project: Project = new Project();
|
||||
|
||||
@ -26,8 +26,8 @@ describe('DrawingService', () => {
|
||||
|
||||
httpClient = TestBed.get(HttpClient);
|
||||
httpTestingController = TestBed.get(HttpTestingController);
|
||||
httpServer = TestBed.get(HttpController);
|
||||
controller = getTestServer();
|
||||
httpController = TestBed.get(HttpController);
|
||||
controller = getTestController();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -9,10 +9,10 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class DrawingService {
|
||||
constructor(private httpServer: HttpController, private svgToDrawingConverter: SvgToDrawingConverter) {}
|
||||
constructor(private httpController: HttpController, private svgToDrawingConverter: SvgToDrawingConverter) {}
|
||||
|
||||
add(controller:Controller , project_id: string, x: number, y: number, svg: string) {
|
||||
return this.httpServer.post<Drawing>(controller, `/projects/${project_id}/drawings`, {
|
||||
return this.httpController.post<Drawing>(controller, `/projects/${project_id}/drawings`, {
|
||||
svg: svg,
|
||||
x: Math.round(x),
|
||||
y: Math.round(y),
|
||||
@ -21,7 +21,7 @@ export class DrawingService {
|
||||
}
|
||||
|
||||
duplicate(controller:Controller , project_id: string, drawing: Drawing) {
|
||||
return this.httpServer.post<Drawing>(controller, `/projects/${project_id}/drawings`, {
|
||||
return this.httpController.post<Drawing>(controller, `/projects/${project_id}/drawings`, {
|
||||
svg: drawing.svg,
|
||||
rotation: drawing.rotation,
|
||||
x: drawing.x + 10,
|
||||
@ -46,14 +46,14 @@ export class DrawingService {
|
||||
yPosition = Math.round(yPosition - drawing.element.height / 2);
|
||||
}
|
||||
|
||||
return this.httpServer.put<Drawing>(controller, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`, {
|
||||
return this.httpController.put<Drawing>(controller, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`, {
|
||||
x: xPosition,
|
||||
y: yPosition,
|
||||
});
|
||||
}
|
||||
|
||||
updateSizeAndPosition(controller:Controller , drawing: Drawing, x: number, y: number, svg: string): Observable<Drawing> {
|
||||
return this.httpServer.put<Drawing>(controller, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`, {
|
||||
return this.httpController.put<Drawing>(controller, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`, {
|
||||
svg: svg,
|
||||
x: Math.round(x),
|
||||
y: Math.round(y),
|
||||
@ -61,7 +61,7 @@ export class DrawingService {
|
||||
}
|
||||
|
||||
updateText(controller:Controller , drawing: Drawing, svg: string): Observable<Drawing> {
|
||||
return this.httpServer.put<Drawing>(controller, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`, {
|
||||
return this.httpController.put<Drawing>(controller, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`, {
|
||||
svg: svg,
|
||||
x: Math.round(drawing.x),
|
||||
y: Math.round(drawing.y),
|
||||
@ -70,7 +70,7 @@ export class DrawingService {
|
||||
}
|
||||
|
||||
update(controller:Controller , drawing: Drawing): Observable<Drawing> {
|
||||
return this.httpServer.put<Drawing>(controller, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`, {
|
||||
return this.httpController.put<Drawing>(controller, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`, {
|
||||
locked: drawing.locked,
|
||||
svg: drawing.svg,
|
||||
rotation: drawing.rotation,
|
||||
@ -81,6 +81,6 @@ export class DrawingService {
|
||||
}
|
||||
|
||||
delete(controller:Controller , drawing: Drawing) {
|
||||
return this.httpServer.delete<Drawing>(controller, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`);
|
||||
return this.httpController.delete<Drawing>(controller, `/projects/${drawing.project_id}/drawings/${drawing.drawing_id}`);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import { environment } from 'environments/environment';
|
||||
import{ Controller } from '../models/controller';
|
||||
import { AppTestingModule } from '../testing/app-testing/app-testing.module';
|
||||
import { HttpController, ControllerError, ControllerErrorHandler } from './http-controller.service';
|
||||
import { getTestServer } from './testing';
|
||||
import { getTestController } from './testing';
|
||||
|
||||
class MyType {
|
||||
id: number;
|
||||
@ -67,7 +67,7 @@ describe('HttpController', () => {
|
||||
httpTestingController = TestBed.get(HttpTestingController);
|
||||
service = TestBed.get(HttpController);
|
||||
|
||||
controller = getTestServer();
|
||||
controller = getTestController();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -4,7 +4,7 @@ import { inject, TestBed } from '@angular/core/testing';
|
||||
import { AppTestingModule } from 'app/testing/app-testing/app-testing.module';
|
||||
import{ Controller } from '../models/controller';
|
||||
import { HttpController } from './http-controller.service';
|
||||
import { getTestServer } from './testing';
|
||||
import { getTestController } from './testing';
|
||||
|
||||
import { ImageManagerService } from './image-manager.service';
|
||||
import { Image } from "../models/images";
|
||||
@ -13,7 +13,7 @@ import { environment } from 'environments/environment';
|
||||
describe('ImageManagerService', () => {
|
||||
let httpClient: HttpClient;
|
||||
let httpTestingController: HttpTestingController;
|
||||
let httpServer: HttpController;
|
||||
let httpController: HttpController;
|
||||
let controller:Controller ;
|
||||
|
||||
beforeEach(() => {
|
||||
@ -24,8 +24,8 @@ describe('ImageManagerService', () => {
|
||||
|
||||
httpClient = TestBed.get(HttpClient);
|
||||
httpTestingController = TestBed.get(HttpTestingController);
|
||||
httpServer = TestBed.get(HttpController);
|
||||
controller = getTestServer();
|
||||
httpController = TestBed.get(HttpController);
|
||||
controller = getTestController();
|
||||
// service = TestBed.inject(ImageManagerService);
|
||||
});
|
||||
afterEach(() => {
|
||||
|
@ -10,10 +10,10 @@ import { environment } from 'environments/environment';
|
||||
})
|
||||
export class ImageManagerService {
|
||||
|
||||
constructor(private httpServer: HttpController) { }
|
||||
constructor(private httpController: HttpController) { }
|
||||
|
||||
getImages(controller:Controller ) {
|
||||
return this.httpServer.get<Image[]>(controller, '/images') as Observable<Image[]>;
|
||||
return this.httpController.get<Image[]>(controller, '/images') as Observable<Image[]>;
|
||||
}
|
||||
|
||||
getImagePath(controller :Controller, install_appliance, image_path){
|
||||
@ -25,9 +25,9 @@ export class ImageManagerService {
|
||||
}
|
||||
|
||||
uploadedImage(controller :Controller, install_appliance, image_path, flie){
|
||||
return this.httpServer.post<Image[]>(controller, `/images/upload/${image_path}?install_appliances=${install_appliance}`,flie) as Observable<Image[]>;
|
||||
return this.httpController.post<Image[]>(controller, `/images/upload/${image_path}?install_appliances=${install_appliance}`,flie) as Observable<Image[]>;
|
||||
}
|
||||
deleteFile(controller :Controller, image_path){
|
||||
return this.httpServer.delete<Image[]>(controller, `/images/${image_path}`) as Observable<Image[]>;
|
||||
return this.httpController.delete<Image[]>(controller, `/images/${image_path}`) as Observable<Image[]>;
|
||||
}
|
||||
}
|
||||
|
@ -8,10 +8,10 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class IosService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
getImages(controller:Controller ): Observable<any> {
|
||||
return this.httpServer.get<IosImage[]>(controller, '/images?image_type=ios') as Observable<IosImage[]>;
|
||||
return this.httpController.get<IosImage[]>(controller, '/images?image_type=ios') as Observable<IosImage[]>;
|
||||
}
|
||||
|
||||
getImagePath(controller:Controller , filename: string): string {
|
||||
@ -19,19 +19,19 @@ export class IosService {
|
||||
}
|
||||
|
||||
getTemplates(controller:Controller ): Observable<IosTemplate[]> {
|
||||
return this.httpServer.get<IosTemplate[]>(controller, '/templates') as Observable<IosTemplate[]>;
|
||||
return this.httpController.get<IosTemplate[]>(controller, '/templates') as Observable<IosTemplate[]>;
|
||||
}
|
||||
|
||||
getTemplate(controller:Controller , template_id: string): Observable<IosTemplate> {
|
||||
return this.httpServer.get<IosTemplate>(controller, `/templates/${template_id}`) as Observable<IosTemplate>;
|
||||
return this.httpController.get<IosTemplate>(controller, `/templates/${template_id}`) as Observable<IosTemplate>;
|
||||
}
|
||||
|
||||
addTemplate(controller:Controller , iosTemplate: IosTemplate): Observable<IosTemplate> {
|
||||
return this.httpServer.post<IosTemplate>(controller, `/templates`, iosTemplate) as Observable<IosTemplate>;
|
||||
return this.httpController.post<IosTemplate>(controller, `/templates`, iosTemplate) as Observable<IosTemplate>;
|
||||
}
|
||||
|
||||
saveTemplate(controller:Controller , iosTemplate: IosTemplate): Observable<IosTemplate> {
|
||||
return this.httpServer.put<IosTemplate>(
|
||||
return this.httpController.put<IosTemplate>(
|
||||
controller,
|
||||
`/templates/${iosTemplate.template_id}`,
|
||||
iosTemplate
|
||||
|
@ -8,18 +8,18 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class IouService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
getTemplates(controller:Controller ): Observable<IouTemplate[]> {
|
||||
return this.httpServer.get<IouTemplate[]>(controller, '/templates') as Observable<IouTemplate[]>;
|
||||
return this.httpController.get<IouTemplate[]>(controller, '/templates') as Observable<IouTemplate[]>;
|
||||
}
|
||||
|
||||
getTemplate(controller:Controller , template_id: string): Observable<any> {
|
||||
return this.httpServer.get<IouTemplate>(controller, `/templates/${template_id}`) as Observable<IouTemplate>;
|
||||
return this.httpController.get<IouTemplate>(controller, `/templates/${template_id}`) as Observable<IouTemplate>;
|
||||
}
|
||||
|
||||
getImages(controller:Controller ): Observable<any> {
|
||||
return this.httpServer.get<IouImage[]>(controller, '/images?image_type=iou') as Observable<IouImage[]>;
|
||||
return this.httpController.get<IouImage[]>(controller, '/images?image_type=iou') as Observable<IouImage[]>;
|
||||
}
|
||||
|
||||
getImagePath(controller:Controller , filename: string): string {
|
||||
@ -27,11 +27,11 @@ export class IouService {
|
||||
}
|
||||
|
||||
addTemplate(controller:Controller , iouTemplate: any): Observable<any> {
|
||||
return this.httpServer.post<IouTemplate>(controller, `/templates`, iouTemplate) as Observable<IouTemplate>;
|
||||
return this.httpController.post<IouTemplate>(controller, `/templates`, iouTemplate) as Observable<IouTemplate>;
|
||||
}
|
||||
|
||||
saveTemplate(controller:Controller , iouTemplate: any): Observable<any> {
|
||||
return this.httpServer.put<IouTemplate>(
|
||||
return this.httpController.put<IouTemplate>(
|
||||
controller,
|
||||
`/templates/${iouTemplate.template_id}`,
|
||||
iouTemplate
|
||||
|
@ -8,12 +8,12 @@ import{ Controller } from '../models/controller';
|
||||
import { AppTestingModule } from '../testing/app-testing/app-testing.module';
|
||||
import { HttpController } from './http-controller.service';
|
||||
import { LinkService } from './link.service';
|
||||
import { getTestServer } from './testing';
|
||||
import { getTestController } from './testing';
|
||||
|
||||
describe('LinkService', () => {
|
||||
let httpClient: HttpClient;
|
||||
let httpTestingController: HttpTestingController;
|
||||
let httpServer: HttpController;
|
||||
let httpController: HttpController;
|
||||
let controller:Controller ;
|
||||
|
||||
beforeEach(() => {
|
||||
@ -24,8 +24,8 @@ describe('LinkService', () => {
|
||||
|
||||
httpClient = TestBed.get(HttpClient);
|
||||
httpTestingController = TestBed.get(HttpTestingController);
|
||||
httpServer = TestBed.get(HttpController);
|
||||
controller = getTestServer();
|
||||
httpController = TestBed.get(HttpController);
|
||||
controller = getTestController();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -11,7 +11,7 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class LinkService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
createLink(
|
||||
controller:Controller ,
|
||||
@ -24,7 +24,7 @@ export class LinkService {
|
||||
xLabelTargetNode: number,
|
||||
yLabelTargetNode: number
|
||||
) {
|
||||
return this.httpServer.post(controller, `/projects/${source_node.project_id}/links`, {
|
||||
return this.httpController.post(controller, `/projects/${source_node.project_id}/links`, {
|
||||
nodes: [
|
||||
{
|
||||
node_id: source_node.node_id,
|
||||
@ -55,26 +55,26 @@ export class LinkService {
|
||||
}
|
||||
|
||||
getLink(controller:Controller , projectId: string, linkId: string) {
|
||||
return this.httpServer.get<Link>(controller, `/projects/${projectId}/links/${linkId}`);
|
||||
return this.httpController.get<Link>(controller, `/projects/${projectId}/links/${linkId}`);
|
||||
}
|
||||
|
||||
deleteLink(controller:Controller , link: Link) {
|
||||
return this.httpServer.delete(controller, `/projects/${link.project_id}/links/${link.link_id}`);
|
||||
return this.httpController.delete(controller, `/projects/${link.project_id}/links/${link.link_id}`);
|
||||
}
|
||||
|
||||
updateLink(controller:Controller , link: Link) {
|
||||
link.x = Math.round(link.x);
|
||||
link.y = Math.round(link.y);
|
||||
|
||||
return this.httpServer.put<Link>(controller, `/projects/${link.project_id}/links/${link.link_id}`, link);
|
||||
return this.httpController.put<Link>(controller, `/projects/${link.project_id}/links/${link.link_id}`, link);
|
||||
}
|
||||
|
||||
updateLinkStyle(controller:Controller , link: Link) {
|
||||
return this.httpServer.put<Link>(controller, `/projects/${link.project_id}/links/${link.link_id}`, link);
|
||||
return this.httpController.put<Link>(controller, `/projects/${link.project_id}/links/${link.link_id}`, link);
|
||||
}
|
||||
|
||||
getAvailableFilters(controller:Controller , link: Link) {
|
||||
return this.httpServer.get<FilterDescription[]>(
|
||||
return this.httpController.get<FilterDescription[]>(
|
||||
controller,
|
||||
`/projects/${link.project_id}/links/${link.link_id}/available_filters`
|
||||
);
|
||||
@ -96,22 +96,22 @@ export class LinkService {
|
||||
};
|
||||
});
|
||||
|
||||
return this.httpServer.put(controller, `/projects/${link.project_id}/links/${link.link_id}`, { nodes: requestNodes });
|
||||
return this.httpController.put(controller, `/projects/${link.project_id}/links/${link.link_id}`, { nodes: requestNodes });
|
||||
}
|
||||
|
||||
startCaptureOnLink(controller:Controller , link: Link, settings: CapturingSettings) {
|
||||
return this.httpServer.post(controller, `/projects/${link.project_id}/links/${link.link_id}/capture/start`, settings);
|
||||
return this.httpController.post(controller, `/projects/${link.project_id}/links/${link.link_id}/capture/start`, settings);
|
||||
}
|
||||
|
||||
stopCaptureOnLink(controller:Controller , link: Link) {
|
||||
return this.httpServer.post(controller, `/projects/${link.project_id}/links/${link.link_id}/capture/stop`, {});
|
||||
return this.httpController.post(controller, `/projects/${link.project_id}/links/${link.link_id}/capture/stop`, {});
|
||||
}
|
||||
|
||||
resetLink(controller:Controller , link: Link) {
|
||||
return this.httpServer.post(controller, `/projects/${link.project_id}/links/${link.link_id}/reset`, {});
|
||||
return this.httpController.post(controller, `/projects/${link.project_id}/links/${link.link_id}/reset`, {});
|
||||
}
|
||||
|
||||
streamPcap(controller:Controller , link: Link) {
|
||||
return this.httpServer.get(controller, `/projects/${link.project_id}/links/${link.link_id}/capture/stream`);
|
||||
return this.httpController.get(controller, `/projects/${link.project_id}/links/${link.link_id}/capture/stream`);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import { AuthResponse } from '../models/authResponse';
|
||||
@Injectable()
|
||||
export class LoginService {
|
||||
controller_id:string =''
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
login(controller:Controller , username: string, password: string) {
|
||||
const payload = new HttpParams()
|
||||
@ -19,13 +19,13 @@ export class LoginService {
|
||||
headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')
|
||||
};
|
||||
|
||||
return this.httpServer.post<AuthResponse>(controller, '/users/login', payload, options);
|
||||
return this.httpController.post<AuthResponse>(controller, '/users/login', payload, options);
|
||||
}
|
||||
|
||||
getLoggedUser(controller:Controller ) {
|
||||
return this.httpServer.get(controller, "/users/me").toPromise()
|
||||
return this.httpController.get(controller, "/users/me").toPromise()
|
||||
}
|
||||
async getLoggedUserRefToken(controller:Controller ,current_user):Promise<any> {
|
||||
return await this.httpServer.post<AuthResponse>(controller, "/users/authenticate", {"username":current_user.username,"password":current_user.password}).toPromise()
|
||||
return await this.httpController.post<AuthResponse>(controller, "/users/authenticate", {"username":current_user.username,"password":current_user.password}).toPromise()
|
||||
}
|
||||
}
|
||||
|
@ -10,12 +10,12 @@ import { Template } from '../models/template';
|
||||
import { AppTestingModule } from '../testing/app-testing/app-testing.module';
|
||||
import { HttpController } from './http-controller.service';
|
||||
import { NodeService } from './node.service';
|
||||
import { getTestServer } from './testing';
|
||||
import { getTestController } from './testing';
|
||||
|
||||
describe('NodeService', () => {
|
||||
let httpClient: HttpClient;
|
||||
let httpTestingController: HttpTestingController;
|
||||
let httpServer: HttpController;
|
||||
let httpController: HttpController;
|
||||
let service: NodeService;
|
||||
let controller:Controller ;
|
||||
|
||||
@ -30,9 +30,9 @@ describe('NodeService', () => {
|
||||
|
||||
httpClient = TestBed.get(HttpClient);
|
||||
httpTestingController = TestBed.get(HttpTestingController);
|
||||
httpServer = TestBed.get(HttpController);
|
||||
httpController = TestBed.get(HttpController);
|
||||
service = TestBed.get(NodeService);
|
||||
controller = getTestServer();
|
||||
controller = getTestController();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -10,53 +10,53 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class NodeService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
getNodeById(controller:Controller , projectId: string, nodeId: string) {
|
||||
return this.httpServer.get(controller, `/projects/${projectId}/nodes/${nodeId}`);
|
||||
return this.httpController.get(controller, `/projects/${projectId}/nodes/${nodeId}`);
|
||||
}
|
||||
|
||||
isolate(controller:Controller , node: Node) {
|
||||
return this.httpServer.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/isolate`, {});
|
||||
return this.httpController.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/isolate`, {});
|
||||
}
|
||||
|
||||
unisolate(controller:Controller , node: Node) {
|
||||
return this.httpServer.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/unisolate`, {});
|
||||
return this.httpController.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/unisolate`, {});
|
||||
}
|
||||
|
||||
start(controller:Controller , node: Node) {
|
||||
return this.httpServer.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/start`, {});
|
||||
return this.httpController.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/start`, {});
|
||||
}
|
||||
|
||||
startAll(controller:Controller , project: Project) {
|
||||
return this.httpServer.post(controller, `/projects/${project.project_id}/nodes/start`, {});
|
||||
return this.httpController.post(controller, `/projects/${project.project_id}/nodes/start`, {});
|
||||
}
|
||||
|
||||
stop(controller:Controller , node: Node) {
|
||||
return this.httpServer.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/stop`, {});
|
||||
return this.httpController.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/stop`, {});
|
||||
}
|
||||
|
||||
stopAll(controller:Controller , project: Project) {
|
||||
return this.httpServer.post(controller, `/projects/${project.project_id}/nodes/stop`, {});
|
||||
return this.httpController.post(controller, `/projects/${project.project_id}/nodes/stop`, {});
|
||||
}
|
||||
|
||||
suspend(controller:Controller , node: Node) {
|
||||
return this.httpServer.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/suspend`, {});
|
||||
return this.httpController.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/suspend`, {});
|
||||
}
|
||||
|
||||
suspendAll(controller:Controller , project: Project) {
|
||||
return this.httpServer.post(controller, `/projects/${project.project_id}/nodes/suspend`, {});
|
||||
return this.httpController.post(controller, `/projects/${project.project_id}/nodes/suspend`, {});
|
||||
}
|
||||
|
||||
reload(controller:Controller , node: Node) {
|
||||
return this.httpServer.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/reload`, {});
|
||||
return this.httpController.post<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}/reload`, {});
|
||||
}
|
||||
|
||||
reloadAll(controller:Controller , project: Project) {
|
||||
return this.httpServer.post(controller, `/projects/${project.project_id}/nodes/reload`, {});
|
||||
return this.httpController.post(controller, `/projects/${project.project_id}/nodes/reload`, {});
|
||||
}
|
||||
resetAllNodes(controller:Controller , project: Project) {
|
||||
return this.httpServer.post(controller, `/projects/${project.project_id}/nodes/console/reset`, {});
|
||||
return this.httpController.post(controller, `/projects/${project.project_id}/nodes/console/reset`, {});
|
||||
}
|
||||
|
||||
createFromTemplate(
|
||||
@ -68,13 +68,13 @@ export class NodeService {
|
||||
compute_id: string
|
||||
): Observable<Node> {
|
||||
if (!compute_id) {
|
||||
return this.httpServer.post(controller, `/projects/${project.project_id}/templates/${template.template_id}`, {
|
||||
return this.httpController.post(controller, `/projects/${project.project_id}/templates/${template.template_id}`, {
|
||||
x: Math.round(x),
|
||||
y: Math.round(y),
|
||||
compute_id: 'local',
|
||||
});
|
||||
}
|
||||
return this.httpServer.post(controller, `/projects/${project.project_id}/templates/${template.template_id}`, {
|
||||
return this.httpController.post(controller, `/projects/${project.project_id}/templates/${template.template_id}`, {
|
||||
x: Math.round(x),
|
||||
y: Math.round(y),
|
||||
compute_id: compute_id,
|
||||
@ -93,14 +93,14 @@ export class NodeService {
|
||||
yPosition = Math.round(yPosition - node.height / 2);
|
||||
}
|
||||
|
||||
return this.httpServer.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
return this.httpController.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
x: xPosition,
|
||||
y: yPosition,
|
||||
});
|
||||
}
|
||||
|
||||
updateLabel(controller:Controller , node: Node, label: Label): Observable<Node> {
|
||||
return this.httpServer.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
return this.httpController.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
label: {
|
||||
rotation: label.rotation,
|
||||
style: label.style,
|
||||
@ -112,13 +112,13 @@ export class NodeService {
|
||||
}
|
||||
|
||||
updateSymbol(controller:Controller , node: Node, changedSymbol: string): Observable<Node> {
|
||||
return this.httpServer.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
return this.httpController.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
symbol: changedSymbol,
|
||||
});
|
||||
}
|
||||
|
||||
update(controller:Controller , node: Node): Observable<Node> {
|
||||
return this.httpServer.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
return this.httpController.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
x: Math.round(node.x),
|
||||
y: Math.round(node.y),
|
||||
z: node.z,
|
||||
@ -126,7 +126,7 @@ export class NodeService {
|
||||
}
|
||||
|
||||
updateNode(controller:Controller , node: Node): Observable<Node> {
|
||||
return this.httpServer.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
return this.httpController.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
console_type: node.console_type,
|
||||
console_auto_start: node.console_auto_start,
|
||||
locked: node.locked,
|
||||
@ -136,7 +136,7 @@ export class NodeService {
|
||||
}
|
||||
|
||||
updateNodeWithCustomAdapters(controller:Controller , node: Node): Observable<Node> {
|
||||
return this.httpServer.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
return this.httpController.put<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`, {
|
||||
console_type: node.console_type,
|
||||
console_auto_start: node.console_auto_start,
|
||||
custom_adapters: node.custom_adapters,
|
||||
@ -146,11 +146,11 @@ export class NodeService {
|
||||
}
|
||||
|
||||
delete(controller:Controller , node: Node) {
|
||||
return this.httpServer.delete<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`);
|
||||
return this.httpController.delete<Node>(controller, `/projects/${node.project_id}/nodes/${node.node_id}`);
|
||||
}
|
||||
|
||||
duplicate(controller:Controller , node: Node) {
|
||||
return this.httpServer.post(controller, `/projects/${node.project_id}/nodes/${node.node_id}/duplicate`, {
|
||||
return this.httpController.post(controller, `/projects/${node.project_id}/nodes/${node.node_id}/duplicate`, {
|
||||
x: node.x + 10,
|
||||
y: node.y + 10,
|
||||
z: node.z,
|
||||
@ -158,7 +158,7 @@ export class NodeService {
|
||||
}
|
||||
|
||||
getNode(controller:Controller , node: Node) {
|
||||
return this.httpServer.get(controller, `/projects/${node.project_id}/nodes/${node.node_id}`);
|
||||
return this.httpController.get(controller, `/projects/${node.project_id}/nodes/${node.node_id}`);
|
||||
}
|
||||
|
||||
getDefaultCommand(): string {
|
||||
@ -166,7 +166,7 @@ export class NodeService {
|
||||
}
|
||||
|
||||
getNetworkConfiguration(controller:Controller , node: Node) {
|
||||
return this.httpServer.get(
|
||||
return this.httpController.get(
|
||||
controller,
|
||||
`/projects/${node.project_id}/nodes/${node.node_id}/files/etc/network/interfaces`,
|
||||
{ responseType: 'text' as 'json' }
|
||||
@ -174,7 +174,7 @@ export class NodeService {
|
||||
}
|
||||
|
||||
saveNetworkConfiguration(controller:Controller , node: Node, configuration: string) {
|
||||
return this.httpServer.post(
|
||||
return this.httpController.post(
|
||||
controller,
|
||||
`/projects/${node.project_id}/nodes/${node.node_id}/files/etc/network/interfaces`,
|
||||
configuration
|
||||
@ -192,7 +192,7 @@ export class NodeService {
|
||||
urlPath += `/files/configs/i${node.node_id}_startup-config.cfg`;
|
||||
}
|
||||
|
||||
return this.httpServer.get(controller, urlPath, { responseType: 'text' as 'json' });
|
||||
return this.httpController.get(controller, urlPath, { responseType: 'text' as 'json' });
|
||||
}
|
||||
|
||||
getPrivateConfiguration(controller:Controller , node: Node) {
|
||||
@ -204,7 +204,7 @@ export class NodeService {
|
||||
urlPath += `/files/configs/i${node.node_id}_private-config.cfg`;
|
||||
}
|
||||
|
||||
return this.httpServer.get(controller, urlPath, { responseType: 'text' as 'json' });
|
||||
return this.httpController.get(controller, urlPath, { responseType: 'text' as 'json' });
|
||||
}
|
||||
|
||||
saveConfiguration(controller:Controller , node: Node, configuration: string) {
|
||||
@ -218,7 +218,7 @@ export class NodeService {
|
||||
urlPath += `/files/configs/i${node.node_id}_startup-config.cfg`;
|
||||
}
|
||||
|
||||
return this.httpServer.post(controller, urlPath, configuration);
|
||||
return this.httpController.post(controller, urlPath, configuration);
|
||||
}
|
||||
|
||||
savePrivateConfiguration(controller:Controller , node: Node, configuration: string) {
|
||||
@ -230,6 +230,6 @@ export class NodeService {
|
||||
urlPath += `/files/configs/i${node.node_id}_private-config.cfg`;
|
||||
}
|
||||
|
||||
return this.httpServer.post(controller, urlPath, configuration);
|
||||
return this.httpController.post(controller, urlPath, configuration);
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import { HttpController } from './http-controller.service';
|
||||
import { ProjectService } from './project.service';
|
||||
import { RecentlyOpenedProjectService } from './recentlyOpenedProject.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { getTestServer } from './testing';
|
||||
import { getTestController } from './testing';
|
||||
|
||||
/**
|
||||
* Mocks ProjectsService so it's not based on settings
|
||||
@ -63,7 +63,7 @@ export class MockedProjectService {
|
||||
describe('ProjectService', () => {
|
||||
let httpClient: HttpClient;
|
||||
let httpTestingController: HttpTestingController;
|
||||
let httpServer: HttpController;
|
||||
let httpController: HttpController;
|
||||
let service: ProjectService;
|
||||
let controller:Controller ;
|
||||
let settingsService: SettingsService;
|
||||
@ -81,11 +81,11 @@ describe('ProjectService', () => {
|
||||
|
||||
httpClient = TestBed.get(HttpClient);
|
||||
httpTestingController = TestBed.get(HttpTestingController);
|
||||
httpServer = TestBed.get(HttpController);
|
||||
httpController = TestBed.get(HttpController);
|
||||
service = TestBed.get(ProjectService);
|
||||
settingsService = TestBed.get(SettingsService);
|
||||
|
||||
controller = getTestServer();
|
||||
controller = getTestController();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -34,7 +34,7 @@ export class ProjectService {
|
||||
|
||||
public projectListSubject = new Subject<boolean>();
|
||||
constructor(
|
||||
private httpServer: HttpController,
|
||||
private httpController: HttpController,
|
||||
private settingsService: SettingsService,
|
||||
private recentlyOpenedProjectService: RecentlyOpenedProjectService
|
||||
) {}
|
||||
@ -44,48 +44,49 @@ export class ProjectService {
|
||||
}
|
||||
|
||||
getReadmeFile(controller:Controller , project_id: string) {
|
||||
return this.httpServer.getText(controller, `/projects/${project_id}/files/README.txt`);
|
||||
return this.httpController.getText(controller, `/projects/${project_id}/files/README.txt`);
|
||||
}
|
||||
|
||||
postReadmeFile(controller:Controller , project_id: string, readme: string) {
|
||||
return this.httpServer.post<any>(controller, `/projects/${project_id}/files/README.txt`, readme);
|
||||
return this.httpController.post<any>(controller, `/projects/${project_id}/files/README.txt`, readme);
|
||||
}
|
||||
|
||||
get(controller:Controller , project_id: string) {
|
||||
return this.httpServer.get<Project>(controller, `/projects/${project_id}`);
|
||||
return this.httpController.get<Project>(controller, `/projects/${project_id}`);
|
||||
}
|
||||
|
||||
open(controller:Controller , project_id: string) {
|
||||
return this.httpServer.post<Project>(controller, `/projects/${project_id}/open`, {});
|
||||
return this.httpController.post<Project>(controller, `/projects/${project_id}/open`, {});
|
||||
}
|
||||
|
||||
close(controller:Controller , project_id: string) {
|
||||
this.recentlyOpenedProjectService.removeData();
|
||||
return this.httpServer.post<Project>(controller, `/projects/${project_id}/close`, {});
|
||||
return this.httpController.post<Project>(controller, `/projects/${project_id}/close`, {});
|
||||
}
|
||||
|
||||
list(controller:Controller ) {
|
||||
return this.httpServer.get<Project[]>(controller, '/projects');
|
||||
return this.httpController.get<Project[]>(controller, '/projects');
|
||||
}
|
||||
|
||||
nodes(controller:Controller , project_id: string) {
|
||||
return this.httpServer.get<Node[]>(controller, `/projects/${project_id}/nodes`);
|
||||
return this.httpController.get<Node[]>(controller, `/projects/${project_id}/nodes`);
|
||||
}
|
||||
|
||||
links(controller:Controller , project_id: string) {
|
||||
return this.httpServer.get<Link[]>(controller, `/projects/${project_id}/links`);
|
||||
debugger
|
||||
return this.httpController.get<Link[]>(controller, `/projects/${project_id}/links`);
|
||||
}
|
||||
|
||||
drawings(controller:Controller , project_id: string) {
|
||||
return this.httpServer.get<Drawing[]>(controller, `/projects/${project_id}/drawings`);
|
||||
return this.httpController.get<Drawing[]>(controller, `/projects/${project_id}/drawings`);
|
||||
}
|
||||
|
||||
add(controller:Controller , project_name: string, project_id: string): Observable<any> {
|
||||
return this.httpServer.post<Project>(controller, `/projects`, { name: project_name, project_id: project_id });
|
||||
return this.httpController.post<Project>(controller, `/projects`, { name: project_name, project_id: project_id });
|
||||
}
|
||||
|
||||
update(controller:Controller , project: Project): Observable<Project> {
|
||||
return this.httpServer.put<Project>(controller, `/projects/${project.project_id}`, {
|
||||
return this.httpController.put<Project>(controller, `/projects/${project.project_id}`, {
|
||||
auto_close: project.auto_close,
|
||||
auto_open: project.auto_open,
|
||||
auto_start: project.auto_start,
|
||||
@ -99,7 +100,7 @@ export class ProjectService {
|
||||
}
|
||||
|
||||
delete(controller:Controller , project_id: string): Observable<any> {
|
||||
return this.httpServer.delete(controller, `/projects/${project_id}`);
|
||||
return this.httpController.delete(controller, `/projects/${project_id}`);
|
||||
}
|
||||
|
||||
getUploadPath(controller:Controller , uuid: string, project_name: string) {
|
||||
@ -111,15 +112,15 @@ export class ProjectService {
|
||||
}
|
||||
|
||||
export(controller:Controller , project_id: string): Observable<any> {
|
||||
return this.httpServer.get(controller, `/projects/${project_id}/export`);
|
||||
return this.httpController.get(controller, `/projects/${project_id}/export`);
|
||||
}
|
||||
|
||||
getStatistics(controller:Controller , project_id: string): Observable<any> {
|
||||
return this.httpServer.get(controller, `/projects/${project_id}/stats`);
|
||||
return this.httpController.get(controller, `/projects/${project_id}/stats`);
|
||||
}
|
||||
|
||||
duplicate(controller:Controller , project_id: string, project_name): Observable<any> {
|
||||
return this.httpServer.post(controller, `/projects/${project_id}/duplicate`, { name: project_name });
|
||||
return this.httpController.post(controller, `/projects/${project_id}/duplicate`, { name: project_name });
|
||||
}
|
||||
|
||||
isReadOnly(project: Project) {
|
||||
|
@ -7,12 +7,12 @@ import { QemuTemplate } from '../models/templates/qemu-template';
|
||||
import { AppTestingModule } from '../testing/app-testing/app-testing.module';
|
||||
import { HttpController } from './http-controller.service';
|
||||
import { QemuService } from './qemu.service';
|
||||
import { getTestServer } from './testing';
|
||||
import { getTestController } from './testing';
|
||||
|
||||
describe('QemuService', () => {
|
||||
let httpClient: HttpClient;
|
||||
let httpTestingController: HttpTestingController;
|
||||
let httpServer: HttpController;
|
||||
let httpController: HttpController;
|
||||
let controller:Controller ;
|
||||
|
||||
beforeEach(() => {
|
||||
@ -23,8 +23,8 @@ describe('QemuService', () => {
|
||||
|
||||
httpClient = TestBed.get(HttpClient);
|
||||
httpTestingController = TestBed.get(HttpTestingController);
|
||||
httpServer = TestBed.get(HttpController);
|
||||
controller = getTestServer();
|
||||
httpController = TestBed.get(HttpController);
|
||||
controller = getTestController();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -9,14 +9,14 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class QemuService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
getTemplates(controller:Controller ): Observable<QemuTemplate[]> {
|
||||
return this.httpServer.get<QemuTemplate[]>(controller, '/templates') as Observable<QemuTemplate[]>;
|
||||
return this.httpController.get<QemuTemplate[]>(controller, '/templates') as Observable<QemuTemplate[]>;
|
||||
}
|
||||
|
||||
getTemplate(controller:Controller , template_id: string): Observable<QemuTemplate> {
|
||||
return this.httpServer.get<QemuTemplate>(controller, `/templates/${template_id}`) as Observable<QemuTemplate>;
|
||||
return this.httpController.get<QemuTemplate>(controller, `/templates/${template_id}`) as Observable<QemuTemplate>;
|
||||
}
|
||||
|
||||
getImagePath(controller:Controller , filename: string): string {
|
||||
@ -24,23 +24,23 @@ export class QemuService {
|
||||
}
|
||||
|
||||
getBinaries(controller:Controller ): Observable<QemuBinary[]> {
|
||||
return this.httpServer.get<QemuBinary[]>(controller, '/computes/local/qemu/binaries') as Observable<QemuBinary[]>;
|
||||
return this.httpController.get<QemuBinary[]>(controller, '/computes/local/qemu/binaries') as Observable<QemuBinary[]>;
|
||||
}
|
||||
|
||||
getImages(controller:Controller ): Observable<any> {
|
||||
return this.httpServer.get<QemuImage[]>(controller, '/images?image_type=qemu') as Observable<QemuImage[]>;
|
||||
return this.httpController.get<QemuImage[]>(controller, '/images?image_type=qemu') as Observable<QemuImage[]>;
|
||||
}
|
||||
|
||||
addImage(controller:Controller , qemuImg: QemuImg): Observable<QemuImg> {
|
||||
return this.httpServer.post<QemuImg>(controller, '/images/upload', qemuImg) as Observable<QemuImg>;
|
||||
return this.httpController.post<QemuImg>(controller, '/images/upload', qemuImg) as Observable<QemuImg>;
|
||||
}
|
||||
|
||||
addTemplate(controller:Controller , qemuTemplate: QemuTemplate): Observable<QemuTemplate> {
|
||||
return this.httpServer.post<QemuTemplate>(controller, `/templates`, qemuTemplate) as Observable<QemuTemplate>;
|
||||
return this.httpController.post<QemuTemplate>(controller, `/templates`, qemuTemplate) as Observable<QemuTemplate>;
|
||||
}
|
||||
|
||||
saveTemplate(controller:Controller , qemuTemplate: QemuTemplate): Observable<QemuTemplate> {
|
||||
return this.httpServer.put<QemuTemplate>(
|
||||
return this.httpController.put<QemuTemplate>(
|
||||
controller,
|
||||
`/templates/${qemuTemplate.template_id}`,
|
||||
qemuTemplate
|
||||
|
@ -7,12 +7,12 @@ import { Snapshot } from '../models/snapshot';
|
||||
import { AppTestingModule } from '../testing/app-testing/app-testing.module';
|
||||
import { HttpController } from './http-controller.service';
|
||||
import { SnapshotService } from './snapshot.service';
|
||||
import { getTestServer } from './testing';
|
||||
import { getTestController } from './testing';
|
||||
|
||||
describe('SnapshotService', () => {
|
||||
let httpClient: HttpClient;
|
||||
let httpTestingController: HttpTestingController;
|
||||
let httpServer: HttpController;
|
||||
let httpController: HttpController;
|
||||
let service: SnapshotService;
|
||||
let controller:Controller ;
|
||||
|
||||
@ -24,9 +24,9 @@ describe('SnapshotService', () => {
|
||||
|
||||
httpClient = TestBed.get(HttpClient);
|
||||
httpTestingController = TestBed.get(HttpTestingController);
|
||||
httpServer = TestBed.get(HttpController);
|
||||
httpController = TestBed.get(HttpController);
|
||||
service = TestBed.get(SnapshotService);
|
||||
controller = getTestServer();
|
||||
controller = getTestController();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -5,21 +5,21 @@ import { HttpController } from './http-controller.service';
|
||||
|
||||
@Injectable()
|
||||
export class SnapshotService {
|
||||
constructor(private httpServer: HttpController) {}
|
||||
constructor(private httpController: HttpController) {}
|
||||
|
||||
create(controller:Controller , project_id: string, snapshot: Snapshot) {
|
||||
return this.httpServer.post<Snapshot>(controller, `/projects/${project_id}/snapshots`, snapshot);
|
||||
return this.httpController.post<Snapshot>(controller, `/projects/${project_id}/snapshots`, snapshot);
|
||||
}
|
||||
|
||||
delete(controller:Controller , project_id: string, snapshot_id: string) {
|
||||
return this.httpServer.delete(controller, `/projects/${project_id}/snapshots/${snapshot_id}`);
|
||||
return this.httpController.delete(controller, `/projects/${project_id}/snapshots/${snapshot_id}`);
|
||||
}
|
||||
|
||||
list(controller:Controller , project_id: string) {
|
||||
return this.httpServer.get<Snapshot[]>(controller, `/projects/${project_id}/snapshots`);
|
||||
return this.httpController.get<Snapshot[]>(controller, `/projects/${project_id}/snapshots`);
|
||||
}
|
||||
|
||||
restore(controller:Controller , project_id: string, snapshot_id: string) {
|
||||
return this.httpServer.post(controller, `/projects/${project_id}/snapshots/${snapshot_id}/restore`, {});
|
||||
return this.httpController.post(controller, `/projects/${project_id}/snapshots/${snapshot_id}/restore`, {});
|
||||
}
|
||||
}
|
||||
|
@ -8,12 +8,12 @@ import { Symbol } from '../models/symbol';
|
||||
import { AppTestingModule } from '../testing/app-testing/app-testing.module';
|
||||
import { HttpController } from './http-controller.service';
|
||||
import { SymbolService } from './symbol.service';
|
||||
import { getTestServer } from './testing';
|
||||
import { getTestController } from './testing';
|
||||
|
||||
describe('SymbolService', () => {
|
||||
let httpClient: HttpClient;
|
||||
let httpTestingController: HttpTestingController;
|
||||
let httpServer: HttpController;
|
||||
let httpController: HttpController;
|
||||
let controller:Controller ;
|
||||
|
||||
beforeEach(() => {
|
||||
@ -24,8 +24,8 @@ describe('SymbolService', () => {
|
||||
|
||||
httpClient = TestBed.get(HttpClient);
|
||||
httpTestingController = TestBed.get(HttpTestingController);
|
||||
httpServer = TestBed.get(HttpController);
|
||||
controller = getTestServer();
|
||||
httpController = TestBed.get(HttpController);
|
||||
controller = getTestController();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user