This commit is contained in:
crusader 2018-06-04 17:55:47 +09:00
parent ffcee6564e
commit 9990650925
34 changed files with 127 additions and 103 deletions

View File

@ -1,13 +1,17 @@
import {
Component, Input, Output, EventEmitter, OnDestroy, ViewChild,
} from '@angular/core';
import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';
import { Anim } from './animation';
import { Store, select } from '@ngrx/store';
import { Observable, of, Subscription } from 'rxjs';
import { DiscoveryService } from '../service/discovery.service';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';
import { DiscoverZone, Zone, Host, Port, Service } from '@overflow/commons-typescript/model/discovery';
import { Anim } from './animation';
import { DiscoveryService } from '../service/discovery.service';
import { DiscoverySubscriber, DiscoveryNotify } from '../subscriber/discovery.subscriber';
import { SearchResultComponent } from './search-result.component';
import { SearchFilterComponent } from './search-filter.component';

View File

@ -5,13 +5,17 @@ import {
SimpleChanges,
OnInit,
} from '@angular/core';
import { Anim } from './animation';
import { TreeNode } from 'primeng/primeng';
import { DiscoveryNotify } from '../subscriber/discovery.subscriber';
import { DiscoverZone, Zone, Host, Port, Service } from '@overflow/commons-typescript/model/discovery';
import { Subscription } from 'rxjs';
import { DiscoverZone, Zone, Host, Port, Service } from '@overflow/commons-typescript/model/discovery';
import { TreeNode } from 'primeng/primeng';
import { ProbeHost } from '@overflow/commons-typescript/model/probe';
import { Anim } from './animation';
import { DiscoveryNotify } from '../subscriber/discovery.subscriber';
@Component({
selector: 'of-discovery-result',
templateUrl: './search-result.component.html',

View File

@ -9,7 +9,7 @@ import {
} from '@angular/core';
import { Store, select, StateObservable } from '@ngrx/store';
import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { RPCClientError } from '@loafer/ng-rpc';
import { MetaCrawler } from '@overflow/commons-typescript/model/meta';
@ -55,7 +55,8 @@ export class ServiceSelectorComponent implements OnInit, AfterContentInit, OnDes
this.includeServices = this.metaCrawlers.slice();
this.change.emit(this.includeServices);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
ngOnDestroy() {

View File

@ -1,7 +1,7 @@
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { Store, select } from '@ngrx/store';
import { Observable, of, Subscription } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { AuthSelector } from '@overflow/shared/auth/store';
import { DomainMember } from '@overflow/commons-typescript/model/domain';
@ -46,7 +46,8 @@ export class InfraHostComponent implements OnInit {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
} else {
// error
}

View File

@ -1,8 +1,6 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
import { RPCService } from '@loafer/ng-rpc';
import { Infra } from '@overflow/commons-typescript/model/infra';

View File

@ -1,7 +1,7 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { FormBuilder } from '@angular/forms';
import { EmailAuthService } from '../service/email-auth.service';
import { EmailAuth } from '@overflow/commons-typescript/model/email/EmailAuth';
@ -40,7 +40,8 @@ export class MemberConfirmResetPasswordComponent implements OnInit {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
onModifyPassword() {

View File

@ -1,7 +1,7 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { FormBuilder } from '@angular/forms';
import { EmailAuthService } from '../service/email-auth.service';
import { EmailAuth } from '@overflow/commons-typescript/model/email/EmailAuth';
@ -39,7 +39,8 @@ export class MemberConfirmSignupComponent implements OnInit {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
onSignin() {

View File

@ -3,7 +3,7 @@ import { FormGroup, FormBuilder, Validators, FormControl, ValidationErrors, Abst
import { Member } from '@overflow/commons-typescript/model/member';
import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { MemberService } from '../service/member.service';
@ -95,7 +95,8 @@ export class MemberModifyPasswordComponent implements OnInit {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
onSignin() {

View File

@ -1,12 +1,16 @@
import { Component, OnInit, OnDestroy, Input, Output, EventEmitter } from '@angular/core';
import { Member } from '@overflow/commons-typescript/model/member';
import { AbstractControl, FormBuilder, FormGroup, Validators} from '@angular/forms';
import { DomainMember } from '@overflow/commons-typescript/model/domain';
import { Observable, of } from 'rxjs';
import { Store } from '@ngrx/store';
import { Observable, of } from 'rxjs';
import { catchError, map, tap, take } from 'rxjs/operators';
import { Member } from '@overflow/commons-typescript/model/member';
import { DomainMember } from '@overflow/commons-typescript/model/domain';
import { AuthSelector } from '@overflow/shared/auth/store';
import * as AuthStore from '@overflow/shared/auth/store/auth';
import { catchError, map, tap } from 'rxjs/operators';
import { MemberService } from '../service/member.service';
@Component({
@ -98,7 +102,8 @@ export class MemberProfileComponent implements OnInit, OnDestroy {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
private checkProfile(formValue: any): boolean {

View File

@ -12,7 +12,7 @@ import {
} from '@angular/forms';
import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { Member } from '@overflow/commons-typescript/model/member';
import { MemberService } from '../service/member.service';
@ -71,7 +71,8 @@ export class MemberResetPasswordComponent implements OnInit {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
onSignin() {

View File

@ -2,7 +2,7 @@ import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import { FormGroup, FormBuilder, Validators, AbstractControl } from '@angular/forms';
import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { MemberService } from '../service/member.service';
import {DomainMember} from '@overflow/commons-typescript/model/domain';
import * as AuthStore from '../../shared/auth/store/auth';
@ -80,7 +80,8 @@ export class MemberSigninComponent implements OnInit {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
onResetPassword() {

View File

@ -9,7 +9,7 @@ import { FormGroup, FormBuilder, Validators, AbstractControl, FormControl, Valid
import { Member } from '@overflow/commons-typescript/model/member';
import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { MemberService } from '../service/member.service';
@Component({
@ -146,7 +146,8 @@ export class MemberSignupComponent implements OnInit, OnDestroy {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
termsDisplayOpen() {

View File

@ -1,11 +1,15 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Store } from '@ngrx/store';
import { Observable, of } from 'rxjs';
import { catchError, map, tap } from 'rxjs/operators';
import { DomainMember } from '@overflow/commons-typescript/model/domain';
import { Member } from '@overflow/commons-typescript/model/member';
import {AuthSelector} from '../../shared/auth/store';
import { Observable, of } from 'rxjs';
import { Store } from '@ngrx/store';
import * as AuthStore from '@overflow/shared/auth/store/auth';
import { catchError, map, tap } from 'rxjs/operators';
import {AuthSelector} from '../../shared/auth/store';
@Component({
selector: 'of-member-totp',

View File

@ -1,8 +1,6 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
import { RESTService } from '@loafer/ng-rest';
import { RPCService } from '@loafer/ng-rpc';
import { DomainMember } from '@overflow/commons-typescript/model/domain';

View File

@ -1,7 +1,7 @@
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 } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { ConfirmationService, Message } from 'primeng/primeng';
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
@ -53,7 +53,8 @@ export class NoAuthProbeListComponent implements OnInit, OnDestroy {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
this.noauthProbeSubscription = this.noAuthProbeSubscriber.observable().pipe(
tap((noAuthProbeNotify: NoAuthProbeNotify) => {
@ -104,7 +105,8 @@ export class NoAuthProbeListComponent implements OnInit, OnDestroy {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
} else {
this.noAuthProbeService.denyNoauthProbe(selected.id)
.pipe(
@ -121,7 +123,8 @@ export class NoAuthProbeListComponent implements OnInit, OnDestroy {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
},
reject: () => {

View File

@ -1,8 +1,6 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
import { RPCService } from '@loafer/ng-rpc';
import { Domain } from '@overflow/commons-typescript/model/domain';

View File

@ -1,8 +1,6 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
import { RPCService } from '@loafer/ng-rpc';
import { Notification } from '@overflow/commons-typescript/model/notification';

View File

@ -4,15 +4,8 @@ import { Router } from '@angular/router';
import { Effect, Actions, ofType } from '@ngrx/effects';
import { Action } from '@ngrx/store';
import { Observable } from 'rxjs';
import { of } from 'rxjs/observable/of';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/exhaustMap';
import 'rxjs/add/operator/switchMap';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/take';
import { of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { RPCClientError } from '@loafer/ng-rpc';
@ -39,26 +32,35 @@ export class Effects {
) { }
@Effect()
readAllByMember$: Observable<Action> = this.actions$
.ofType(ActionType.ReadAllByMember)
.map((action: ReadAllByMember) => action.payload)
.switchMap(payload => this.notificationService.readAllByMember(payload.member, payload.pageParams))
.map(page => {
return new ReadAllByMemberSuccess(page);
})
.catch((error: RPCClientError) => {
return of(new ReadAllByMemberFailure(error));
});
readAllByMember$ = this.actions$.pipe(
ofType(ActionType.ReadAllByMember),
map((action: ReadAllByMember) => action.payload),
exhaustMap(payload =>
this.notificationService
.readAllByMember(payload.member, payload.pageParams)
.pipe(
map(page => {
return new ReadAllByMemberSuccess(page);
}),
catchError(error => of(new ReadAllByMemberFailure(error)))
)
)
);
@Effect()
markAllAsRead$: Observable<Action> = this.actions$
.ofType(ActionType.MarkAllAsRead)
.map((action: MarkAllAsRead) => action.payload)
.switchMap(payload => this.notificationService.markAllAsRead(payload.member, payload.pageParams))
.map(page => {
return new MarkAllAsReadSuccess(page);
})
.catch((error: RPCClientError) => {
return of(new MarkAllAsReadFailure(error));
});
markAllAsRead$ = this.actions$.pipe(
ofType(ActionType.MarkAllAsRead),
map((action: MarkAllAsRead) => action.payload),
exhaustMap(payload =>
this.notificationService
.markAllAsRead(payload.member, payload.pageParams)
.pipe(
map(page => {
return new MarkAllAsReadSuccess(page);
}),
catchError(error => of(new MarkAllAsReadFailure(error)))
)
)
);
}

View File

@ -2,7 +2,7 @@ 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 } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { AuthSelector } from '@overflow/shared/auth/store';
import { DomainMember } from '@overflow/commons-typescript/model/domain';
import { ProbeHostService } from '../service/probe-host.service';
@ -42,7 +42,8 @@ export class ProbeDetailComponent implements OnInit {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
modifiedGeneral(probe: Probe) {

View File

@ -2,7 +2,7 @@ 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 } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { AuthSelector } from '@overflow/shared/auth/store';
import { DomainMember } from '@overflow/commons-typescript/model/domain';
import { ProbeHostService } from '../service/probe-host.service';
@ -54,7 +54,8 @@ export class ProbeGeneralComponent implements OnInit {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
} else {
// error
}
@ -101,7 +102,8 @@ export class ProbeGeneralComponent implements OnInit {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
checkValidDisplayName(value: string): string | null {

View File

@ -1,11 +1,14 @@
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs';
import { ProbeHostService } from '../service/probe-host.service';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { AuthSelector } from '@overflow/shared/auth/store';
import { DomainMember } from '@overflow/commons-typescript/model/domain';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
import { ProbeHostService } from '../service/probe-host.service';
@Component({
selector: 'of-probe-list',
@ -45,7 +48,8 @@ export class ProbeListComponent implements OnInit {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
onProbeSelect(event) {

View File

@ -2,7 +2,7 @@ import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges, OnIni
import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
import { Store, select } from '@ngrx/store';
import { Observable, of, Subscription } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { AuthSelector } from '@overflow/shared/auth/store';
import { DomainMember } from '@overflow/commons-typescript/model/domain';
import { ProbeHostService } from '../service/probe-host.service';
@ -52,7 +52,8 @@ export class ProbeSelectorComponent implements OnInit, OnChanges {
this.generate();
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
ngOnChanges(changes: SimpleChanges): void {

View File

@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
import { RPCService } from '@loafer/ng-rpc';
import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';
import { Domain } from '@overflow/commons-typescript/model/domain';

View File

@ -1,8 +1,6 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
import { RPCService } from '@loafer/ng-rpc';
import { Domain } from '@overflow/commons-typescript/model/domain';

View File

@ -3,7 +3,7 @@ import { Component, OnInit, Inject, AfterContentInit, OnDestroy, Input } from '@
import { Store, select } from '@ngrx/store';
import { Observable, of, Subscription } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { ConfirmationService } from 'primeng/primeng';
@ -50,7 +50,8 @@ export class SensorDetailComponent implements OnInit, OnDestroy {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}
ngOnDestroy() {

View File

@ -2,7 +2,7 @@ import { Component, Input, OnInit, OnChanges, SimpleChanges, Output, EventEmitte
import { Store, select } from '@ngrx/store';
import { Observable, of, Subscription } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
import { AuthSelector } from '@overflow/shared/auth/store';
@ -66,7 +66,8 @@ export class SensorListComponent implements OnInit, OnChanges {
tap(() => {
this.pending$ = of(false);
}),
).take(1).subscribe();
take(1),
).subscribe();
}

View File

@ -1,8 +1,6 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
import { RPCService } from '@loafer/ng-rpc';
// import { PageParams, Page } from 'app/commons/model';

View File

@ -1,8 +1,6 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
import { RPCService } from '@loafer/ng-rpc';
import { Target } from '@overflow/commons-typescript/model/target';

View File

@ -1,7 +1,7 @@
import { Component, OnDestroy } from '@angular/core';
import { AppComponent } from '../../../../app.component';
import { BreadcrumbService } from '@app/commons/service/breadcrumb.service';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { MenuItem } from 'primeng/primeng';
@Component({

View File

@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
import { Observable } from 'rxjs';
import { Observable, Subject } from 'rxjs';
import { MenuItem } from 'primeng/primeng';
@Injectable()

View File

@ -1,6 +1,6 @@
import { Component, OnDestroy } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
@Component({
selector: 'of-pages-probe-tab',

View File

@ -1,6 +1,6 @@
import { Component, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
import { Target } from '@overflow/commons-typescript/model/target';
import { BreadcrumbService } from '@app/commons/service/breadcrumb.service';

View File

@ -1,6 +1,6 @@
import { Component, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { ProbeHost, Probe } from '@overflow/commons-typescript/model/probe';
import { Target } from '@overflow/commons-typescript/model/target';
import { BreadcrumbService } from '@app/commons/service/breadcrumb.service';

View File

@ -1,6 +1,6 @@
import { Component, OnDestroy } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
@Component({
selector: 'of-pages-sensor-tab',