diff --git a/src/app/pages/home/home-page.component.html b/src/app/pages/home/home-page.component.html
index 0c48ef9..1029f4e 100644
--- a/src/app/pages/home/home-page.component.html
+++ b/src/app/pages/home/home-page.component.html
@@ -68,7 +68,7 @@
diff --git a/src/app/pages/home/home-page.component.ts b/src/app/pages/home/home-page.component.ts
index 8a0b6bb..cb64fcf 100644
--- a/src/app/pages/home/home-page.component.ts
+++ b/src/app/pages/home/home-page.component.ts
@@ -610,4 +610,15 @@ export class HomePageComponent implements OnInit, OnDestroy {
});
return _n;
}
+
+
+ otherHostSelected(host: Host) {
+ const foundNode = this.nodes.find(node => {
+ return node.group === 'host' && node.id === host.address;
+ });
+ if (!foundNode) {
+ return;
+ }
+ this.selectedNode = foundNode;
+ }
}
diff --git a/src/commons/component/host-detail.component.html b/src/commons/component/host-detail.component.html
index 2b773f2..39c8081 100644
--- a/src/commons/component/host-detail.component.html
+++ b/src/commons/component/host-detail.component.html
@@ -14,7 +14,7 @@
-
+
diff --git a/src/commons/component/host-detail.component.ts b/src/commons/component/host-detail.component.ts
index 7719a92..6ea77fe 100644
--- a/src/commons/component/host-detail.component.ts
+++ b/src/commons/component/host-detail.component.ts
@@ -1,5 +1,7 @@
import { Component, Input } from '@angular/core';
-import { Host, Port } from '@overflow/model/discovery';
+import { Host, DiscoverHost } from '@overflow/model/discovery';
+import { ProbeService, requesterID } from '../service/probe.service';
+import { RPCSubscriber } from '@overflow/commons/ui/decorator/RPCSubscriber';
@Component({
@@ -12,8 +14,24 @@ export class HostDetailComponent {
@Input() host: Host;
constructor(
+ private probeService: ProbeService
) {
-
}
+ ping() {
+ console.log(this.host);
+ // const discoverHost: DiscoverHost = {
+ // discoveryConfig: {},
+ // metaIPType: this.host.metaIPType,
+ // firstScanRange: this.host.address,
+ // lastScanRange: this.host.address,
+ // discoverPort: null,
+ // };
+ // this.probeService.send('DiscoveryService.DiscoverHost', requesterID, this.host.zone, discoverHost);
+ }
+
+ // @RPCSubscriber({ method: 'DiscoveryService.DiscoveredHost' })
+ // public DiscoveredHost(host: Host) {
+ // console.log(host);
+ // }
}
diff --git a/src/commons/component/nic-dropdown.component.ts b/src/commons/component/nic-dropdown.component.ts
index e2782e2..19734d9 100644
--- a/src/commons/component/nic-dropdown.component.ts
+++ b/src/commons/component/nic-dropdown.component.ts
@@ -7,10 +7,17 @@ import { ProbeService } from '../service/probe.service';
import { Interface } from '@overflow/model/net/nic';
import { SelectItem } from 'primeng/primeng';
import { Zone } from '@overflow/model/discovery';
-import { toMetaIPType, MetaIPTypeEnum } from '@overflow/model/meta';
+import { toMetaIPType, MetaIPType, MetaIPTypeEnum } from '@overflow/model/meta';
import { DropdownPanelComponent } from '@overflow/commons/ui/component/primeng';
-
+class NICInfo {
+ iface: string;
+ friendlyName: string;
+ metaIPType: MetaIPType;
+ mac: string;
+ address: string;
+ network: string;
+}
@Component({
selector: 'app-nic-dropdown',
@@ -23,7 +30,7 @@ export class NicDropdownComponent implements OnInit {
@ViewChild('panel') panel: DropdownPanelComponent;
nics: SelectItem[] = [];
- selected;
+ selected: NICInfo;
constructor(
private probeService: ProbeService,
@@ -39,23 +46,25 @@ export class NicDropdownComponent implements OnInit {
if (address.metaIPType.key !== toMetaIPType(MetaIPTypeEnum.V4).key) {
return;
}
+ const nicInfo = {
+ iface: iface.iface,
+ friendlyName: iface.friendlyName,
+ metaIPType: address.metaIPType,
+ mac: iface.mac,
+ address: address.address,
+ network: address.network,
+ };
this.nics.push({
label: iface.friendlyName + ' (' + address.network + ')',
- value: {
- iface: iface.iface,
- friendlyName: iface.friendlyName,
- metaIPType: address.metaIPType,
- mac: iface.mac,
- address: address.address,
- network: address.network,
- },
+ value: nicInfo,
disabled: address.metaIPType.key !== toMetaIPType(MetaIPTypeEnum.V4).key ? true : false,
});
+ if (address.gateway !== undefined && address.gateway.length > 0) {
+ this.nicSelected(nicInfo);
+ }
});
+
});
- if (this.nics.length > 0) {
- this.nicSelected(this.nics[0].value);
- }
}),
catchError(error => {
console.log(error);
@@ -66,7 +75,7 @@ export class NicDropdownComponent implements OnInit {
}
- nicSelected(nic: SelectItem) {
+ nicSelected(nic: NICInfo) {
this.selected = nic;
const zone: Zone = {
diff --git a/src/commons/component/node-detail.component.html b/src/commons/component/node-detail.component.html
index cbafe8e..19e9db1 100644
--- a/src/commons/component/node-detail.component.html
+++ b/src/commons/component/node-detail.component.html
@@ -4,7 +4,7 @@
-
+
diff --git a/src/commons/component/node-detail.component.ts b/src/commons/component/node-detail.component.ts
index 79b23ae..ad8de78 100644
--- a/src/commons/component/node-detail.component.ts
+++ b/src/commons/component/node-detail.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input } from '@angular/core';
+import { Component, Input, Output, Host, EventEmitter } from '@angular/core';
@Component({
@@ -9,10 +9,14 @@ import { Component, Input } from '@angular/core';
export class NodeDetailComponent {
@Input() node;
+ @Output() otherHostSelect = new EventEmitter();
constructor(
) {
}
+ otherHostSelected(host: Host) {
+ this.otherHostSelect.emit(host);
+ }
}
diff --git a/src/commons/component/service-detail.component.html b/src/commons/component/service-detail.component.html
index a938f97..967dc9d 100644
--- a/src/commons/component/service-detail.component.html
+++ b/src/commons/component/service-detail.component.html
@@ -17,7 +17,7 @@
-
+
diff --git a/src/commons/component/service-detail.component.ts b/src/commons/component/service-detail.component.ts
index 318f762..1080419 100644
--- a/src/commons/component/service-detail.component.ts
+++ b/src/commons/component/service-detail.component.ts
@@ -16,4 +16,8 @@ export class ServiceDetailComponent {
}
+ ping() {
+ console.log(this.service);
+ }
+
}
diff --git a/src/commons/component/zone-detail.component.html b/src/commons/component/zone-detail.component.html
index 759e946..766a577 100644
--- a/src/commons/component/zone-detail.component.html
+++ b/src/commons/component/zone-detail.component.html
@@ -49,8 +49,10 @@
diff --git a/src/commons/component/zone-detail.component.ts b/src/commons/component/zone-detail.component.ts
index faa5fd2..d26aa7b 100644
--- a/src/commons/component/zone-detail.component.ts
+++ b/src/commons/component/zone-detail.component.ts
@@ -1,4 +1,4 @@
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
import { Zone, Host } from '@overflow/model/discovery';
const IPCIDR = require('ip-cidr');
@@ -11,6 +11,7 @@ const IPCIDR = require('ip-cidr');
export class ZoneDetailComponent implements OnInit {
@Input() zone: Zone;
+ @Output() otherHostSelect = new EventEmitter();
ipRange: string;
constructor(
@@ -24,6 +25,9 @@ export class ZoneDetailComponent implements OnInit {
const cidr = new IPCIDR(this.zone.network);
this.ipRange = cidr.start() + ' - ' + cidr.end();
+ }
+ hostSelected(host: Host) {
+ this.otherHostSelect.emit(host);
}
}