+
-
-
+
diff --git a/src/app/components/direct-link/direct-link.component.ts b/src/app/components/direct-link/direct-link.component.ts
index d8f6a3b9..f7cee146 100644
--- a/src/app/components/direct-link/direct-link.component.ts
+++ b/src/app/components/direct-link/direct-link.component.ts
@@ -1,9 +1,9 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
-import { Server } from '../../models/server';
-import { ServerDatabase } from '../../services/server.database';
-import { ServerService } from '../../services/server.service';
+import{ Controller } from '../../models/controller';
+import { ControllerDatabase } from '../../services/controller.database';
+import { ControllerService } from '../../services/controller.service';
import { ToasterService } from '../../services/toaster.service';
@Component({
@@ -13,9 +13,9 @@ import { ToasterService } from '../../services/toaster.service';
encapsulation: ViewEncapsulation.None,
})
export class DirectLinkComponent implements OnInit {
- public serverOptionsVisibility = false;
- public serverIp;
- public serverPort;
+ public controllerOptionsVisibility = false;
+ public controllerIp;
+ public controllerPort;
public projectId;
protocols = [
@@ -27,61 +27,61 @@ export class DirectLinkComponent implements OnInit {
{ key: 'remote', name: 'Remote' },
];
- serverForm = new FormGroup({
+ controllerForm = new FormGroup({
name: new FormControl('', [Validators.required]),
location: new FormControl(''),
protocol: new FormControl('http:')
});
constructor(
- private serverService: ServerService,
- private serverDatabase: ServerDatabase,
+ private controllerService: ControllerService,
+ private controllerDatabase: ControllerDatabase,
private route: ActivatedRoute,
private router: Router,
private toasterService: ToasterService
) {}
async ngOnInit() {
- if (this.serverService.isServiceInitialized) this.getServers();
+ if (this.controllerService.isServiceInitialized) this.getControllers();
- this.serverService.serviceInitialized.subscribe(async (value: boolean) => {
+ this.controllerService.serviceInitialized.subscribe(async (value: boolean) => {
if (value) {
- this.getServers();
+ this.getControllers();
}
});
}
- private async getServers() {
- this.serverIp = this.route.snapshot.paramMap.get('server_ip');
- this.serverPort = +this.route.snapshot.paramMap.get('server_port');
+ private async getControllers() {
+ this.controllerIp = this.route.snapshot.paramMap.get('controller_ip');
+ this.controllerPort = +this.route.snapshot.paramMap.get('controller_port');
this.projectId = this.route.snapshot.paramMap.get('project_id');
- const servers = await this.serverService.findAll();
- const server = servers.filter((server) => server.host === this.serverIp && server.port === this.serverPort)[0];
+ const controllers = await this.controllerService.findAll();
+ const controller = controllers.filter((controller) => controller.host === this.controllerIp && controller.port === this.controllerPort)[0];
- if (server) {
- this.router.navigate(['/server', server.id, 'project', this.projectId]);
+ if (controller) {
+ this.router.navigate(['/controller', controller.id, 'project', this.projectId]);
} else {
- this.serverOptionsVisibility = true;
+ this.controllerOptionsVisibility = true;
}
}
- public createServer() {
- if (!this.serverForm.get('name').hasError && !this.serverForm.get('location').hasError && !this.serverForm.get('protocol').hasError) {
+ public createController() {
+ if (!this.controllerForm.get('name').hasError && !this.controllerForm.get('location').hasError && !this.controllerForm.get('protocol').hasError) {
this.toasterService.error('Please use correct values');
return;
}
- let serverToAdd: Server = new Server();
- serverToAdd.host = this.serverIp;
- serverToAdd.port = this.serverPort;
+ let controllerToAdd:Controller = new Controller ();
+ controllerToAdd.host = this.controllerIp;
+ controllerToAdd.port = this.controllerPort;
- serverToAdd.name = this.serverForm.get('name').value;
- serverToAdd.location = this.serverForm.get('location').value;
- serverToAdd.protocol = this.serverForm.get('protocol').value;
+ controllerToAdd.name = this.controllerForm.get('name').value;
+ controllerToAdd.location = this.controllerForm.get('location').value;
+ controllerToAdd.protocol = this.controllerForm.get('protocol').value;
- this.serverService.create(serverToAdd).then((addedServer: Server) => {
- this.router.navigate(['/server', addedServer.id, 'project', this.projectId]);
+ this.controllerService.create(controllerToAdd).then((addedController:Controller ) => {
+ this.router.navigate(['/controller', addedController.id, 'project', this.projectId]);
});
}
}
diff --git a/src/app/components/drawings-listeners/drawing-added/drawing-added.component.ts b/src/app/components/drawings-listeners/drawing-added/drawing-added.component.ts
index f43c825f..fd0dfb33 100644
--- a/src/app/components/drawings-listeners/drawing-added/drawing-added.component.ts
+++ b/src/app/components/drawings-listeners/drawing-added/drawing-added.component.ts
@@ -7,7 +7,7 @@ import { AddedDataEvent } from '../../../cartography/events/event-source';
import { DefaultDrawingsFactory } from '../../../cartography/helpers/default-drawings-factory';
import { Drawing } from '../../../cartography/models/drawing';
import { Project } from '../../../models/project';
-import { Server } from '../../../models/server';
+import{ Controller } from '../../../models/controller';
import { DrawingService } from '../../../services/drawing.service';
@Component({
@@ -16,7 +16,7 @@ import { DrawingService } from '../../../services/drawing.service';
styleUrls: ['./drawing-added.component.scss'],
})
export class DrawingAddedComponent implements OnInit, OnDestroy {
- @Input() server: Server;
+ @Input() controller: Controller
@Input() project: Project;
@Input() selectedDrawing: string;
@Output() drawingSaved = new EventEmitter
();
@@ -49,9 +49,9 @@ export class DrawingAddedComponent implements OnInit, OnDestroy {
let svgText = this.mapDrawingToSvgConverter.convert(drawing);
this.drawingService
- .add(this.server, this.project.project_id, evt.x, evt.y, svgText)
- .subscribe((serverDrawing: Drawing) => {
- this.drawingsDataSource.add(serverDrawing);
+ .add(this.controller, this.project.project_id, evt.x, evt.y, svgText)
+ .subscribe((controllerDrawing: Drawing) => {
+ this.drawingsDataSource.add(controllerDrawing);
this.drawingSaved.emit(true);
});
}
diff --git a/src/app/components/drawings-listeners/drawing-dragged/drawing-dragged.component.ts b/src/app/components/drawings-listeners/drawing-dragged/drawing-dragged.component.ts
index dc33b8fa..8954e944 100644
--- a/src/app/components/drawings-listeners/drawing-dragged/drawing-dragged.component.ts
+++ b/src/app/components/drawings-listeners/drawing-dragged/drawing-dragged.component.ts
@@ -6,7 +6,7 @@ import { DraggedDataEvent } from '../../../cartography/events/event-source';
import { Drawing } from '../../../cartography/models/drawing';
import { MapDrawing } from '../../../cartography/models/map/map-drawing';
import { Project } from '../../../models/project';
-import { Server } from '../../../models/server';
+import{ Controller } from '../../../models/controller';
import { DrawingService } from '../../../services/drawing.service';
@Component({
@@ -15,7 +15,7 @@ import { DrawingService } from '../../../services/drawing.service';
styleUrls: ['./drawing-dragged.component.scss'],
})
export class DrawingDraggedComponent implements OnInit, OnDestroy {
- @Input() server: Server;
+ @Input() controller:Controller ;
@Input() project: Project;
private drawingDragged: Subscription;
@@ -35,9 +35,9 @@ export class DrawingDraggedComponent implements OnInit, OnDestroy {
drawing.y += draggedEvent.dy;
this.drawingService
- .updatePosition(this.server, this.project, drawing, drawing.x, drawing.y)
- .subscribe((serverDrawing: Drawing) => {
- this.drawingsDataSource.update(serverDrawing);
+ .updatePosition(this.controller, this.project, drawing, drawing.x, drawing.y)
+ .subscribe((controllerDrawing: Drawing) => {
+ this.drawingsDataSource.update(controllerDrawing);
});
}
diff --git a/src/app/components/drawings-listeners/drawing-resized/drawing-resized.component.ts b/src/app/components/drawings-listeners/drawing-resized/drawing-resized.component.ts
index ef8fc203..1bfabf80 100644
--- a/src/app/components/drawings-listeners/drawing-resized/drawing-resized.component.ts
+++ b/src/app/components/drawings-listeners/drawing-resized/drawing-resized.component.ts
@@ -6,7 +6,7 @@ import { DrawingsEventSource } from '../../../cartography/events/drawings-event-
import { ResizedDataEvent } from '../../../cartography/events/event-source';
import { Drawing } from '../../../cartography/models/drawing';
import { MapDrawing } from '../../../cartography/models/map/map-drawing';
-import { Server } from '../../../models/server';
+import{ Controller } from '../../../models/controller';
import { DrawingService } from '../../../services/drawing.service';
@Component({
@@ -15,7 +15,7 @@ import { DrawingService } from '../../../services/drawing.service';
styleUrls: ['./drawing-resized.component.scss'],
})
export class DrawingResizedComponent implements OnInit, OnDestroy {
- @Input() server: Server;
+ @Input() controller:Controller ;
private drawingResized: Subscription;
constructor(
@@ -34,9 +34,9 @@ export class DrawingResizedComponent implements OnInit, OnDestroy {
let svgString = this.mapDrawingToSvgConverter.convert(resizedEvent.datum);
this.drawingService
- .updateSizeAndPosition(this.server, drawing, resizedEvent.x, resizedEvent.y, svgString)
- .subscribe((serverDrawing: Drawing) => {
- this.drawingsDataSource.update(serverDrawing);
+ .updateSizeAndPosition(this.controller, drawing, resizedEvent.x, resizedEvent.y, svgString)
+ .subscribe((controllerDrawing: Drawing) => {
+ this.drawingsDataSource.update(controllerDrawing);
});
}
diff --git a/src/app/components/drawings-listeners/interface-label-dragged/interface-label-dragged.component.ts b/src/app/components/drawings-listeners/interface-label-dragged/interface-label-dragged.component.ts
index 124674ea..0e82d866 100644
--- a/src/app/components/drawings-listeners/interface-label-dragged/interface-label-dragged.component.ts
+++ b/src/app/components/drawings-listeners/interface-label-dragged/interface-label-dragged.component.ts
@@ -5,7 +5,7 @@ import { DraggedDataEvent } from '../../../cartography/events/event-source';
import { LinksEventSource } from '../../../cartography/events/links-event-source';
import { MapLinkNode } from '../../../cartography/models/map/map-link-node';
import { Link } from '../../../models/link';
-import { Server } from '../../../models/server';
+import{ Controller } from '../../../models/controller';
import { LinkService } from '../../../services/link.service';
@Component({
@@ -14,7 +14,7 @@ import { LinkService } from '../../../services/link.service';
styleUrls: ['./interface-label-dragged.component.scss'],
})
export class InterfaceLabelDraggedComponent {
- @Input() server: Server;
+ @Input() controller:Controller ;
private interfaceDragged: Subscription;
constructor(
@@ -40,8 +40,8 @@ export class InterfaceLabelDraggedComponent {
link.nodes[1].label.y += draggedEvent.dy;
}
- this.linkService.updateNodes(this.server, 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);
});
}
diff --git a/src/app/components/drawings-listeners/link-created/link-created.component.ts b/src/app/components/drawings-listeners/link-created/link-created.component.ts
index f115ca90..a5c027c6 100644
--- a/src/app/components/drawings-listeners/link-created/link-created.component.ts
+++ b/src/app/components/drawings-listeners/link-created/link-created.component.ts
@@ -7,7 +7,7 @@ import { MapLinkCreated } from '../../../cartography/events/links';
import { LinksEventSource } from '../../../cartography/events/links-event-source';
import { Link } from '../../../models/link';
import { Project } from '../../../models/project';
-import { Server } from '../../../models/server';
+import{ Controller } from '../../../models/controller';
import { LinkService } from '../../../services/link.service';
import { ProjectService } from '../../../services/project.service';
@@ -17,7 +17,7 @@ import { ProjectService } from '../../../services/project.service';
styleUrls: ['./link-created.component.scss'],
})
export class LinkCreatedComponent implements OnInit, OnDestroy {
- @Input() server: Server;
+ @Input() controller:Controller ;
@Input() project: Project;
private linkCreated: Subscription;
@@ -87,7 +87,7 @@ export class LinkCreatedComponent implements OnInit, OnDestroy {
this.linkService
.createLink(
- this.server,
+ this.controller,
sourceNode,
sourcePort,
targetNode,
@@ -98,7 +98,7 @@ export class LinkCreatedComponent implements OnInit, OnDestroy {
yLabelTargetNode
)
.subscribe(() => {
- this.projectService.links(this.server, this.project.project_id).subscribe((links: Link[]) => {
+ this.projectService.links(this.controller, this.project.project_id).subscribe((links: Link[]) => {
this.linksDataSource.set(links);
});
});
diff --git a/src/app/components/drawings-listeners/node-dragged/node-dragged.component.ts b/src/app/components/drawings-listeners/node-dragged/node-dragged.component.ts
index 7730d4b2..f651e94c 100644
--- a/src/app/components/drawings-listeners/node-dragged/node-dragged.component.ts
+++ b/src/app/components/drawings-listeners/node-dragged/node-dragged.component.ts
@@ -6,7 +6,7 @@ import { NodesEventSource } from '../../../cartography/events/nodes-event-source
import { MapNode } from '../../../cartography/models/map/map-node';
import { Node } from '../../../cartography/models/node';
import { Project } from '../../../models/project';
-import { Server } from '../../../models/server';
+import{ Controller } from '../../../models/controller';
import { NodeService } from '../../../services/node.service';
@Component({
@@ -15,7 +15,7 @@ import { NodeService } from '../../../services/node.service';
styleUrls: ['./node-dragged.component.scss'],
})
export class NodeDraggedComponent implements OnInit, OnDestroy {
- @Input() server: Server;
+ @Input() controller:Controller ;
@Input() project: Project;
private nodeDragged: Subscription;
@@ -34,8 +34,8 @@ export class NodeDraggedComponent implements OnInit, OnDestroy {
node.x += draggedEvent.dx;
node.y += draggedEvent.dy;
- this.nodeService.updatePosition(this.server, this.project, node, node.x, node.y).subscribe((serverNode: Node) => {
- this.nodesDataSource.update(serverNode);
+ this.nodeService.updatePosition(this.controller, this.project, node, node.x, node.y).subscribe((controllerNode: Node) => {
+ this.nodesDataSource.update(controllerNode);
});
}
diff --git a/src/app/components/drawings-listeners/node-label-dragged/node-label-dragged.component.ts b/src/app/components/drawings-listeners/node-label-dragged/node-label-dragged.component.ts
index 9a3bcc47..4f878032 100644
--- a/src/app/components/drawings-listeners/node-label-dragged/node-label-dragged.component.ts
+++ b/src/app/components/drawings-listeners/node-label-dragged/node-label-dragged.component.ts
@@ -6,7 +6,7 @@ import { DraggedDataEvent } from '../../../cartography/events/event-source';
import { NodesEventSource } from '../../../cartography/events/nodes-event-source';
import { MapLabel } from '../../../cartography/models/map/map-label';
import { Node } from '../../../cartography/models/node';
-import { Server } from '../../../models/server';
+import{ Controller } from '../../../models/controller';
import { NodeService } from '../../../services/node.service';
@Component({
@@ -15,7 +15,7 @@ import { NodeService } from '../../../services/node.service';
styleUrls: ['./node-label-dragged.component.scss'],
})
export class NodeLabelDraggedComponent implements OnInit, OnDestroy {
- @Input() server: Server;
+ @Input() controller:Controller ;
private nodeLabelDragged: Subscription;
constructor(
@@ -38,8 +38,8 @@ export class NodeLabelDraggedComponent implements OnInit, OnDestroy {
const label = this.mapLabelToLabel.convert(mapLabel);
node.label = label;
- this.nodeService.updateLabel(this.server, node, node.label).subscribe((serverNode: Node) => {
- this.nodesDataSource.update(serverNode);
+ this.nodeService.updateLabel(this.controller, node, node.label).subscribe((controllerNode: Node) => {
+ this.nodesDataSource.update(controllerNode);
});
}
diff --git a/src/app/components/drawings-listeners/text-added/text-added.component.ts b/src/app/components/drawings-listeners/text-added/text-added.component.ts
index d14311ee..dfd05038 100644
--- a/src/app/components/drawings-listeners/text-added/text-added.component.ts
+++ b/src/app/components/drawings-listeners/text-added/text-added.component.ts
@@ -9,7 +9,7 @@ import { Context } from '../../../cartography/models/context';
import { Drawing } from '../../../cartography/models/drawing';
import { TextElement } from '../../../cartography/models/drawings/text-element';
import { Project } from '../../../models/project';
-import { Server } from '../../../models/server';
+import{ Controller } from '../../../models/controller';
import { DrawingService } from '../../../services/drawing.service';
@Component({
@@ -18,7 +18,7 @@ import { DrawingService } from '../../../services/drawing.service';
styleUrls: ['./text-added.component.scss'],
})
export class TextAddedComponent implements OnInit, OnDestroy {
- @Input() server: Server;
+ @Input() controller: Controller;
@Input() project: Project;
@Output() drawingSaved = new EventEmitter();
private textAdded: Subscription;
@@ -43,7 +43,7 @@ export class TextAddedComponent implements OnInit, OnDestroy {
this.drawingService
.add(
- this.server,
+ this.controller,
this.project.project_id,
(evt.x - (this.context.getZeroZeroTransformationPoint().x + this.context.transformation.x)) /
this.context.transformation.k,
@@ -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);
});
}
diff --git a/src/app/components/drawings-listeners/text-edited/text-edited.component.ts b/src/app/components/drawings-listeners/text-edited/text-edited.component.ts
index d5d5eaec..32a138e5 100644
--- a/src/app/components/drawings-listeners/text-edited/text-edited.component.ts
+++ b/src/app/components/drawings-listeners/text-edited/text-edited.component.ts
@@ -7,7 +7,7 @@ import { TextEditedDataEvent } from '../../../cartography/events/event-source';
import { Drawing } from '../../../cartography/models/drawing';
import { TextElement } from '../../../cartography/models/drawings/text-element';
import { MapDrawing } from '../../../cartography/models/map/map-drawing';
-import { Server } from '../../../models/server';
+import{ Controller } from '../../../models/controller';
import { DrawingService } from '../../../services/drawing.service';
@Component({
@@ -16,7 +16,7 @@ import { DrawingService } from '../../../services/drawing.service';
styleUrls: ['./text-edited.component.scss'],
})
export class TextEditedComponent implements OnInit, OnDestroy {
- @Input() server: Server;
+ @Input() controller: Controller;
private textEdited: Subscription;
constructor(
@@ -38,8 +38,8 @@ export class TextEditedComponent implements OnInit, OnDestroy {
let drawing = this.drawingsDataSource.get(evt.textDrawingId);
- this.drawingService.updateText(this.server, 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);
});
}
diff --git a/src/app/components/export-portable-project/export-portable-project.component.html b/src/app/components/export-portable-project/export-portable-project.component.html
index f232dba0..de20ebe8 100644
--- a/src/app/components/export-portable-project/export-portable-project.component.html
+++ b/src/app/components/export-portable-project/export-portable-project.component.html
@@ -21,7 +21,7 @@
{{
- compressionValue.name
+ compressionValue?.name
}}
diff --git a/src/app/components/export-portable-project/export-portable-project.component.ts b/src/app/components/export-portable-project/export-portable-project.component.ts
index b4f05311..3f348646 100644
--- a/src/app/components/export-portable-project/export-portable-project.component.ts
+++ b/src/app/components/export-portable-project/export-portable-project.component.ts
@@ -2,7 +2,7 @@ import { Component, Inject, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Project } from '../../models/project';
-import { Server } from '../../models/server';
+import{ Controller } from '../../models/controller';
import { ProjectService } from '../../services/project.service';
@Component({
@@ -16,7 +16,7 @@ export class ExportPortableProjectComponent implements OnInit {
compression_methods: any = [];
compression_level: any = [];
compression_filter_value: any = [];
- server: Server;
+ controller:Controller ;
project: Project;
index: number = 4;
fileName: string;
@@ -30,7 +30,7 @@ export class ExportPortableProjectComponent implements OnInit {
) {}
async ngOnInit() {
- this.server = this.data.serverDetails;
+ this.controller = this.data.controllerDetails;
this.project = this.data.projectDetails;
this.fileName = this.project.name + '.gns3project';
await this.formControls();
@@ -65,7 +65,7 @@ export class ExportPortableProjectComponent implements OnInit {
exportPortableProject() {
this.isExport = true;
this.export_project_form.value.compression = this.export_project_form.value.compression.value ?? 'zstd';
- window.location.assign(this.projectService.getexportPortableProjectPath(this.server, this.project.project_id, this.export_project_form.value))
+ window.location.assign(this.projectService.getexportPortableProjectPath(this.controller, this.project.project_id, this.export_project_form.value))
this.dialogRef.close();
}
}
diff --git a/src/app/components/group-details/add-role-to-group/add-role-to-group.component.ts b/src/app/components/group-details/add-role-to-group/add-role-to-group.component.ts
index e6a34e04..e6bf8350 100644
--- a/src/app/components/group-details/add-role-to-group/add-role-to-group.component.ts
+++ b/src/app/components/group-details/add-role-to-group/add-role-to-group.component.ts
@@ -14,7 +14,7 @@ import {Component, Inject, OnInit} from '@angular/core';
import {BehaviorSubject, forkJoin, timer} from "rxjs";
import {User} from "@models/users/user";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
-import {Server} from "@models/server";
+import {Controller} from "@models/controller";
import {Group} from "@models/groups/group";
import {UserService} from "@services/user.service";
import {GroupService} from "@services/group.service";
@@ -35,7 +35,7 @@ export class AddRoleToGroupComponent implements OnInit {
loading = false;
constructor(private dialog: MatDialogRef,
- @Inject(MAT_DIALOG_DATA) public data: { server: Server; group: Group },
+ @Inject(MAT_DIALOG_DATA) public data: { controller: Controller; group: Group },
private groupService: GroupService,
private roleService: RoleService,
private toastService: ToasterService) {
@@ -58,8 +58,8 @@ export class AddRoleToGroupComponent implements OnInit {
getRoles() {
forkJoin([
- this.roleService.get(this.data.server),
- this.groupService.getGroupRole(this.data.server, this.data.group.user_group_id)
+ this.roleService.get(this.data.controller),
+ this.groupService.getGroupRole(this.data.controller, this.data.group.user_group_id)
]).subscribe((results) => {
const [globalRoles, groupRoles] = results;
const roles = globalRoles.filter((role: Role) => {
@@ -76,7 +76,7 @@ export class AddRoleToGroupComponent implements OnInit {
addRole(role: Role) {
this.loading = true;
this.groupService
- .addRoleToGroup(this.data.server, this.data.group, role)
+ .addRoleToGroup(this.data.controller, this.data.group, role)
.subscribe(() => {
this.toastService.success(`role ${role.name} was added`);
this.getRoles();
diff --git a/src/app/components/group-details/add-user-to-group-dialog/add-user-to-group-dialog.component.ts b/src/app/components/group-details/add-user-to-group-dialog/add-user-to-group-dialog.component.ts
index 3f1483cb..4aac2293 100644
--- a/src/app/components/group-details/add-user-to-group-dialog/add-user-to-group-dialog.component.ts
+++ b/src/app/components/group-details/add-user-to-group-dialog/add-user-to-group-dialog.component.ts
@@ -13,7 +13,7 @@
import {Component, Inject, OnInit} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import {UserService} from "@services/user.service";
-import {Server} from "@models/server";
+import {Controller} from "@models/controller";
import {BehaviorSubject, forkJoin, observable, Observable, timer} from "rxjs";
import {User} from "@models/users/user";
import {GroupService} from "@services/group.service";
@@ -34,7 +34,7 @@ export class AddUserToGroupDialogComponent implements OnInit {
loading = false;
constructor(private dialog: MatDialogRef,
- @Inject(MAT_DIALOG_DATA) public data: { server: Server; group: Group },
+ @Inject(MAT_DIALOG_DATA) public data: { controller: Controller; group: Group },
private userService: UserService,
private groupService: GroupService,
private toastService: ToasterService) {
@@ -57,8 +57,8 @@ export class AddUserToGroupDialogComponent implements OnInit {
getUsers() {
forkJoin([
- this.userService.list(this.data.server),
- this.groupService.getGroupMember(this.data.server, this.data.group.user_group_id)
+ this.userService.list(this.data.controller),
+ this.groupService.getGroupMember(this.data.controller, this.data.group.user_group_id)
]).subscribe((results) => {
const [userList, members] = results;
const users = userList.filter((user: User) => {
@@ -75,7 +75,7 @@ export class AddUserToGroupDialogComponent implements OnInit {
addUser(user: User) {
this.loading = true;
this.groupService
- .addMemberToGroup(this.data.server, this.data.group, user)
+ .addMemberToGroup(this.data.controller, this.data.group, user)
.subscribe(() => {
this.toastService.success(`user ${user.username} was added`);
this.getUsers();
diff --git a/src/app/components/group-details/group-details.component.html b/src/app/components/group-details/group-details.component.html
index c8dfd913..9bec7a3a 100644
--- a/src/app/components/group-details/group-details.component.html
+++ b/src/app/components/group-details/group-details.component.html
@@ -5,7 +5,7 @@
mat-icon-button
matTooltip="Back to group management"
matTooltipClass="custom-tooltip"
- [routerLink]="['/server', server.id, 'management', 'groups']">
+ [routerLink]="['/controller', controller.id, 'management', 'groups']">
keyboard_arrow_left
Groups {{group.name}} details
@@ -47,7 +47,7 @@
-
+
diff --git a/src/app/components/image-manager/image-manager.component.spec.ts b/src/app/components/image-manager/image-manager.component.spec.ts
index bdba7db1..4d1d9e86 100644
--- a/src/app/components/image-manager/image-manager.component.spec.ts
+++ b/src/app/components/image-manager/image-manager.component.spec.ts
@@ -6,10 +6,10 @@ import { MatIconModule } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
import { MatToolbarModule } from '@angular/material/toolbar';
import { ImageManagerService } from 'app/services/image-manager.service';
-import { ServerService } from 'app/services/server.service';
-import { MockedServerService } from 'app/services/server.service.spec';
+import { ControllerService } from 'app/services/controller.service';
+import { MockedControllerService } from 'app/services/controller.service.spec';
import { of } from 'rxjs';
-import { Server } from '../../models/server';
+import{ Controller } from '../../models/controller';
import { ImageManagerComponent } from './image-manager.component';
import { Image } from '../../models/images';
@@ -23,11 +23,11 @@ import { ToasterService } from 'app/services/toaster.service';
import { MockedToasterService } from 'app/services/toaster.service.spec';
export class MockedImageManagerService {
- public getImages(server: Server) {
+ public getImages(controller:Controller ) {
return of();
}
- public deleteFile(server: Server, image_path) {
+ public deleteFile(controller:Controller , image_path) {
return of();
}
@@ -37,7 +37,7 @@ describe('ImageManagerComponent', () => {
let component: ImageManagerComponent;
let fixture: ComponentFixture;
- let mockedServerService = new MockedServerService();
+ let mockedControllerService = new MockedControllerService();
let mockedImageManagerService = new MockedImageManagerService()
let mockedProgressService = new MockedProgressService()
let mockedVersionService = new MockedVersionService()
@@ -59,7 +59,7 @@ describe('ImageManagerComponent', () => {
provide: ActivatedRoute,
useValue: activatedRoute,
},
- { provide: ServerService, useValue: mockedServerService },
+ { provide: ControllerService, useValue: mockedControllerService },
{ provide: ImageManagerService, useValue: mockedImageManagerService },
{ provide: ProgressService, useValue: mockedProgressService },
{ provide: VersionService, useValue: mockedVersionService },
diff --git a/src/app/components/image-manager/image-manager.component.ts b/src/app/components/image-manager/image-manager.component.ts
index 5a3c09eb..7ccd3d31 100644
--- a/src/app/components/image-manager/image-manager.component.ts
+++ b/src/app/components/image-manager/image-manager.component.ts
@@ -1,10 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
-import { ServerService } from '../../services/server.service';
+import { ControllerService } from '../../services/controller.service';
import { VersionService } from '../../services/version.service';
import { ProgressService } from 'app/common/progress/progress.service';
import { Image } from '../../models/images';
-import { Server } from '../../models/server';
+import{ Controller } from '../../models/controller';
import { ImageManagerService } from "../../services/image-manager.service";
import { DataSource, SelectionModel } from '@angular/cdk/collections';
import { AddImageDialogComponent } from './add-image-dialog/add-image-dialog.component';
@@ -19,7 +19,7 @@ import { imageDataSource, imageDatabase } from "./image-database-file";
styleUrls: ['./image-manager.component.scss']
})
export class ImageManagerComponent implements OnInit {
- server: Server;
+ controller:Controller ;
public version: string;
dataSource: imageDataSource;
imageDatabase = new imageDatabase();
@@ -32,7 +32,7 @@ export class ImageManagerComponent implements OnInit {
private imageService: ImageManagerService,
private progressService: ProgressService,
private route: ActivatedRoute,
- private serverService: ServerService,
+ private controllerService: ControllerService,
private versionService: VersionService,
private dialog: MatDialog,
private toasterService: ToasterService,
@@ -40,13 +40,13 @@ export class ImageManagerComponent implements OnInit {
) { }
ngOnInit(): void {
- let server_id = parseInt(this.route.snapshot.paramMap.get('server_id'));
- this.serverService.get(server_id).then((server: Server) => {
- this.server = server;
- if (server.authToken) {
+ let controller_id = parseInt(this.route.snapshot.paramMap.get('controller_id'));
+ this.controllerService.get(controller_id).then((controller:Controller ) => {
+ this.controller = controller;
+ if (controller.authToken) {
this.getImages()
}
- // this.versionService.get(this.server).subscribe((version: Version) => {
+ // this.versionService.get(this.controller).subscribe((version: Version) => {
// this.version = version.version;
// });
});
@@ -54,7 +54,7 @@ export class ImageManagerComponent implements OnInit {
}
getImages() {
- this.imageService.getImages(this.server).subscribe(
+ this.imageService.getImages(this.controller).subscribe(
(images: Image[]) => {
this.imageDatabase.addImages(images)
},
@@ -66,7 +66,7 @@ export class ImageManagerComponent implements OnInit {
}
deleteFile(path) {
- this.imageService.deleteFile(this.server, path).subscribe(
+ this.imageService.deleteFile(this.controller, path).subscribe(
(res) => {
this.getImages()
this.unChecked()
@@ -106,7 +106,7 @@ export class ImageManagerComponent implements OnInit {
maxHeight: '550px',
autoFocus: false,
disableClose: true,
- data: this.server
+ data: this.controller
});
dialogRef.afterClosed().subscribe((isAddes: boolean) => {
@@ -128,7 +128,7 @@ export class ImageManagerComponent implements OnInit {
autoFocus: false,
disableClose: true,
data: {
- server: this.server,
+ controller: this.controller,
deleteFilesPaths: this.selection.selected
}
});
diff --git a/src/app/components/login/login.component.ts b/src/app/components/login/login.component.ts
index 3d9ab2bf..0e431d42 100644
--- a/src/app/components/login/login.component.ts
+++ b/src/app/components/login/login.component.ts
@@ -2,11 +2,11 @@ import { Component, DoCheck, OnInit, ViewEncapsulation } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { AuthResponse } from '../../models/authResponse';
-import { Server } from '../../models/server';
+import{ Controller } from '../../models/controller';
import { Version } from '../../models/version';
import { LoginService } from '../../services/login.service';
-import { ServerDatabase } from '../../services/server.database';
-import { ServerService } from '../../services/server.service';
+import { ControllerDatabase } from '../../services/controller.database';
+import { ControllerService } from '../../services/controller.service';
import { ThemeService } from '../../services/theme.service';
import { ToasterService } from '../../services/toaster.service';
import { VersionService } from '../../services/version.service';
@@ -18,7 +18,7 @@ import { VersionService } from '../../services/version.service';
encapsulation: ViewEncapsulation.None,
})
export class LoginComponent implements OnInit, DoCheck {
- private server: Server;
+ private controller:Controller ;
public version: string;
public isLightThemeEnabled: boolean = false;
public loginError: boolean = false;
@@ -33,8 +33,8 @@ export class LoginComponent implements OnInit, DoCheck {
constructor(
private loginService: LoginService,
- private serverService: ServerService,
- private serverDatabase: ServerDatabase,
+ private controllerService: ControllerService,
+ private controllerDatabase: ControllerDatabase,
private route: ActivatedRoute,
private router: Router,
private toasterService: ToasterService,
@@ -43,16 +43,16 @@ export class LoginComponent implements OnInit, DoCheck {
) {}
async ngOnInit() {
- const server_id = this.route.snapshot.paramMap.get('server_id');
+ const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/';
- this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
- this.server = server;
+ this.controllerService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
+ this.controller = controller;
- if (server.authToken) {
- this.router.navigate(['/server', this.server.id, 'projects']);
+ if (controller.authToken) {
+ this.router.navigate(['/controller', this.controller.id, 'projects']);
}
- this.versionService.get(this.server).subscribe((version: Version) => {
+ this.versionService.get(this.controller).subscribe((version: Version) => {
this.version = version.version;
});
});
@@ -78,17 +78,17 @@ export class LoginComponent implements OnInit, DoCheck {
let username = this.loginForm.get('username').value;
let password = this.loginForm.get('password').value;
- this.loginService.login(this.server, username, password).subscribe(
+ this.loginService.login(this.controller, username, password).subscribe(
async (response: AuthResponse) => {
- let server = this.server;
- server.authToken = response.access_token;
- server.username = username;
- server.password = password;
- server.tokenExpired = false;
- await this.serverService.update(server);
+ let controller = this.controller;
+ controller.authToken = response.access_token;
+ controller.username = username;
+ controller.password = password;
+ controller.tokenExpired = false;
+ await this.controllerService.update(controller);
if (this.returnUrl.length <= 1) {
- this.router.navigate(['/server', this.server.id, 'projects']);
+ this.router.navigate(['/controller', this.controller.id, 'projects']);
} else {
this.router.navigateByUrl(this.returnUrl);
}
diff --git a/src/app/components/management/management.component.ts b/src/app/components/management/management.component.ts
index 12273a93..8bb190e6 100644
--- a/src/app/components/management/management.component.ts
+++ b/src/app/components/management/management.component.ts
@@ -12,8 +12,8 @@
*/
import { Component, OnInit } from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
-import {Server} from "@models/server";
-import {ServerService} from "@services/server.service";
+import {Controller} from "@models/controller";
+import {ControllerService} from "@services/controller.service";
@Component({
selector: 'app-management',
@@ -22,19 +22,19 @@ import {ServerService} from "@services/server.service";
})
export class ManagementComponent implements OnInit {
- server: Server;
+ controller: Controller;
links = ['users', 'groups', 'roles', 'permissions'];
activeLink: string = this.links[0];
constructor(
private route: ActivatedRoute,
public router: Router,
- private serverService: ServerService) { }
+ private controllerService: ControllerService) { }
ngOnInit(): void {
- const serverId = this.route.snapshot.paramMap.get('server_id');
- this.serverService.get(+serverId).then((server: Server) => {
- this.server = server;
+ const controllerId = this.route.snapshot.paramMap.get('controller_id');
+ this.controllerService.get(+controllerId).then((controller: Controller) => {
+ this.controller = controller;
});
}
}
diff --git a/src/app/components/page-not-found/page-not-found.component.html b/src/app/components/page-not-found/page-not-found.component.html
index d4b33a2d..22598e3c 100644
--- a/src/app/components/page-not-found/page-not-found.component.html
+++ b/src/app/components/page-not-found/page-not-found.component.html
@@ -2,6 +2,6 @@
diff --git a/src/app/components/permissions-management/add-permission-line/add-permission-line.component.html b/src/app/components/permissions-management/add-permission-line/add-permission-line.component.html
index 219ebc2a..4a743b78 100644
--- a/src/app/components/permissions-management/add-permission-line/add-permission-line.component.html
+++ b/src/app/components/permissions-management/add-permission-line/add-permission-line.component.html
@@ -4,7 +4,7 @@