This commit is contained in:
crusader 2018-06-14 12:28:29 +09:00
parent 7a9c04f197
commit 8797b4fa60
2 changed files with 17 additions and 50 deletions

View File

@ -21,9 +21,9 @@
<i [ngClass]="expanded ? 'fa fa-fw fa-chevron-circle-down' : 'fa fa-fw fa-chevron-circle-right'"></i>
</a>
</td>
<td>{{rowData.apiKey}}</td>
<td>{{getInfraHostInfo(rowData.infraHostMeta, 'name')}}</td>
<td>{{getInfraHostInfo(rowData.infraHostMeta, 'os')}}</td>
<td>{{rowData.tempProbeKey}}</td>
<td>{{rowData.infraHost.host.name}}</td>
<td>{{rowData.infraHost.host.os}}</td>
<td>{{rowData.createDate | date: 'dd/MM/yyyy'}}</td>
</tr>
</ng-template>
@ -34,16 +34,17 @@
<div class="ui-g-12 ui-md-6">
<div class="ui-g-12">
<b>Platform:</b> {{getInfraHostInfo(rowData.infraHostMeta, 'platform')}}
<b>Platform:</b> {{rowData.infraHost.host.platform}}
</div>
<div class="ui-g-12">
<b>Platform family:</b> {{rowData.infraHost.host.platformFamily}}
</div>
<div class="ui-g-12">
<b>Platform family:</b> {{getInfraHostInfo(rowData.infraHostMeta, 'platformFamily')}}
<b>Kernel:</b> {{rowData.infraHost.host.kernelVersion}}
</div>
<div class="ui-g-12">
<b>Kernel:</b> {{getInfraHostInfo(rowData.infraHostMeta, 'kernelVersion')}}
</div>
<div class="ui-g-12">
<b>HostID:</b> {{getInfraHostInfo(rowData.infraHostMeta, 'hostID')}}
<b>HostID:</b> {{rowData.infraHost.host.hostID}}
</div>
<div class="ui-g-12">
<b>Connected:</b>
@ -57,16 +58,16 @@
<div class="ui-g-12 ui-md-6">
<div class="ui-g">
<div class="ui-g-12">
<b>NIC:</b> {{getInfraNetworkInfo(rowData.infraHostMeta, 'name')}}
<b>NIC:</b> {{rowData.infraHost.network.name}}
</div>
<div class="ui-g-12">
<b>Network Address:</b> {{getInfraNetworkInfo(rowData.infraHostMeta, 'address')}}
<b>Network Address:</b> {{rowData.infraHost.network.address}}
</div>
<div class="ui-g-12">
<b>Gateway:</b> {{getInfraNetworkInfo(rowData.infraHostMeta, 'gateway')}}
<b>Gateway:</b> {{rowData.infraHost.network.gateway}}
</div>
<div class="ui-g-12">
<b>Mac Address:</b> {{getInfraNetworkInfo(rowData.infraHostMeta, 'macAddress')}}
<b>Mac Address:</b> {{rowData.infraHost.network.macAddress}}
</div>
<div class="ui-g-12">
</div>

View File

@ -139,6 +139,9 @@ export class NoAuthProbeListComponent implements OnInit, OnDestroy {
if (null === noauthProbes) {
return;
}
noauthProbes.forEach(noauthProbe => {
noauthProbe.infraHost = JSON.parse(noauthProbe.infraHostMeta);
});
this.noauthProbes = noauthProbes;
}
@ -146,42 +149,5 @@ export class NoAuthProbeListComponent implements OnInit, OnDestroy {
this.error$ = of(error);
}
getInfraHostInfo(infraHostMeta: string, type: string): string {
const infraHost = JSON.parse(infraHostMeta);
switch (type) {
case 'name':
return infraHost.host.name;
case 'os':
let os = infraHost.host.os;
return os;
case 'platform':
return infraHost.host.platform;
case 'platformFamily':
return infraHost.host.platformFamily;
case 'kernelVersion':
return infraHost.host.kernelVersion;
case 'hostID':
return infraHost.host.hostID;
default:
return '';
}
}
getInfraNetworkInfo(infraHostMeta: string, type: string): string {
const infraHost = JSON.parse(infraHostMeta);
switch (type) {
case 'name':
return infraHost.network.name;
case 'address':
return infraHost.network.address;
case 'gateway':
return infraHost.network.gateway;
case 'macAddress':
return infraHost.network.macAddress;
default:
return '';
}
}
}