...
This commit is contained in:
parent
8b255fb19f
commit
884fbcd36d
|
@ -4,4 +4,5 @@ import { PingSummary } from './summary';
|
||||||
export interface PingResult {
|
export interface PingResult {
|
||||||
responses: Map<number, PingResponse>;
|
responses: Map<number, PingResponse>;
|
||||||
summary: PingSummary;
|
summary: PingSummary;
|
||||||
|
raw?: string[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
<p-blockUI [blocked]="block"></p-blockUI>
|
||||||
|
|
||||||
<div id="app-container">
|
<div id="app-container">
|
||||||
<div id="app-chrome" class="focused">
|
<div id="app-chrome" class="focused">
|
||||||
<app-title-bar *ngIf="showTitleBar"></app-title-bar>
|
<app-title-bar *ngIf="showTitleBar"></app-title-bar>
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { MenuEvent } from '../commons/type';
|
||||||
export class AppComponent implements OnInit, OnDestroy {
|
export class AppComponent implements OnInit, OnDestroy {
|
||||||
title = 'scanner-app';
|
title = 'scanner-app';
|
||||||
showTitleBar: boolean;
|
showTitleBar: boolean;
|
||||||
|
block: boolean;
|
||||||
|
|
||||||
menuSubscription: Subscription;
|
menuSubscription: Subscription;
|
||||||
displayAbout: boolean;
|
displayAbout: boolean;
|
||||||
|
@ -25,10 +26,10 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
public constructor(
|
public constructor(
|
||||||
private changeDetector: ChangeDetectorRef,
|
private changeDetector: ChangeDetectorRef,
|
||||||
private electronProxyService: ElectronProxyService,
|
private electronProxyService: ElectronProxyService,
|
||||||
private probeService: ProbeService,
|
|
||||||
) {
|
) {
|
||||||
// this.showTitleBar = !__LINUX__;
|
// this.showTitleBar = !__LINUX__;
|
||||||
this.showTitleBar = false;
|
this.showTitleBar = false;
|
||||||
|
this.block = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
|
@ -95,6 +95,12 @@
|
||||||
<p-blockUI id="discovery-blockUI" [target]="discoveryContainer" [blocked]="discoveryRequestID !== null">
|
<p-blockUI id="discovery-blockUI" [target]="discoveryContainer" [blocked]="discoveryRequestID !== null">
|
||||||
</p-blockUI>
|
</p-blockUI>
|
||||||
|
|
||||||
|
<p-dialog header="Stopping..." [(visible)]="stopping" [modal]="true" [responsive]="false" [width]="300" [minWidth]="200"
|
||||||
|
[minY]="70" [closeOnEscape]="false" [closable]="false" [hidden]="true">
|
||||||
|
|
||||||
|
</p-dialog>
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="ui-fluid">
|
<!-- <div class="ui-fluid">
|
||||||
<div class="ui-g">
|
<div class="ui-g">
|
||||||
<div class="ui-g-12">
|
<div class="ui-g-12">
|
||||||
|
|
|
@ -37,6 +37,7 @@ export class HomePageComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
blockedPanel = false;
|
blockedPanel = false;
|
||||||
displaySidebar = false;
|
displaySidebar = false;
|
||||||
|
stopping = false;
|
||||||
|
|
||||||
blockedDocument = false;
|
blockedDocument = false;
|
||||||
|
|
||||||
|
@ -118,6 +119,7 @@ export class HomePageComponent implements OnInit, OnDestroy {
|
||||||
this.startDiscovery();
|
this.startDiscovery();
|
||||||
} else {
|
} else {
|
||||||
if (null !== this.discoveryRequestID) {
|
if (null !== this.discoveryRequestID) {
|
||||||
|
this.stopping = true;
|
||||||
this.probeService.send('DiscoveryService.DiscoverStop', requesterID, this.discoveryRequestID);
|
this.probeService.send('DiscoveryService.DiscoverStop', requesterID, this.discoveryRequestID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -637,6 +639,8 @@ export class HomePageComponent implements OnInit, OnDestroy {
|
||||||
public DiscoveryStop(stopDate: Date) {
|
public DiscoveryStop(stopDate: Date) {
|
||||||
console.log('DiscoveryStop', stopDate);
|
console.log('DiscoveryStop', stopDate);
|
||||||
|
|
||||||
|
this.discoveryConfigService.setStarted(false);
|
||||||
|
|
||||||
this.discoveryRequestID = null;
|
this.discoveryRequestID = null;
|
||||||
|
|
||||||
const _millisecond = Math.abs(stopDate.getTime() - this.discoveryStartDate.getTime());
|
const _millisecond = Math.abs(stopDate.getTime() - this.discoveryStartDate.getTime());
|
||||||
|
@ -678,6 +682,7 @@ export class HomePageComponent implements OnInit, OnDestroy {
|
||||||
this.resultMsg.push(hostCount + '');
|
this.resultMsg.push(hostCount + '');
|
||||||
this.resultMsg.push(serviceCount + '');
|
this.resultMsg.push(serviceCount + '');
|
||||||
this.resultMsg.push(hours + ':' + minutes + ':' + seconds);
|
this.resultMsg.push(hours + ':' + minutes + ':' + seconds);
|
||||||
|
this.stopping = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { DiscoverHost, Zone } from '@overflow/model/discovery';
|
import { DiscoverHost, Zone } from '@overflow/model/discovery';
|
||||||
import { DiscoveryConfigService } from '../../commons/service/discovery-config.service';
|
import { DiscoveryConfigService } from '../../commons/service/discovery-config.service';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
|
||||||
enum MenuOrientation {
|
enum MenuOrientation {
|
||||||
STATIC,
|
STATIC,
|
||||||
|
|
|
@ -93,8 +93,8 @@
|
||||||
<br />
|
<br />
|
||||||
<p-progressSpinner *ngIf="pingWaiting"></p-progressSpinner>
|
<p-progressSpinner *ngIf="pingWaiting"></p-progressSpinner>
|
||||||
|
|
||||||
<textarea style="width: 100%; height: 200px; background-color: black; color:#fff;" *ngIf="!pingWaiting && pingResult"
|
<textarea style="width: 100%; height: 250px; background-color: black; color:#fff;" *ngIf="!pingWaiting && pingResult"
|
||||||
pInputTextarea autoResize="autoResize" [(ngModel)]="pingResult.raw"></textarea>
|
pInputTextarea autoResize="autoResize" [(ngModel)]="pingResultRaw"></textarea>
|
||||||
|
|
||||||
</p-tabPanel>
|
</p-tabPanel>
|
||||||
</p-tabView>
|
</p-tabView>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
|
||||||
|
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { map, catchError, take } from 'rxjs/operators';
|
import { map, catchError, take } from 'rxjs/operators';
|
||||||
|
@ -14,8 +14,7 @@ import { ProbeService } from '../service/probe.service';
|
||||||
templateUrl: './host-detail.component.html',
|
templateUrl: './host-detail.component.html',
|
||||||
styleUrls: ['./host-detail.component.scss'],
|
styleUrls: ['./host-detail.component.scss'],
|
||||||
})
|
})
|
||||||
export class HostDetailComponent {
|
export class HostDetailComponent implements OnChanges {
|
||||||
|
|
||||||
@Input() host: Host;
|
@Input() host: Host;
|
||||||
|
|
||||||
pingWaiting: boolean;
|
pingWaiting: boolean;
|
||||||
|
@ -25,6 +24,7 @@ export class HostDetailComponent {
|
||||||
deadline: number;
|
deadline: number;
|
||||||
|
|
||||||
pingResult: PingResult;
|
pingResult: PingResult;
|
||||||
|
pingResultRaw: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private probeService: ProbeService,
|
private probeService: ProbeService,
|
||||||
|
@ -35,6 +35,11 @@ export class HostDetailComponent {
|
||||||
this.deadline = 1;
|
this.deadline = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnChanges(simpleChanges: SimpleChanges): void {
|
||||||
|
this.pingResult = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
doPing() {
|
doPing() {
|
||||||
this.pingWaiting = true;
|
this.pingWaiting = true;
|
||||||
|
|
||||||
|
@ -48,8 +53,10 @@ export class HostDetailComponent {
|
||||||
.call<PingResult>('PingService.PingHost', this.host, option)
|
.call<PingResult>('PingService.PingHost', this.host, option)
|
||||||
.pipe(
|
.pipe(
|
||||||
map((pingResult: PingResult) => {
|
map((pingResult: PingResult) => {
|
||||||
|
console.log(pingResult);
|
||||||
if (pingResult) {
|
if (pingResult) {
|
||||||
this.pingResult = pingResult;
|
this.pingResult = pingResult;
|
||||||
|
this.pingResultRaw = pingResult.raw.join('');
|
||||||
}
|
}
|
||||||
this.pingWaiting = false;
|
this.pingWaiting = false;
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</p-tabPanel>
|
</p-tabPanel>
|
||||||
|
|
||||||
<p-tabPanel header="Health">
|
<p-tabPanel header="Health" *ngIf="service.port.metaPortType.key === 'TCP'">
|
||||||
|
|
||||||
<div class="ui-g-10 ui-g-offset-2">Count :
|
<div class="ui-g-10 ui-g-offset-2">Count :
|
||||||
<input type="number" pInputText [(ngModel)]="count" min="1" max="50">
|
<input type="number" pInputText [(ngModel)]="count" min="1" max="50">
|
||||||
|
@ -71,20 +71,28 @@
|
||||||
<input type="number" pInputText [(ngModel)]="deadline" min="1" max="10">
|
<input type="number" pInputText [(ngModel)]="deadline" min="1" max="10">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" pButton label="Ping" (click)="doPing()" class="ui-button-secondary ui-pingbn-position"></button>
|
<button type="button" pButton label="Ping" (click)="doPing()" class="ui-button-secondary"></button>
|
||||||
<p-progressSpinner *ngIf="pingWaiting"></p-progressSpinner>
|
<p-progressSpinner *ngIf="pingWaiting"></p-progressSpinner>
|
||||||
<div *ngIf="!pingWaiting && pingResult">
|
<p-table [value]="pingResult.responses | objectKeys" *ngIf="!pingWaiting && pingResult">
|
||||||
<ul>
|
<ng-template pTemplate="header">
|
||||||
<li *ngFor="let key of pingResult.responses | objectKeys">
|
<tr>
|
||||||
<span *ngIf="pingResult.responses[key].error else value">
|
<th style="width: 3.25em">No.</th>
|
||||||
|
<th>Response Time (ms)</th>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template pTemplate="body" let-key let-i="rowIndex">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{{i + 1}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{pingResult.responses[key].time}}
|
||||||
{{pingResult.responses[key].error}}
|
{{pingResult.responses[key].error}}
|
||||||
</span>
|
</td>
|
||||||
<ng-template #value>
|
</tr>
|
||||||
Response time {{key}} : {{pingResult.responses[key].time}}ms
|
</ng-template>
|
||||||
</ng-template>
|
</p-table>
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</p-tabPanel>
|
</p-tabPanel>
|
||||||
|
|
||||||
</p-tabView>
|
</p-tabView>
|
||||||
|
|
|
@ -15,11 +15,13 @@ export class ServiceDetailComponent {
|
||||||
@Input() service: Service;
|
@Input() service: Service;
|
||||||
pingWaiting: boolean;
|
pingWaiting: boolean;
|
||||||
pingResult: PingResult;
|
pingResult: PingResult;
|
||||||
|
pingResultStr: string;
|
||||||
|
|
||||||
count: number;
|
count: number;
|
||||||
interval: number;
|
interval: number;
|
||||||
deadline: number;
|
deadline: number;
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private probeService: ProbeService
|
private probeService: ProbeService
|
||||||
) {
|
) {
|
||||||
|
@ -45,8 +47,8 @@ export class ServiceDetailComponent {
|
||||||
console.log(pingResult);
|
console.log(pingResult);
|
||||||
if (pingResult) {
|
if (pingResult) {
|
||||||
this.pingResult = pingResult;
|
this.pingResult = pingResult;
|
||||||
|
this.pingWaiting = false;
|
||||||
}
|
}
|
||||||
this.pingWaiting = false;
|
|
||||||
}),
|
}),
|
||||||
catchError(error => {
|
catchError(error => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
@ -58,5 +60,4 @@ export class ServiceDetailComponent {
|
||||||
)
|
)
|
||||||
.subscribe();
|
.subscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>ElectronApp</title>
|
<title>overFlow</title>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user