From a76fea585a1dd9ae224fd240d45bd953ed26b5aa Mon Sep 17 00:00:00 2001 From: insanity Date: Wed, 19 Sep 2018 13:40:32 +0900 Subject: [PATCH] ing --- package-lock.json | 27 ++++ package.json | 13 +- src/app/pages/home/home-page.component.ts | 1 - src/commons/commons.module.ts | 14 +- .../component/host-detail.component.html | 25 ++- .../component/host-detail.component.ts | 20 ++- .../component/node-detail.component.html | 4 + .../component/service-detail.component.html | 20 ++- .../component/service-detail.component.ts | 14 +- .../component/zone-detail.component.html | 153 +++++++++++++----- yarn.lock | 15 ++ 11 files changed, 249 insertions(+), 57 deletions(-) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..30eefef --- /dev/null +++ b/package-lock.json @@ -0,0 +1,27 @@ +{ + "name": "scanner-app", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ngx-perfect-scrollbar": { + "version": "6.3.1", + "resolved": "https://nexus.loafle.net/repository/npm-all/ngx-perfect-scrollbar/-/ngx-perfect-scrollbar-6.3.1.tgz", + "integrity": "sha512-kgHT0A1pDnZO5CxB4TOwflHb1Q152wZ3Nec0Zf7d29bgA1kAFl6oK8wFmYtGWeaFNhSCExus6TOq3sWN3xRQig==", + "requires": { + "perfect-scrollbar": "1.4.0", + "resize-observer-polyfill": "1.5.0" + } + }, + "perfect-scrollbar": { + "version": "1.4.0", + "resolved": "https://nexus.loafle.net/repository/npm-all/perfect-scrollbar/-/perfect-scrollbar-1.4.0.tgz", + "integrity": "sha512-/2Sk/khljhdrsamjJYS5NjrH+GKEHEwh7zFSiYyxROyYKagkE4kSn2zDQDRTOMo8mpT2jikxx6yI1dG7lNP/hw==" + }, + "resize-observer-polyfill": { + "version": "1.5.0", + "resolved": "https://nexus.loafle.net/repository/npm-all/resize-observer-polyfill/-/resize-observer-polyfill-1.5.0.tgz", + "integrity": "sha512-M2AelyJDVR/oLnToJLtuDJRBBWUGUvvGigj1411hXhAdyFWqMaqHp7TixW3FpiLuVaikIcR1QL+zqoJoZlOgpg==" + } + } +} diff --git a/package.json b/package.json index f0ad0ed..a47287a 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "private": true, "dependencies": { "electron-devtools-installer": "^2.2.4", + "ngx-perfect-scrollbar": "^6.3.1", "rxjs": "^6.2.2", "sqlite3": "^4.0.2" }, @@ -54,24 +55,25 @@ "codelyzer": "~4.2.1", "core-js": "^2.5.4", "d3": "^5.7.0", - "dexie": "^2.0.4", "devtron": "^1.4.0", + "dexie": "^2.0.4", "electron": "^2.0.9", "electron-builder": "^20.28.4", - "electron-connect-webpack-plugin": "^0.1.1", "electron-connect": "^0.6.3", + "electron-connect-webpack-plugin": "^0.1.1", "electron-debug": "^2.0.0", "electron-window-state": "^5.0.1", "file-uri-to-path": "^1.0.0", "file-url": "^2.0.2", "fs-extra": "^7.0.0", + "ip-cidr": "^2.0.0", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~1.7.1", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.0", - "karma-jasmine-html-reporter": "^0.2.2", "karma-jasmine": "~1.1.1", + "karma-jasmine-html-reporter": "^0.2.2", "ngrx-store-freeze": "^0.2.4", "npm-run-all": "^4.1.3", "primeng": "^6.1.3", @@ -85,7 +87,6 @@ "wait-on": "^2.1.0", "webpack-cli": "^3.1.0", "webpack-node-externals": "^1.7.2", - "zone.js": "^0.8.26", - "ip-cidr": "^2.0.0" + "zone.js": "^0.8.26" } -} \ No newline at end of file +} diff --git a/src/app/pages/home/home-page.component.ts b/src/app/pages/home/home-page.component.ts index 2e1e943..417209c 100644 --- a/src/app/pages/home/home-page.component.ts +++ b/src/app/pages/home/home-page.component.ts @@ -16,7 +16,6 @@ import { Link } from '../../../commons/model/link'; import { RPCError } from '@overflow/rpc-js'; import { toMetaIPType, MetaIPTypeEnum, toMetaCryptoType, MetaCryptoTypeEnum, toMetaPortType, MetaPortTypeEnum } from '@overflow/model/meta'; import { DiscoveryModeType } from '@overflow/model/discovery/discovery'; -import { PingResult } from '@overflow/model/ping'; @Component({ selector: 'app-pages-home', diff --git a/src/commons/commons.module.ts b/src/commons/commons.module.ts index a6eec5b..9a5c00f 100644 --- a/src/commons/commons.module.ts +++ b/src/commons/commons.module.ts @@ -2,15 +2,21 @@ import { NgModule, APP_INITIALIZER } from '@angular/core'; import { CommonModule } from '@angular/common'; import { CommonsUIModule } from '@overflow/commons/ui/commons-ui.module'; - +import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; +import { PERFECT_SCROLLBAR_CONFIG } from 'ngx-perfect-scrollbar'; +import { PerfectScrollbarConfigInterface } from 'ngx-perfect-scrollbar'; import { COMPONENTS } from './component'; +const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { + suppressScrollX: true +}; + @NgModule({ imports: [ CommonModule, - CommonsUIModule, + PerfectScrollbarModule ], exports: [ ...COMPONENTS, @@ -19,6 +25,10 @@ import { COMPONENTS } from './component'; ...COMPONENTS, ], providers: [ + { + provide: PERFECT_SCROLLBAR_CONFIG, + useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG + } ] }) export class CommonsModule { } diff --git a/src/commons/component/host-detail.component.html b/src/commons/component/host-detail.component.html index 8ea396a..2e2d5c7 100644 --- a/src/commons/component/host-detail.component.html +++ b/src/commons/component/host-detail.component.html @@ -79,7 +79,26 @@ + +
Retries : + +
+ + +
+ + +
+ Checking.... +
  • @@ -100,11 +119,9 @@
    Min: {{pingResult.summary.minTime}} ms
    Min: {{pingResult.summary.maxTime}} ms
+
- - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/commons/component/host-detail.component.ts b/src/commons/component/host-detail.component.ts index 9fae351..1e64938 100644 --- a/src/commons/component/host-detail.component.ts +++ b/src/commons/component/host-detail.component.ts @@ -2,9 +2,8 @@ import { Component, Input, Output, EventEmitter } from '@angular/core'; import { Host } from '@overflow/model/discovery'; import { ProbeService } from '../service/probe.service'; import { map, catchError, take } from 'rxjs/operators'; -import { PingResult, PingResponse } from '@overflow/model/ping'; +import { PingResult } from '@overflow/model/ping'; import { of } from 'rxjs'; -import { Message } from 'primeng/primeng'; @Component({ @@ -15,16 +14,26 @@ import { Message } from 'primeng/primeng'; export class HostDetailComponent { @Input() host: Host; + + healthResponse: string; + + pingWaiting: boolean; pingResult: PingResult; + retries: number; constructor( - private probeService: ProbeService + private probeService: ProbeService, ) { + this.pingWaiting = false; + this.retries = 5; } doPing() { + this.pingWaiting = true; + this.pingWaiting = true; + const option = { - Retry: 3, + Retry: this.retries, Interval: 1, Deadline: 1, }; @@ -33,13 +42,16 @@ export class HostDetailComponent { .call('PingService.PingHost', this.host, option) .pipe( map((pingResult: PingResult) => { + this.healthResponse = 'aslkdfjas\nasdflskjdf'; if (pingResult) { this.pingResult = pingResult; } + this.pingWaiting = false; }), catchError(error => { console.log(error); alert('An error has occurred.'); + this.pingWaiting = false; return of(); }), take(1) diff --git a/src/commons/component/node-detail.component.html b/src/commons/component/node-detail.component.html index 98d8490..87f95b9 100644 --- a/src/commons/component/node-detail.component.html +++ b/src/commons/component/node-detail.component.html @@ -1,5 +1,8 @@
+
+ + @@ -18,5 +21,6 @@ +
\ No newline at end of file diff --git a/src/commons/component/service-detail.component.html b/src/commons/component/service-detail.component.html index 57a38a8..b39c56c 100644 --- a/src/commons/component/service-detail.component.html +++ b/src/commons/component/service-detail.component.html @@ -21,7 +21,6 @@ -
    @@ -60,6 +59,25 @@
+ + +
+ Checking.... +
+
+
    +
  • + + {{pingResult.responses[key].error}} + + + {{pingResult.responses[key].time}}ms + +
  • +
+
+
+
\ No newline at end of file diff --git a/src/commons/component/service-detail.component.ts b/src/commons/component/service-detail.component.ts index 9d51566..f34e8a0 100644 --- a/src/commons/component/service-detail.component.ts +++ b/src/commons/component/service-detail.component.ts @@ -13,15 +13,19 @@ import { of } from 'rxjs'; export class ServiceDetailComponent { @Input() service: Service; - @Output() ping = new EventEmitter(); + pingWaiting: boolean; + pingResult: PingResult; constructor( private probeService: ProbeService ) { - + this.pingWaiting = false; } doPing() { + this.pingWaiting = true; + + const option = { Retry: 3, Interval: 1, @@ -32,11 +36,15 @@ export class ServiceDetailComponent { .call('PingService.PingService', this.service, option) .pipe( map((pingResult: PingResult) => { - this.ping.emit(pingResult); + if (pingResult) { + this.pingResult = pingResult; + } + this.pingWaiting = false; }), catchError(error => { console.log(error); alert('An error has occurred.'); + this.pingWaiting = false; return of(); }), take(1) diff --git a/src/commons/component/zone-detail.component.html b/src/commons/component/zone-detail.component.html index 8c84c27..916269f 100644 --- a/src/commons/component/zone-detail.component.html +++ b/src/commons/component/zone-detail.component.html @@ -15,47 +15,128 @@ + - -
    -
  • - Interface - {{zone.iface}} -
  • - -
  • - Mac Address - {{zone.mac}} -
  • - -
  • - IP Version - {{zone.metaIPType.key}} -
  • - -
  • - Network - {{zone.network}} -
  • - -
  • - IP Range - {{ipRange}} -
  • - -
+ +
    +
  • + Interface + {{zone.iface}} +
  • +
  • + Mac Address + {{zone.mac}} +
  • +
  • + IP Version + {{zone.metaIPType.key}} +
  • +
  • + Network + {{zone.network}} +
  • +
  • + IP Range + {{ipRange}} +
  • + +
  • + Interface + {{zone.iface}} +
  • +
  • + Mac Address + {{zone.mac}} +
  • +
  • + IP Version + {{zone.metaIPType.key}} +
  • +
  • + Network + {{zone.network}} +
  • +
  • + IP Range + {{ipRange}} +
  • +
  • + Interface + {{zone.iface}} +
  • +
  • + Mac Address + {{zone.mac}} +
  • +
  • + IP Version + {{zone.metaIPType.key}} +
  • +
  • + Network + {{zone.network}} +
  • +
  • + IP Range + {{ipRange}} +
  • +
  • + Interface + {{zone.iface}} +
  • +
  • + Mac Address + {{zone.mac}} +
  • +
  • + IP Version + {{zone.metaIPType.key}} +
  • +
  • + Network + {{zone.network}} +
  • +
  • + IP Range + {{ipRange}} +
  • +
  • + Interface + {{zone.iface}} +
  • +
  • + Mac Address + {{zone.mac}} +
  • +
  • + IP Version + {{zone.metaIPType.key}} +
  • +
  • + Network + {{zone.network}} +
  • +
  • + IP Range + {{ipRange}} +
  • +
+
- + + + +
\ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 734a645..902c343 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5264,6 +5264,13 @@ ngrx-store-freeze@^0.2.4: dependencies: deep-freeze-strict "^1.1.1" +ngx-perfect-scrollbar@^6.3.1: + version "6.3.1" + resolved "https://nexus.loafle.net/repository/npm-all/ngx-perfect-scrollbar/-/ngx-perfect-scrollbar-6.3.1.tgz#38e5e3259a61e911d82ba24f06fc01ab92eaf919" + dependencies: + perfect-scrollbar "^1.4.0" + resize-observer-polyfill "^1.4.0" + nice-try@^1.0.4: version "1.0.5" resolved "https://nexus.loafle.net/repository/npm-all/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -5870,6 +5877,10 @@ pend@~1.2.0: version "1.2.0" resolved "https://nexus.loafle.net/repository/npm-all/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" +perfect-scrollbar@^1.4.0: + version "1.4.0" + resolved "https://nexus.loafle.net/repository/npm-all/perfect-scrollbar/-/perfect-scrollbar-1.4.0.tgz#5d014ef9775e1f43058a1dbae9ed1daf0e7091f1" + performance-now@^2.1.0: version "2.1.0" resolved "https://nexus.loafle.net/repository/npm-all/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -6475,6 +6486,10 @@ requires-port@^1.0.0: version "1.0.0" resolved "https://nexus.loafle.net/repository/npm-all/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" +resize-observer-polyfill@^1.4.0: + version "1.5.0" + resolved "https://nexus.loafle.net/repository/npm-all/resize-observer-polyfill/-/resize-observer-polyfill-1.5.0.tgz#660ff1d9712a2382baa2cad450a4716209f9ca69" + resolve-cwd@^2.0.0: version "2.0.0" resolved "https://nexus.loafle.net/repository/npm-all/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"