Merge pull request #547 from GNS3/Usage-instructions-should-be-available-from-context-menu

Usage instructions for nodes
This commit is contained in:
piotrpekala7 2019-10-25 10:47:58 +02:00 committed by GitHub
commit 0bffe1b0b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 0 deletions

View File

@ -31,6 +31,7 @@ export class MapNodeToNodeConverter implements Converter<MapNode, Node> {
node.status = mapNode.status; node.status = mapNode.status;
node.symbol = mapNode.symbol; node.symbol = mapNode.symbol;
node.symbol_url = mapNode.symbolUrl; node.symbol_url = mapNode.symbolUrl;
node.usage = mapNode.usage;
node.width = mapNode.width; node.width = mapNode.width;
node.x = mapNode.x; node.x = mapNode.x;
node.y = mapNode.y; node.y = mapNode.y;

View File

@ -40,6 +40,7 @@ export class NodeToMapNodeConverter implements Converter<Node, MapNode> {
mapNode.status = node.status; mapNode.status = node.status;
mapNode.symbol = node.symbol; mapNode.symbol = node.symbol;
mapNode.symbolUrl = node.symbol_url; mapNode.symbolUrl = node.symbol_url;
mapNode.usage = node.usage;
mapNode.width = node.width; mapNode.width = node.width;
mapNode.x = node.x; mapNode.x = node.x;
mapNode.y = node.y; mapNode.y = node.y;

View File

@ -23,6 +23,7 @@ export class MapNode implements Indexed {
status: string; status: string;
symbol: string; symbol: string;
symbolUrl: string; symbolUrl: string;
usage?: string;
width: number; width: number;
x: number; x: number;
y: number; y: number;

View File

@ -82,6 +82,7 @@ export class Node {
status: string; status: string;
symbol: string; symbol: string;
symbol_url: string; // @TODO: full URL to symbol, move to MapNode once converters are moved to app module symbol_url: string; // @TODO: full URL to symbol, move to MapNode once converters are moved to app module
usage?: string;
width: number; width: number;
x: number; x: number;
y: number; y: number;

View File

@ -9,6 +9,11 @@
</div> </div>
</div> </div>
</mat-tab> </mat-tab>
<mat-tab label="Usage instructions">
<div class="textBox">
{{usage}}
</div>
</mat-tab>
<mat-tab label="Command line"> <mat-tab label="Command line">
<div class="textBox"> <div class="textBox">
{{commandLine}} {{commandLine}}

View File

@ -13,6 +13,7 @@ export class InfoDialogComponent implements OnInit {
@Input() server: Server; @Input() server: Server;
@Input() node: Node; @Input() node: Node;
infoList: string[] = []; infoList: string[] = [];
usage: string = '';
commandLine: string = ''; commandLine: string = '';
constructor( constructor(
@ -23,6 +24,7 @@ export class InfoDialogComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.infoList = this.infoService.getInfoAboutNode(this.node, this.server); this.infoList = this.infoService.getInfoAboutNode(this.node, this.server);
this.commandLine = this.infoService.getCommandLine(this.node); this.commandLine = this.infoService.getCommandLine(this.node);
this.usage = this.node.usage ? this.node.usage : `No usage information has been provided for this node.`;
} }
onCloseClick() { onCloseClick() {