This commit is contained in:
crusader 2018-09-17 16:20:59 +09:00
parent 11d0f4c682
commit 39ab3971ee

View File

@ -46,7 +46,7 @@ export class HomePageComponent implements OnInit, OnDestroy {
private discoveryContainerWidth: number; private discoveryContainerWidth: number;
private discoveryContainerHeight: number; private discoveryContainerHeight: number;
private discoveryStartDate: Date; private discoveryStartDate: Date;
private discoveryRequestID: string; private discoveryRequestID: string | null;
private readonly maxScale: number; private readonly maxScale: number;
private readonly minScale: number; private readonly minScale: number;
@ -70,7 +70,9 @@ export class HomePageComponent implements OnInit, OnDestroy {
@HostListener('window:beforeunload', ['$event']) @HostListener('window:beforeunload', ['$event'])
onBeforeUnload(event) { onBeforeUnload(event) {
this.probeService.send('DiscoveryService.DiscoverStop', requesterID, this.discoveryRequestID); if (null !== this.discoveryRequestID) {
this.probeService.send('DiscoveryService.DiscoverStop', requesterID, this.discoveryRequestID);
}
// event.returnValue = true; // event.returnValue = true;
} }
@ -88,6 +90,8 @@ export class HomePageComponent implements OnInit, OnDestroy {
this.hosts = []; this.hosts = [];
this.ports = []; this.ports = [];
this.discoveryRequestID = null;
this.maxScale = 1; this.maxScale = 1;
this.minScale = 0.7; this.minScale = 0.7;
} }
@ -552,7 +556,7 @@ export class HomePageComponent implements OnInit, OnDestroy {
@RPCSubscriber({ method: 'DiscoveryService.QueueingTimeout' }) @RPCSubscriber({ method: 'DiscoveryService.QueueingTimeout' })
public DiscoveryQueueingTimeout(queueingTimeoutDate: Date) { public DiscoveryQueueingTimeout(queueingTimeoutDate: Date) {
console.log('DiscoveryQueueingTimeout', queueingTimeoutDate); console.log('DiscoveryQueueingTimeout', queueingTimeoutDate);
this.discoveryRequestID = ''; this.discoveryRequestID = null;
} }
/** /**
@ -571,7 +575,7 @@ export class HomePageComponent implements OnInit, OnDestroy {
public DiscoveryStop(stopDate: Date) { public DiscoveryStop(stopDate: Date) {
console.log('DiscoveryStop', stopDate); console.log('DiscoveryStop', stopDate);
this.discoveryRequestID = ''; this.discoveryRequestID = null;
const _millisecond = Math.abs(stopDate.getTime() - this.discoveryStartDate.getTime()); const _millisecond = Math.abs(stopDate.getTime() - this.discoveryStartDate.getTime());