I reanmed server_id into controller_id everywhere in the code as well.

This commit is contained in:
Rajnikant Lodhi 2022-07-19 10:15:09 +05:30
parent 37cc3f3731
commit 2755f7226b
59 changed files with 173 additions and 173 deletions

View File

@ -66,11 +66,11 @@ const routes: Routes = [
{ path: '', redirectTo: 'controllers', pathMatch: 'full' },
{ path: 'controllers', component: ControllersComponent },
{ path: 'bundled', component: BundledServerFinderComponent },
{ path: 'controller/:server_id/login', component: LoginComponent },
{ path: 'controller/:server_id/loggeduser', component: LoggedUserComponent },
{path : 'controller/:server_id/image-manager', component: ImageManagerComponent},
{ path: 'controller/:controller_id/login', component: LoginComponent },
{ path: 'controller/:controller_id/loggeduser', component: LoggedUserComponent },
{path : 'controller/:controller_id/image-manager', component: ImageManagerComponent},
{
path: 'controller/:server_id/projects',
path: 'controller/:controller_id/projects',
component: ProjectsComponent,
canActivate: [LoginGuard],
resolve: { server: ServerResolve },
@ -79,134 +79,134 @@ const routes: Routes = [
{ path: 'settings', component: SettingsComponent },
{ path: 'settings/console', component: ConsoleComponent },
{ path: 'installed-software', component: InstalledSoftwareComponent },
{ path: 'controller/:server_id/systemstatus', component: SystemStatusComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/systemstatus', component: SystemStatusComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_ip/:server_port/project/:project_id', component: DirectLinkComponent, canActivate: [LoginGuard] },
{
path: 'controller/:server_id/project/:project_id/snapshots',
path: 'controller/:controller_id/project/:project_id/snapshots',
component: ListOfSnapshotsComponent,
canActivate: [LoginGuard],
resolve: { server: ServerResolve },
},
{ path: 'controller/:server_id/preferences', component: PreferencesComponent, canActivate: [LoginGuard] },
// { path: 'controller/:server_id/preferences/general', component: GeneralPreferencesComponent },
{ path: 'controller/:server_id/preferences/builtin', component: BuiltInPreferencesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences', component: PreferencesComponent, canActivate: [LoginGuard] },
// { path: 'controller/:controller_id/preferences/general', component: GeneralPreferencesComponent },
{ path: 'controller/:controller_id/preferences/builtin', component: BuiltInPreferencesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/builtin/ethernet-hubs', component: EthernetHubsTemplatesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/builtin/ethernet-hubs', component: EthernetHubsTemplatesComponent, canActivate: [LoginGuard] },
{
path: 'controller/:server_id/preferences/builtin/ethernet-hubs/addtemplate',
path: 'controller/:controller_id/preferences/builtin/ethernet-hubs/addtemplate',
component: EthernetHubsAddTemplateComponent,
canActivate: [LoginGuard]
},
{
path: 'controller/:server_id/preferences/builtin/ethernet-hubs/:template_id',
path: 'controller/:controller_id/preferences/builtin/ethernet-hubs/:template_id',
component: EthernetHubsTemplateDetailsComponent,
canActivate: [LoginGuard]
},
{
path: 'controller/:server_id/preferences/builtin/ethernet-switches',
path: 'controller/:controller_id/preferences/builtin/ethernet-switches',
component: EthernetSwitchesTemplatesComponent,
canActivate: [LoginGuard]
},
{
path: 'controller/:server_id/preferences/builtin/ethernet-switches/addtemplate',
path: 'controller/:controller_id/preferences/builtin/ethernet-switches/addtemplate',
component: EthernetSwitchesAddTemplateComponent,
canActivate: [LoginGuard]
},
{
path: 'controller/:server_id/preferences/builtin/ethernet-switches/:template_id',
path: 'controller/:controller_id/preferences/builtin/ethernet-switches/:template_id',
component: EthernetSwitchesTemplateDetailsComponent,
canActivate: [LoginGuard]
},
{ path: 'controller/:server_id/preferences/builtin/cloud-nodes', component: CloudNodesTemplatesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/builtin/cloud-nodes', component: CloudNodesTemplatesComponent, canActivate: [LoginGuard] },
{
path: 'controller/:server_id/preferences/builtin/cloud-nodes/addtemplate',
path: 'controller/:controller_id/preferences/builtin/cloud-nodes/addtemplate',
component: CloudNodesAddTemplateComponent,
canActivate: [LoginGuard]
},
{
path: 'controller/:server_id/preferences/builtin/cloud-nodes/:template_id',
path: 'controller/:controller_id/preferences/builtin/cloud-nodes/:template_id',
component: CloudNodesTemplateDetailsComponent,
canActivate: [LoginGuard]
},
//{ path: 'controller/:server_id/preferences/dynamips', component: DynamipsPreferencesComponent },
{ path: 'controller/:server_id/preferences/dynamips/templates', component: IosTemplatesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/dynamips/templates/addtemplate', component: AddIosTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/dynamips/templates/:template_id', component: IosTemplateDetailsComponent, canActivate: [LoginGuard] },
//{ path: 'controller/:controller_id/preferences/dynamips', component: DynamipsPreferencesComponent },
{ path: 'controller/:controller_id/preferences/dynamips/templates', component: IosTemplatesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/dynamips/templates/addtemplate', component: AddIosTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/dynamips/templates/:template_id', component: IosTemplateDetailsComponent, canActivate: [LoginGuard] },
{
path: 'controller/:server_id/preferences/dynamips/templates/:template_id/copy',
path: 'controller/:controller_id/preferences/dynamips/templates/:template_id/copy',
component: CopyIosTemplateComponent,
canActivate: [LoginGuard]
},
// { path: 'controller/:server_id/preferences/qemu', component: QemuPreferencesComponent },
{ path: 'controller/:server_id/preferences/qemu/templates', component: QemuVmTemplatesComponent, canActivate: [LoginGuard] },
// { path: 'controller/:controller_id/preferences/qemu', component: QemuPreferencesComponent },
{ path: 'controller/:controller_id/preferences/qemu/templates', component: QemuVmTemplatesComponent, canActivate: [LoginGuard] },
{
path: 'controller/:server_id/preferences/qemu/templates/:template_id/copy',
path: 'controller/:controller_id/preferences/qemu/templates/:template_id/copy',
component: CopyQemuVmTemplateComponent,
canActivate: [LoginGuard]
},
{ path: 'controller/:server_id/preferences/qemu/templates/:template_id', component: QemuVmTemplateDetailsComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/qemu/addtemplate', component: AddQemuVmTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/qemu/templates/:template_id', component: QemuVmTemplateDetailsComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/qemu/addtemplate', component: AddQemuVmTemplateComponent, canActivate: [LoginGuard] },
// { path: 'controller/:server_id/preferences/vpcs', component: VpcsPreferencesComponent },
{ path: 'controller/:server_id/preferences/vpcs/templates', component: VpcsTemplatesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/vpcs/templates/:template_id', component: VpcsTemplateDetailsComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/vpcs/addtemplate', component: AddVpcsTemplateComponent, canActivate: [LoginGuard] },
// { path: 'controller/:controller_id/preferences/vpcs', component: VpcsPreferencesComponent },
{ path: 'controller/:controller_id/preferences/vpcs/templates', component: VpcsTemplatesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/vpcs/templates/:template_id', component: VpcsTemplateDetailsComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/vpcs/addtemplate', component: AddVpcsTemplateComponent, canActivate: [LoginGuard] },
// { path: 'controller/:server_id/preferences/virtualbox', component: VirtualBoxPreferencesComponent },
{ path: 'controller/:server_id/preferences/virtualbox/templates', component: VirtualBoxTemplatesComponent, canActivate: [LoginGuard] },
// { path: 'controller/:controller_id/preferences/virtualbox', component: VirtualBoxPreferencesComponent },
{ path: 'controller/:controller_id/preferences/virtualbox/templates', component: VirtualBoxTemplatesComponent, canActivate: [LoginGuard] },
{
path: 'controller/:server_id/preferences/virtualbox/templates/:template_id',
path: 'controller/:controller_id/preferences/virtualbox/templates/:template_id',
component: VirtualBoxTemplateDetailsComponent,
canActivate: [LoginGuard]
},
{ path: 'controller/:server_id/preferences/virtualbox/addtemplate', component: AddVirtualBoxTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/virtualbox/addtemplate', component: AddVirtualBoxTemplateComponent, canActivate: [LoginGuard] },
// { path: 'controller/:server_id/preferences/vmware', component: VmwarePreferencesComponent },
{ path: 'controller/:server_id/preferences/vmware/templates', component: VmwareTemplatesComponent, canActivate: [LoginGuard] },
// { path: 'controller/:controller_id/preferences/vmware', component: VmwarePreferencesComponent },
{ path: 'controller/:controller_id/preferences/vmware/templates', component: VmwareTemplatesComponent, canActivate: [LoginGuard] },
{
path: 'controller/:server_id/preferences/vmware/templates/:template_id',
path: 'controller/:controller_id/preferences/vmware/templates/:template_id',
component: VmwareTemplateDetailsComponent,
canActivate: [LoginGuard]
},
{ path: 'controller/:server_id/preferences/vmware/addtemplate', component: AddVmwareTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/vmware/addtemplate', component: AddVmwareTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/docker/templates', component: DockerTemplatesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/docker/templates', component: DockerTemplatesComponent, canActivate: [LoginGuard] },
{
path: 'controller/:server_id/preferences/docker/templates/:template_id',
path: 'controller/:controller_id/preferences/docker/templates/:template_id',
component: DockerTemplateDetailsComponent,
canActivate: [LoginGuard]
},
{
path: 'controller/:server_id/preferences/docker/templates/:template_id/copy',
path: 'controller/:controller_id/preferences/docker/templates/:template_id/copy',
component: CopyDockerTemplateComponent,
canActivate: [LoginGuard]
},
{ path: 'controller/:server_id/preferences/docker/addtemplate', component: AddDockerTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/docker/addtemplate', component: AddDockerTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/iou/templates', component: IouTemplatesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/iou/templates/:template_id', component: IouTemplateDetailsComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/iou/templates/:template_id/copy', component: CopyIouTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:server_id/preferences/iou/addtemplate', component: AddIouTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/iou/templates', component: IouTemplatesComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/iou/templates/:template_id', component: IouTemplateDetailsComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/iou/templates/:template_id/copy', component: CopyIouTemplateComponent, canActivate: [LoginGuard] },
{ path: 'controller/:controller_id/preferences/iou/addtemplate', component: AddIouTemplateComponent, canActivate: [LoginGuard] },
],
},
{
path: 'controller/:server_id/project/:project_id',
path: 'controller/:controller_id/project/:project_id',
component: ProjectMapComponent,
canActivate: [LoginGuard],
canDeactivate: [ConsoleGuard],
},
{
path: 'controller/:server_id/project/:project_id/nodes/:node_id',
path: 'controller/:controller_id/project/:project_id/nodes/:node_id',
component: WebConsoleFullWindowComponent,
canActivate: [LoginGuard]
},
{
path: 'static/web-ui/controller/:server_id/project/:project_id/nodes/:node_id',
path: 'static/web-ui/controller/:controller_id/project/:project_id/nodes/:node_id',
component: WebConsoleFullWindowComponent,
canActivate: [LoginGuard]
},

View File

@ -1,4 +1,4 @@
<h1 mat-dialog-title>Add server</h1>
<h1 mat-dialog-title>Add controller</h1>
<form [formGroup]="serverForm">
<div mat-dialog-content>
<mat-form-field>
@ -6,19 +6,19 @@
<mat-error *ngIf="serverForm.get('name').hasError('required')">You must enter a value</mat-error>
</mat-form-field>
<mat-form-field>
<!-- <mat-form-field>
<mat-select placeholder="Location" formControlName="location">
<mat-option *ngFor="let location of locations" [value]="location.key"> {{ location.name }} </mat-option>
</mat-select>
</mat-form-field>
</mat-form-field> -->
<mat-form-field *ngIf="serverForm.get('location').value === 'local'">
<!-- <mat-form-field *ngIf="serverForm.get('location').value === 'local'">
<input matInput tabindex="1" formControlName="path" placeholder="Local server path" />
</mat-form-field>
<mat-form-field *ngIf="serverForm.get('location').value === 'local'">
<input matInput tabindex="1" formControlName="ubridge_path" placeholder="Ubridge path" />
</mat-form-field>
</mat-form-field> -->
<mat-form-field>
<input matInput tabindex="1" formControlName="host" placeholder="Host" />

View File

@ -82,7 +82,7 @@
matTooltipClass="custom-tooltip"
(click)="deleteServer(row)"
>
<mat-icon aria-label="Remove server">delete</mat-icon>
<mat-icon aria-label="Remove controller">delete</mat-icon>
</button>
</mat-cell>
</ng-container>

View File

@ -40,8 +40,8 @@ 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) => {
let controller_id = parseInt(this.route.snapshot.paramMap.get('controller_id'));
this.serverService.get(controller_id).then((server: Server) => {
this.server = server;
if (server.authToken) {
this.getImages()

View File

@ -43,9 +43,9 @@ 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.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
if (server.authToken) {

View File

@ -12,6 +12,6 @@ export class BuiltInPreferencesComponent implements OnInit {
constructor(private route: ActivatedRoute) {}
ngOnInit() {
this.serverId = this.route.snapshot.paramMap.get('server_id');
this.serverId = this.route.snapshot.paramMap.get('controller_id');
}
}

View File

@ -38,8 +38,8 @@ export class CloudNodesAddTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
});
}

View File

@ -47,9 +47,9 @@ export class CloudNodesTemplateDetailsComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getConfiguration();

View File

@ -23,8 +23,8 @@ export class CloudNodesTemplatesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getTemplates();
});

View File

@ -39,8 +39,8 @@ export class EthernetHubsAddTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
});
}

View File

@ -39,9 +39,9 @@ export class EthernetHubsTemplateDetailsComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.categories = this.builtInTemplatesConfigurationService.getCategoriesForEthernetHubs();

View File

@ -23,8 +23,8 @@ export class EthernetHubsTemplatesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getTemplates();
});

View File

@ -39,8 +39,8 @@ export class EthernetSwitchesAddTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
});
}

View File

@ -40,9 +40,9 @@ export class EthernetSwitchesTemplateDetailsComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getConfiguration();

View File

@ -23,8 +23,8 @@ export class EthernetSwitchesTemplatesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getTemplates();
});

View File

@ -59,8 +59,8 @@ export class AddDockerTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.consoleTypes = this.configurationService.getConsoleTypes();

View File

@ -33,9 +33,9 @@ export class CopyDockerTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.dockerService.getTemplate(this.server, template_id).subscribe((dockerTemplate: DockerTemplate) => {

View File

@ -46,9 +46,9 @@ export class DockerTemplateDetailsComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getConfiguration();

View File

@ -24,8 +24,8 @@ export class DockerTemplatesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getTemplates();
});

View File

@ -112,8 +112,8 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
})
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getImages();

View File

@ -33,9 +33,9 @@ export class CopyIosTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.iosService.getTemplate(this.server, template_id).subscribe((iosTemplate: IosTemplate) => {

View File

@ -20,8 +20,8 @@ export class DynamipsPreferencesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
});
}

View File

@ -69,9 +69,9 @@ export class IosTemplateDetailsComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getConfiguration();

View File

@ -25,8 +25,8 @@ export class IosTemplatesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getTemplates();
});

View File

@ -12,6 +12,6 @@ export class GeneralPreferencesComponent implements OnInit {
constructor(private route: ActivatedRoute) {}
ngOnInit() {
this.serverId = this.route.snapshot.paramMap.get('server_id');
this.serverId = this.route.snapshot.paramMap.get('controller_id');
}
}

View File

@ -84,8 +84,8 @@ export class AddIouTemplateComponent implements OnInit, OnDestroy {
this.toasterService.success('Image uploaded');
};
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getImages();
this.templateMocksService.getIouTemplate().subscribe((iouTemplate: IouTemplate) => {

View File

@ -33,9 +33,9 @@ export class CopyIouTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.qemuService.getTemplate(this.server, template_id).subscribe((iouTemplate: IouTemplate) => {

View File

@ -51,9 +51,9 @@ export class IouTemplateDetailsComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getConfiguration();

View File

@ -24,8 +24,8 @@ export class IouTemplatesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getTemplates();
});

View File

@ -12,6 +12,6 @@ export class PreferencesComponent implements OnInit {
constructor(private route: ActivatedRoute) {}
ngOnInit() {
this.serverId = this.route.snapshot.paramMap.get('server_id');
this.serverId = this.route.snapshot.paramMap.get('controller_id');
}
}

View File

@ -100,8 +100,8 @@ export class AddQemuVmTemplateComponent implements OnInit {
};
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.templateMocksService.getQemuTemplate().subscribe((qemuTemplate: QemuTemplate) => {

View File

@ -35,9 +35,9 @@ export class CopyQemuVmTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.qemuService.getTemplate(this.server, template_id).subscribe((qemuTemplate: QemuTemplate) => {

View File

@ -23,8 +23,8 @@ export class QemuPreferencesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.serverSettingsService.getSettingsForQemu(this.server).subscribe((settings: QemuSettings) => {

View File

@ -53,9 +53,9 @@ export class QemuVmTemplateDetailsComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getConfiguration();

View File

@ -24,8 +24,8 @@ export class QemuVmTemplatesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getTemplates();
});

View File

@ -37,8 +37,8 @@ export class AddVirtualBoxTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.virtualBoxService.getVirtualMachines(this.server).subscribe((virtualMachines: VirtualBoxVm[]) => {

View File

@ -15,8 +15,8 @@ export class VirtualBoxPreferencesComponent implements OnInit {
constructor(private route: ActivatedRoute, private serverService: ServerService) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
});
}

View File

@ -55,9 +55,9 @@ export class VirtualBoxTemplateDetailsComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getConfiguration();

View File

@ -24,8 +24,8 @@ export class VirtualBoxTemplatesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getTemplates();
});

View File

@ -37,8 +37,8 @@ export class AddVmwareTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.vmwareService.getVirtualMachines(this.server).subscribe((virtualMachines: VmwareVm[]) => {

View File

@ -15,9 +15,9 @@ export class VmwarePreferencesComponent implements OnInit {
constructor(private route: ActivatedRoute, private serverService: ServerService) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
});
}

View File

@ -47,9 +47,9 @@ export class VmwareTemplateDetailsComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getConfiguration();

View File

@ -23,8 +23,8 @@ export class VmwareTemplatesComponent implements OnInit {
) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getTemplates();
});

View File

@ -38,8 +38,8 @@ export class AddVpcsTemplateComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
});
}

View File

@ -15,9 +15,9 @@ export class VpcsPreferencesComponent implements OnInit {
constructor(private route: ActivatedRoute, private serverService: ServerService) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
});
}

View File

@ -39,9 +39,9 @@ export class VpcsTemplateDetailsComponent implements OnInit {
}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
const controller_id = this.route.snapshot.paramMap.get('controller_id');
const template_id = this.route.snapshot.paramMap.get('template_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getConfiguration();

View File

@ -19,8 +19,8 @@ export class VpcsTemplatesComponent implements OnInit {
constructor(private route: ActivatedRoute, private serverService: ServerService, private vpcsService: VpcsService) {}
ngOnInit() {
const server_id = this.route.snapshot.paramMap.get('server_id');
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
const controller_id = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
this.server = server;
this.getTemplates();
});

View File

@ -329,9 +329,9 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
getData() {
const routeSub = this.route.paramMap.subscribe((paramMap: ParamMap) => {
const server_id = parseInt(paramMap.get('server_id'), 10);
const controller_id = parseInt(paramMap.get('controller_id'), 10);
from(this.serverService.get(server_id))
from(this.serverService.get(controller_id))
.pipe(
mergeMap((server: Server) => {
if (!server) this.router.navigate(['/controllers']);

View File

@ -80,7 +80,7 @@ describe('ListOfSnapshotsComponent', () => {
NoopAnimationsModule,
RouterTestingModule.withRoutes([
{
path: 'controller/:server_id/project/:project_id/snapshots',
path: 'controller/:controller_id/project/:project_id/snapshots',
component: ListOfSnapshotsComponent,
resolve: { server: ServerResolve },
},

View File

@ -24,7 +24,7 @@ export class StatusInfoComponent implements OnInit {
) {}
ngOnInit() {
this.serverId = this.route.snapshot.paramMap.get('server_id');
this.serverId = this.route.snapshot.paramMap.get('controller_id');
this.getStatistics();
}

View File

@ -12,6 +12,6 @@ export class SystemStatusComponent implements OnInit {
constructor(private route: ActivatedRoute) {}
ngOnInit() {
this.serverId = this.route.snapshot.paramMap.get('server_id');
this.serverId = this.route.snapshot.paramMap.get('controller_id');
}
}

View File

@ -23,7 +23,7 @@ export class LoggedUserComponent implements OnInit {
) {}
ngOnInit() {
let serverId = this.route.snapshot.paramMap.get('server_id');
let serverId = this.route.snapshot.paramMap.get('controller_id');
this.serverService.get(+serverId).then((server: Server) => {
this.server = server;
this.userService.getInformationAboutLoggedUser(server).subscribe((response: any) => {

View File

@ -51,7 +51,7 @@ export class WebConsoleFullWindowComponent implements OnInit {
}
getData() {
this.serverId = this.route.snapshot.paramMap.get('server_id');
this.serverId = this.route.snapshot.paramMap.get('controller_id');
this.projectId = this.route.snapshot.paramMap.get('project_id');
this.nodeId = this.route.snapshot.paramMap.get('node_id');

View File

@ -9,13 +9,13 @@ export class LoginGuard implements CanActivate {
constructor(private serverService: ServerService, private loginService: LoginService, private router: Router) {}
async canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
const server_id = next.paramMap.get('server_id');
this.loginService.server_id = server_id;
let server = await this.serverService.get(parseInt(server_id, 10));
const controller_id = next.paramMap.get('controller_id');
this.loginService.controller_id = controller_id;
let server = await this.serverService.get(parseInt(controller_id, 10));
try {
await this.loginService.getLoggedUser(server);
} catch (e) {}
return this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
return this.serverService.get(parseInt(controller_id, 10)).then((server: Server) => {
if (server.authToken && !server.tokenExpired) {
return true;
}

View File

@ -22,8 +22,8 @@ export class HttpRequestsInterceptor implements HttpInterceptor {
async call() {
let getCurrentUser = JSON.parse(localStorage.getItem(`isRememberMe`)) ?? null;
const server_id = this.loginService.server_id;
let server = await this.serverService.get(parseInt(server_id, 10));
const controller_id = this.loginService.controller_id;
let server = await this.serverService.get(parseInt(controller_id, 10));
server.tokenExpired = true;
await this.serverService.update(server);
try {

View File

@ -8,6 +8,6 @@ export class ServerResolve implements Resolve<Server> {
constructor(private serverService: ServerService) {}
resolve(route: ActivatedRouteSnapshot) {
return this.serverService.get(parseInt(route.params['server_id']));
return this.serverService.get(parseInt(route.params['controller_id']));
}
}

View File

@ -7,7 +7,7 @@ import { AuthResponse } from '../models/authResponse';
@Injectable()
export class LoginService {
server_id:string =''
controller_id:string =''
constructor(private httpServer: HttpServer) {}
login(server: Server, username: string, password: string) {

View File

@ -10,9 +10,9 @@ export class MockedServerService {
});
}
public get(server_id: number) {
public get(controller_id: number) {
const server = new Server();
server.id = server_id;
server.id = controller_id;
return Promise.resolve(server);
}

View File

@ -5,18 +5,18 @@ import { HttpServer } from './http-server.service';
@Injectable()
export class ServerService {
private serverIds: string[] = [];
private controllerIds: string[] = [];
public serviceInitialized: Subject<boolean> = new Subject<boolean>();
public isServiceInitialized: boolean;
constructor(private httpServer: HttpServer) {
this.serverIds = this.getServerIds();
this.controllerIds = this.getServerIds();
this.isServiceInitialized = true;
this.serviceInitialized.next(this.isServiceInitialized);
}
getServerIds() : string[]{
let str = localStorage.getItem("serverIds");
let str = localStorage.getItem("controllerIds");
if (str?.length > 0) {
return str.split(",");
}
@ -24,12 +24,12 @@ export class ServerService {
}
updateServerIds() {
localStorage.removeItem("serverIds");
localStorage.setItem("serverIds", this.serverIds.toString());
localStorage.removeItem("controllerIds");
localStorage.setItem("controllerIds", this.controllerIds.toString());
}
public get(id: number): Promise<Server> {
let server: Server = JSON.parse(localStorage.getItem(`server-${id}`));
let server: Server = JSON.parse(localStorage.getItem(`controller-${id}`));
let promise = new Promise<Server>((resolve) => {
resolve(server);
});
@ -37,10 +37,10 @@ export class ServerService {
}
public create(server: Server) {
server.id = this.serverIds.length + 1;
localStorage.setItem(`server-${server.id}`, JSON.stringify(server));
server.id = this.controllerIds.length + 1;
localStorage.setItem(`controller-${server.id}`, JSON.stringify(server));
this.serverIds.push(`server-${server.id}`);
this.controllerIds.push(`controller-${server.id}`);
this.updateServerIds();
let promise = new Promise<Server>((resolve) => {
@ -50,8 +50,8 @@ export class ServerService {
}
public update(server: Server) {
localStorage.removeItem(`server-${server.id}`);
localStorage.setItem(`server-${server.id}`, JSON.stringify(server));
localStorage.removeItem(`controller-${server.id}`);
localStorage.setItem(`controller-${server.id}`, JSON.stringify(server));
let promise = new Promise<Server>((resolve) => {
resolve(server);
@ -62,7 +62,7 @@ export class ServerService {
public findAll() {
let promise = new Promise<Server[]>((resolve) => {
let servers: Server[] = [];
this.serverIds.forEach((n) => {
this.controllerIds.forEach((n) => {
let server: Server = JSON.parse(localStorage.getItem(n));
servers.push(server);
});
@ -72,8 +72,8 @@ export class ServerService {
}
public delete(server: Server) {
localStorage.removeItem(`server-${server.id}`);
this.serverIds = this.serverIds.filter((n) => n !== `server-${server.id}`);
localStorage.removeItem(`controller-${server.id}`);
this.controllerIds = this.controllerIds.filter((n) => n !== `controller-${server.id}`);
this.updateServerIds();
let promise = new Promise((resolve) => {