diff --git a/src/app/components/direct-link/direct-link.component.ts b/src/app/components/direct-link/direct-link.component.ts
index 6476d749..09d792b9 100644
--- a/src/app/components/direct-link/direct-link.component.ts
+++ b/src/app/components/direct-link/direct-link.component.ts
@@ -23,8 +23,8 @@ export class DirectLinkComponent implements OnInit {
{ key: 'basic', name: 'Basic authorization' },
];
protocols = [
- { key: 'http:', name: 'HTTP' },
- { key: 'https:', name: 'HTTPS' },
+ { key: 'http', name: 'HTTP' },
+ { key: 'https', name: 'HTTPS' },
];
locations = [
{ key: 'local', name: 'Local' },
@@ -34,7 +34,7 @@ export class DirectLinkComponent implements OnInit {
serverForm = new FormGroup({
name: new FormControl('', [Validators.required]),
location: new FormControl(''),
- protocol: new FormControl('http:'),
+ protocol: new FormControl('http'),
authorization: new FormControl('none'),
login: new FormControl(''),
password: new FormControl(''),
diff --git a/src/app/components/preferences/common/symbols/symbols.component.ts b/src/app/components/preferences/common/symbols/symbols.component.ts
index 7dbbb527..7cc5a265 100644
--- a/src/app/components/preferences/common/symbols/symbols.component.ts
+++ b/src/app/components/preferences/common/symbols/symbols.component.ts
@@ -72,11 +72,11 @@ export class SymbolsComponent implements OnInit {
}
private createSvgFileForImage(image: string | ArrayBuffer, imageToUpload: HTMLImageElement) {
- return ``;
}
getImageSourceForTemplate(symbol: string) {
- return `${this.server.protocol}//${this.server.host}:${this.server.port}/v2/symbols/${symbol}/raw`;
+ return `${this.server.protocol}://${this.server.host}:${this.server.port}/v2/symbols/${symbol}/raw`;
}
}
diff --git a/src/app/components/project-map/import-appliance/import-appliance.component.ts b/src/app/components/project-map/import-appliance/import-appliance.component.ts
index 1b827f15..e0e35854 100644
--- a/src/app/components/project-map/import-appliance/import-appliance.component.ts
+++ b/src/app/components/project-map/import-appliance/import-appliance.component.ts
@@ -150,6 +150,6 @@ export class ImportApplianceComponent implements OnInit {
}
private getUploadPath(server: Server, emulator: string, filename: string) {
- return `${server.protocol}//${server.host}:${server.port}/v2/${emulator}/images/${filename}`;
+ return `${server.protocol}://${server.host}:${server.port}/v2/${emulator}/images/${filename}`;
}
}
diff --git a/src/app/components/project-map/project-map.component.ts b/src/app/components/project-map/project-map.component.ts
index 3f2ce336..5119e634 100644
--- a/src/app/components/project-map/project-map.component.ts
+++ b/src/app/components/project-map/project-map.component.ts
@@ -174,7 +174,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
private nodeConsoleService: NodeConsoleService,
private symbolService: SymbolService,
private cd: ChangeDetectorRef,
- private cfr: ComponentFactoryResolver,
+ private cfr: ComponentFactoryResolver,
private injector: Injector
) {}
@@ -229,7 +229,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
this.instance.instance.ngOnDestroy();
this.instance.destroy();
}
- }
+ }
}
addSubscriptions() {
@@ -250,7 +250,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
this.nodesDataSource.changes.subscribe((nodes: Node[]) => {
if (!this.server) return;
nodes.forEach(async (node: Node) => {
- node.symbol_url = `${this.server.protocol}//${this.server.host}:${this.server.port}/v2/symbols/${node.symbol}/raw`;
+ node.symbol_url = `${this.server.protocol}://${this.server.host}:${this.server.port}/v2/symbols/${node.symbol}/raw`;
// if (node.width == 0 && node.height == 0) {
// let symbolDimensions = await this.symbolService.getDimensions(this.server, node.symbol).toPromise();
@@ -990,8 +990,8 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
fileReader.onloadend = () => {
let image = fileReader.result;
- let svg = ``;
this.drawingService
.add(this.server, this.project.project_id, -(imageToUpload.width / 2), -(imageToUpload.height / 2), svg)
diff --git a/src/app/components/servers/add-server-dialog/add-server-dialog.component.ts b/src/app/components/servers/add-server-dialog/add-server-dialog.component.ts
index 46f2ebdd..ad99d8da 100644
--- a/src/app/components/servers/add-server-dialog/add-server-dialog.component.ts
+++ b/src/app/components/servers/add-server-dialog/add-server-dialog.component.ts
@@ -16,8 +16,8 @@ export class AddServerDialogComponent implements OnInit {
{ key: 'basic', name: 'Basic authorization' },
];
protocols = [
- { key: 'http:', name: 'HTTP' },
- { key: 'https:', name: 'HTTPS' },
+ { key: 'http', name: 'HTTP' },
+ { key: 'https', name: 'HTTPS' },
];
locations = [];
@@ -28,7 +28,7 @@ export class AddServerDialogComponent implements OnInit {
ubridge_path: new FormControl(''),
host: new FormControl('', [Validators.required]),
port: new FormControl('', [Validators.required, Validators.min(1)]),
- protocol: new FormControl('http:'),
+ protocol: new FormControl('http'),
authorization: new FormControl('none'),
login: new FormControl(''),
password: new FormControl(''),
diff --git a/src/app/components/template/template.component.ts b/src/app/components/template/template.component.ts
index 4fc6a705..8ea90dae 100644
--- a/src/app/components/template/template.component.ts
+++ b/src/app/components/template/template.component.ts
@@ -142,10 +142,10 @@ export class TemplateComponent implements OnInit, OnDestroy {
}
getImageSourceForTemplate(template: Template) {
- return `${this.server.protocol}//${this.server.host}:${this.server.port}/v2/symbols/${template.symbol}/raw`;
+ return `${this.server.protocol}://${this.server.host}:${this.server.port}/v2/symbols/${template.symbol}/raw`;
}
ngOnDestroy() {
this.subscription.unsubscribe();
}
-}
\ No newline at end of file
+}
diff --git a/src/app/models/server.ts b/src/app/models/server.ts
index c4419de4..ab8b0f4f 100644
--- a/src/app/models/server.ts
+++ b/src/app/models/server.ts
@@ -1,7 +1,7 @@
export type ServerAuthorization = 'basic' | 'none';
export type ServerLocation = 'local' | 'remote' | 'bundled';
export type ServerStatus = 'stopped' | 'starting' | 'running';
-export type ServerProtocol = 'http:' | 'https:';
+export type ServerProtocol = 'http' | 'https';
export class Server {
id: number;
diff --git a/src/app/services/appliances.service.ts b/src/app/services/appliances.service.ts
index d9bff93d..ffecf084 100644
--- a/src/app/services/appliances.service.ts
+++ b/src/app/services/appliances.service.ts
@@ -17,7 +17,7 @@ export class ApplianceService {
}
getUploadPath(server: Server, emulator: string, filename: string) {
- return `${server.protocol}//${server.host}:${server.port}/v2/compute/${emulator}/images/${filename}`;
+ return `${server.protocol}://${server.host}:${server.port}/v2/compute/${emulator}/images/${filename}`;
}
updateAppliances(server: Server): Observable {
diff --git a/src/app/services/compute.service.ts b/src/app/services/compute.service.ts
index ab8c1d7f..ef42f6f5 100644
--- a/src/app/services/compute.service.ts
+++ b/src/app/services/compute.service.ts
@@ -14,7 +14,7 @@ export class ComputeService {
}
getUploadPath(server: Server, emulator: string, filename: string) {
- return `${server.protocol}//${server.host}:${server.port}/v2/${emulator}/images/${filename}`;
+ return `${server.protocol}://${server.host}:${server.port}/v2/${emulator}/images/${filename}`;
}
getStatistics(server: Server): Observable {
diff --git a/src/app/services/http-server.service.ts b/src/app/services/http-server.service.ts
index 3e1ad74c..7e3709ea 100644
--- a/src/app/services/http-server.service.ts
+++ b/src/app/services/http-server.service.ts
@@ -178,7 +178,7 @@ export class HttpServer {
if (!server.protocol) {
server.protocol = location.protocol as ServerProtocol;
}
- url = `${server.protocol}//${server.host}:${server.port}/v2${url}`;
+ url = `${server.protocol}://${server.host}:${server.port}/v2${url}`;
} else {
url = `/v2${url}`;
}
diff --git a/src/app/services/ios.service.ts b/src/app/services/ios.service.ts
index 8880d7f0..60e9836d 100644
--- a/src/app/services/ios.service.ts
+++ b/src/app/services/ios.service.ts
@@ -14,7 +14,7 @@ export class IosService {
}
getImagePath(server: Server, filename: string): string {
- return `${server.protocol}//${server.host}:${server.port}/v2/compute/dynamips/images/${filename}`;
+ return `${server.protocol}://${server.host}:${server.port}/v2/compute/dynamips/images/${filename}`;
}
getTemplates(server: Server): Observable {
diff --git a/src/app/services/iou.service.ts b/src/app/services/iou.service.ts
index 064555d9..b422deb3 100644
--- a/src/app/services/iou.service.ts
+++ b/src/app/services/iou.service.ts
@@ -22,7 +22,7 @@ export class IouService {
}
getImagePath(server: Server, filename: string): string {
- return `${server.protocol}//${server.host}:${server.port}/v2/compute/iou/images/${filename}`;
+ return `${server.protocol}://${server.host}:${server.port}/v2/compute/iou/images/${filename}`;
}
addTemplate(server: Server, iouTemplate: any): Observable {
diff --git a/src/app/services/nodeConsole.service.ts b/src/app/services/nodeConsole.service.ts
index 9cdd1e63..e5efd26f 100644
--- a/src/app/services/nodeConsole.service.ts
+++ b/src/app/services/nodeConsole.service.ts
@@ -67,7 +67,7 @@ export class NodeConsoleService {
getUrl(server: Server, node: Node) {
let protocol:string = "ws"
- if (server.protocol === "https:") {
+ if (server.protocol === "https") {
protocol = "wss"
}
diff --git a/src/app/services/notification.service.ts b/src/app/services/notification.service.ts
index e99bc78b..8b6b022b 100644
--- a/src/app/services/notification.service.ts
+++ b/src/app/services/notification.service.ts
@@ -5,17 +5,17 @@ import { Server } from '../models/server';
export class NotificationService {
notificationsPath(server: Server): string {
let protocol:string = "ws"
- if (server.protocol === "https:") {
+ if (server.protocol === "https") {
protocol = "wss"
}
return `${protocol}://${server.host}:${server.port}/v2/notifications/ws`;
}
-
+
projectNotificationsPath(server: Server, project_id: string): string {
let protocol:string = "ws"
- if (server.protocol === "https:") {
+ if (server.protocol === "https") {
protocol = "wss"
}
diff --git a/src/app/services/project.service.ts b/src/app/services/project.service.ts
index 2f6a9625..83de638e 100644
--- a/src/app/services/project.service.ts
+++ b/src/app/services/project.service.ts
@@ -75,11 +75,11 @@ export class ProjectService {
}
getUploadPath(server: Server, uuid: string, project_name: string) {
- return `${server.protocol}//${server.host}:${server.port}/v2/projects/${uuid}/import?name=${project_name}`;
+ return `${server.protocol}://${server.host}:${server.port}/v2/projects/${uuid}/import?name=${project_name}`;
}
getExportPath(server: Server, project: Project) {
- return `${server.protocol}//${server.host}:${server.port}/v2/projects/${project.project_id}/export`;
+ return `${server.protocol}://${server.host}:${server.port}/v2/projects/${project.project_id}/export`;
}
export(server: Server, project_id: string): Observable {
diff --git a/src/app/services/qemu.service.ts b/src/app/services/qemu.service.ts
index 924a944d..e934629a 100644
--- a/src/app/services/qemu.service.ts
+++ b/src/app/services/qemu.service.ts
@@ -20,7 +20,7 @@ export class QemuService {
}
getImagePath(server: Server, filename: string): string {
- return `${server.protocol}//${server.host}:${server.port}/v2/compute/qemu/images/${filename}`;
+ return `${server.protocol}://${server.host}:${server.port}/v2/compute/qemu/images/${filename}`;
}
getBinaries(server: Server): Observable {
diff --git a/src/app/services/server.service.ts b/src/app/services/server.service.ts
index f40f57a3..9bbb6316 100644
--- a/src/app/services/server.service.ts
+++ b/src/app/services/server.service.ts
@@ -83,7 +83,7 @@ export class ServerService {
}
public getServerUrl(server: Server) {
- return `${server.protocol}//${server.host}:${server.port}/`;
+ return `${server.protocol}://${server.host}:${server.port}/`;
}
public checkServerVersion(server: Server): Observable {
diff --git a/src/app/services/testing.ts b/src/app/services/testing.ts
index 04e76f4e..e10de341 100644
--- a/src/app/services/testing.ts
+++ b/src/app/services/testing.ts
@@ -5,6 +5,6 @@ export function getTestServer(): Server {
server.host = '127.0.0.1';
server.port = 3080;
server.authorization = 'none';
- server.protocol = 'http:';
+ server.protocol = 'http';
return server;
}