Displaying ports updated

This commit is contained in:
Piotr Pekala 2019-08-08 06:25:28 -07:00
parent 162806b268
commit c70d9852f6
2 changed files with 14 additions and 14 deletions

View File

@ -4,19 +4,17 @@
<mat-tab-group>
<mat-tab label="General information">
<div class='textBox'>
<mat-list>
<mat-list-item *ngFor="let info of infoList">
{{info}}
</mat-list-item>
</mat-list>
<div *ngFor="let info of infoList">
{{info}}
</div>
</div>
</mat-tab>
<mat-tab label="Command line">
<div *ngIf="node.status !== 'started'" class='textBox'>
Please start the node in order to get the command line information.
</div>
<div *ngIf="node.status === 'started'" class="textBox">
{{node.command_line}}
<div class="textBox">
{{command_line}}
</div>
</mat-tab>
</mat-tab-group>

View File

@ -46,14 +46,12 @@ export class InfoService {
}
getInfoAboutPorts(ports: Port[]): string {
let response: string = `ports: `
let response: string = `Ports: `
ports.forEach(port => {
response = response + `adapter_number: ${port.adapter_number},
link_type: ${port.link_type},
name: ${port.name},
port_number: ${port.port_number},
short_name: ${port.short_name}, `
response += `link_type: ${port.link_type},
name: ${port.name}; `
});
response = response.substring(0, response.length - 2);
return response;
}
@ -61,7 +59,11 @@ export class InfoService {
if (node.node_type === 'cloud' || "nat" || "ethernet_hub" || "ethernet_switch" || "frame_relay_switch" || "atm_switch" || "dynamips" || "traceng" || "iou") {
return 'Command line information is not supported for this type of node.';
} else {
return node.command_line;
if (node.status === 'started') {
return node.command_line;
} else {
return 'Please start the node in order to get the command line information.';
}
}
}
}