formatOnSave true

This commit is contained in:
insanity
2018-06-12 22:21:53 +09:00
parent 7e682274d4
commit 1c415fe163
13 changed files with 58 additions and 189 deletions

View File

@@ -1,13 +1,12 @@
import {
Component, Input, Output, EventEmitter, OnDestroy, ViewChild,
Component, Input, OnDestroy, ViewChild,
} 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 { catchError, map } from 'rxjs/operators';
import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';
import { ProbeHost } from '@overflow/commons-typescript/model/probe';
import { DiscoverZone, Zone, Host, Port, Service } from '@overflow/commons-typescript/model/discovery';
import { Anim } from './animation';
@@ -42,7 +41,6 @@ export class DiscoveryComponent implements OnDestroy {
constructor(
private discoveryService: DiscoveryService,
private discoverySubscriber: DiscoverySubscriber,
private store: Store<any>
) {
this.discoverySubscription = null;
this.finished = false;
@@ -60,7 +58,7 @@ export class DiscoveryComponent implements OnDestroy {
// TODO: fix
const zone: Zone = {
network: '192.168.1.0/24',
network: '192.168.1.0/24', // this.selectedProbe.probe.cidr
address: '192.168.1.103',
iface: 'enp3s0',
mac: '44:8a:5b:44:8c:e8',

View File

@@ -195,25 +195,25 @@ export class SearchResultComponent implements OnInit, OnChanges {
}
});
this.targetService.registDiscoveredTargets(this.probeHost.probe.id, hosts, services)
.pipe(
tap(() => {
this.targetSaveSucceed = false;
}),
map((targets: Target[]) => {
if (targets) {
this.displayTargetDone = true;
}
}),
catchError(error => {
this.error$ = of(error);
return of();
}),
tap(() => {
this.targetSaveSucceed = true;
}),
take(1),
).subscribe();
// this.targetService.registDiscoveredTargets(this.probeHost.probe.id, hosts, services)
// .pipe(
// tap(() => {
// this.targetSaveSucceed = false;
// }),
// map((targets: Target[]) => {
// if (targets) {
// this.displayTargetDone = true;
// }
// }),
// catchError(error => {
// this.error$ = of(error);
// return of();
// }),
// tap(() => {
// this.targetSaveSucceed = true;
// }),
// take(1),
// ).subscribe();
}
}