From 27886326020c0dd8ac103cc3232142c2db2fd30e Mon Sep 17 00:00:00 2001 From: insanity Date: Tue, 11 Sep 2018 19:33:00 +0900 Subject: [PATCH] detail --- .../component/host-detail.component.html | 68 +++++++++++++------ .../component/host-detail.component.ts | 4 +- .../component/nic-dropdown.component.ts | 1 + .../component/node-detail.component.html | 5 +- .../component/service-detail.component.html | 58 +++++++++------- .../component/zone-detail.component.html | 42 +++++++++++- .../component/zone-detail.component.ts | 20 ++++-- 7 files changed, 146 insertions(+), 52 deletions(-) diff --git a/src/commons/component/host-detail.component.html b/src/commons/component/host-detail.component.html index bbb7cfb..f3df8bd 100644 --- a/src/commons/component/host-detail.component.html +++ b/src/commons/component/host-detail.component.html @@ -1,22 +1,50 @@
-
-
    -
  • - IP Address - {{host.address}} -
  • -
  • - Name - {{host.name}} -
  • -
  • - Mac Address - {{host.mac}} -
  • -
  • - Opened Ports - {{host.portList.length}} -
  • -
-
+ + {{host.name}} + {{host.address}} + + + + +
    + +
  • + Type + {{host.deviceType}} +
  • +
  • + Vendor + {{host.deviceVendor}} +
  • +
  • + Model + {{host.model}} +
  • + +
  • + OS + {{host.osType}} +
  • + +
  • + Mac Address + {{host.mac}} +
  • + +
  • + Discovered by + {{host.discoveredBy.join(',')}} +
  • +
+ +
+ + + + + + + + +
\ No newline at end of file diff --git a/src/commons/component/host-detail.component.ts b/src/commons/component/host-detail.component.ts index ab56b2a..5b2ad47 100644 --- a/src/commons/component/host-detail.component.ts +++ b/src/commons/component/host-detail.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { Host } from '@overflow/model/discovery'; +import { Host, Port } from '@overflow/model/discovery'; @Component({ @@ -10,6 +10,8 @@ import { Host } from '@overflow/model/discovery'; export class HostDetailComponent { @Input() host: Host; + ports: Port[]; + selectedPort: Port; constructor( ) { diff --git a/src/commons/component/nic-dropdown.component.ts b/src/commons/component/nic-dropdown.component.ts index 17f5e66..80e3709 100644 --- a/src/commons/component/nic-dropdown.component.ts +++ b/src/commons/component/nic-dropdown.component.ts @@ -35,6 +35,7 @@ export class NicDropdownComponent implements OnInit { this.probeService.call('MachineService.Interfaces').pipe( map((ifaces: Interface[]) => { ifaces.forEach(iface => { + console.log(iface); iface.addresses.forEach(address => { if (address.metaIPType.key != toMetaIPType(MetaIPTypeEnum.V4).key) { return; diff --git a/src/commons/component/node-detail.component.html b/src/commons/component/node-detail.component.html index c8ff422..ff946a4 100644 --- a/src/commons/component/node-detail.component.html +++ b/src/commons/component/node-detail.component.html @@ -1,7 +1,8 @@
- +
@@ -9,7 +10,7 @@ - + diff --git a/src/commons/component/service-detail.component.html b/src/commons/component/service-detail.component.html index bd2772f..7797809 100644 --- a/src/commons/component/service-detail.component.html +++ b/src/commons/component/service-detail.component.html @@ -1,26 +1,36 @@
-
-
    -
  • - Name - {{service.key}} -
  • -
  • - Port - {{service.port.metaPortType.name}} {{service.port.portNumber}} -
  • -
  • - Description - {{service.description}} -
  • -
  • - Crypto Type - {{service.metaCryptoType.name}} -
  • - -
-
+ + + {{service.name}} {{service.port.host.address}} + + + + + +
    +
  • + Name + {{service.key}} +
  • +
  • + Port + {{service.port.metaPortType.name}} {{service.port.portNumber}} +
  • +
  • + Description + {{service.description}} +
  • +
  • + Crypto Type + {{service.metaCryptoType.name}} +
  • +
+ +
+ + + + +
+
\ No newline at end of file diff --git a/src/commons/component/zone-detail.component.html b/src/commons/component/zone-detail.component.html index 8574915..2207cf3 100644 --- a/src/commons/component/zone-detail.component.html +++ b/src/commons/component/zone-detail.component.html @@ -1,3 +1,43 @@
- zone component + + {{zone.network}} + + + + + +
    +
  • + Interface + {{zone.iface}} +
  • + +
  • + Mac Address + {{zone.mac}} +
  • + +
  • + IP Version + {{zone.metaIPType.key}} +
  • + +
  • + Network + {{zone.network}} +
  • + +
  • + IP Range + {{ipRange}} +
  • + +
+ +
+ + + +
+
\ No newline at end of file diff --git a/src/commons/component/zone-detail.component.ts b/src/commons/component/zone-detail.component.ts index 8557855..6c96099 100644 --- a/src/commons/component/zone-detail.component.ts +++ b/src/commons/component/zone-detail.component.ts @@ -1,19 +1,31 @@ -import { Component, Input } from '@angular/core'; -import { Zone } from '@overflow/model/discovery'; +import { Component, Input, OnInit } from '@angular/core'; +import { Zone, Host } from '@overflow/model/discovery'; +const IPCIDR = require('ip-cidr'); @Component({ selector: 'app-zone-detail', templateUrl: './zone-detail.component.html', styleUrls: ['./zone-detail.component.scss'], }) -export class ZoneDetailComponent { +export class ZoneDetailComponent implements OnInit { @Input() zone: Zone; + ipRange: string; + hosts: Host[]; + selectedHost: Host; constructor( ) { - } + ngOnInit(): void { + if (!this.zone) { + return; + } + + const cidr = new IPCIDR(this.zone.network); + this.ipRange = cidr.start() + ' - ' + cidr.end(); + + } }