From 33da27c26c6e989c84cea4a9323be4c0cd31ee31 Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 11 Sep 2018 02:47:33 +0900 Subject: [PATCH] ing --- src/app/pages/home/home-page.component.html | 10 +++------- src/app/pages/home/home-page.component.ts | 8 ++++---- src/commons/model/node.ts | 8 ++++++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/app/pages/home/home-page.component.html b/src/app/pages/home/home-page.component.html index f834a16..751f316 100644 --- a/src/app/pages/home/home-page.component.html +++ b/src/app/pages/home/home-page.component.html @@ -16,19 +16,15 @@
- - - - - - - {{node.id}} + + + {{node.id}} diff --git a/src/app/pages/home/home-page.component.ts b/src/app/pages/home/home-page.component.ts index 295dcc8..1a8075a 100644 --- a/src/app/pages/home/home-page.component.ts +++ b/src/app/pages/home/home-page.component.ts @@ -127,7 +127,7 @@ export class HomePageComponent implements OnInit, OnDestroy { this.links = []; this.nodes.push( - { id: '192.168.1.0/24', group: 'zone', target: this.zone, fx: width / 2, fy: height / 2 }, + { id: '192.168.1.0/24', group: 'zone', target: this.zone, fx: width / 2, fy: height / 2, r: 60 }, // { id: '192.168.1.1' }, // { id: '192.168.1.2' }, ); @@ -139,7 +139,7 @@ export class HomePageComponent implements OnInit, OnDestroy { this.simulationRestart(); - // this.probeService.send('DiscoveryService.DiscoverHost', requesterID, this.zone, this.discoverHost); + this.probeService.send('DiscoveryService.DiscoverHost', requesterID, this.zone, this.discoverHost); // this.probeService.send( // 'DiscoveryService.DiscoverHost', @@ -288,7 +288,7 @@ export class HomePageComponent implements OnInit, OnDestroy { console.log('DiscoveredHost', host); const hostId = `${host.address}`; const zoneNode = this.getNode('192.168.1.0/24'); - const hostNode = new Node(hostId, 'host', host); + const hostNode = new Node(hostId, 'host', host, 40); hostNode.x = zoneNode.x; hostNode.y = zoneNode.y; @@ -315,7 +315,7 @@ export class HomePageComponent implements OnInit, OnDestroy { const serviceId = `${service.port.host.address}-${service.port.portNumber}-${service.key}`; const hostNode = this.getNode(hostId); - const serviceNode = new Node(serviceId, 'service', service); + const serviceNode = new Node(serviceId, 'service', service, 30); serviceNode.x = hostNode.x; serviceNode.y = hostNode.y; diff --git a/src/commons/model/node.ts b/src/commons/model/node.ts index 43b47d8..292817f 100644 --- a/src/commons/model/node.ts +++ b/src/commons/model/node.ts @@ -40,11 +40,15 @@ export class Node implements d3.SimulationNodeDatum { image?: string; - constructor(id, group, target) { + constructor(id, group, target, r?) { this.id = id; this.group = group; this.target = target; - this.r = 50; + if (undefined === r) { + this.r = 20; + } else { + this.r = r; + } } }