mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-03-23 12:05:15 +00:00
Installed software link in application menu when in electron
This commit is contained in:
parent
8aa4e33011
commit
77a47e8fd2
@ -7,6 +7,7 @@ import { ProjectsComponent } from "./components/projects/projects.component";
|
||||
import { DefaultLayoutComponent } from "./layouts/default-layout/default-layout.component";
|
||||
import { SettingsComponent } from "./components/settings/settings.component";
|
||||
import { LocalServerComponent } from "./components/local-server/local-server.component";
|
||||
import { InstalledSoftwareComponent } from './components/installed-software/installed-software.component';
|
||||
|
||||
|
||||
const routes: Routes = [
|
||||
@ -17,6 +18,7 @@ const routes: Routes = [
|
||||
{ path: 'local', component: LocalServerComponent },
|
||||
{ path: 'server/:server_id/projects', component: ProjectsComponent },
|
||||
{ path: 'settings', component: SettingsComponent },
|
||||
{ path: 'installed-software', component: InstalledSoftwareComponent },
|
||||
]
|
||||
},
|
||||
{ path: 'server/:server_id/project/:project_id', component: ProjectMapComponent },
|
||||
|
@ -74,6 +74,7 @@ import { ProjectNameValidator } from './components/projects/models/projectNameVa
|
||||
import { MatSidenavModule } from '@angular/material';
|
||||
import { NodeSelectInterfaceComponent } from './components/project-map/node-select-interface/node-select-interface.component';
|
||||
import { DrawLinkToolComponent } from './components/project-map/draw-link-tool/draw-link-tool.component';
|
||||
import { InstalledSoftwareComponent } from './components/installed-software/installed-software.component';
|
||||
|
||||
|
||||
if (environment.production) {
|
||||
@ -116,7 +117,8 @@ if (environment.production) {
|
||||
ProgressComponent,
|
||||
ServerDiscoveryComponent,
|
||||
NodeSelectInterfaceComponent,
|
||||
DrawLinkToolComponent
|
||||
DrawLinkToolComponent,
|
||||
InstalledSoftwareComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
|
@ -0,0 +1,48 @@
|
||||
<div class="content">
|
||||
<div class="default-header">
|
||||
<h1>Installed software</h1>
|
||||
</div>
|
||||
<div class="default-content">
|
||||
<!-- <div class="example-container mat-elevation-z8">
|
||||
<mat-table #table [dataSource]="dataSource">
|
||||
|
||||
<ng-container matColumnDef="id">
|
||||
<mat-header-cell *matHeaderCellDef> ID </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row;"> {{row.id}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row;"> <a [routerLink]="['/server', row.id, 'projects']" class="table-link">{{row.name}}</a></mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="ip">
|
||||
<mat-header-cell *matHeaderCellDef> IP </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row;"> {{row.ip}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="port">
|
||||
<mat-header-cell *matHeaderCellDef> Port </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row;"> {{row.port}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let row;" style="text-align: right">
|
||||
<button mat-icon-button (click)="deleteServer(row)">
|
||||
<mat-icon aria-label="Remove server">delete</mat-icon>
|
||||
</button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
</mat-table>
|
||||
</div>
|
||||
|
||||
<div class="buttons-bar">
|
||||
<button mat-raised-button color="primary" (click)="createModal()">Add server</button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { InstalledSoftwareComponent } from './installed-software.component';
|
||||
|
||||
describe('InstalledSoftwareComponent', () => {
|
||||
let component: InstalledSoftwareComponent;
|
||||
let fixture: ComponentFixture<InstalledSoftwareComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ InstalledSoftwareComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(InstalledSoftwareComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-installed-software',
|
||||
templateUrl: './installed-software.component.html',
|
||||
styleUrls: ['./installed-software.component.scss']
|
||||
})
|
||||
export class InstalledSoftwareComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
@ -35,4 +35,5 @@
|
||||
<button mat-raised-button color="primary" (click)="save()">Save settings</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -8,9 +8,22 @@
|
||||
|
||||
<span class="fill-space"></span>
|
||||
|
||||
<button mat-button routerLink="/settings" >
|
||||
<mat-icon>settings</mat-icon>
|
||||
<button mat-button [matMenuTriggerFor]="menu" >
|
||||
<mat-icon>more_vert</mat-icon>
|
||||
</button>
|
||||
|
||||
<mat-menu #menu="matMenu">
|
||||
<button mat-menu-item routerLink="/settings">
|
||||
<mat-icon>settings</mat-icon>
|
||||
<span>Settings</span>
|
||||
</button>
|
||||
<button mat-menu-item routerLink="/installed-software" [disabled]="!isInstalledSoftwareAvailable">
|
||||
<mat-icon>cloud_download</mat-icon>
|
||||
<span>Installed software</span>
|
||||
</button>
|
||||
</mat-menu>
|
||||
|
||||
|
||||
</mat-toolbar>
|
||||
</header>
|
||||
|
||||
@ -21,6 +34,6 @@
|
||||
<app-progress></app-progress>
|
||||
|
||||
<footer class="footer mat-app-background">
|
||||
GNS3 Web UI demo © 2018
|
||||
GNS3 Web UI © 2019
|
||||
</footer>
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {Component, OnInit, ViewEncapsulation} from '@angular/core';
|
||||
import { ElectronService } from 'ngx-electron';
|
||||
|
||||
@Component({
|
||||
selector: 'app-default-layout',
|
||||
@ -7,10 +8,14 @@ import {Component, OnInit, ViewEncapsulation} from '@angular/core';
|
||||
styleUrls: ['./default-layout.component.css']
|
||||
})
|
||||
export class DefaultLayoutComponent implements OnInit {
|
||||
public isInstalledSoftwareAvailable = false;
|
||||
|
||||
constructor() { }
|
||||
constructor(
|
||||
private electronService: ElectronService
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.isInstalledSoftwareAvailable = this.electronService.isElectronApp;
|
||||
}
|
||||
|
||||
}
|
||||
|
12
src/app/services/installed-software.service.spec.ts
Normal file
12
src/app/services/installed-software.service.spec.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { InstalledSoftwareService } from './installed-software.service';
|
||||
|
||||
describe('InstalledSoftwareService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: InstalledSoftwareService = TestBed.get(InstalledSoftwareService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
9
src/app/services/installed-software.service.ts
Normal file
9
src/app/services/installed-software.service.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class InstalledSoftwareService {
|
||||
|
||||
constructor() { }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user