mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-25 01:19:11 +00:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
67b597d8ec | |||
7fd37610ee | |||
c8ccf4d475 | |||
1a49bec3d4 | |||
64f9631946 | |||
b02fe4c751 | |||
84169a2c1e | |||
2a9ced5cbd | |||
7c7e20d95f | |||
e959a947cc | |||
7b633c29dd | |||
ee5b88e19a |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gns3-web-ui",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.3",
|
||||
"author": {
|
||||
"name": "GNS3 Technology Inc.",
|
||||
"email": "developers@gns3.com"
|
||||
|
@ -142,7 +142,7 @@ export class ImportApplianceComponent implements OnInit {
|
||||
}
|
||||
this.template = template;
|
||||
|
||||
const url = this.getUploadPath(this.controller, template.template_type, name);
|
||||
const url = this.getUploadPath(this.controller, name);
|
||||
this.uploader.queue.forEach((elem) => (elem.url = url));
|
||||
const itemToUpload = this.uploader.queue[0];
|
||||
this.uploader.uploadItem(itemToUpload);
|
||||
@ -150,7 +150,7 @@ export class ImportApplianceComponent implements OnInit {
|
||||
fileReader.readAsText(file);
|
||||
}
|
||||
|
||||
private getUploadPath(controller:Controller , emulator: string, filename: string) {
|
||||
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/${emulator}/images/${filename}`;
|
||||
private getUploadPath(controller:Controller , filename: string) {
|
||||
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/images/upload/${filename}`;
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,7 @@
|
||||
<mat-card [hidden]="!(!isLinuxPlatform || applianceToInstall.dynamips)">
|
||||
<div *ngIf="applianceToInstall.qemu">
|
||||
<div>
|
||||
Install required files
|
||||
Install the required files
|
||||
<button
|
||||
mat-icon-button
|
||||
matTooltip="Refresh list of images"
|
||||
@ -380,11 +380,11 @@
|
||||
{{ image.filename }}
|
||||
</span>
|
||||
<div>
|
||||
<span *ngIf="checkImageFromVersion(image.filename)"
|
||||
><mat-icon matTooltip="Ready to install" matTooltipClass="custom-tooltip">check</mat-icon>
|
||||
<span *ngIf="checkImageFromVersion(image.filename)">
|
||||
<mat-icon matTooltip="Ready to install" matTooltipClass="custom-tooltip">check</mat-icon>
|
||||
</span>
|
||||
<span *ngIf="!checkImageFromVersion(image.filename)"
|
||||
><mat-icon matTooltip="Missing" matTooltipClass="custom-tooltip">close</mat-icon>
|
||||
<span *ngIf="!checkImageFromVersion(image.filename)">
|
||||
<mat-icon matTooltip="Missing" matTooltipClass="custom-tooltip">close</mat-icon>
|
||||
</span>
|
||||
<input
|
||||
type="file"
|
||||
@ -407,7 +407,7 @@
|
||||
|
||||
<div *ngIf="applianceToInstall.iou">
|
||||
<div>
|
||||
Install required images
|
||||
Install the required images
|
||||
<button
|
||||
mat-icon-button
|
||||
matTooltip="Refresh list of images"
|
||||
@ -419,16 +419,16 @@
|
||||
<mat-list>
|
||||
<mat-list-item *ngFor="let image of applianceToInstall.images">
|
||||
<div class="list-item">
|
||||
<div>
|
||||
<span>
|
||||
{{ image.filename }}
|
||||
</div>
|
||||
</span>
|
||||
<span *ngIf="checkImageFromVersion(image.filename)">
|
||||
<mat-icon matTooltip="Ready to install" matTooltipClass="custom-tooltip">check</mat-icon>
|
||||
</span>
|
||||
<span *ngIf="!checkImageFromVersion(image.filename)">
|
||||
<mat-icon matTooltip="Missing" matTooltipClass="custom-tooltip">close</mat-icon>
|
||||
</span>
|
||||
<div>
|
||||
<span *ngIf="checkImageFromVersion(image.filename)"
|
||||
><mat-icon matTooltip="Ready to install" matTooltipClass="custom-tooltip">check</mat-icon>
|
||||
</span>
|
||||
<span *ngIf="!checkImageFromVersion(image.filename)"
|
||||
><mat-icon matTooltip="Missing" matTooltipClass="custom-tooltip">close</mat-icon>
|
||||
</span>
|
||||
<input
|
||||
type="file"
|
||||
class="non-visible"
|
||||
|
@ -266,7 +266,7 @@ export class NewTemplateDialogComponent implements OnInit {
|
||||
if (appliance.iou) emulator = 'iou';
|
||||
if (appliance.qemu) emulator = 'qemu';
|
||||
|
||||
const url = this.applianceService.getUploadPath(this.controller, emulator, fileName);
|
||||
const url = this.applianceService.getUploadPath(this.controller, fileName);
|
||||
this.uploader.queue.forEach((elem) => (elem.url = url));
|
||||
|
||||
const itemToUpload = this.uploader.queue[0];
|
||||
@ -381,7 +381,7 @@ export class NewTemplateDialogComponent implements OnInit {
|
||||
if (this.applianceToInstall.dynamips) emulator = 'dynamips';
|
||||
if (this.applianceToInstall.iou) emulator = 'iou';
|
||||
|
||||
const url = this.applianceService.getUploadPath(this.controller, emulator, imageName);
|
||||
const url = this.applianceService.getUploadPath(this.controller, imageName);
|
||||
this.uploaderImage.queue.forEach((elem) => (elem.url = url));
|
||||
|
||||
const itemToUpload = this.uploaderImage.queue[0];
|
||||
|
@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
|
||||
@Injectable()
|
||||
export class ProjectNameValidator {
|
||||
get(projectName) {
|
||||
var pattern = new RegExp(/[~`!#$%\^&*+=\[\]\\';,/{}|\\":<>\?]/);
|
||||
var pattern = new RegExp(/[~`!#$%\^&*+=\[\]\\';,/{}|\\"<>\?]/);
|
||||
|
||||
if (!pattern.test(projectName.value)) {
|
||||
return null;
|
||||
|
@ -17,8 +17,8 @@ export class ApplianceService {
|
||||
return this.httpController.get<Appliance>(controller, url) as Observable<Appliance>;
|
||||
}
|
||||
|
||||
getUploadPath(controller:Controller , emulator: string, filename: string) {
|
||||
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/images/upload/${filename}?allow_raw_image=true`;
|
||||
getUploadPath(controller:Controller, filename: string) {
|
||||
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/images/upload/${filename}`;
|
||||
}
|
||||
|
||||
updateAppliances(controller:Controller ): Observable<Appliance[]> {
|
||||
|
@ -14,10 +14,6 @@ export class ComputeService {
|
||||
return this.httpController.get<Compute[]>(controller, '/computes') as Observable<Compute[]>;
|
||||
}
|
||||
|
||||
getUploadPath(controller:Controller , emulator: string, filename: string) {
|
||||
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/${emulator}/images/${filename}`;
|
||||
}
|
||||
|
||||
getStatistics(controller:Controller ): Observable<ComputeStatistics[]> {
|
||||
return this.httpController.get(controller, `/statistics`);
|
||||
}
|
||||
|
@ -20,10 +20,6 @@ export class ImageManagerService {
|
||||
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/images/upload/${image_path}?install_appliances=${install_appliance}`;
|
||||
}
|
||||
|
||||
getUploadPath(controller:Controller , emulator: string, filename: string) {
|
||||
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/images/upload/${filename}`;
|
||||
}
|
||||
|
||||
uploadedImage(controller :Controller, install_appliance, image_path, flie){
|
||||
return this.httpController.post<Image[]>(controller, `/images/upload/${image_path}?install_appliances=${install_appliance}`,flie) as Observable<Image[]>;
|
||||
}
|
||||
|
Reference in New Issue
Block a user