From bb38d922e41ca62f8ed43f14e48bc7970d60d732 Mon Sep 17 00:00:00 2001 From: insanity Date: Thu, 14 Jun 2018 16:42:04 +0900 Subject: [PATCH] noauth --- .../component/infra-host-ips.component.html | 7 +- .../noauth-probe-detail.component.html | 7 +- .../noauth-probe-detail.component.ts | 40 ++++- .../noauth-probe-general.component.html | 2 +- .../noauth-probe-list.component.html | 6 +- .../component/noauth-probe-list.component.ts | 13 ++ .../old/noauth-probe-list.component.html | 97 ----------- .../old/noauth-probe-list.component.ts | 164 ------------------ .../ui/component/key-value.component.ts | 2 +- src/styles.scss | 29 ++-- 10 files changed, 77 insertions(+), 290 deletions(-) delete mode 100644 @overflow/noauth-probe/component/old/noauth-probe-list.component.html delete mode 100644 @overflow/noauth-probe/component/old/noauth-probe-list.component.ts diff --git a/@overflow/infra/component/infra-host-ips.component.html b/@overflow/infra/component/infra-host-ips.component.html index d8a2f64..061ed58 100644 --- a/@overflow/infra/component/infra-host-ips.component.html +++ b/@overflow/infra/component/infra-host-ips.component.html @@ -8,6 +8,8 @@ + + Interface Ver. Address @@ -15,8 +17,11 @@ Gateway - + + + + {{rowData.iface}} {{rowData.metaIPType.key}} {{rowData.address}} diff --git a/@overflow/noauth-probe/component/noauth-probe-detail.component.html b/@overflow/noauth-probe/component/noauth-probe-detail.component.html index 97dc1fc..98fc1db 100644 --- a/@overflow/noauth-probe/component/noauth-probe-detail.component.html +++ b/@overflow/noauth-probe/component/noauth-probe-detail.component.html @@ -9,9 +9,10 @@
- - + +
diff --git a/@overflow/noauth-probe/component/noauth-probe-detail.component.ts b/@overflow/noauth-probe/component/noauth-probe-detail.component.ts index 69f6e7b..9646248 100644 --- a/@overflow/noauth-probe/component/noauth-probe-detail.component.ts +++ b/@overflow/noauth-probe/component/noauth-probe-detail.component.ts @@ -1,8 +1,6 @@ import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; -import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe'; -import { Store, select } from '@ngrx/store'; -import { Observable, of, Subscription } from 'rxjs'; -import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators'; +import { Observable, of } from 'rxjs'; +import { catchError, map, tap, take } from 'rxjs/operators'; import { NoAuthProbeService } from '../service/noauth-probe.service'; import { NoAuthProbe, InfraHostIP } from '@overflow/commons-typescript'; import { ConfirmationService } from 'primeng/primeng'; @@ -50,13 +48,15 @@ export class NoAuthProbeDetailComponent implements OnInit { onNICSelect(infraHostIP: InfraHostIP) { this.selectedNIC = infraHostIP; - console.log(this.selectedNIC); } accept() { + let message = 'Start collecting data as a Probe.\n'; + message += this.selectedNIC.address; + this.confirmationService.confirm({ header: 'Are you sure to accept this Probe?', - message: 'Start collecting data as a Probe.', + message: message, icon: 'fa-check', accept: () => { this.noAuthProbeService.acceptNoAuthProbe(this.id, this.selectedNIC.address) @@ -84,6 +84,32 @@ export class NoAuthProbeDetailComponent implements OnInit { } deny() { - alert('609호에 있는 강아지 deny'); + this.confirmationService.confirm({ + header: 'Are you sure to deny this Probe', + message: 'It will be permanently deleted.', + icon: 'fa fa-trash', + accept: () => { + this.noAuthProbeService.denyNoauthProbe(this.id) + .pipe( + tap(() => { + this.pending$ = of(true); + }), + map((noauthProbes: NoAuthProbe[]) => { + this.back.emit(); + }), + catchError(error => { + this.error$ = of(error); + return of(); + }), + tap(() => { + this.pending$ = of(false); + }), + take(1), + ).subscribe(); + }, + reject: () => { + + } + }); } } diff --git a/@overflow/noauth-probe/component/noauth-probe-general.component.html b/@overflow/noauth-probe/component/noauth-probe-general.component.html index 483ff4d..0e03124 100644 --- a/@overflow/noauth-probe/component/noauth-probe-general.component.html +++ b/@overflow/noauth-probe/component/noauth-probe-general.component.html @@ -21,7 +21,7 @@ - + diff --git a/@overflow/noauth-probe/component/noauth-probe-list.component.html b/@overflow/noauth-probe/component/noauth-probe-list.component.html index 9893d83..b82e5a1 100644 --- a/@overflow/noauth-probe/component/noauth-probe-list.component.html +++ b/@overflow/noauth-probe/component/noauth-probe-list.component.html @@ -7,17 +7,17 @@ - Probe Key + Probe Key Host Name OS - Created at + Created at {{rowData.tempProbeKey}} {{rowData.infraHost.infraHostOS.name}} - {{rowData.infraHost.infraHostOS.os}} + {{getOS(rowData)}} {{rowData.createDate | date: 'dd/MM/yyyy'}} diff --git a/@overflow/noauth-probe/component/noauth-probe-list.component.ts b/@overflow/noauth-probe/component/noauth-probe-list.component.ts index a25038d..72e696d 100644 --- a/@overflow/noauth-probe/component/noauth-probe-list.component.ts +++ b/@overflow/noauth-probe/component/noauth-probe-list.component.ts @@ -88,10 +88,23 @@ export class NoAuthProbeListComponent implements OnInit, OnDestroy { noauthProbe.infraHost = JSON.parse(noauthProbe.infraHostMeta); }); this.noauthProbes = noauthProbes; + console.log(this.noauthProbes); } private setError$(error: any): void { this.error$ = of(error); } + getOS(noauthProbe: NoAuthProbe): string { + if (null == noauthProbe.infraHost.infraHostOS) { + return null; + } + let os = noauthProbe.infraHost.infraHostOS.os; + os += noauthProbe.infraHost.infraHostOS.platform ? + noauthProbe.infraHost.infraHostOS.platform : ''; + os += noauthProbe.infraHost.infraHostOS.platformFamily ? + noauthProbe.infraHost.infraHostOS.platformFamily : ''; + return os; + } + } diff --git a/@overflow/noauth-probe/component/old/noauth-probe-list.component.html b/@overflow/noauth-probe/component/old/noauth-probe-list.component.html deleted file mode 100644 index c8c2217..0000000 --- a/@overflow/noauth-probe/component/old/noauth-probe-list.component.html +++ /dev/null @@ -1,97 +0,0 @@ - \ No newline at end of file diff --git a/@overflow/noauth-probe/component/old/noauth-probe-list.component.ts b/@overflow/noauth-probe/component/old/noauth-probe-list.component.ts deleted file mode 100644 index a272d12..0000000 --- a/@overflow/noauth-probe/component/old/noauth-probe-list.component.ts +++ /dev/null @@ -1,164 +0,0 @@ -// import { Component, Input, Output, EventEmitter, AfterContentInit, OnInit, OnDestroy } from '@angular/core'; -// import { Store, select } from '@ngrx/store'; -// import { Observable, of, Subscription } from 'rxjs'; -// import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators'; -// import { ConfirmationService, Message } from 'primeng/primeng'; - -// import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth'; -// import { AuthSelector } from '@overflow/shared/auth/store'; -// import { DomainMember } from '@overflow/commons-typescript/model/domain'; - -// import { NoAuthProbeService } from '../service/noauth-probe.service'; -// import { NoAuthProbeSubscriber, NoAuthProbeNotify } from '../subscriber/noauth-probe.subscriber'; -// import { InfraHostIP, InfraHost } from '@overflow/commons-typescript'; - -// @Component({ -// selector: 'of-noauth-probe-list', -// templateUrl: './noauth-probe-list.component.html', -// providers: [ConfirmationService] -// }) -// export class NoAuthProbeListComponent implements OnInit, OnDestroy { -// pending$: Observable; -// error$: Observable; - -// noauthProbes: NoAuthProbe[]; -// noauthProbeSubscription: Subscription; - -// selectedInfraHost: InfraHost; -// visibleNICs: boolean; - -// constructor( -// private confirmationService: ConfirmationService, -// private store: Store, -// private noAuthProbeService: NoAuthProbeService, -// private noAuthProbeSubscriber: NoAuthProbeSubscriber, -// ) { -// this.noauthProbes = []; -// this.noauthProbeSubscription = null; -// } - -// ngOnInit() { -// this.store.pipe( -// tap(() => { -// this.pending$ = of(true); -// }), -// select(AuthSelector.selectDomainMember), -// exhaustMap((domainMember: DomainMember) => -// this.noAuthProbeService.readAllByDomainID(domainMember.domain.id) -// .pipe( -// map((noauthProbes: NoAuthProbe[]) => { -// this.setNoauthProbes(noauthProbes); -// }), -// catchError(error => { -// this.setError$(error); -// return of(); -// }) -// ) -// ), -// tap(() => { -// this.pending$ = of(false); -// }), -// take(1), -// ).subscribe(); - -// this.noauthProbeSubscription = this.noAuthProbeSubscriber.observable().pipe( -// tap((noAuthProbeNotify: NoAuthProbeNotify) => { -// const noauthProbes = []; -// this.noauthProbes.forEach(noauthProbe => { -// const n = noAuthProbeNotify.params; -// if (noauthProbe.id === n.id) { -// noauthProbes.push(n); -// } else { -// noauthProbes.push(noauthProbe); -// } -// }); - -// this.setNoauthProbes(noauthProbes); -// } -// ), -// ).subscribe(); -// } - -// ngOnDestroy(): void { -// if (null !== this.noauthProbeSubscription) { -// this.noauthProbeSubscription.unsubscribe(); -// } -// } - -// onAccept(infraHost: InfraHost) { -// this.selectedInfraHost = infraHost; -// this.visibleNICs = true; -// } - -// onAcceptOrDeny(isAccept: boolean, selected: NoAuthProbe) { -// const title = isAccept ? -// 'Are you sure to accept this Probe?' : 'Are you sure to deny this Probe'; -// const message = isAccept ? -// 'Start collecting data as a Probe.' : 'It will be permanently deleted.'; - -// this.confirmationService.confirm({ -// header: title, -// message: message, -// icon: isAccept ? 'fa-check' : 'fa fa-trash', -// accept: () => { -// if (isAccept) { -// this.noAuthProbeService.acceptNoAuthProbe(selected.id) -// .pipe( -// tap(() => { -// this.pending$ = of(true); -// }), -// map((noauthProbes: NoAuthProbe[]) => { -// this.setNoauthProbes(noauthProbes); -// }), -// catchError(error => { -// this.setError$(error); -// return of(); -// }), -// tap(() => { -// this.pending$ = of(false); -// }), -// take(1), -// ).subscribe(); -// } else { -// this.noAuthProbeService.denyNoauthProbe(selected.id) -// .pipe( -// tap(() => { -// this.pending$ = of(true); -// }), -// map((noauthProbes: NoAuthProbe[]) => { -// this.setNoauthProbes(noauthProbes); -// }), -// catchError(error => { -// this.setError$(error); -// return of(); -// }), -// tap(() => { -// this.pending$ = of(false); -// }), -// take(1), -// ).subscribe(); -// } -// }, -// reject: () => { -// } -// }); -// } - -// private setNoauthProbes(noauthProbes: NoAuthProbe[]): void { -// if (null === noauthProbes) { -// return; -// } -// noauthProbes.forEach(noauthProbe => { -// noauthProbe.infraHost = JSON.parse(noauthProbe.infraHostMeta); -// }); -// this.noauthProbes = noauthProbes; -// } - -// private setError$(error: any): void { -// this.error$ = of(error); -// } - -// onNICSelected(infraHostIP: InfraHostIP) { -// console.log(infraHostIP); -// } -// } diff --git a/@overflow/shared/ui/component/key-value.component.ts b/@overflow/shared/ui/component/key-value.component.ts index f1c7d2b..aa5ab8d 100644 --- a/@overflow/shared/ui/component/key-value.component.ts +++ b/@overflow/shared/ui/component/key-value.component.ts @@ -7,7 +7,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; export class KeyValueComponent implements OnInit { @Input() key: string; - @Input() value: string; + @Input() value: any; @Input() clickable = false; @Output() click = new EventEmitter(); diff --git a/src/styles.scss b/src/styles.scss index 132349e..38be3a7 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1496,8 +1496,8 @@ transition: all 0.3s; font-size: 36px; } .layout-container .topbar .topbar-right #menu-button i:before { - //content: "chevron_left"; - content: "menu" !important; + //content: "chevron_left"; + content: "menu" !important; } //auth style .login-body { @@ -1510,7 +1510,7 @@ background-size: cover !important; background-attachment: fixed !important; } -@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { +@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { .login-body { //background: url("../images/login/login2x.png") top left no-repeat #f7f7f7; //background: url("/assets/layout/images/login11.jpg") top left no-repeat #f7f7f7 !important; @@ -1527,7 +1527,7 @@ min-height: 300px !important; .ui-g { .ui-g-12 { - a { + a { color: #5e6166; font-size: 0.8em; } @@ -1687,21 +1687,21 @@ -webkit-border-radius: 3px; border-radius: 3px; margin: auto; - + img { object-fit: cover; width:220px; height:220px; } - - @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { + + @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { } - + @media (max-width: 1024px) { } - + @media (max-width: 640px) { } @@ -1732,14 +1732,14 @@ of-key-value{ //width: 100%; min-width: 250px; - margin: 0; - + margin: 0; + } .of-key-value-div{ //width: 100%; min-width: 250px; - margin: 0; - + margin: 0; + } span { font-weight: bold; @@ -1899,4 +1899,7 @@ body .ui-progressbar .ui-progressbar-value { .ui-tabview-nav > li.ui-state-active { background-color: #f3f3f3 !important; } +} +.ui-confirmdialog-message { + white-space: pre-line; } \ No newline at end of file