From 12be8505814b4284860d472f9443448f70d2cab9 Mon Sep 17 00:00:00 2001 From: insanity Date: Thu, 20 Sep 2018 23:06:22 +0900 Subject: [PATCH] discovery status added --- src/app/pages/home/home-page.component.html | 8 +++---- src/app/pages/home/home-page.component.ts | 13 ++++++------ src/app/pages/pages.component.html | 9 +++++--- src/app/pages/pages.component.ts | 13 ++++++++---- .../component/service-detail.component.html | 2 +- .../service/discovery-config.service.ts | 21 +++++++++++++------ 6 files changed, 41 insertions(+), 25 deletions(-) diff --git a/src/app/pages/home/home-page.component.html b/src/app/pages/home/home-page.component.html index 36e86bf..5b6b160 100644 --- a/src/app/pages/home/home-page.component.html +++ b/src/app/pages/home/home-page.component.html @@ -1,6 +1,6 @@
-
+
@@ -95,9 +95,9 @@ - - + + Discovery is being stopped... diff --git a/src/app/pages/home/home-page.component.ts b/src/app/pages/home/home-page.component.ts index c005487..9018126 100644 --- a/src/app/pages/home/home-page.component.ts +++ b/src/app/pages/home/home-page.component.ts @@ -15,7 +15,7 @@ import { toMetaIPType, MetaIPTypeEnum, toMetaCryptoType, MetaCryptoTypeEnum, toM import { DiscoveryModeType } from '@overflow/model/discovery/discovery'; import { ProbeService, requesterID } from '../../../commons/service/probe.service'; -import { DiscoveryConfigService } from '../../../commons/service/discovery-config.service'; +import { DiscoveryConfigService, DiscoveryStatusType } from '../../../commons/service/discovery-config.service'; import { Node } from '../../../commons/model/node'; import { Link } from '../../../commons/model/link'; @@ -114,10 +114,10 @@ export class HomePageComponent implements OnInit, OnDestroy { this.discoveryConfigService.discoverHost.subscribe(res => { this.discoverHost = res as DiscoverHost; }); - this.discoveryConfigService.started.subscribe(res => { - if (res) { + this.discoveryConfigService.discoveryStatus.subscribe(res => { + if (res === DiscoveryStatusType.Started) { this.startDiscovery(); - } else { + } else if (res === DiscoveryStatusType.Stopping) { if (null !== this.discoveryRequestID) { this.stopping = true; this.probeService.send('DiscoveryService.DiscoverStop', requesterID, this.discoveryRequestID); @@ -639,8 +639,6 @@ export class HomePageComponent implements OnInit, OnDestroy { public DiscoveryStop(stopDate: Date) { console.log('DiscoveryStop', stopDate); - this.discoveryConfigService.setStarted(false); - this.discoveryRequestID = null; const _millisecond = Math.abs(stopDate.getTime() - this.discoveryStartDate.getTime()); @@ -674,7 +672,8 @@ export class HomePageComponent implements OnInit, OnDestroy { console.log(`Host: ${hostCount}개 Service: ${serviceCount}개`); - this.discoveryConfigService.setStarted(false); + this.discoveryConfigService.setDiscoveryStatus(DiscoveryStatusType.Stopped); + this.simulationRestart(true); this.zoomToFit(0.95, 500); diff --git a/src/app/pages/pages.component.html b/src/app/pages/pages.component.html index f861435..1be01f1 100644 --- a/src/app/pages/pages.component.html +++ b/src/app/pages/pages.component.html @@ -3,7 +3,7 @@
-
-
+ +