mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-16 22:08:08 +00:00
Review fixes
This commit is contained in:
@ -162,6 +162,7 @@ import { CopyDockerTemplateComponent } from './components/preferences/docker/cop
|
|||||||
import { EmptyTemplatesListComponent } from './components/preferences/common/empty-templates-list/empty-templates-list.component';
|
import { EmptyTemplatesListComponent } from './components/preferences/common/empty-templates-list/empty-templates-list.component';
|
||||||
import { SymbolsMenuComponent } from './components/preferences/common/symbols-menu/symbols-menu.component';
|
import { SymbolsMenuComponent } from './components/preferences/common/symbols-menu/symbols-menu.component';
|
||||||
import { SearchFilter } from './filters/searchFilter.pipe';
|
import { SearchFilter } from './filters/searchFilter.pipe';
|
||||||
|
import { RecentlyOpenedProjectService } from './services/recentlyOpenedProject.service';
|
||||||
|
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
||||||
@ -330,7 +331,8 @@ if (environment.production) {
|
|||||||
DockerService,
|
DockerService,
|
||||||
DockerConfigurationService,
|
DockerConfigurationService,
|
||||||
IouService,
|
IouService,
|
||||||
IouConfigurationService
|
IouConfigurationService,
|
||||||
|
RecentlyOpenedProjectService
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
AddServerDialogComponent,
|
AddServerDialogComponent,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<h1>Installed software</h1>
|
<h1>Installed software</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="default-content">
|
<div class="default-content">
|
||||||
<div class="example-container mat-elevation-z8">
|
<div class="container mat-elevation-z8">
|
||||||
<mat-table #table [dataSource]="dataSource">
|
<mat-table #table [dataSource]="dataSource">
|
||||||
|
|
||||||
<ng-container matColumnDef="name">
|
<ng-container matColumnDef="name">
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="default-content">
|
<div class="default-content">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list>
|
<mat-nav-list>
|
||||||
<mat-list-item routerLink="/server/{{serverId}}/preferences/builtin/ethernet-hubs">
|
<mat-list-item routerLink="/server/{{serverId}}/preferences/builtin/ethernet-hubs">
|
||||||
Ethernet hubs
|
Ethernet hubs
|
||||||
|
@ -8,13 +8,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<app-empty-templates-list *ngIf="!cloudNodesTemplates.length"></app-empty-templates-list>
|
<app-empty-templates-list *ngIf="!cloudNodesTemplates.length"></app-empty-templates-list>
|
||||||
<div class="default-content" *ngIf="cloudNodesTemplates.length">
|
<div class="default-content" *ngIf="cloudNodesTemplates.length">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list *ngIf="server">
|
<mat-nav-list *ngIf="server">
|
||||||
<div class="list-item" *ngFor='let template of cloudNodesTemplates'>
|
<div class="list-item" *ngFor='let template of cloudNodesTemplates'>
|
||||||
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
||||||
<button class="delete-button" mat-icon-button (click)="deleteTemplate(template)">
|
<button mat-button class="menu-button" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
<mat-menu #menu="matMenu">
|
||||||
|
<button mat-menu-item (click)="deleteTemplate(template)">
|
||||||
|
<mat-icon>delete</mat-icon><span>Delete</span>
|
||||||
|
</button>
|
||||||
|
</mat-menu>
|
||||||
</div>
|
</div>
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,7 +32,6 @@ export class CloudNodesTemplatesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTemplates() {
|
getTemplates() {
|
||||||
this.cloudNodesTemplates = [];
|
|
||||||
this.builtInTemplatesService.getTemplates(this.server).subscribe((cloudNodesTemplates: CloudTemplate[]) => {
|
this.builtInTemplatesService.getTemplates(this.server).subscribe((cloudNodesTemplates: CloudTemplate[]) => {
|
||||||
this.cloudNodesTemplates = cloudNodesTemplates.filter((elem) => elem.template_type === "cloud" && !elem.builtin);
|
this.cloudNodesTemplates = cloudNodesTemplates.filter((elem) => elem.template_type === "cloud" && !elem.builtin);
|
||||||
});
|
});
|
||||||
|
@ -8,13 +8,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<app-empty-templates-list *ngIf="!ethernetHubsTemplates.length"></app-empty-templates-list>
|
<app-empty-templates-list *ngIf="!ethernetHubsTemplates.length"></app-empty-templates-list>
|
||||||
<div class="default-content" *ngIf="ethernetHubsTemplates.length">
|
<div class="default-content" *ngIf="ethernetHubsTemplates.length">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list *ngIf="server">
|
<mat-nav-list *ngIf="server">
|
||||||
<div class="list-item" *ngFor='let template of ethernetHubsTemplates'>
|
<div class="list-item" *ngFor='let template of ethernetHubsTemplates'>
|
||||||
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
||||||
<button class="delete-button" mat-icon-button (click)="deleteTemplate(template)">
|
<button mat-button class="menu-button" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
<mat-menu #menu="matMenu">
|
||||||
|
<button mat-menu-item (click)="deleteTemplate(template)">
|
||||||
|
<mat-icon>delete</mat-icon><span>Delete</span>
|
||||||
|
</button>
|
||||||
|
</mat-menu>
|
||||||
</div>
|
</div>
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,7 +32,6 @@ export class EthernetHubsTemplatesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTemplates() {
|
getTemplates() {
|
||||||
this.ethernetHubsTemplates = [];
|
|
||||||
this.builtInTemplatesService.getTemplates(this.server).subscribe((ethernetHubsTemplates: EthernetHubTemplate[]) => {
|
this.builtInTemplatesService.getTemplates(this.server).subscribe((ethernetHubsTemplates: EthernetHubTemplate[]) => {
|
||||||
this.ethernetHubsTemplates = ethernetHubsTemplates.filter((elem) => elem.template_type === "ethernet_hub" && !elem.builtin);
|
this.ethernetHubsTemplates = ethernetHubsTemplates.filter((elem) => elem.template_type === "ethernet_hub" && !elem.builtin);
|
||||||
});
|
});
|
||||||
|
@ -8,13 +8,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<app-empty-templates-list *ngIf="!ethernetSwitchesTemplates.length"></app-empty-templates-list>
|
<app-empty-templates-list *ngIf="!ethernetSwitchesTemplates.length"></app-empty-templates-list>
|
||||||
<div class="default-content" *ngIf="ethernetSwitchesTemplates.length">
|
<div class="default-content" *ngIf="ethernetSwitchesTemplates.length">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list *ngIf="server">
|
<mat-nav-list *ngIf="server">
|
||||||
<div class="list-item" *ngFor='let template of ethernetSwitchesTemplates'>
|
<div class="list-item" *ngFor='let template of ethernetSwitchesTemplates'>
|
||||||
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
||||||
<button class="delete-button" mat-icon-button (click)="deleteTemplate(template)">
|
<button mat-button class="menu-button" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
<mat-menu #menu="matMenu">
|
||||||
|
<button mat-menu-item (click)="deleteTemplate(template)">
|
||||||
|
<mat-icon>delete</mat-icon><span>Delete</span>
|
||||||
|
</button>
|
||||||
|
</mat-menu>
|
||||||
</div>
|
</div>
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,7 +32,6 @@ export class EthernetSwitchesTemplatesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTemplates() {
|
getTemplates() {
|
||||||
this.ethernetSwitchesTemplates = [];
|
|
||||||
this.builtInTemplatesService.getTemplates(this.server).subscribe((ethernetSwitchesTemplates: EthernetSwitchTemplate[]) => {
|
this.builtInTemplatesService.getTemplates(this.server).subscribe((ethernetSwitchesTemplates: EthernetSwitchTemplate[]) => {
|
||||||
this.ethernetSwitchesTemplates = ethernetSwitchesTemplates.filter((elem) => elem.template_type === "ethernet_switch" && !elem.builtin);
|
this.ethernetSwitchesTemplates = ethernetSwitchesTemplates.filter((elem) => elem.template_type === "ethernet_switch" && !elem.builtin);
|
||||||
});
|
});
|
||||||
|
@ -1,9 +1,15 @@
|
|||||||
<span>Are you sure you want to delete template {{templateName}}?</span>
|
<div class="dialogcontainer">
|
||||||
<div mat-dialog-actions>
|
<h1 mat-dialog-title>Delete template</h1>
|
||||||
|
<div mat-dialog-content>Are you sure you want to delete template {{templateName}}?</div>
|
||||||
|
|
||||||
|
<div class="spacer"></div>
|
||||||
|
|
||||||
|
<div mat-dialog-actions>
|
||||||
<button mat-button class="cancelButton" (click)="onNoClick()" color="accent">
|
<button mat-button class="cancelButton" (click)="onNoClick()" color="accent">
|
||||||
No
|
No
|
||||||
</button>
|
</button>
|
||||||
<button mat-button class="confirmButton" (click)="onYesClick()" tabindex="2" mat-raised-button color="primary">
|
<button mat-button class="confirmButton" (click)="onYesClick()" tabindex="2" mat-raised-button color="primary">
|
||||||
Yes
|
Yes
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
.dialogcontainer {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spacer {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
@ -23,7 +23,7 @@ export class DeleteTemplateComponent {
|
|||||||
deleteItem(templateName, templateId) {
|
deleteItem(templateName, templateId) {
|
||||||
const dialogRef = this.dialog.open(DeleteConfirmationDialogComponent, {
|
const dialogRef = this.dialog.open(DeleteConfirmationDialogComponent, {
|
||||||
width: '300px',
|
width: '300px',
|
||||||
height: '150px',
|
height: '250px',
|
||||||
data: {
|
data: {
|
||||||
templateName: templateName
|
templateName: templateName
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
<h6 class="header">
|
<div class="default-content">
|
||||||
|
<mat-card class="matCard">
|
||||||
|
<h6 class="header">
|
||||||
{{emptyTemplatesListMessage}}
|
{{emptyTemplatesListMessage}}
|
||||||
</h6>
|
</h6>
|
||||||
|
</mat-card>
|
||||||
|
</div>
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
.header {
|
.header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
color: darkgray;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Component } from "@angular/core";
|
import { Component, Input } from "@angular/core";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -7,5 +7,12 @@ import { Component } from "@angular/core";
|
|||||||
styleUrls: ['./empty-templates-list.component.scss']
|
styleUrls: ['./empty-templates-list.component.scss']
|
||||||
})
|
})
|
||||||
export class EmptyTemplatesListComponent {
|
export class EmptyTemplatesListComponent {
|
||||||
|
@Input() textMessage: string;
|
||||||
emptyTemplatesListMessage: string = 'Empty templates list';
|
emptyTemplatesListMessage: string = 'Empty templates list';
|
||||||
|
|
||||||
|
constructor(){
|
||||||
|
if (this.textMessage) {
|
||||||
|
this.emptyTemplatesListMessage = this.textMessage;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<app-empty-templates-list *ngIf="!dockerTemplates.length"></app-empty-templates-list>
|
<app-empty-templates-list *ngIf="!dockerTemplates.length"></app-empty-templates-list>
|
||||||
<div class="default-content" *ngIf="dockerTemplates.length">
|
<div class="default-content" *ngIf="dockerTemplates.length">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list *ngIf="server">
|
<mat-nav-list *ngIf="server">
|
||||||
<div class="list-item" *ngFor='let template of dockerTemplates'>
|
<div class="list-item" *ngFor='let template of dockerTemplates'>
|
||||||
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
||||||
<button mat-icon-button class="menu-button" [matMenuTriggerFor]="menu">
|
<button mat-button class="menu-button" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>more_vert</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<mat-menu #menu="matMenu">
|
<mat-menu #menu="matMenu">
|
||||||
|
@ -33,13 +33,8 @@ export class DockerTemplatesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTemplates() {
|
getTemplates() {
|
||||||
this.dockerTemplates = [];
|
|
||||||
this.dockerService.getTemplates(this.server).subscribe((dockerTemplates: DockerTemplate[]) => {
|
this.dockerService.getTemplates(this.server).subscribe((dockerTemplates: DockerTemplate[]) => {
|
||||||
dockerTemplates.forEach((template) => {
|
this.dockerTemplates = dockerTemplates.filter((elem) => elem.template_type === 'docker' && !elem.builtin);
|
||||||
if ((template.template_type === 'docker') && !template.builtin) {
|
|
||||||
this.dockerTemplates.push(template);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<app-empty-templates-list *ngIf="!iosTemplates.length"></app-empty-templates-list>
|
<app-empty-templates-list *ngIf="!iosTemplates.length"></app-empty-templates-list>
|
||||||
<div class="default-content" *ngIf="iosTemplates.length">
|
<div class="default-content" *ngIf="iosTemplates.length">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list *ngIf="server">
|
<mat-nav-list *ngIf="server">
|
||||||
<div class="list-item" *ngFor='let template of iosTemplates'>
|
<div class="list-item" *ngFor='let template of iosTemplates'>
|
||||||
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
||||||
<button mat-icon-button class="menu-button" [matMenuTriggerFor]="menu">
|
<button mat-button class="menu-button" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>more_vert</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<mat-menu #menu="matMenu">
|
<mat-menu #menu="matMenu">
|
||||||
|
@ -35,7 +35,7 @@ export class IosTemplatesComponent implements OnInit {
|
|||||||
|
|
||||||
getTemplates() {
|
getTemplates() {
|
||||||
this.iosService.getTemplates(this.server).subscribe((templates: IosTemplate[]) => {
|
this.iosService.getTemplates(this.server).subscribe((templates: IosTemplate[]) => {
|
||||||
this.iosTemplates = templates.filter((elem) => elem.template_type === 'dynamips');
|
this.iosTemplates = templates.filter((elem) => elem.template_type === 'dynamips' && !elem.builtin);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<app-empty-templates-list *ngIf="!iouTemplates.length"></app-empty-templates-list>
|
<app-empty-templates-list *ngIf="!iouTemplates.length"></app-empty-templates-list>
|
||||||
<div class="default-content" *ngIf="iouTemplates.length">
|
<div class="default-content" *ngIf="iouTemplates.length">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list *ngIf="server">
|
<mat-nav-list *ngIf="server">
|
||||||
<div class="list-item" *ngFor='let template of iouTemplates'>
|
<div class="list-item" *ngFor='let template of iouTemplates'>
|
||||||
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
||||||
<button mat-icon-button class="menu-button" [matMenuTriggerFor]="menu">
|
<button mat-button class="menu-button" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>more_vert</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<mat-menu #menu="matMenu">
|
<mat-menu #menu="matMenu">
|
||||||
|
@ -33,13 +33,8 @@ export class IouTemplatesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTemplates() {
|
getTemplates() {
|
||||||
this.iouTemplates = [];
|
|
||||||
this.iouService.getTemplates(this.server).subscribe((iouTemplates: IouTemplate[]) => {
|
this.iouService.getTemplates(this.server).subscribe((iouTemplates: IouTemplate[]) => {
|
||||||
iouTemplates.forEach((template) => {
|
this.iouTemplates = iouTemplates.filter((elem) => elem.template_type === 'iou' && !elem.builtin);
|
||||||
if ((template.template_type === 'iou') && !template.builtin) {
|
|
||||||
this.iouTemplates.push(template);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="default-content">
|
<div class="default-content">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list>
|
<mat-nav-list>
|
||||||
<mat-list-item routerLink="/server/{{serverId}}/preferences/builtin">
|
<mat-list-item routerLink="/server/{{serverId}}/preferences/builtin">
|
||||||
Built-in
|
Built-in
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
.listcontainer {
|
||||||
|
padding-left: 0px!important;
|
||||||
|
padding-right: 0px!important;
|
||||||
|
}
|
||||||
|
|
||||||
.top-button {
|
.top-button {
|
||||||
height: 36px;
|
height: 36px;
|
||||||
margin-top: 22px
|
margin-top: 22px
|
||||||
@ -50,7 +55,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.template-name {
|
.template-name {
|
||||||
width: 90%;
|
width: 95%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.delete-button {
|
.delete-button {
|
||||||
@ -59,7 +64,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.menu-button {
|
.menu-button {
|
||||||
width: 10%;
|
width: 5%;
|
||||||
|
outline: none!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
th {
|
th {
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<app-empty-templates-list *ngIf="!qemuTemplates.length"></app-empty-templates-list>
|
<app-empty-templates-list *ngIf="!qemuTemplates.length"></app-empty-templates-list>
|
||||||
<div class="default-content" *ngIf="qemuTemplates.length">
|
<div class="default-content" *ngIf="qemuTemplates.length">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list *ngIf="server">
|
<mat-nav-list *ngIf="server">
|
||||||
<div class="list-item" *ngFor='let template of qemuTemplates'>
|
<div class="list-item" *ngFor='let template of qemuTemplates'>
|
||||||
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
||||||
<button mat-icon-button class="menu-button" [matMenuTriggerFor]="menu">
|
<button mat-button class="menu-button" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>more_vert</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<mat-menu #menu="matMenu">
|
<mat-menu #menu="matMenu">
|
||||||
|
@ -34,7 +34,7 @@ export class QemuVmTemplatesComponent implements OnInit {
|
|||||||
|
|
||||||
getTemplates() {
|
getTemplates() {
|
||||||
this.qemuService.getTemplates(this.server).subscribe((qemuTemplates: QemuTemplate[]) => {
|
this.qemuService.getTemplates(this.server).subscribe((qemuTemplates: QemuTemplate[]) => {
|
||||||
this.qemuTemplates = qemuTemplates.filter((elem) => elem.template_type === 'dynamips');
|
this.qemuTemplates = qemuTemplates.filter((elem) => elem.template_type === 'qemu' && !elem.builtin);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,13 +8,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<app-empty-templates-list *ngIf="!virtualBoxTemplates.length"></app-empty-templates-list>
|
<app-empty-templates-list *ngIf="!virtualBoxTemplates.length"></app-empty-templates-list>
|
||||||
<div class="default-content" *ngIf="virtualBoxTemplates.length">
|
<div class="default-content" *ngIf="virtualBoxTemplates.length">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list *ngIf="server">
|
<mat-nav-list *ngIf="server">
|
||||||
<div class="list-item" *ngFor='let template of virtualBoxTemplates'>
|
<div class="list-item" *ngFor='let template of virtualBoxTemplates'>
|
||||||
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
||||||
<button class="delete-button" mat-icon-button (click)="deleteTemplate(template)">
|
<button mat-button class="menu-button" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
<mat-menu #menu="matMenu">
|
||||||
|
<button mat-menu-item (click)="deleteTemplate(template)">
|
||||||
|
<mat-icon>delete</mat-icon><span>Delete</span>
|
||||||
|
</button>
|
||||||
|
</mat-menu>
|
||||||
</div>
|
</div>
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
</div>
|
</div>
|
||||||
|
@ -34,7 +34,7 @@ export class VirtualBoxTemplatesComponent implements OnInit {
|
|||||||
|
|
||||||
getTemplates(){
|
getTemplates(){
|
||||||
this.virtualBoxService.getTemplates(this.server).subscribe((virtualBoxTemplates: VirtualBoxTemplate[]) => {
|
this.virtualBoxService.getTemplates(this.server).subscribe((virtualBoxTemplates: VirtualBoxTemplate[]) => {
|
||||||
this.virtualBoxTemplates = virtualBoxTemplates.filter((elem) => elem.template_type === 'virtualbox');
|
this.virtualBoxTemplates = virtualBoxTemplates.filter((elem) => elem.template_type === 'virtualbox' && !elem.builtin);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,13 +8,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<app-empty-templates-list *ngIf="!vmwareTemplates.length"></app-empty-templates-list>
|
<app-empty-templates-list *ngIf="!vmwareTemplates.length"></app-empty-templates-list>
|
||||||
<div class="default-content" *ngIf="vmwareTemplates.length">
|
<div class="default-content" *ngIf="vmwareTemplates.length">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list *ngIf="server">
|
<mat-nav-list *ngIf="server">
|
||||||
<div class="list-item" *ngFor='let template of vmwareTemplates'>
|
<div class="list-item" *ngFor='let template of vmwareTemplates'>
|
||||||
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
||||||
<button class="delete-button" mat-icon-button (click)="deleteTemplate(template)">
|
<button mat-button class="menu-button" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
<mat-menu #menu="matMenu">
|
||||||
|
<button mat-menu-item (click)="deleteTemplate(template)">
|
||||||
|
<mat-icon>delete</mat-icon><span>Delete</span>
|
||||||
|
</button>
|
||||||
|
</mat-menu>
|
||||||
</div>
|
</div>
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,13 +32,8 @@ export class VmwareTemplatesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTemplates() {
|
getTemplates() {
|
||||||
this.vmwareTemplates = [];
|
this.vmwareService.getTemplates(this.server).subscribe((vmwareTemplates: VmwareTemplate[]) => {
|
||||||
this.vmwareService.getTemplates(this.server).subscribe((vpcsTemplates: VmwareTemplate[]) => {
|
this.vmwareTemplates = vmwareTemplates.filter((elem) => elem.template_type === 'vmware' && !elem.builtin);
|
||||||
vpcsTemplates.forEach((template) => {
|
|
||||||
if ((template.template_type === 'vmware') && !template.builtin) {
|
|
||||||
this.vmwareTemplates.push(template);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,13 +8,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<app-empty-templates-list *ngIf="!vpcsTemplates.length"></app-empty-templates-list>
|
<app-empty-templates-list *ngIf="!vpcsTemplates.length"></app-empty-templates-list>
|
||||||
<div class="default-content" *ngIf="vpcsTemplates.length">
|
<div class="default-content" *ngIf="vpcsTemplates.length">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="listcontainer mat-elevation-z8">
|
||||||
<mat-nav-list *ngIf="server">
|
<mat-nav-list *ngIf="server">
|
||||||
<div class="list-item" *ngFor='let template of vpcsTemplates'>
|
<div class="list-item" *ngFor='let template of vpcsTemplates'>
|
||||||
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
<mat-list-item class="template-name" routerLink="{{template.template_id}}">{{template.name}}</mat-list-item>
|
||||||
<button class="delete-button" mat-icon-button (click)="deleteTemplate(template)">
|
<button mat-button class="menu-button" [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>delete</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
<mat-menu #menu="matMenu">
|
||||||
|
<button mat-menu-item (click)="deleteTemplate(template)">
|
||||||
|
<mat-icon>delete</mat-icon><span>Delete</span>
|
||||||
|
</button>
|
||||||
|
</mat-menu>
|
||||||
</div>
|
</div>
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
</div>
|
</div>
|
||||||
|
@ -33,7 +33,7 @@ export class VpcsTemplatesComponent implements OnInit {
|
|||||||
|
|
||||||
getTemplates() {
|
getTemplates() {
|
||||||
this.vpcsService.getTemplates(this.server).subscribe((vpcsTemplates: VpcsTemplate[]) => {
|
this.vpcsService.getTemplates(this.server).subscribe((vpcsTemplates: VpcsTemplate[]) => {
|
||||||
this.vpcsTemplates = vpcsTemplates.filter((elem) => elem.template_type === 'vpcs');
|
this.vpcsTemplates = vpcsTemplates.filter((elem) => elem.template_type === 'vpcs' && !elem.builtin);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ import { MapLabel } from '../../cartography/models/map/map-label';
|
|||||||
import { Label } from '../../cartography/models/label';
|
import { Label } from '../../cartography/models/label';
|
||||||
import { MapNode } from '../../cartography/models/map/map-node';
|
import { MapNode } from '../../cartography/models/map/map-node';
|
||||||
import { MapLabelToLabelConverter } from '../../cartography/converters/map/map-label-to-label-converter';
|
import { MapLabelToLabelConverter } from '../../cartography/converters/map/map-label-to-label-converter';
|
||||||
|
import { RecentlyOpenedProjectService } from '../../services/recentlyOpenedProject.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -101,7 +102,8 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
|||||||
private settingsService: SettingsService,
|
private settingsService: SettingsService,
|
||||||
private toolsService: ToolsService,
|
private toolsService: ToolsService,
|
||||||
private selectionManager: SelectionManager,
|
private selectionManager: SelectionManager,
|
||||||
private selectionTool: SelectionTool
|
private selectionTool: SelectionTool,
|
||||||
|
private recentlyOpenedProjectService: RecentlyOpenedProjectService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -124,6 +126,9 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
|||||||
mergeMap((project: Project) => {
|
mergeMap((project: Project) => {
|
||||||
this.project = project;
|
this.project = project;
|
||||||
|
|
||||||
|
this.recentlyOpenedProjectService.setServerId(this.server.id.toString());
|
||||||
|
this.recentlyOpenedProjectService.setProjectId(this.project.project_id);
|
||||||
|
|
||||||
if (this.project.status === 'opened') {
|
if (this.project.status === 'opened') {
|
||||||
return new Observable<Project>(observer => {
|
return new Observable<Project>(observer => {
|
||||||
observer.next(this.project);
|
observer.next(this.project);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="default-content">
|
<div class="default-content">
|
||||||
<div class="container mat-elevation-z8">
|
<div class="mat-elevation-z8">
|
||||||
<mat-table #table [dataSource]="dataSource" matSort>
|
<mat-table #table [dataSource]="dataSource" matSort>
|
||||||
<ng-container matColumnDef="name">
|
<ng-container matColumnDef="name">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
.buttons-bar {
|
||||||
|
padding-top: 22px;
|
||||||
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div class="default-content">
|
<div class="default-content">
|
||||||
<app-server-discovery></app-server-discovery>
|
<app-server-discovery></app-server-discovery>
|
||||||
|
|
||||||
<div class="container mat-elevation-z8">
|
<div class="mat-elevation-z8">
|
||||||
<mat-table #table [dataSource]="dataSource">
|
<mat-table #table [dataSource]="dataSource">
|
||||||
<ng-container matColumnDef="id">
|
<ng-container matColumnDef="id">
|
||||||
<mat-header-cell *matHeaderCellDef> ID </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> ID </mat-header-cell>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="default-header"><h1>Settings</h1></div>
|
<div class="default-header"><h1>Settings</h1></div>
|
||||||
<div class="default-content">
|
<div class="default-content">
|
||||||
<div class="example-container mat-elevation-z8">
|
<div class="container mat-elevation-z8">
|
||||||
<mat-accordion>
|
<mat-accordion>
|
||||||
<mat-expansion-panel [expanded]="true">
|
<mat-expansion-panel [expanded]="true">
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
<button mat-button routerLink="/servers">Servers</button>
|
<button mat-button routerLink="/servers">Servers</button>
|
||||||
|
|
||||||
|
<button *ngIf="recentlyOpenedProjectId && recentlyOpenedServerId" mat-button routerLink="/server/{{recentlyOpenedServerId}}/project/{{recentlyOpenedProjectId}}">Back to project</button>
|
||||||
|
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
|
|
||||||
<button mat-button [matMenuTriggerFor]="menu" >
|
<button mat-button [matMenuTriggerFor]="menu" >
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { ElectronService } from 'ngx-electron';
|
import { ElectronService } from 'ngx-electron';
|
||||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
|
import { RecentlyOpenedProjectService } from '../../services/recentlyOpenedProject.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-default-layout',
|
selector: 'app-default-layout',
|
||||||
@ -10,12 +11,18 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
|||||||
export class DefaultLayoutComponent implements OnInit {
|
export class DefaultLayoutComponent implements OnInit {
|
||||||
public isInstalledSoftwareAvailable = false;
|
public isInstalledSoftwareAvailable = false;
|
||||||
|
|
||||||
|
recentlyOpenedServerId : string;
|
||||||
|
recentlyOpenedProjectId : string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private electronService: ElectronService
|
private electronService: ElectronService,
|
||||||
|
private recentlyOpenedProjectService: RecentlyOpenedProjectService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.isInstalledSoftwareAvailable = this.electronService.isElectronApp;
|
this.isInstalledSoftwareAvailable = this.electronService.isElectronApp;
|
||||||
}
|
|
||||||
|
|
||||||
|
this.recentlyOpenedServerId = this.recentlyOpenedProjectService.getServerId();
|
||||||
|
this.recentlyOpenedProjectId = this.recentlyOpenedProjectService.getProjectId();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
23
src/app/services/recentlyOpenedProject.service.ts
Normal file
23
src/app/services/recentlyOpenedProject.service.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class RecentlyOpenedProjectService {
|
||||||
|
private serverId: string;
|
||||||
|
private projectId: string;
|
||||||
|
|
||||||
|
setServerId(serverId: string) {
|
||||||
|
this.serverId = serverId;
|
||||||
|
}
|
||||||
|
|
||||||
|
setProjectId(projectId: string) {
|
||||||
|
this.projectId = projectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
getServerId() : string {
|
||||||
|
return this.serverId;
|
||||||
|
}
|
||||||
|
|
||||||
|
getProjectId() : string {
|
||||||
|
return this.projectId;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user