Help component added

This commit is contained in:
Piotr Pekala 2019-06-24 01:41:28 -07:00
parent 4ed93ed6ab
commit eaf38d4374
7 changed files with 51 additions and 3 deletions

View File

@ -52,6 +52,7 @@ import { CopyDockerTemplateComponent } from './components/preferences/docker/cop
import { CopyIouTemplateComponent } from './components/preferences/ios-on-unix/copy-iou-template/copy-iou-template.component'; import { CopyIouTemplateComponent } from './components/preferences/ios-on-unix/copy-iou-template/copy-iou-template.component';
import { ListOfSnapshotsComponent } from './components/snapshots/list-of-snapshots/list-of-snapshots.component'; import { ListOfSnapshotsComponent } from './components/snapshots/list-of-snapshots/list-of-snapshots.component';
import { ConsoleComponent } from './components/settings/console/console.component'; import { ConsoleComponent } from './components/settings/console/console.component';
import { HelpComponent } from './components/help/help.component';
const routes: Routes = [ const routes: Routes = [
{ {
@ -62,6 +63,7 @@ const routes: Routes = [
{ path: 'servers', component: ServersComponent }, { path: 'servers', component: ServersComponent },
{ path: 'bundled', component: BundledServerFinderComponent }, { path: 'bundled', component: BundledServerFinderComponent },
{ path: 'server/:server_id/projects', component: ProjectsComponent }, { path: 'server/:server_id/projects', component: ProjectsComponent },
{ path: 'help', component: HelpComponent },
{ path: 'settings', component: SettingsComponent }, { path: 'settings', component: SettingsComponent },
{ path: 'settings/console', component: ConsoleComponent }, { path: 'settings/console', component: ConsoleComponent },
{ path: 'installed-software', component: InstalledSoftwareComponent }, { path: 'installed-software', component: InstalledSoftwareComponent },

View File

@ -186,6 +186,7 @@ import { DefaultConsoleService } from './services/settings/default-console.servi
import { NodeCreatedLabelStylesFixer } from './components/project-map/helpers/node-created-label-styles-fixer'; import { NodeCreatedLabelStylesFixer } from './components/project-map/helpers/node-created-label-styles-fixer';
import { NonNegativeValidator } from './validators/non-negative-validator'; import { NonNegativeValidator } from './validators/non-negative-validator';
import { RotationValidator } from './validators/rotation-validator'; import { RotationValidator } from './validators/rotation-validator';
import { HelpComponent } from './components/help/help.component';
if (environment.production) { if (environment.production) {
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', { Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
@ -304,7 +305,8 @@ if (environment.production) {
AdbutlerComponent, AdbutlerComponent,
ConsoleDeviceActionComponent, ConsoleDeviceActionComponent,
ConsoleComponent, ConsoleComponent,
NodesMenuComponent NodesMenuComponent,
HelpComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,

View File

@ -0,0 +1,15 @@
<div class="content">
<div class="default-header"><h1>Help</h1></div>
<div class="default-content">
<div class="container mat-elevation-z8">
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title> Third party components </mat-panel-title>
</mat-expansion-panel-header>
<div [innerHTML]="thirdpartylicenses"></div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>

View File

@ -0,0 +1,27 @@
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-help',
templateUrl: './help.component.html',
styleUrls: ['./help.component.scss']
})
export class HelpComponent implements OnInit {
thirdpartylicenses = '';
constructor(
private httpClient: HttpClient
) {}
ngOnInit() {
this.httpClient.get('/3rdpartylicenses.txt', {responseType: 'text'})
.subscribe(data => {
this.thirdpartylicenses = data.replace(new RegExp('\n', 'g'), "<br />")
},
error => {
if (error.status === 404) {
this.thirdpartylicenses = 'File not found';
}
});
}
}

View File

@ -21,9 +21,12 @@
<mat-icon>cloud_download</mat-icon> <mat-icon>cloud_download</mat-icon>
<span>Installed software</span> <span>Installed software</span>
</button> </button>
<button mat-menu-item routerLink="/help">
<mat-icon>help</mat-icon>
<span>Help</span>
</button>
</mat-menu> </mat-menu>
</mat-toolbar> </mat-toolbar>
</header> </header>
@ -34,4 +37,3 @@
<footer class="footer mat-app-background"> <footer class="footer mat-app-background">
GNS3 Web UI &copy; 2019 - v{{ uiVersion }} GNS3 Web UI &copy; 2019 - v{{ uiVersion }}
</footer> </footer>