mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-14 13:46:34 +00:00
Rename Server file name into controller
This commit is contained in:
parent
ca601e410b
commit
c682db4595
@ -67,7 +67,7 @@ GNS3 Web UI 2020.2.0-beta.4
|
||||
Bug Fixes
|
||||
- New port setting for GNS3 VM preferences
|
||||
- Option to auto-hide menu toolbar on the left side
|
||||
- Server type in template preferences
|
||||
-Controller type in template preferences
|
||||
- Error when selecting existing Docker image
|
||||
- Default values in templates
|
||||
- TypeError: Cannot read property 'message' of undefined
|
||||
|
@ -53,7 +53,7 @@ import { WebConsoleFullWindowComponent } from './components/web-console-full-win
|
||||
import { ConsoleGuard } from './guards/console-guard';
|
||||
import { LoginGuard } from './guards/login-guard';
|
||||
import { DefaultLayoutComponent } from './layouts/default-layout/default-layout.component';
|
||||
import { ServerResolve } from './resolvers/server-resolve';
|
||||
import { ControllerResolve } from './resolvers/controller-resolve';
|
||||
import { UserManagementComponent } from './components/user-management/user-management.component';
|
||||
import { LoggedUserComponent } from './components/users/logged-user/logged-user.component';
|
||||
import { ImageManagerComponent } from './components/image-manager/image-manager.component';
|
||||
@ -73,7 +73,7 @@ const routes: Routes = [
|
||||
path: 'controller/:controller_id/projects',
|
||||
component: ProjectsComponent,
|
||||
canActivate: [LoginGuard],
|
||||
resolve: { controller: ServerResolve },
|
||||
resolve: { controller: ControllerResolve },
|
||||
},
|
||||
{ path: 'help', component: HelpComponent },
|
||||
{ path: 'settings', component: SettingsComponent },
|
||||
@ -86,7 +86,7 @@ const routes: Routes = [
|
||||
path: 'controller/:controller_id/project/:project_id/snapshots',
|
||||
component: ListOfSnapshotsComponent,
|
||||
canActivate: [LoginGuard],
|
||||
resolve: { controller: ServerResolve },
|
||||
resolve: { controller: ControllerResolve },
|
||||
},
|
||||
{ path: 'controller/:controller_id/preferences', component: PreferencesComponent, canActivate: [LoginGuard] },
|
||||
// { path: 'controller/:controller_id/preferences/general', component: GeneralPreferencesComponent },
|
||||
|
@ -214,7 +214,7 @@ import { LoginGuard } from './guards/login-guard';
|
||||
import { ProjectWebServiceHandler } from './handlers/project-web-service-handler';
|
||||
import { DefaultLayoutComponent } from './layouts/default-layout/default-layout.component';
|
||||
import { MATERIAL_IMPORTS } from './material.imports';
|
||||
import { ServerResolve } from './resolvers/server-resolve';
|
||||
import { ControllerResolve } from './resolvers/controller-resolve';
|
||||
import { ApplianceService } from './services/appliances.service';
|
||||
import { BuiltInTemplatesConfigurationService } from './services/built-in-templates-configuration.service';
|
||||
import { BuiltInTemplatesService } from './services/built-in-templates.service';
|
||||
@ -243,10 +243,10 @@ import { ProjectService } from './services/project.service';
|
||||
import { QemuConfigurationService } from './services/qemu-configuration.service';
|
||||
import { QemuService } from './services/qemu.service';
|
||||
import { RecentlyOpenedProjectService } from './services/recentlyOpenedProject.service';
|
||||
import { ServerManagementService } from './services/server-management.service';
|
||||
import { ServerSettingsService } from './services/server-settings.service';
|
||||
import { ServerDatabase } from './services/server.database';
|
||||
import { ServerService } from './services/server.service';
|
||||
import { ControllerManagementService } from './services/controller-management.service';
|
||||
import { ControllerSettingsService } from './services/controller-settings.service';
|
||||
import { ControllerDatabase } from './services/controller.database';
|
||||
import { ControllerService } from './services/controller.service';
|
||||
import { SettingsService } from './services/settings.service';
|
||||
import { ConsoleService } from './services/settings/console.service';
|
||||
import { DefaultConsoleService } from './services/settings/default-console.service';
|
||||
@ -505,7 +505,7 @@ import { NodesMenuConfirmationDialogComponent } from './components/project-map/n
|
||||
VersionService,
|
||||
ProjectService,
|
||||
SymbolService,
|
||||
ServerService,
|
||||
ControllerService,
|
||||
TemplateService,
|
||||
NodeService,
|
||||
LinkService,
|
||||
@ -524,10 +524,10 @@ import { NodesMenuConfirmationDialogComponent } from './components/project-map/n
|
||||
InRectangleHelper,
|
||||
DrawingsDataSource,
|
||||
ServerErrorHandler,
|
||||
ServerDatabase,
|
||||
ControllerDatabase,
|
||||
ProjectNameValidator,
|
||||
ToolsService,
|
||||
ServerSettingsService,
|
||||
ControllerSettingsService,
|
||||
QemuService,
|
||||
VpcsService,
|
||||
TemplateMocksService,
|
||||
@ -549,7 +549,7 @@ import { NodesMenuConfirmationDialogComponent } from './components/project-map/n
|
||||
IouService,
|
||||
IouConfigurationService,
|
||||
RecentlyOpenedProjectService,
|
||||
ServerManagementService,
|
||||
ControllerManagementService,
|
||||
MapScaleService,
|
||||
ConsoleService,
|
||||
DefaultConsoleService,
|
||||
@ -564,7 +564,7 @@ import { NodesMenuConfirmationDialogComponent } from './components/project-map/n
|
||||
ThemeService,
|
||||
GoogleAnalyticsService,
|
||||
NodeConsoleService,
|
||||
ServerResolve,
|
||||
ControllerResolve,
|
||||
LoginGuard,
|
||||
ConsoleGuard,
|
||||
Title,
|
||||
|
@ -13,7 +13,7 @@ import { select, Selection } from 'd3-selection';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { Link } from '../../../models/link';
|
||||
import { Project } from '../../../models/project';
|
||||
import { Server } from '../../../models/server';
|
||||
import { Controller } from '../../../models/controller';
|
||||
import { Symbol } from '../../../models/symbol';
|
||||
import { MapScaleService } from '../../../services/mapScale.service';
|
||||
import { MapSettingsService } from '../../../services/mapsettings.service';
|
||||
@ -43,7 +43,7 @@ export class D3MapComponent implements OnInit, OnChanges, OnDestroy {
|
||||
@Input() drawings: Drawing[] = [];
|
||||
@Input() symbols: Symbol[] = [];
|
||||
@Input() project: Project;
|
||||
@Input() controller: Server;
|
||||
@Input() controller: Controller;
|
||||
|
||||
@Input() width = 1500;
|
||||
@Input() height = 600;
|
||||
|
@ -13,7 +13,7 @@ import { select } from 'd3-selection';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { StyleProperty } from '../../../components/project-map/drawings-editors/text-editor/text-editor.component';
|
||||
import { Link } from '../../../models/link';
|
||||
import { Server } from '../../../models/server';
|
||||
import { Controller } from '../../../models/controller';
|
||||
import { LinkService } from '../../../services/link.service';
|
||||
import { MapScaleService } from '../../../services/mapScale.service';
|
||||
import { ToolsService } from '../../../services/tools.service';
|
||||
@ -37,7 +37,7 @@ import { Node } from '../../models/node';
|
||||
export class TextEditorComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('temporaryTextElement') temporaryTextElement: ElementRef;
|
||||
@Input('svg') svg: SVGSVGElement;
|
||||
@Input('controller') controller: Server;
|
||||
@Input('controller') controller: Controller;
|
||||
|
||||
leftPosition: string = '0px';
|
||||
topPosition: string = '0px';
|
||||
|
@ -4,9 +4,9 @@ import { By } from '@angular/platform-browser';
|
||||
import { Router } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { ProgressService } from '../../common/progress/progress.service';
|
||||
import { Server } from '../../models/server';
|
||||
import { ServerService } from '../../services/server.service';
|
||||
import { MockedServerService } from '../../services/server.service.spec';
|
||||
import{ Controller } from '../../models/controller';
|
||||
import { ControllerService } from '../../services/controller.service';
|
||||
import { MockedServerService } from '../../services/controller.service.spec';
|
||||
import { MockedProgressService } from '../project-map/project-map.component.spec';
|
||||
import { BundledServerFinderComponent } from './bundled-server-finder.component';
|
||||
|
||||
@ -14,9 +14,9 @@ describe('BundledServerFinderComponent', () => {
|
||||
let component: BundledServerFinderComponent;
|
||||
let fixture: ComponentFixture<BundledServerFinderComponent>;
|
||||
let router: any;
|
||||
let service: ServerService;
|
||||
let service: ControllerService;
|
||||
let progressService: MockedProgressService = new MockedProgressService();
|
||||
let controllerServiceMock: jasmine.SpyObj<ServerService>;
|
||||
let controllerServiceMock: jasmine.SpyObj<ControllerService>;
|
||||
|
||||
|
||||
beforeEach(async () => {
|
||||
@ -26,7 +26,7 @@ describe('BundledServerFinderComponent', () => {
|
||||
|
||||
|
||||
|
||||
controllerServiceMock = jasmine.createSpyObj<ServerService>([
|
||||
controllerServiceMock = jasmine.createSpyObj<ControllerService>([
|
||||
"getLocalServer"
|
||||
]);
|
||||
|
||||
@ -37,7 +37,7 @@ describe('BundledServerFinderComponent', () => {
|
||||
await TestBed.configureTestingModule({
|
||||
providers: [
|
||||
{ provide: Router, useValue: router },
|
||||
{ provide: ServerService, useValue: controllerServiceMock },
|
||||
{ provide: ControllerService, useValue: controllerServiceMock },
|
||||
{ provide: ProgressService, useValue: progressService },
|
||||
],
|
||||
declarations: [BundledServerFinderComponent],
|
||||
@ -50,7 +50,7 @@ describe('BundledServerFinderComponent', () => {
|
||||
});
|
||||
|
||||
it('should create and redirect to controller', fakeAsync(() => {
|
||||
const controller = new Server();
|
||||
const controller = new Controller ();
|
||||
controller.id = 99;
|
||||
controllerServiceMock.getLocalServer.and.returnValue(
|
||||
Promise.resolve(controller)
|
||||
@ -62,6 +62,6 @@ describe('BundledServerFinderComponent', () => {
|
||||
expect(controllerServiceMock.getLocalServer).toHaveBeenCalledWith('vps3.gns3.net',3000);
|
||||
expect(router.navigate).toHaveBeenCalledWith(['/controller', 99, 'projects']);
|
||||
})
|
||||
service = TestBed.inject(ServerService);
|
||||
service = TestBed.inject(ControllerService);
|
||||
}));
|
||||
});
|
||||
|
@ -2,8 +2,8 @@ import { DOCUMENT } from '@angular/common';
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { ProgressService } from '../../common/progress/progress.service';
|
||||
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-bundled-server-finder',
|
||||
@ -13,7 +13,7 @@ import { ServerService } from '../../services/server.service';
|
||||
export class BundledServerFinderComponent implements OnInit {
|
||||
constructor(
|
||||
private router: Router,
|
||||
private serverService: ServerService,
|
||||
private serverService: ControllerService,
|
||||
private progressService: ProgressService,
|
||||
@Inject(DOCUMENT) private document
|
||||
) {}
|
||||
@ -31,7 +31,7 @@ export class BundledServerFinderComponent implements OnInit {
|
||||
port = 80;
|
||||
}
|
||||
|
||||
this.serverService.getLocalServer(this.document.location.hostname, port).then((controller: Server) => {
|
||||
this.serverService.getLocalServer(this.document.location.hostname, port).then((controller:Controller ) => {
|
||||
this.router.navigate(['/controller', controller.id, 'projects']);
|
||||
this.progressService.deactivate();
|
||||
});
|
||||
|
@ -2,8 +2,8 @@ import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { ElectronService } from 'ngx-electron';
|
||||
import { Server } from '../../../models/server';
|
||||
import { ServerService } from '../../../services/server.service';
|
||||
import{ Controller } from '../../../models/controller';
|
||||
import { ControllerService } from '../../../services/controller.service';
|
||||
import { ToasterService } from '../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -30,7 +30,7 @@ export class AddControllerDialogComponent implements OnInit {
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<AddControllerDialogComponent>,
|
||||
private electronService: ElectronService,
|
||||
private serverService: ServerService,
|
||||
private serverService: ControllerService,
|
||||
private toasterService: ToasterService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {}
|
||||
@ -124,7 +124,7 @@ export class AddControllerDialogComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
const controller: Server = Object.assign({}, this.controllerForm.value);
|
||||
const controller:Controller = Object.assign({}, this.controllerForm.value);
|
||||
this.serverService.checkServerVersion(controller).subscribe(
|
||||
(serverInfo) => {
|
||||
if (serverInfo.version.split('.')[0] >= 3) {
|
||||
|
@ -2,11 +2,11 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { Server } from '../../../models/server';
|
||||
import{ Controller } from '../../../models/controller';
|
||||
import { Version } from '../../../models/version';
|
||||
import { ServerDatabase } from '../../../services/server.database';
|
||||
import { ServerService } from '../../../services/server.service';
|
||||
import { MockedServerService } from '../../../services/server.service.spec';
|
||||
import { ControllerDatabase } from '../../../services/controller.database';
|
||||
import { ControllerService } from '../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../services/controller.service.spec';
|
||||
import { VersionService } from '../../../services/version.service';
|
||||
import { MockedVersionService } from '../../../services/version.service.spec';
|
||||
import { ControllerDiscoveryComponent } from './controller-discovery.component';
|
||||
@ -24,8 +24,8 @@ xdescribe('ControllerDiscoveryComponent', () => {
|
||||
imports: [MatCardModule, MatDividerModule],
|
||||
providers: [
|
||||
{ provide: VersionService, useFactory: () => mockedVersionService },
|
||||
{ provide: ServerService, useFactory: () => mockedServerService },
|
||||
ServerDatabase,
|
||||
{ provide: ControllerService, useFactory: () => mockedServerService },
|
||||
ControllerDatabase,
|
||||
],
|
||||
declarations: [ControllerDiscoveryComponent],
|
||||
}).compileComponents();
|
||||
@ -58,7 +58,7 @@ describe('isAvailable', () => {
|
||||
expect(s.port).toEqual(3080);
|
||||
});
|
||||
|
||||
const controller = new Server();
|
||||
const controller = new Controller ();
|
||||
controller.host = '127.0.0.1';
|
||||
controller.port = 3080;
|
||||
|
||||
@ -66,7 +66,7 @@ describe('isAvailable', () => {
|
||||
});
|
||||
|
||||
it('should throw error once controller is not available', () => {
|
||||
const controller = new Server();
|
||||
const controller = new Controller ();
|
||||
controller.host = '127.0.0.1';
|
||||
controller.port = 3080;
|
||||
|
||||
@ -94,7 +94,7 @@ describe('discovery', () => {
|
||||
version.version = '2.1.8';
|
||||
|
||||
spyOn(component, 'isServerAvailable').and.callFake((ip, port) => {
|
||||
const controller = new Server();
|
||||
const controller = new Controller ();
|
||||
controller.host = ip;
|
||||
controller.port = port;
|
||||
return Observable.of(controller);
|
||||
@ -112,10 +112,10 @@ describe('discovery', () => {
|
||||
});
|
||||
|
||||
describe('discoverFirstAvailableServer', () => {
|
||||
let controller: Server;
|
||||
let controller:Controller ;
|
||||
|
||||
beforeEach(function () {
|
||||
controller = new Server();
|
||||
controller = new Controller ();
|
||||
(controller.host = '199.111.111.1'), (controller.port = 3333);
|
||||
|
||||
spyOn(component, 'discovery').and.callFake(() => {
|
||||
@ -142,9 +142,9 @@ describe('discoverFirstAvailableServer', () => {
|
||||
});
|
||||
|
||||
describe('accepting and ignoring found controller', () => {
|
||||
let controller: Server;
|
||||
let controller:Controller ;
|
||||
beforeEach(() => {
|
||||
controller = new Server();
|
||||
controller = new Controller ();
|
||||
(controller.host = '199.111.111.1'), (controller.port = 3333);
|
||||
component.discoveredServer = controller;
|
||||
});
|
||||
|
@ -3,10 +3,10 @@ import { ActivatedRoute } from '@angular/router';
|
||||
import { forkJoin, from } from 'rxjs';
|
||||
import { map } from 'rxjs//operators';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { Server, ServerProtocol } from '../../../models/server';
|
||||
import { Controller, ServerProtocol } from '../../../models/controller';
|
||||
import { Version } from '../../../models/version';
|
||||
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 { VersionService } from '../../../services/version.service';
|
||||
|
||||
@Component({
|
||||
@ -22,12 +22,12 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
},
|
||||
];
|
||||
|
||||
discoveredServer: Server;
|
||||
discoveredServer: Controller;
|
||||
|
||||
constructor(
|
||||
private versionService: VersionService,
|
||||
private serverService: ServerService,
|
||||
private serverDatabase: ServerDatabase,
|
||||
private serverService: ControllerService,
|
||||
private serverDatabase: ControllerDatabase,
|
||||
private route: ActivatedRoute
|
||||
) {}
|
||||
|
||||
@ -56,9 +56,9 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
}
|
||||
|
||||
async discoverServers() {
|
||||
let discoveredServers: Server[] = [];
|
||||
let discoveredServers: Controller[] = [];
|
||||
this.defaultServers.forEach(async (testServer) => {
|
||||
const controller = new Server();
|
||||
const controller = new Controller();
|
||||
controller.host = testServer.host;
|
||||
controller.port = testServer.port;
|
||||
let version = await this.versionService
|
||||
@ -71,7 +71,7 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
}
|
||||
|
||||
discoverFirstAvailableServer() {
|
||||
forkJoin([from(this.serverService.findAll()).pipe(map((s: Server[]) => s)), this.discovery()]).subscribe(
|
||||
forkJoin([from(this.serverService.findAll()).pipe(map((s: Controller[]) => s)), this.discovery()]).subscribe(
|
||||
([local, discovered]) => {
|
||||
local.forEach((added) => {
|
||||
discovered = discovered.filter((controller) => {
|
||||
@ -86,8 +86,8 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
discovery(): Observable<Server[]> {
|
||||
const queries: Observable<Server>[] = [];
|
||||
discovery(): Observable<Controller[]> {
|
||||
const queries: Observable<Controller>[] = [];
|
||||
|
||||
this.defaultServers.forEach((testServer) => {
|
||||
queries.push(
|
||||
@ -97,7 +97,7 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
);
|
||||
});
|
||||
|
||||
return new Observable<Server[]>((observer) => {
|
||||
return new Observable<Controller[]>((observer) => {
|
||||
forkJoin(queries).subscribe((discoveredServers) => {
|
||||
observer.next(discoveredServers.filter((s) => s != null));
|
||||
observer.complete();
|
||||
@ -105,18 +105,18 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
isServerAvailable(ip: string, port: number): Observable<Server> {
|
||||
const controller = new Server();
|
||||
isServerAvailable(ip: string, port: number): Observable<Controller> {
|
||||
const controller = new Controller();
|
||||
controller.host = ip;
|
||||
controller.port = port;
|
||||
return this.versionService.get(controller).flatMap((version: Version) => Observable.of(controller));
|
||||
}
|
||||
|
||||
ignore(controller: Server) {
|
||||
ignore(controller: Controller) {
|
||||
this.discoveredServer = null;
|
||||
}
|
||||
|
||||
accept(controller: Server) {
|
||||
accept(controller: Controller) {
|
||||
if (controller.name == null) {
|
||||
controller.name = controller.host;
|
||||
}
|
||||
@ -124,7 +124,7 @@ export class ControllerDiscoveryComponent implements OnInit {
|
||||
controller.location = 'remote';
|
||||
controller.protocol = location.protocol as ServerProtocol;
|
||||
|
||||
this.serverService.create(controller).then((created: Server) => {
|
||||
this.serverService.create(controller).then((created: Controller) => {
|
||||
this.serverDatabase.addServer(created);
|
||||
this.discoveredServer = null;
|
||||
});
|
||||
|
@ -4,11 +4,11 @@ import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { ServerDatabase } from '../../services/server.database';
|
||||
import { ServerService } from '../../services/server.service';
|
||||
import { MockedServerService } from 'app/services/server.service.spec';
|
||||
import { ControllerDatabase } from '../../services/controller.database';
|
||||
import { ControllerService } from '../../services/controller.service';
|
||||
import { MockedServerService } from 'app/services/controller.service.spec';
|
||||
import { ControllersComponent } from './controllers.component';
|
||||
import { ServerManagementService } from 'app/services/server-management.service';
|
||||
import { ControllerManagementService } from 'app/services/server-management.service';
|
||||
import { ElectronService } from 'ngx-electron';
|
||||
import { ChildProcessService } from 'ngx-childprocess';
|
||||
import { MatBottomSheet, MatBottomSheetModule } from '@angular/material/bottom-sheet';
|
||||
@ -35,13 +35,13 @@ describe('ControllersComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
MatDialog,
|
||||
ServerDatabase,
|
||||
ServerManagementService,
|
||||
ControllerDatabase,
|
||||
ControllerManagementService,
|
||||
ElectronService,
|
||||
MatBottomSheet,
|
||||
ChildProcessService,
|
||||
ChangeDetectorRef,
|
||||
{ provide: ServerService, useValue: serverMockedService },
|
||||
{ provide: ControllerService, useValue: serverMockedService },
|
||||
{ provide: ActivatedRoute, useValue: mockedActivatedRoute },
|
||||
{ provide: Router, useValue: mockedRouter },
|
||||
]
|
||||
|
@ -7,10 +7,10 @@ import { ChildProcessService } from 'ngx-childprocess';
|
||||
import { ElectronService } from 'ngx-electron';
|
||||
import { merge, Observable, Subscription } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Server, ServerProtocol } from '../../models/server';
|
||||
import { ServerManagementService } from '../../services/server-management.service';
|
||||
import { ServerDatabase } from '../../services/server.database';
|
||||
import { ServerService } from '../../services/server.service';
|
||||
import {Controller , ServerProtocol } from '../../models/controller';
|
||||
import { ControllerManagementService } from '../../services/controller-management.service';
|
||||
import { ControllerDatabase } from '../../services/controller.database';
|
||||
import { ControllerService } from '../../services/controller.service';
|
||||
import { ConfirmationBottomSheetComponent } from '../projects/confirmation-bottomsheet/confirmation-bottomsheet.component';
|
||||
import { AddControllerDialogComponent } from './add-controller-dialog/add-controller-dialog.component';
|
||||
|
||||
@ -27,9 +27,9 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(
|
||||
private dialog: MatDialog,
|
||||
private serverService: ServerService,
|
||||
private serverDatabase: ServerDatabase,
|
||||
private serverManagement: ServerManagementService,
|
||||
private serverService: ControllerService,
|
||||
private serverDatabase: ControllerDatabase,
|
||||
private serverManagement: ControllerManagementService,
|
||||
private changeDetector: ChangeDetectorRef,
|
||||
private electronService: ElectronService,
|
||||
private childProcessService: ChildProcessService,
|
||||
@ -41,7 +41,7 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
getControllers() {
|
||||
const runningServersNames = this.serverManagement.getRunningServers();
|
||||
|
||||
this.serverService.findAll().then((controllers: Server[]) => {
|
||||
this.serverService.findAll().then((controllers:Controller []) => {
|
||||
controllers.forEach((controller) => {
|
||||
const serverIndex = runningServersNames.findIndex((controllerName) => controller.name === controllerName);
|
||||
if (serverIndex >= 0) {
|
||||
@ -78,7 +78,7 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.dataSource = new ServerDataSource(this.serverDatabase);
|
||||
|
||||
this.serverStatusSubscription = this.serverManagement.serverStatusChanged.subscribe((serverStatus) => {
|
||||
this.serverStatusSubscription = this.serverManagement.controllerStatusChanged.subscribe((serverStatus) => {
|
||||
const controller = this.serverDatabase.find(serverStatus.serverName);
|
||||
if (!controller) {
|
||||
return;
|
||||
@ -122,14 +122,14 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
|
||||
dialogRef.afterClosed().subscribe((controller) => {
|
||||
if (controller) {
|
||||
this.serverService.create(controller).then((created: Server) => {
|
||||
this.serverService.create(controller).then((created:Controller ) => {
|
||||
this.serverDatabase.addServer(created);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getServerStatus(controller: Server) {
|
||||
getServerStatus(controller:Controller ) {
|
||||
if (controller.location === 'local') {
|
||||
if (controller.status === undefined) {
|
||||
return 'stopped';
|
||||
@ -138,7 +138,7 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
deleteServer(controller: Server) {
|
||||
deleteServer(controller:Controller ) {
|
||||
this.bottomSheet.open(ConfirmationBottomSheetComponent);
|
||||
let bottomSheetRef = this.bottomSheet._openedBottomSheetRef;
|
||||
bottomSheetRef.instance.message = 'Do you want to delete the controller?';
|
||||
@ -151,21 +151,21 @@ export class ControllersComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
async startServer(controller: Server) {
|
||||
async startServer(controller:Controller ) {
|
||||
await this.serverManagement.start(controller);
|
||||
}
|
||||
|
||||
async stopServer(controller: Server) {
|
||||
async stopServer(controller:Controller ) {
|
||||
await this.serverManagement.stop(controller);
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerDataSource extends DataSource<Server> {
|
||||
constructor(private serverDatabase: ServerDatabase) {
|
||||
export class ServerDataSource extends DataSource<Controller> {
|
||||
constructor(private serverDatabase: ControllerDatabase) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<Server[]> {
|
||||
connect(): Observable< Controller[] > {
|
||||
return merge(this.serverDatabase.dataChange).pipe(
|
||||
map(() => {
|
||||
return this.serverDatabase.data;
|
||||
|
@ -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({
|
||||
@ -34,8 +34,8 @@ export class DirectLinkComponent implements OnInit {
|
||||
});
|
||||
|
||||
constructor(
|
||||
private serverService: ServerService,
|
||||
private serverDatabase: ServerDatabase,
|
||||
private serverService: ControllerService,
|
||||
private serverDatabase: ControllerDatabase,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private toasterService: ToasterService
|
||||
@ -72,7 +72,7 @@ export class DirectLinkComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
let serverToAdd: Server = new Server();
|
||||
let serverToAdd:Controller = new Controller ();
|
||||
serverToAdd.host = this.controllerIp;
|
||||
serverToAdd.port = this.controllerPort;
|
||||
|
||||
@ -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: Server) => {
|
||||
this.serverService.create(serverToAdd).then((addedServer:Controller ) => {
|
||||
this.router.navigate(['/controller', addedServer.id, 'project', this.projectId]);
|
||||
});
|
||||
}
|
||||
|
@ -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() controller: Server;
|
||||
@Input() controller: Controller
|
||||
@Input() project: Project;
|
||||
@Input() selectedDrawing: string;
|
||||
@Output() drawingSaved = new EventEmitter<boolean>();
|
||||
|
@ -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() controller: Server;
|
||||
@Input() controller:Controller ;
|
||||
@Input() project: Project;
|
||||
private drawingDragged: Subscription;
|
||||
|
||||
|
@ -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() controller: Server;
|
||||
@Input() controller:Controller ;
|
||||
private drawingResized: Subscription;
|
||||
|
||||
constructor(
|
||||
|
@ -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() controller: Server;
|
||||
@Input() controller:Controller ;
|
||||
private interfaceDragged: Subscription;
|
||||
|
||||
constructor(
|
||||
|
@ -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() controller: Server;
|
||||
@Input() controller:Controller ;
|
||||
@Input() project: Project;
|
||||
private linkCreated: Subscription;
|
||||
|
||||
|
@ -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() controller: Server;
|
||||
@Input() controller:Controller ;
|
||||
@Input() project: Project;
|
||||
private nodeDragged: Subscription;
|
||||
|
||||
|
@ -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() controller: Server;
|
||||
@Input() controller:Controller ;
|
||||
private nodeLabelDragged: Subscription;
|
||||
|
||||
constructor(
|
||||
|
@ -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() controller: Server;
|
||||
@Input() controller: Controller;
|
||||
@Input() project: Project;
|
||||
@Output() drawingSaved = new EventEmitter<boolean>();
|
||||
private textAdded: Subscription;
|
||||
|
@ -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() controller: Server;
|
||||
@Input() controller: Controller;
|
||||
private textEdited: Subscription;
|
||||
|
||||
constructor(
|
||||
|
@ -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 = [];
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
project: Project;
|
||||
index: number = 4;
|
||||
fileName: string;
|
||||
|
@ -5,10 +5,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 '../../../services/server.service';
|
||||
import { MockedServerService } from '../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../services/controller.service.spec';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../models/server';
|
||||
import{ Controller } from '../../../models/controller';
|
||||
|
||||
import { AddImageDialogComponent } from './add-image-dialog.component';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
@ -17,7 +17,7 @@ import { MockedToasterService } from 'app/services/toaster.service.spec';
|
||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
|
||||
export class MockedImageManagerService {
|
||||
public getImages(controller: Server) {
|
||||
public getImages(controller:Controller ) {
|
||||
return of();
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ describe('AddImageDialogComponent', () => {
|
||||
MatSnackBarModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: ImageManagerService, useValue: mockedImageManagerService },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: {} },
|
||||
{ provide: MatDialogRef, useValue: {} },
|
||||
|
@ -3,7 +3,7 @@ import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { UploadServiceService } from 'app/common/uploading-processbar/upload-service.service';
|
||||
import { FileItem, FileUploader, ParsedResponseHeaders } from 'ng2-file-upload';
|
||||
import { Server } from '../../../models/server';
|
||||
import{ Controller } from '../../../models/controller';
|
||||
import { ImageManagerService } from '../../../services/image-manager.service';
|
||||
import { ToasterService } from '../../../services/toaster.service';
|
||||
|
||||
@ -20,7 +20,7 @@ import { ToasterService } from '../../../services/toaster.service';
|
||||
],
|
||||
})
|
||||
export class AddImageDialogComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
isInstallAppliance: boolean = false;
|
||||
install_appliance: boolean = false;
|
||||
selectFile: any = [];
|
||||
|
@ -7,17 +7,17 @@ import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { ToasterService } from 'app/services/toaster.service';
|
||||
import { MockedToasterService } from 'app/services/toaster.service.spec';
|
||||
import { Server } from 'http';
|
||||
import{ Server } from 'http';
|
||||
import { of } from 'rxjs';
|
||||
import { ImageManagerService } from '../../../services/image-manager.service';
|
||||
import { ServerService } from '../../../services/server.service';
|
||||
import { MockedServerService } from '../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../services/controller.service.spec';
|
||||
import { ImageManagerComponent } from '../image-manager.component';
|
||||
|
||||
import { DeleteAllImageFilesDialogComponent } from './deleteallfiles-dialog.component';
|
||||
|
||||
export class MockedImageManagerService {
|
||||
public deleteALLFile(controller: Server, image_path) {
|
||||
public deleteALLFile(controller:Server , image_path) {
|
||||
return of();
|
||||
}
|
||||
}
|
||||
@ -39,7 +39,7 @@ export class MockedImageManagerService {
|
||||
MatDialogModule,
|
||||
],
|
||||
providers: [
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: ImageManagerService, useValue: mockedImageManagerService },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: {} },
|
||||
{ provide: MatDialogRef, useValue: {} },
|
||||
|
@ -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 { MockedServerService } 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(controller: Server) {
|
||||
public getImages(controller:Controller ) {
|
||||
return of();
|
||||
}
|
||||
|
||||
public deleteFile(controller: Server, image_path) {
|
||||
public deleteFile(controller:Controller , image_path) {
|
||||
return of();
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ describe('ImageManagerComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: ImageManagerService, useValue: mockedImageManagerService },
|
||||
{ provide: ProgressService, useValue: mockedProgressService },
|
||||
{ provide: VersionService, useValue: mockedVersionService },
|
||||
|
@ -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 {
|
||||
controller: 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 serverService: 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: Server) => {
|
||||
this.serverService.get(controller_id).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
if (controller.authToken) {
|
||||
this.getImages()
|
||||
|
@ -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 controller: 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 serverService: ControllerService,
|
||||
private serverDatabase: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
if (controller.authToken) {
|
||||
|
@ -10,12 +10,12 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { CloudTemplate } from '../../../../../models/templates/cloud-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ComputeService } from '../../../../../services/compute.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../../services/controller.service.spec';
|
||||
import { TemplateMocksService } from '../../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../../services/toaster.service.spec';
|
||||
@ -24,7 +24,7 @@ import { MockedActivatedRoute } from '../../../preferences.component.spec';
|
||||
import { CloudNodesAddTemplateComponent } from './cloud-nodes-add-template.component';
|
||||
|
||||
export class MockedBuiltInTemplatesService {
|
||||
public addTemplate(controller: Server, cloudTemplate: CloudTemplate) {
|
||||
public addTemplate(controller:Controller , cloudTemplate: CloudTemplate) {
|
||||
return of(cloudTemplate);
|
||||
}
|
||||
}
|
||||
@ -56,7 +56,7 @@ describe('CloudNodesAddTemplateComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: BuiltInTemplatesService, useValue: mockedBuiltInTemplatesService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: ComputeService, useValue: mockedComputeService },
|
||||
@ -80,7 +80,7 @@ describe('CloudNodesAddTemplateComponent', () => {
|
||||
it('should call add template', () => {
|
||||
spyOn(mockedBuiltInTemplatesService, 'addTemplate').and.returnValue(of({} as CloudTemplate));
|
||||
component.templateName = 'sample name';
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
component.formGroup.controls['templateName'].setValue('template name');
|
||||
|
||||
component.addTemplate();
|
||||
@ -92,7 +92,7 @@ describe('CloudNodesAddTemplateComponent', () => {
|
||||
spyOn(mockedBuiltInTemplatesService, 'addTemplate').and.returnValue(of({} as CloudTemplate));
|
||||
spyOn(mockedToasterService, 'error');
|
||||
component.templateName = '';
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
|
@ -3,11 +3,11 @@ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Compute } from '../../../../../models/compute';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { CloudTemplate } from '../../../../../models/templates/cloud-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ComputeService } from '../../../../../services/compute.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { TemplateMocksService } from '../../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
|
||||
@ -17,14 +17,14 @@ import { ToasterService } from '../../../../../services/toaster.service';
|
||||
styleUrls: ['./cloud-nodes-add-template.component.scss', '../../../preferences.component.scss'],
|
||||
})
|
||||
export class CloudNodesAddTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
templateName: string = '';
|
||||
formGroup: FormGroup;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -11,23 +11,23 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { CloudTemplate } from '../../../../../models/templates/cloud-template';
|
||||
import { BuiltInTemplatesConfigurationService } from '../../../../../services/built-in-templates-configuration.service';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../../services/toaster.service.spec';
|
||||
import { MockedActivatedRoute } from '../../../preferences.component.spec';
|
||||
import { CloudNodesTemplateDetailsComponent } from './cloud-nodes-template-details.component';
|
||||
|
||||
export class MockedBuiltInTemplatesService {
|
||||
public getTemplate(controller: Server, template_id: string) {
|
||||
public getTemplate(controller:Controller , template_id: string) {
|
||||
return of({ ports_mapping: [] } as CloudTemplate);
|
||||
}
|
||||
|
||||
public saveTemplate(controller: Server, cloudTemplate: CloudTemplate) {
|
||||
public saveTemplate(controller:Controller , cloudTemplate: CloudTemplate) {
|
||||
return of(cloudTemplate);
|
||||
}
|
||||
}
|
||||
@ -60,7 +60,7 @@ describe('CloudNodesTemplateDetailsComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: BuiltInTemplatesService, useValue: mockedBuiltInTemplatesService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: BuiltInTemplatesConfigurationService, useClass: BuiltInTemplatesConfigurationService },
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { PortsMappingEntity } from '../../../../../models/ethernetHub/ports-mapping-enity';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { CloudTemplate } from '../../../../../models/templates/cloud-template';
|
||||
import { BuiltInTemplatesConfigurationService } from '../../../../../services/built-in-templates-configuration.service';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -14,7 +14,7 @@ import { ToasterService } from '../../../../../services/toaster.service';
|
||||
styleUrls: ['./cloud-nodes-template-details.component.scss', '../../../preferences.component.scss'],
|
||||
})
|
||||
export class CloudNodesTemplateDetailsComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
cloudNodeTemplate: CloudTemplate;
|
||||
|
||||
isSymbolSelectionOpened: boolean = false;
|
||||
@ -34,7 +34,7 @@ export class CloudNodesTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -9,16 +9,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { CloudTemplate } from '../../../../../models/templates/cloud-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../../services/controller.service.spec';
|
||||
import { MockedActivatedRoute } from '../../../preferences.component.spec';
|
||||
import { CloudNodesTemplatesComponent } from './cloud-nodes-templates.component';
|
||||
|
||||
export class MockedBuiltInTemplatesService {
|
||||
public getTemplates(controller: Server) {
|
||||
public getTemplates(controller:Controller ) {
|
||||
return of([{} as CloudTemplate]);
|
||||
}
|
||||
}
|
||||
@ -47,7 +47,7 @@ describe('CloudNodesTemplatesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: BuiltInTemplatesService, useValue: mockedBuiltInTemplatesService },
|
||||
],
|
||||
declarations: [CloudNodesTemplatesComponent],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { CloudTemplate } from '../../../../../models/templates/cloud-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { DeleteTemplateComponent } from '../../../common/delete-template-component/delete-template.component';
|
||||
|
||||
@Component({
|
||||
@ -12,19 +12,19 @@ import { DeleteTemplateComponent } from '../../../common/delete-template-compone
|
||||
styleUrls: ['./cloud-nodes-templates.component.scss', '../../../preferences.component.scss'],
|
||||
})
|
||||
export class CloudNodesTemplatesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
cloudNodesTemplates: CloudTemplate[] = [];
|
||||
@ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -10,12 +10,12 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetHubTemplate } from '../../../../../models/templates/ethernet-hub-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ComputeService } from '../../../../../services/compute.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../../services/controller.service.spec';
|
||||
import { TemplateMocksService } from '../../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../../services/toaster.service.spec';
|
||||
@ -24,7 +24,7 @@ import { MockedActivatedRoute } from '../../../preferences.component.spec';
|
||||
import { EthernetHubsAddTemplateComponent } from './ethernet-hubs-add-template.component';
|
||||
|
||||
export class MockedBuiltInTemplatesService {
|
||||
public addTemplate(controller: Server, ethernetHubTemplate: EthernetHubTemplate) {
|
||||
public addTemplate(controller:Controller , ethernetHubTemplate: EthernetHubTemplate) {
|
||||
return of(ethernetHubTemplate);
|
||||
}
|
||||
}
|
||||
@ -59,7 +59,7 @@ describe('EthernetHubsAddTemplateComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: BuiltInTemplatesService, useValue: mockedBuiltInTemplatesService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: ComputeService, useValue: mockedComputeService },
|
||||
@ -83,7 +83,7 @@ describe('EthernetHubsAddTemplateComponent', () => {
|
||||
it('should call add template', () => {
|
||||
spyOn(mockedBuiltInTemplatesService, 'addTemplate').and.returnValue(of({} as EthernetHubTemplate));
|
||||
component.templateName = 'sample name';
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
component.formGroup.controls['templateName'].setValue('template name');
|
||||
component.formGroup.controls['numberOfPorts'].setValue('1');
|
||||
|
||||
@ -96,7 +96,7 @@ describe('EthernetHubsAddTemplateComponent', () => {
|
||||
spyOn(mockedBuiltInTemplatesService, 'addTemplate').and.returnValue(of({} as EthernetHubTemplate));
|
||||
spyOn(mockedToasterService, 'error');
|
||||
component.templateName = '';
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
@ -108,7 +108,7 @@ describe('EthernetHubsAddTemplateComponent', () => {
|
||||
spyOn(mockedBuiltInTemplatesService, 'addTemplate').and.returnValue(of({} as EthernetHubTemplate));
|
||||
spyOn(mockedToasterService, 'error');
|
||||
component.templateName = 'sample name';
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
|
@ -3,11 +3,11 @@ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Compute } from '../../../../../models/compute';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetHubTemplate } from '../../../../../models/templates/ethernet-hub-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ComputeService } from '../../../../../services/compute.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { TemplateMocksService } from '../../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
|
||||
@ -17,14 +17,14 @@ import { ToasterService } from '../../../../../services/toaster.service';
|
||||
styleUrls: ['./ethernet-hubs-add-template.component.scss', '../../../preferences.component.scss'],
|
||||
})
|
||||
export class EthernetHubsAddTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
templateName: string = '';
|
||||
formGroup: FormGroup;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -11,23 +11,23 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetHubTemplate } from '../../../../../models/templates/ethernet-hub-template';
|
||||
import { BuiltInTemplatesConfigurationService } from '../../../../../services/built-in-templates-configuration.service';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../../services/toaster.service.spec';
|
||||
import { MockedActivatedRoute } from '../../../preferences.component.spec';
|
||||
import { EthernetHubsTemplateDetailsComponent } from './ethernet-hubs-template-details.component';
|
||||
|
||||
export class MockedBuiltInTemplatesService {
|
||||
public getTemplate(controller: Server, template_id: string) {
|
||||
public getTemplate(controller:Controller , template_id: string) {
|
||||
return of({ ports_mapping: [] } as EthernetHubTemplate);
|
||||
}
|
||||
|
||||
public saveTemplate(controller: Server, cloudTemplate: EthernetHubTemplate) {
|
||||
public saveTemplate(controller:Controller , cloudTemplate: EthernetHubTemplate) {
|
||||
return of(cloudTemplate);
|
||||
}
|
||||
}
|
||||
@ -60,7 +60,7 @@ describe('EthernetHubsTemplateDetailsComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: BuiltInTemplatesService, useValue: mockedBuiltInTemplatesService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: BuiltInTemplatesConfigurationService, useClass: BuiltInTemplatesConfigurationService },
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetHubTemplate } from '../../../../../models/templates/ethernet-hub-template';
|
||||
import { BuiltInTemplatesConfigurationService } from '../../../../../services/built-in-templates-configuration.service';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -14,7 +14,7 @@ import { ToasterService } from '../../../../../services/toaster.service';
|
||||
styleUrls: ['./ethernet-hubs-template-details.component.scss', '../../../preferences.component.scss'],
|
||||
})
|
||||
export class EthernetHubsTemplateDetailsComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
ethernetHubTemplate: EthernetHubTemplate;
|
||||
numberOfPorts: number;
|
||||
inputForm: FormGroup;
|
||||
@ -24,7 +24,7 @@ export class EthernetHubsTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.categories = this.builtInTemplatesConfigurationService.getCategoriesForEthernetHubs();
|
||||
|
@ -9,16 +9,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetHubTemplate } from '../../../../../models/templates/ethernet-hub-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../../services/controller.service.spec';
|
||||
import { MockedActivatedRoute } from '../../../preferences.component.spec';
|
||||
import { EthernetHubsTemplatesComponent } from './ethernet-hubs-templates.component';
|
||||
|
||||
export class MockedBuiltInTemplatesService {
|
||||
public getTemplates(controller: Server) {
|
||||
public getTemplates(controller:Controller ) {
|
||||
return of([{} as EthernetHubTemplate]);
|
||||
}
|
||||
}
|
||||
@ -47,7 +47,7 @@ describe('EthernetHubsTemplatesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: BuiltInTemplatesService, useValue: mockedBuiltInTemplatesService },
|
||||
],
|
||||
declarations: [EthernetHubsTemplatesComponent],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetHubTemplate } from '../../../../../models/templates/ethernet-hub-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { DeleteTemplateComponent } from '../../../common/delete-template-component/delete-template.component';
|
||||
|
||||
@Component({
|
||||
@ -12,19 +12,19 @@ import { DeleteTemplateComponent } from '../../../common/delete-template-compone
|
||||
styleUrls: ['./ethernet-hubs-templates.component.scss', '../../../preferences.component.scss'],
|
||||
})
|
||||
export class EthernetHubsTemplatesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
ethernetHubsTemplates: EthernetHubTemplate[] = [];
|
||||
@ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -10,12 +10,12 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetSwitchTemplate } from '../../../../../models/templates/ethernet-switch-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ComputeService } from '../../../../../services/compute.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../../services/controller.service.spec';
|
||||
import { TemplateMocksService } from '../../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../../services/toaster.service.spec';
|
||||
@ -24,7 +24,7 @@ import { MockedActivatedRoute } from '../../../preferences.component.spec';
|
||||
import { EthernetSwitchesAddTemplateComponent } from './ethernet-switches-add-template.component';
|
||||
|
||||
export class MockedBuiltInTemplatesService {
|
||||
public addTemplate(controller: Server, ethernetHubTemplate: EthernetSwitchTemplate) {
|
||||
public addTemplate(controller:Controller , ethernetHubTemplate: EthernetSwitchTemplate) {
|
||||
return of(ethernetHubTemplate);
|
||||
}
|
||||
}
|
||||
@ -59,7 +59,7 @@ describe('EthernetSwitchesAddTemplateComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: BuiltInTemplatesService, useValue: mockedBuiltInTemplatesService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: ComputeService, useValue: mockedComputeService },
|
||||
@ -83,7 +83,7 @@ describe('EthernetSwitchesAddTemplateComponent', () => {
|
||||
it('should call add template', () => {
|
||||
spyOn(mockedBuiltInTemplatesService, 'addTemplate').and.returnValue(of({} as EthernetSwitchTemplate));
|
||||
component.templateName = 'sample name';
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
component.formGroup.controls['templateName'].setValue('template name');
|
||||
component.formGroup.controls['numberOfPorts'].setValue('1');
|
||||
|
||||
@ -96,7 +96,7 @@ describe('EthernetSwitchesAddTemplateComponent', () => {
|
||||
spyOn(mockedBuiltInTemplatesService, 'addTemplate').and.returnValue(of({} as EthernetSwitchTemplate));
|
||||
spyOn(mockedToasterService, 'error');
|
||||
component.formGroup.controls['numberOfPorts'].setValue('1');
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
@ -108,7 +108,7 @@ describe('EthernetSwitchesAddTemplateComponent', () => {
|
||||
spyOn(mockedBuiltInTemplatesService, 'addTemplate').and.returnValue(of({} as EthernetSwitchTemplate));
|
||||
spyOn(mockedToasterService, 'error');
|
||||
component.formGroup.controls['templateName'].setValue('template name');
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
|
@ -3,11 +3,11 @@ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Compute } from '../../../../../models/compute';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetSwitchTemplate } from '../../../../../models/templates/ethernet-switch-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ComputeService } from '../../../../../services/compute.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { TemplateMocksService } from '../../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
|
||||
@ -17,14 +17,14 @@ import { ToasterService } from '../../../../../services/toaster.service';
|
||||
styleUrls: ['./ethernet-switches-add-template.component.scss', '../../../preferences.component.scss'],
|
||||
})
|
||||
export class EthernetSwitchesAddTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
templateName: string = '';
|
||||
formGroup: FormGroup;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -11,12 +11,12 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetSwitchTemplate } from '../../../../../models/templates/ethernet-switch-template';
|
||||
import { BuiltInTemplatesConfigurationService } from '../../../../../services/built-in-templates-configuration.service';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../../services/toaster.service.spec';
|
||||
import { PortsComponent } from '../../../common/ports/ports.component';
|
||||
@ -24,11 +24,11 @@ import { MockedActivatedRoute } from '../../../preferences.component.spec';
|
||||
import { EthernetSwitchesTemplateDetailsComponent } from './ethernet-switches-template-details.component';
|
||||
|
||||
export class MockedBuiltInTemplatesService {
|
||||
public getTemplate(controller: Server, template_id: string) {
|
||||
public getTemplate(controller:Controller , template_id: string) {
|
||||
return of({ ports_mapping: [] } as EthernetSwitchTemplate);
|
||||
}
|
||||
|
||||
public saveTemplate(controller: Server, cloudTemplate: EthernetSwitchTemplate) {
|
||||
public saveTemplate(controller:Controller , cloudTemplate: EthernetSwitchTemplate) {
|
||||
return of(cloudTemplate);
|
||||
}
|
||||
}
|
||||
@ -61,7 +61,7 @@ describe('EthernetSwitchesTemplateDetailsComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: BuiltInTemplatesService, useValue: mockedBuiltInTemplatesService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: BuiltInTemplatesConfigurationService, useClass: BuiltInTemplatesConfigurationService },
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetSwitchTemplate } from '../../../../../models/templates/ethernet-switch-template';
|
||||
import { BuiltInTemplatesConfigurationService } from '../../../../../services/built-in-templates-configuration.service';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../../services/toaster.service';
|
||||
import { PortsComponent } from '../../../common/ports/ports.component';
|
||||
|
||||
@ -16,7 +16,7 @@ import { PortsComponent } from '../../../common/ports/ports.component';
|
||||
})
|
||||
export class EthernetSwitchesTemplateDetailsComponent implements OnInit {
|
||||
@ViewChild(PortsComponent) portsComponent: PortsComponent;
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
ethernetSwitchTemplate: EthernetSwitchTemplate;
|
||||
inputForm: FormGroup;
|
||||
isSymbolSelectionOpened: boolean = false;
|
||||
@ -25,7 +25,7 @@ export class EthernetSwitchesTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -9,16 +9,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetSwitchTemplate } from '../../../../../models/templates/ethernet-switch-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../../services/controller.service.spec';
|
||||
import { MockedActivatedRoute } from '../../../preferences.component.spec';
|
||||
import { EthernetSwitchesTemplatesComponent } from './ethernet-switches-templates.component';
|
||||
|
||||
export class MockedBuiltInTemplatesService {
|
||||
public getTemplates(controller: Server) {
|
||||
public getTemplates(controller:Controller ) {
|
||||
return of([{} as EthernetSwitchTemplate]);
|
||||
}
|
||||
}
|
||||
@ -47,7 +47,7 @@ describe('EthernetSwitchesTemplatesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: BuiltInTemplatesService, useValue: mockedBuiltInTemplatesService },
|
||||
],
|
||||
declarations: [EthernetSwitchesTemplatesComponent],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Server } from '../../../../../models/server';
|
||||
import{ Controller } from '../../../../../models/controller';
|
||||
import { EthernetSwitchTemplate } from '../../../../../models/templates/ethernet-switch-template';
|
||||
import { BuiltInTemplatesService } from '../../../../../services/built-in-templates.service';
|
||||
import { ServerService } from '../../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../../services/controller.service';
|
||||
import { DeleteTemplateComponent } from '../../../common/delete-template-component/delete-template.component';
|
||||
|
||||
@Component({
|
||||
@ -12,19 +12,19 @@ import { DeleteTemplateComponent } from '../../../common/delete-template-compone
|
||||
styleUrls: ['./ethernet-switches-templates.component.scss', '../../../preferences.component.scss'],
|
||||
})
|
||||
export class EthernetSwitchesTemplatesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
ethernetSwitchesTemplates: EthernetSwitchTemplate[] = [];
|
||||
@ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: ControllerService,
|
||||
private builtInTemplatesService: BuiltInTemplatesService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { TemplateService } from '../../../../services/template.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { DeleteConfirmationDialogComponent } from '../delete-confirmation-dialog/delete-confirmation-dialog.component';
|
||||
@ -11,7 +11,7 @@ import { DeleteConfirmationDialogComponent } from '../delete-confirmation-dialog
|
||||
styleUrls: ['./delete-template.component.scss'],
|
||||
})
|
||||
export class DeleteTemplateComponent {
|
||||
@Input() controller: Server;
|
||||
@Input() controller:Controller ;
|
||||
@Output() deleteEvent = new EventEmitter<string>();
|
||||
|
||||
constructor(
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
|
||||
@Component({
|
||||
selector: 'app-symbols-menu',
|
||||
@ -7,7 +7,7 @@ import { Server } from '../../../../models/server';
|
||||
styleUrls: ['./symbols-menu.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class SymbolsMenuComponent {
|
||||
@Input() controller: Server;
|
||||
@Input() controller:Controller ;
|
||||
@Input() symbol: string;
|
||||
@Output() symbolChangedEmitter = new EventEmitter<string>();
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { environment } from 'environments/environment';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { Symbol } from '../../../../models/symbol';
|
||||
import { SymbolService } from '../../../../services/symbol.service';
|
||||
|
||||
@ -10,7 +10,7 @@ import { SymbolService } from '../../../../services/symbol.service';
|
||||
styleUrls: ['./symbols.component.scss'],
|
||||
})
|
||||
export class SymbolsComponent implements OnInit {
|
||||
@Input() controller: Server;
|
||||
@Input() controller:Controller ;
|
||||
@Input() symbol: string;
|
||||
@Output() symbolChanged = new EventEmitter<string>();
|
||||
|
||||
|
@ -18,12 +18,12 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { DockerTemplate } from '../../../../models/templates/docker-template';
|
||||
import { DockerConfigurationService } from '../../../../services/docker-configuration.service';
|
||||
import { DockerService } from '../../../../services/docker.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
@ -31,7 +31,7 @@ import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { AddDockerTemplateComponent } from './add-docker-template.component';
|
||||
|
||||
export class MockedDockerService {
|
||||
public addTemplate(controller: Server, dockerTemplate: DockerTemplate) {
|
||||
public addTemplate(controller:Controller , dockerTemplate: DockerTemplate) {
|
||||
return of(dockerTemplate);
|
||||
}
|
||||
}
|
||||
@ -72,7 +72,7 @@ xdescribe('AddDockerTemplateComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: DockerService, useValue: mockedDockerService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: TemplateMocksService, useClass: TemplateMocksService },
|
||||
|
@ -4,12 +4,12 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Compute } from '../../../../models/compute';
|
||||
import { DockerImage } from '../../../../models/docker/docker-image';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { DockerTemplate } from '../../../../models/templates/docker-template';
|
||||
import { ComputeService } from '../../../../services/compute.service';
|
||||
import { DockerConfigurationService } from '../../../../services/docker-configuration.service';
|
||||
import { DockerService } from '../../../../services/docker.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@ -19,7 +19,7 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./add-docker-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class AddDockerTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
dockerTemplate: DockerTemplate;
|
||||
consoleTypes: string[] = [];
|
||||
isRemoteComputerChosen: boolean = false;
|
||||
@ -34,7 +34,7 @@ export class AddDockerTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.consoleTypes = this.configurationService.getConsoleTypes();
|
||||
|
@ -2,10 +2,10 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { DockerTemplate } from '../../../../models/templates/docker-template';
|
||||
import { DockerService } from '../../../../services/docker.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -14,14 +14,14 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./copy-docker-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class CopyDockerTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
templateName: string = '';
|
||||
dockerTemplate: DockerTemplate;
|
||||
templateNameForm: FormGroup;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.dockerService.getTemplate(this.controller, template_id).subscribe((dockerTemplate: DockerTemplate) => {
|
||||
|
@ -10,23 +10,23 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { DockerTemplate } from '../../../../models/templates/docker-template';
|
||||
import { DockerConfigurationService } from '../../../../services/docker-configuration.service';
|
||||
import { DockerService } from '../../../../services/docker.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { DockerTemplateDetailsComponent } from './docker-template-details.component';
|
||||
|
||||
export class MockedDockerService {
|
||||
public getTemplate(controller: Server, template_id: string) {
|
||||
public getTemplate(controller:Controller , template_id: string) {
|
||||
return of({} as DockerTemplate);
|
||||
}
|
||||
|
||||
public saveTemplate(controller: Server, dockerTemplate: DockerTemplate) {
|
||||
public saveTemplate(controller:Controller , dockerTemplate: DockerTemplate) {
|
||||
return of(dockerTemplate);
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@ describe('DockerTemplateDetailsComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: DockerService, useValue: mockedDockerService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: DockerConfigurationService, useClass: DockerConfigurationService },
|
||||
|
@ -2,11 +2,11 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CustomAdapter } from '../../../../models/qemu/qemu-custom-adapter';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { DockerTemplate } from '../../../../models/templates/docker-template';
|
||||
import { DockerConfigurationService } from '../../../../services/docker-configuration.service';
|
||||
import { DockerService } from '../../../../services/docker.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -15,7 +15,7 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./docker-template-details.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class DockerTemplateDetailsComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
dockerTemplate: DockerTemplate;
|
||||
|
||||
isSymbolSelectionOpened: boolean = false;
|
||||
@ -30,7 +30,7 @@ export class DockerTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -9,16 +9,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { DockerTemplate } from '../../../../models/templates/docker-template';
|
||||
import { DockerService } from '../../../../services/docker.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { DockerTemplatesComponent } from './docker-templates.component';
|
||||
|
||||
export class MockedDockerService {
|
||||
public getTemplates(controller: Server) {
|
||||
public getTemplates(controller:Controller ) {
|
||||
return of([{} as DockerTemplate]);
|
||||
}
|
||||
}
|
||||
@ -44,7 +44,7 @@ describe('DockerTemplatesComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: DockerService, useValue: mockedDockerService },
|
||||
],
|
||||
declarations: [DockerTemplatesComponent],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { DockerTemplate } from '../../../../models/templates/docker-template';
|
||||
import { DockerService } from '../../../../services/docker.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { DeleteTemplateComponent } from '../../common/delete-template-component/delete-template.component';
|
||||
|
||||
@Component({
|
||||
@ -12,20 +12,20 @@ import { DeleteTemplateComponent } from '../../common/delete-template-component/
|
||||
styleUrls: ['./docker-templates.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class DockerTemplatesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
dockerTemplates: DockerTemplate[] = [];
|
||||
@ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -16,12 +16,12 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IosTemplate } from '../../../../models/templates/ios-template';
|
||||
import { IosConfigurationService } from '../../../../services/ios-configuration.service';
|
||||
import { IosService } from '../../../../services/ios.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
@ -29,7 +29,7 @@ import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { AddIosTemplateComponent } from './add-ios-template.component';
|
||||
|
||||
export class MockedIosService {
|
||||
public addTemplate(controller: Server, iosTemplate: IosTemplate) {
|
||||
public addTemplate(controller:Controller , iosTemplate: IosTemplate) {
|
||||
return of(iosTemplate);
|
||||
}
|
||||
}
|
||||
@ -67,7 +67,7 @@ xdescribe('AddIosTemplateComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: IosService, useValue: mockedIosService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: TemplateMocksService, useClass: TemplateMocksService },
|
||||
@ -95,7 +95,7 @@ xdescribe('AddIosTemplateComponent', () => {
|
||||
component.iosNameForm.controls['platform'].setValue('platform');
|
||||
component.iosNameForm.controls['chassis'].setValue('chassis');
|
||||
component.iosMemoryForm.controls['memory'].setValue(0);
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
@ -109,7 +109,7 @@ xdescribe('AddIosTemplateComponent', () => {
|
||||
component.iosNameForm.controls['platform'].setValue('platform');
|
||||
component.iosNameForm.controls['chassis'].setValue('chassis');
|
||||
component.iosMemoryForm.controls['memory'].setValue(0);
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
@ -122,7 +122,7 @@ xdescribe('AddIosTemplateComponent', () => {
|
||||
component.iosNameForm.controls['platform'].setValue('platform');
|
||||
component.iosNameForm.controls['chassis'].setValue('chassis');
|
||||
component.iosMemoryForm.controls['memory'].setValue(0);
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
@ -135,7 +135,7 @@ xdescribe('AddIosTemplateComponent', () => {
|
||||
component.iosNameForm.controls['templateName'].setValue('template name');
|
||||
component.iosNameForm.controls['platform'].setValue('platform');
|
||||
component.iosNameForm.controls['chassis'].setValue('chassis');
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
|
@ -10,12 +10,12 @@ import { Subscription } from 'rxjs';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Compute } from '../../../../models/compute';
|
||||
import { IosImage } from '../../../../models/images/ios-image';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IosTemplate } from '../../../../models/templates/ios-template';
|
||||
import { ComputeService } from '../../../../services/compute.service';
|
||||
import { IosConfigurationService } from '../../../../services/ios-configuration.service';
|
||||
import { IosService } from '../../../../services/ios.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@ -25,7 +25,7 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./add-ios-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
iosTemplate: IosTemplate;
|
||||
isEtherSwitchRouter: boolean = false;
|
||||
|
||||
@ -56,7 +56,7 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getImages();
|
||||
|
@ -2,10 +2,10 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IosTemplate } from '../../../../models/templates/ios-template';
|
||||
import { IosService } from '../../../../services/ios.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -14,14 +14,14 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./copy-ios-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class CopyIosTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
templateName: string = '';
|
||||
iosTemplate: IosTemplate;
|
||||
formGroup: FormGroup;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.iosService.getTemplate(this.controller, template_id).subscribe((iosTemplate: IosTemplate) => {
|
||||
|
@ -9,10 +9,10 @@ import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { ServerSettingsService } from '../../../../services/server-settings.service';
|
||||
import { MockedServerSettingsService } from '../../../../services/server-settings.service.spec';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerSettingsService } from '../../../../services/controller-settings.service';
|
||||
import { MockedControllerSettingsService } from '../../../../services/controller-settings.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
@ -24,7 +24,7 @@ describe('DynamipsPreferencesComponent', () => {
|
||||
|
||||
let mockedServerService = new MockedServerService();
|
||||
let activatedRoute = new MockedActivatedRoute().get();
|
||||
let mockedServerSettingsService = new MockedServerSettingsService();
|
||||
let mockedServerSettingsService = new MockedControllerSettingsService();
|
||||
let mockedToasterService = new MockedToasterService();
|
||||
|
||||
beforeEach(async() => {
|
||||
@ -44,8 +44,8 @@ describe('DynamipsPreferencesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ServerSettingsService, useValue: mockedServerSettingsService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: ControllerSettingsService, useValue: mockedServerSettingsService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
],
|
||||
declarations: [DynamipsPreferencesComponent],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Server } from '../../../../models/server';
|
||||
import { ServerSettingsService } from '../../../../services/server-settings.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { ControllerSettingsService } from '../../../../services/controller-settings.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dynamips-preferences',
|
||||
@ -10,18 +10,18 @@ import { ServerService } from '../../../../services/server.service';
|
||||
styleUrls: ['./dynamips-preferences.component.scss'],
|
||||
})
|
||||
export class DynamipsPreferencesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
dynamipsPath: string;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverSettingsService: ServerSettingsService
|
||||
private serverService: ControllerService,
|
||||
private controllerSettingsService: ControllerSettingsService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -10,23 +10,23 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IosTemplate } from '../../../../models/templates/ios-template';
|
||||
import { IosConfigurationService } from '../../../../services/ios-configuration.service';
|
||||
import { IosService } from '../../../../services/ios.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { IosTemplateDetailsComponent } from './ios-template-details.component';
|
||||
|
||||
export class MockedIosService {
|
||||
public getTemplate(controller: Server, template_id: string) {
|
||||
public getTemplate(controller:Controller , template_id: string) {
|
||||
return of({} as IosTemplate);
|
||||
}
|
||||
|
||||
public saveTemplate(controller: Server, iosTemplate: IosTemplate) {
|
||||
public saveTemplate(controller:Controller , iosTemplate: IosTemplate) {
|
||||
return of(iosTemplate);
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@ describe('IosTemplateDetailsComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: IosService, useValue: mockedIosService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: IosConfigurationService, useClass: IosConfigurationService },
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IosTemplate } from '../../../../models/templates/ios-template';
|
||||
import { IosConfigurationService } from '../../../../services/ios-configuration.service';
|
||||
import { IosService } from '../../../../services/ios.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -14,7 +14,7 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./ios-template-details.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class IosTemplateDetailsComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
iosTemplate: IosTemplate;
|
||||
|
||||
isSymbolSelectionOpened: boolean = false;
|
||||
@ -37,7 +37,7 @@ export class IosTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -9,16 +9,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IosTemplate } from '../../../../models/templates/ios-template';
|
||||
import { IosService } from '../../../../services/ios.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { IosTemplatesComponent } from './ios-templates.component';
|
||||
|
||||
export class MockedIosService {
|
||||
public getTemplates(controller: Server) {
|
||||
public getTemplates(controller:Controller ) {
|
||||
return of([{} as IosTemplate]);
|
||||
}
|
||||
}
|
||||
@ -47,7 +47,7 @@ describe('IosTemplatesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: IosService, useValue: mockedIosService },
|
||||
],
|
||||
declarations: [IosTemplatesComponent],
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IosTemplate } from '../../../../models/templates/ios-template';
|
||||
import { VpcsTemplate } from '../../../../models/templates/vpcs-template';
|
||||
import { IosService } from '../../../../services/ios.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { DeleteTemplateComponent } from '../../common/delete-template-component/delete-template.component';
|
||||
|
||||
@Component({
|
||||
@ -13,20 +13,20 @@ import { DeleteTemplateComponent } from '../../common/delete-template-component/
|
||||
styleUrls: ['./ios-templates.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class IosTemplatesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
iosTemplates: IosTemplate[] = [];
|
||||
@ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -16,12 +16,12 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IouTemplate } from '../../../../models/templates/iou-template';
|
||||
import { IouConfigurationService } from '../../../../services/iou-configuration.service';
|
||||
import { IouService } from '../../../../services/iou.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
@ -29,7 +29,7 @@ import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { AddIouTemplateComponent } from './add-iou-template.component';
|
||||
|
||||
export class MockedIouService {
|
||||
public addTemplate(controller: Server, iouTemplate: IouTemplate) {
|
||||
public addTemplate(controller:Controller , iouTemplate: IouTemplate) {
|
||||
return of(iouTemplate);
|
||||
}
|
||||
}
|
||||
@ -67,7 +67,7 @@ xdescribe('AddIouTemplateComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: IouService, useValue: mockedIouService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: TemplateMocksService, useClass: TemplateMocksService },
|
||||
@ -93,7 +93,7 @@ xdescribe('AddIouTemplateComponent', () => {
|
||||
component.templateNameForm.controls['templateName'].setValue('sample name');
|
||||
component.imageForm.controls['imageName'].setValue('sample name');
|
||||
component.newImageSelected = true;
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
@ -104,7 +104,7 @@ xdescribe('AddIouTemplateComponent', () => {
|
||||
spyOn(mockedIouService, 'addTemplate').and.returnValue(of({} as IouTemplate));
|
||||
component.imageForm.controls['imageName'].setValue('sample name');
|
||||
component.newImageSelected = true;
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
@ -115,7 +115,7 @@ xdescribe('AddIouTemplateComponent', () => {
|
||||
spyOn(mockedIouService, 'addTemplate').and.returnValue(of({} as IouTemplate));
|
||||
component.templateNameForm.controls['templateName'].setValue('sample name');
|
||||
component.newImageSelected = true;
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
|
@ -9,11 +9,11 @@ import { Subscription } from 'rxjs';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Compute } from '../../../../models/compute';
|
||||
import { IouImage } from '../../../../models/iou/iou-image';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IouTemplate } from '../../../../models/templates/iou-template';
|
||||
import { ComputeService } from '../../../../services/compute.service';
|
||||
import { IouService } from '../../../../services/iou.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@ -23,7 +23,7 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./add-iou-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class AddIouTemplateComponent implements OnInit, OnDestroy {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
iouTemplate: IouTemplate;
|
||||
isRemoteComputerChosen: boolean = false;
|
||||
newImageSelected: boolean = false;
|
||||
@ -40,7 +40,7 @@ export class AddIouTemplateComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getImages();
|
||||
this.templateMocksService.getIouTemplate().subscribe((iouTemplate: IouTemplate) => {
|
||||
|
@ -2,10 +2,10 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IouTemplate } from '../../../../models/templates/iou-template';
|
||||
import { IouService } from '../../../../services/iou.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -14,14 +14,14 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./copy-iou-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class CopyIouTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
templateName: string = '';
|
||||
iouTemplate: IouTemplate;
|
||||
templateNameForm: FormGroup;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.qemuService.getTemplate(this.controller, template_id).subscribe((iouTemplate: IouTemplate) => {
|
||||
|
@ -10,23 +10,23 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IouTemplate } from '../../../../models/templates/iou-template';
|
||||
import { IouConfigurationService } from '../../../../services/iou-configuration.service';
|
||||
import { IouService } from '../../../../services/iou.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { IouTemplateDetailsComponent } from './iou-template-details.component';
|
||||
|
||||
export class MockedIouService {
|
||||
public getTemplate(controller: Server, template_id: string) {
|
||||
public getTemplate(controller:Controller , template_id: string) {
|
||||
return of({} as IouTemplate);
|
||||
}
|
||||
|
||||
public saveTemplate(controller: Server, iouTemplate: IouTemplate) {
|
||||
public saveTemplate(controller:Controller , iouTemplate: IouTemplate) {
|
||||
return of(iouTemplate);
|
||||
}
|
||||
}
|
||||
@ -55,7 +55,7 @@ describe('IouTemplateDetailsComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: IouService, useValue: mockedIouService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: IouConfigurationService, useClass: IouConfigurationService },
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IouTemplate } from '../../../../models/templates/iou-template';
|
||||
import { IouConfigurationService } from '../../../../services/iou-configuration.service';
|
||||
import { IouService } from '../../../../services/iou.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -14,7 +14,7 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./iou-template-details.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class IouTemplateDetailsComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
iouTemplate: IouTemplate;
|
||||
|
||||
isSymbolSelectionOpened: boolean = false;
|
||||
@ -29,7 +29,7 @@ export class IouTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -9,16 +9,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IouTemplate } from '../../../../models/templates/iou-template';
|
||||
import { IouService } from '../../../../services/iou.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { IouTemplatesComponent } from './iou-templates.component';
|
||||
|
||||
export class MockedIouService {
|
||||
public getTemplates(controller: Server) {
|
||||
public getTemplates(controller:Controller ) {
|
||||
return of([{} as IouTemplate]);
|
||||
}
|
||||
}
|
||||
@ -44,7 +44,7 @@ describe('IouTemplatesComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: IouService, useValue: mockedIouService },
|
||||
],
|
||||
declarations: [IouTemplatesComponent],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { IouTemplate } from '../../../../models/templates/iou-template';
|
||||
import { IouService } from '../../../../services/iou.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { DeleteTemplateComponent } from '../../common/delete-template-component/delete-template.component';
|
||||
|
||||
@Component({
|
||||
@ -12,20 +12,20 @@ import { DeleteTemplateComponent } from '../../common/delete-template-component/
|
||||
styleUrls: ['./iou-templates.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class IouTemplatesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
iouTemplates: IouTemplate[] = [];
|
||||
@ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -15,12 +15,12 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { QemuTemplate } from '../../../../models/templates/qemu-template';
|
||||
import { QemuConfigurationService } from '../../../../services/qemu-configuration.service';
|
||||
import { QemuService } from '../../../../services/qemu.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
@ -28,15 +28,15 @@ import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { AddQemuVmTemplateComponent } from './add-qemu-vm-template.component';
|
||||
|
||||
export class MockedQemuService {
|
||||
public addTemplate(controller: Server, qemuTemplate: QemuTemplate) {
|
||||
public addTemplate(controller:Controller , qemuTemplate: QemuTemplate) {
|
||||
return of(qemuTemplate);
|
||||
}
|
||||
|
||||
public getBinaries(controller: Server) {
|
||||
public getBinaries(controller:Controller ) {
|
||||
return of([]);
|
||||
}
|
||||
|
||||
public getImages(controller: Server) {
|
||||
public getImages(controller:Controller ) {
|
||||
return of([]);
|
||||
}
|
||||
}
|
||||
@ -77,7 +77,7 @@ xdescribe('AddQemuVmTemplateComponent', () => {
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: Router, useValue: router },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: QemuService, useValue: mockedQemuService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: TemplateMocksService, useClass: TemplateMocksService },
|
||||
@ -110,7 +110,7 @@ xdescribe('AddQemuVmTemplateComponent', () => {
|
||||
version: 'version',
|
||||
};
|
||||
component.newImageSelected = true;
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
@ -129,7 +129,7 @@ xdescribe('AddQemuVmTemplateComponent', () => {
|
||||
version: 'version',
|
||||
};
|
||||
component.newImageSelected = true;
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
@ -147,7 +147,7 @@ xdescribe('AddQemuVmTemplateComponent', () => {
|
||||
version: 'version',
|
||||
};
|
||||
component.newImageSelected = true;
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
|
@ -9,12 +9,12 @@ import { v4 as uuid } from 'uuid';
|
||||
import { Compute } from '../../../../models/compute';
|
||||
import { QemuBinary } from '../../../../models/qemu/qemu-binary';
|
||||
import { QemuImage } from '../../../../models/qemu/qemu-image';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { QemuTemplate } from '../../../../models/templates/qemu-template';
|
||||
import { ComputeService } from '../../../../services/compute.service';
|
||||
import { QemuConfigurationService } from '../../../../services/qemu-configuration.service';
|
||||
import { QemuService } from '../../../../services/qemu.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@ -24,7 +24,7 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./add-qemu-vm-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class AddQemuVmTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
qemuBinaries: QemuBinary[] = [];
|
||||
selectPlatform: string[] = [];
|
||||
selectedPlatform: string;
|
||||
@ -47,7 +47,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.templateMocksService.getQemuTemplate().subscribe((qemuTemplate: QemuTemplate) => {
|
||||
|
@ -3,10 +3,10 @@ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { QemuBinary } from '../../../../models/qemu/qemu-binary';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { QemuTemplate } from '../../../../models/templates/qemu-template';
|
||||
import { QemuService } from '../../../../services/qemu.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -15,7 +15,7 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./copy-qemu-vm-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class CopyQemuVmTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
qemuBinaries: QemuBinary[] = [];
|
||||
templateName: string = '';
|
||||
qemuTemplate: QemuTemplate;
|
||||
@ -23,7 +23,7 @@ export class CopyQemuVmTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.qemuService.getTemplate(this.controller, template_id).subscribe((qemuTemplate: QemuTemplate) => {
|
||||
|
@ -10,10 +10,10 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { ServerSettingsService } from '../../../../services/server-settings.service';
|
||||
import { MockedServerSettingsService } from '../../../../services/server-settings.service.spec';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerSettingsService } from '../../../../services/controller-settings.service';
|
||||
import { MockedControllerSettingsService } from '../../../../services/controller-settings.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
@ -25,7 +25,7 @@ describe('QemuPreferencesComponent', () => {
|
||||
|
||||
let mockedServerService = new MockedServerService();
|
||||
let activatedRoute = new MockedActivatedRoute().get();
|
||||
let mockedServerSettingsService = new MockedServerSettingsService();
|
||||
let mockedServerSettingsService = new MockedControllerSettingsService();
|
||||
let mockedToasterService = new MockedToasterService();
|
||||
|
||||
beforeEach(async() => {
|
||||
@ -45,8 +45,8 @@ describe('QemuPreferencesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ServerSettingsService, useValue: mockedServerSettingsService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: ControllerSettingsService, useValue: mockedServerSettingsService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
],
|
||||
declarations: [QemuPreferencesComponent],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { QemuSettings } from '../../../../models/settings/qemu-settings';
|
||||
import { ServerSettingsService } from '../../../../services/server-settings.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerSettingsService } from '../../../../services/controller-settings.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
|
||||
@Component({
|
||||
@ -12,22 +12,22 @@ import { ToasterService } from '../../../../services/toaster.service';
|
||||
styleUrls: ['./qemu-preferences.component.scss'],
|
||||
})
|
||||
export class QemuPreferencesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
settings: QemuSettings;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverSettingsService: ServerSettingsService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.serverSettingsService.getSettingsForQemu(this.controller).subscribe((settings: QemuSettings) => {
|
||||
this.controllerSettingsService.getSettingsForQemu(this.controller).subscribe((settings: QemuSettings) => {
|
||||
this.settings = settings;
|
||||
});
|
||||
});
|
||||
@ -38,7 +38,7 @@ export class QemuPreferencesComponent implements OnInit {
|
||||
this.settings.require_hardware_acceleration = false;
|
||||
}
|
||||
|
||||
this.serverSettingsService
|
||||
this.controllerSettingsService
|
||||
.updateSettingsForQemu(this.controller, this.settings)
|
||||
.subscribe((qemuSettings: QemuSettings) => {
|
||||
this.toasterService.success(`Changes applied`);
|
||||
@ -51,7 +51,7 @@ export class QemuPreferencesComponent implements OnInit {
|
||||
require_hardware_acceleration: true,
|
||||
};
|
||||
|
||||
this.serverSettingsService
|
||||
this.controllerSettingsService
|
||||
.updateSettingsForQemu(this.controller, defaultSettings)
|
||||
.subscribe((qemuSettings: QemuSettings) => {
|
||||
this.settings = qemuSettings;
|
||||
|
@ -11,31 +11,31 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { QemuTemplate } from '../../../../models/templates/qemu-template';
|
||||
import { QemuConfigurationService } from '../../../../services/qemu-configuration.service';
|
||||
import { QemuService } from '../../../../services/qemu.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { QemuVmTemplateDetailsComponent } from './qemu-vm-template-details.component';
|
||||
|
||||
export class MockedQemuService {
|
||||
public getTemplate(controller: Server, template_id: string) {
|
||||
public getTemplate(controller:Controller , template_id: string) {
|
||||
return of({} as QemuTemplate);
|
||||
}
|
||||
|
||||
public saveTemplate(controller: Server, qemuTemplate: QemuTemplate) {
|
||||
public saveTemplate(controller:Controller , qemuTemplate: QemuTemplate) {
|
||||
return of(qemuTemplate);
|
||||
}
|
||||
|
||||
public getBinaries(controller: Server) {
|
||||
public getBinaries(controller:Controller ) {
|
||||
return of([]);
|
||||
}
|
||||
|
||||
public getImages(controller: Server) {
|
||||
public getImages(controller:Controller ) {
|
||||
return of([]);
|
||||
}
|
||||
}
|
||||
@ -65,7 +65,7 @@ describe('QemuVmTemplateDetailsComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: QemuService, useValue: mockedQemuService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: QemuConfigurationService, useClass: QemuConfigurationService },
|
||||
|
@ -3,11 +3,11 @@ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { QemuBinary } from '../../../../models/qemu/qemu-binary';
|
||||
import { CustomAdapter } from '../../../../models/qemu/qemu-custom-adapter';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { QemuTemplate } from '../../../../models/templates/qemu-template';
|
||||
import { QemuConfigurationService } from '../../../../services/qemu-configuration.service';
|
||||
import { QemuService } from '../../../../services/qemu.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { CustomAdaptersComponent } from '../../common/custom-adapters/custom-adapters.component';
|
||||
|
||||
@ -17,7 +17,7 @@ import { CustomAdaptersComponent } from '../../common/custom-adapters/custom-ada
|
||||
styleUrls: ['./qemu-vm-template-details.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class QemuVmTemplateDetailsComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
qemuTemplate: QemuTemplate;
|
||||
isSymbolSelectionOpened: boolean = false;
|
||||
consoleTypes: string[] = [];
|
||||
@ -38,7 +38,7 @@ export class QemuVmTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -9,16 +9,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { QemuTemplate } from '../../../../models/templates/qemu-template';
|
||||
import { QemuService } from '../../../../services/qemu.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { QemuVmTemplatesComponent } from './qemu-vm-templates.component';
|
||||
|
||||
export class MockedQemuService {
|
||||
public getTemplates(controller: Server) {
|
||||
public getTemplates(controller:Controller ) {
|
||||
return of([{} as QemuTemplate]);
|
||||
}
|
||||
}
|
||||
@ -47,7 +47,7 @@ describe('QemuTemplatesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: QemuService, useValue: mockedQemuService },
|
||||
],
|
||||
declarations: [QemuVmTemplatesComponent],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { QemuTemplate } from '../../../../models/templates/qemu-template';
|
||||
import { QemuService } from '../../../../services/qemu.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { DeleteTemplateComponent } from '../../common/delete-template-component/delete-template.component';
|
||||
|
||||
@Component({
|
||||
@ -12,20 +12,20 @@ import { DeleteTemplateComponent } from '../../common/delete-template-component/
|
||||
styleUrls: ['./qemu-vm-templates.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class QemuVmTemplatesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
qemuTemplates: QemuTemplate[] = [];
|
||||
@ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -10,10 +10,10 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VirtualBoxTemplate } from '../../../../models/templates/virtualbox-template';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
@ -22,11 +22,11 @@ import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { AddVirtualBoxTemplateComponent } from './add-virtual-box-template.component';
|
||||
|
||||
export class MockedVirtualBoxService {
|
||||
public addTemplate(controller: Server, virtualBoxTemplate: VirtualBoxTemplate) {
|
||||
public addTemplate(controller:Controller , virtualBoxTemplate: VirtualBoxTemplate) {
|
||||
return of(virtualBoxTemplate);
|
||||
}
|
||||
|
||||
public getVirtualMachines(controller: Server) {
|
||||
public getVirtualMachines(controller:Controller ) {
|
||||
return of([]);
|
||||
}
|
||||
}
|
||||
@ -57,7 +57,7 @@ describe('AddVirtualBoxTemplateComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: VirtualBoxService, useValue: mockedVirtualBoxService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: TemplateMocksService, useClass: TemplateMocksService },
|
||||
@ -106,7 +106,7 @@ describe('AddVirtualBoxTemplateComponent', () => {
|
||||
};
|
||||
component.virtualBoxTemplate = {} as VirtualBoxTemplate;
|
||||
component.selectedVM = template;
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
component.vmForm.controls['vm'].setValue('virtual machine');
|
||||
|
||||
component.addTemplate();
|
||||
@ -116,7 +116,7 @@ describe('AddVirtualBoxTemplateComponent', () => {
|
||||
|
||||
it('should not call save template when virtual machine is not selected', () => {
|
||||
spyOn(mockedVirtualBoxService, 'addTemplate').and.returnValue(of({} as VirtualBoxTemplate));
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
|
@ -2,10 +2,10 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VirtualBoxTemplate } from '../../../../models/templates/virtualbox-template';
|
||||
import { VirtualBoxVm } from '../../../../models/virtualBox/virtual-box-vm';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { VirtualBoxService } from '../../../../services/virtual-box.service';
|
||||
@ -16,7 +16,7 @@ import { VirtualBoxService } from '../../../../services/virtual-box.service';
|
||||
styleUrls: ['./add-virtual-box-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class AddVirtualBoxTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
virtualMachines: VirtualBoxVm[];
|
||||
selectedVM: VirtualBoxVm;
|
||||
virtualBoxTemplate: VirtualBoxTemplate;
|
||||
@ -24,7 +24,7 @@ export class AddVirtualBoxTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.virtualBoxService.getVirtualMachines(this.controller).subscribe((virtualMachines: VirtualBoxVm[]) => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } 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-virtual-box-preferences',
|
||||
@ -9,14 +9,14 @@ import { ServerService } from '../../../../services/server.service';
|
||||
styleUrls: ['./virtual-box-preferences.component.scss'],
|
||||
})
|
||||
export class VirtualBoxPreferencesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
vboxManagePath: string;
|
||||
|
||||
constructor(private route: ActivatedRoute, private serverService: ServerService) {}
|
||||
constructor(private route: ActivatedRoute, private serverService: ControllerService) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { VirtualBoxPreferencesComponent } from './virtual-box-preferences.component';
|
||||
|
||||
@ -36,7 +36,7 @@ describe('VirtualBoxPreferencesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
],
|
||||
declarations: [VirtualBoxPreferencesComponent],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
|
@ -11,10 +11,10 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VirtualBoxTemplate } from '../../../../models/templates/virtualbox-template';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
import { VirtualBoxConfigurationService } from '../../../../services/virtual-box-configuration.service';
|
||||
@ -23,11 +23,11 @@ import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { VirtualBoxTemplateDetailsComponent } from './virtual-box-template-details.component';
|
||||
|
||||
export class MockedVirtualBoxService {
|
||||
public getTemplate(controller: Server, template_id: string) {
|
||||
public getTemplate(controller:Controller , template_id: string) {
|
||||
return of({} as VirtualBoxTemplate);
|
||||
}
|
||||
|
||||
public saveTemplate(controller: Server, virtualBoxTemplate: VirtualBoxTemplate) {
|
||||
public saveTemplate(controller:Controller , virtualBoxTemplate: VirtualBoxTemplate) {
|
||||
return of(virtualBoxTemplate);
|
||||
}
|
||||
}
|
||||
@ -60,7 +60,7 @@ describe('VirtualBoxTemplateDetailsComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: VirtualBoxService, useValue: mockedVirtualBoxService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: VirtualBoxConfigurationService, useClass: VirtualBoxConfigurationService },
|
||||
|
@ -2,9 +2,9 @@ import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CustomAdapter } from '../../../../models/qemu/qemu-custom-adapter';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VirtualBoxTemplate } from '../../../../models/templates/virtualbox-template';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { VirtualBoxConfigurationService } from '../../../../services/virtual-box-configuration.service';
|
||||
import { VirtualBoxService } from '../../../../services/virtual-box.service';
|
||||
@ -16,7 +16,7 @@ import { CustomAdaptersComponent } from '../../common/custom-adapters/custom-ada
|
||||
styleUrls: ['./virtual-box-template-details.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class VirtualBoxTemplateDetailsComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
virtualBoxTemplate: VirtualBoxTemplate;
|
||||
isSymbolSelectionOpened: boolean = false;
|
||||
consoleTypes: string[] = [];
|
||||
@ -33,7 +33,7 @@ export class VirtualBoxTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -9,16 +9,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VirtualBoxTemplate } from '../../../../models/templates/virtualbox-template';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { VirtualBoxService } from '../../../../services/virtual-box.service';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { VirtualBoxTemplatesComponent } from './virtual-box-templates.component';
|
||||
|
||||
export class MockedVirtualBoxService {
|
||||
public getTemplates(controller: Server) {
|
||||
public getTemplates(controller:Controller ) {
|
||||
return of([{} as VirtualBoxTemplate]);
|
||||
}
|
||||
}
|
||||
@ -47,7 +47,7 @@ describe('VirtualBoxTemplatesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: VirtualBoxService, useValue: mockedVirtualBoxService },
|
||||
],
|
||||
declarations: [VirtualBoxTemplatesComponent],
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VirtualBoxTemplate } from '../../../../models/templates/virtualbox-template';
|
||||
import { VpcsTemplate } from '../../../../models/templates/vpcs-template';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { VirtualBoxService } from '../../../../services/virtual-box.service';
|
||||
import { DeleteTemplateComponent } from '../../common/delete-template-component/delete-template.component';
|
||||
|
||||
@ -13,19 +13,19 @@ import { DeleteTemplateComponent } from '../../common/delete-template-component/
|
||||
styleUrls: ['./virtual-box-templates.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class VirtualBoxTemplatesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
virtualBoxTemplates: VirtualBoxTemplate[] = [];
|
||||
@ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: ControllerService,
|
||||
private virtualBoxService: VirtualBoxService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -2,10 +2,10 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VmwareTemplate } from '../../../../models/templates/vmware-template';
|
||||
import { VmwareVm } from '../../../../models/vmware/vmware-vm';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { VmwareService } from '../../../../services/vmware.service';
|
||||
@ -16,7 +16,7 @@ import { VmwareService } from '../../../../services/vmware.service';
|
||||
styleUrls: ['./add-vmware-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class AddVmwareTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
virtualMachines: VmwareVm[];
|
||||
selectedVM: VmwareVm;
|
||||
vmwareTemplate: VmwareTemplate;
|
||||
@ -24,7 +24,7 @@ export class AddVmwareTemplateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.vmwareService.getVirtualMachines(this.controller).subscribe((virtualMachines: VmwareVm[]) => {
|
||||
|
@ -10,11 +10,11 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VmwareTemplate } from '../../../../models/templates/vmware-template';
|
||||
import { VmwareVm } from '../../../../models/vmware/vmware-vm';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
@ -23,11 +23,11 @@ import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { AddVmwareTemplateComponent } from './add-vmware-template.component';
|
||||
|
||||
export class MockedVmwareService {
|
||||
public addTemplate(controller: Server, vmwareTemplate: VmwareTemplate) {
|
||||
public addTemplate(controller:Controller , vmwareTemplate: VmwareTemplate) {
|
||||
return of(vmwareTemplate);
|
||||
}
|
||||
|
||||
public getVirtualMachines(controller: Server) {
|
||||
public getVirtualMachines(controller:Controller ) {
|
||||
return of([]);
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@ describe('AddVmwareTemplateComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: VmwareService, useValue: mockedVmwareService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: TemplateMocksService, useClass: TemplateMocksService },
|
||||
@ -87,7 +87,7 @@ describe('AddVmwareTemplateComponent', () => {
|
||||
|
||||
component.vmwareTemplate = {} as VmwareTemplate;
|
||||
component.selectedVM = template;
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
component.templateNameForm.controls['templateName'].setValue('template name');
|
||||
|
||||
component.addTemplate();
|
||||
@ -97,7 +97,7 @@ describe('AddVmwareTemplateComponent', () => {
|
||||
|
||||
it('should not call save template when virtual machine is not selected', () => {
|
||||
spyOn(mockedVmwareService, 'addTemplate').and.returnValue(of({} as VmwareTemplate));
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
|
@ -8,8 +8,8 @@ import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { VmwarePreferencesComponent } from './vmware-preferences.component';
|
||||
|
||||
@ -36,7 +36,7 @@ describe('VmwarePreferencesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
],
|
||||
declarations: [VmwarePreferencesComponent],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } 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-vmware-preferences',
|
||||
@ -9,15 +9,15 @@ import { ServerService } from '../../../../services/server.service';
|
||||
styleUrls: ['./vmware-preferences.component.scss'],
|
||||
})
|
||||
export class VmwarePreferencesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
vmrunPath: string;
|
||||
|
||||
constructor(private route: ActivatedRoute, private serverService: ServerService) {}
|
||||
constructor(private route: ActivatedRoute, private serverService: ControllerService) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
@ -11,10 +11,10 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VmwareTemplate } from '../../../../models/templates/vmware-template';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
import { VmwareConfigurationService } from '../../../../services/vmware-configuration.service';
|
||||
@ -23,11 +23,11 @@ import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { VmwareTemplateDetailsComponent } from './vmware-template-details.component';
|
||||
|
||||
export class MockedVmwareService {
|
||||
public getTemplate(controller: Server, template_id: string) {
|
||||
public getTemplate(controller:Controller , template_id: string) {
|
||||
return of({} as VmwareTemplate);
|
||||
}
|
||||
|
||||
public saveTemplate(controller: Server, vmwareTemplate: VmwareTemplate) {
|
||||
public saveTemplate(controller:Controller , vmwareTemplate: VmwareTemplate) {
|
||||
return of(vmwareTemplate);
|
||||
}
|
||||
}
|
||||
@ -60,7 +60,7 @@ describe('VmwareTemplateDetailsComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: VmwareService, useValue: mockedVmwareService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: VmwareConfigurationService, useClass: VmwareConfigurationService },
|
||||
|
@ -2,9 +2,9 @@ import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CustomAdapter } from '../../../../models/qemu/qemu-custom-adapter';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VmwareTemplate } from '../../../../models/templates/vmware-template';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { VmwareConfigurationService } from '../../../../services/vmware-configuration.service';
|
||||
import { VmwareService } from '../../../../services/vmware.service';
|
||||
@ -16,7 +16,7 @@ import { CustomAdaptersComponent } from '../../common/custom-adapters/custom-ada
|
||||
styleUrls: ['./vmware-template-details.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class VmwareTemplateDetailsComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
vmwareTemplate: VmwareTemplate;
|
||||
generalSettingsForm: FormGroup;
|
||||
displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions'];
|
||||
@ -32,7 +32,7 @@ export class VmwareTemplateDetailsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
|
||||
this.getConfiguration();
|
||||
|
@ -9,16 +9,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VmwareTemplate } from '../../../../models/templates/vmware-template';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { VmwareService } from '../../../../services/vmware.service';
|
||||
import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { VmwareTemplatesComponent } from './vmware-templates.component';
|
||||
|
||||
export class MockedVmwareService {
|
||||
public getTemplates(controller: Server) {
|
||||
public getTemplates(controller:Controller ) {
|
||||
return of([{} as VmwareTemplate]);
|
||||
}
|
||||
}
|
||||
@ -47,7 +47,7 @@ describe('VmwareTemplatesComponent', () => {
|
||||
provide: ActivatedRoute,
|
||||
useValue: activatedRoute,
|
||||
},
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: VmwareService, useValue: mockedVmwareService },
|
||||
],
|
||||
declarations: [VmwareTemplatesComponent],
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VmwareTemplate } from '../../../../models/templates/vmware-template';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { VmwareService } from '../../../../services/vmware.service';
|
||||
import { DeleteTemplateComponent } from '../../common/delete-template-component/delete-template.component';
|
||||
|
||||
@ -12,19 +12,19 @@ import { DeleteTemplateComponent } from '../../common/delete-template-component/
|
||||
styleUrls: ['./vmware-templates.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class VmwareTemplatesComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
vmwareTemplates: VmwareTemplate[] = [];
|
||||
@ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: ControllerService,
|
||||
private vmwareService: VmwareService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const controller_id = this.route.snapshot.paramMap.get('controller_id');
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
this.getTemplates();
|
||||
});
|
||||
|
@ -10,11 +10,11 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VpcsTemplate } from '../../../../models/templates/vpcs-template';
|
||||
import { ComputeService } from '../../../../services/compute.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { MockedServerService } from '../../../../services/server.service.spec';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { MockedServerService } from '../../../../services/controller.service.spec';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { MockedToasterService } from '../../../../services/toaster.service.spec';
|
||||
@ -23,13 +23,13 @@ import { MockedActivatedRoute } from '../../preferences.component.spec';
|
||||
import { AddVpcsTemplateComponent } from './add-vpcs-template.component';
|
||||
|
||||
export class MockedComputeService {
|
||||
getComputes(controller: Server) {
|
||||
getComputes(controller:Controller ) {
|
||||
return of([]);
|
||||
}
|
||||
}
|
||||
|
||||
export class MockedVpcsService {
|
||||
public addTemplate(controller: Server, vpcsTemplate: VpcsTemplate) {
|
||||
public addTemplate(controller:Controller , vpcsTemplate: VpcsTemplate) {
|
||||
return of(vpcsTemplate);
|
||||
}
|
||||
}
|
||||
@ -61,7 +61,7 @@ describe('AddVpcsTemplateComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: activatedRoute },
|
||||
{ provide: ServerService, useValue: mockedServerService },
|
||||
{ provide: ControllerService, useValue: mockedServerService },
|
||||
{ provide: VpcsService, useValue: mockedVpcsService },
|
||||
{ provide: ToasterService, useValue: mockedToasterService },
|
||||
{ provide: ComputeService, useValue: mockedComputeService },
|
||||
@ -86,7 +86,7 @@ describe('AddVpcsTemplateComponent', () => {
|
||||
spyOn(mockedVpcsService, 'addTemplate').and.returnValue(of({} as VpcsTemplate));
|
||||
component.templateName = 'sample name';
|
||||
component.templateNameForm.controls['templateName'].setValue('template name');
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
@ -97,7 +97,7 @@ describe('AddVpcsTemplateComponent', () => {
|
||||
spyOn(mockedVpcsService, 'addTemplate').and.returnValue(of({} as VpcsTemplate));
|
||||
spyOn(mockedToasterService, 'error');
|
||||
component.templateName = ' ';
|
||||
component.controller = { id: 1 } as Server;
|
||||
component.controller = { id: 1 } as Controller ;
|
||||
|
||||
component.addTemplate();
|
||||
|
||||
|
@ -3,10 +3,10 @@ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { Compute } from '../../../../models/compute';
|
||||
import { Server } from '../../../../models/server';
|
||||
import{ Controller } from '../../../../models/controller';
|
||||
import { VpcsTemplate } from '../../../../models/templates/vpcs-template';
|
||||
import { ComputeService } from '../../../../services/compute.service';
|
||||
import { ServerService } from '../../../../services/server.service';
|
||||
import { ControllerService } from '../../../../services/controller.service';
|
||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||
import { ToasterService } from '../../../../services/toaster.service';
|
||||
import { VpcsService } from '../../../../services/vpcs.service';
|
||||
@ -17,14 +17,14 @@ import { VpcsService } from '../../../../services/vpcs.service';
|
||||
styleUrls: ['./add-vpcs-template.component.scss', '../../preferences.component.scss'],
|
||||
})
|
||||
export class AddVpcsTemplateComponent implements OnInit {
|
||||
controller: Server;
|
||||
controller:Controller ;
|
||||
templateName: string = '';
|
||||
templateNameForm: FormGroup;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private serverService: ServerService,
|
||||
private serverService: 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: Server) => {
|
||||
this.serverService.get(parseInt(controller_id, 10)).then((controller:Controller ) => {
|
||||
this.controller = controller;
|
||||
});
|
||||
}
|
||||
|
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