This commit is contained in:
geek 2018-06-06 19:36:51 +09:00
parent 1bbd827596
commit 418947dfc0
7 changed files with 51 additions and 21 deletions

View File

@ -143,9 +143,9 @@ export class DetailComponent implements OnInit, AfterContentInit, OnDestroy {
}
onDisplayNameChangeKeypress(event, value) {
if (event.key === 'Enter') {
this.onDisplayNameChange(value);
}
// if (event.key === 'Enter') {
// this.onDisplayNameChange(value);
// }
}
}

View File

@ -1,9 +1,9 @@
import { DetailComponent } from './detail/detail.component';
import { ListComponent } from './list/list.component';
// import { FilterComponent } from './list/filter/filter.component';
import {FilterComponent} from './list/filter/filter.component';
export const COMPONENTS = [
ListComponent,
// DetailComponent,
// FilterComponent
DetailComponent,
FilterComponent
];

View File

@ -4,8 +4,12 @@ import { Infra } from '@overflow/commons-typescript/model/infra';
import { Probe } from '@overflow/commons-typescript/model/probe';
import { Target } from '@overflow/commons-typescript/model/target';
import { Observable, of, Subscription } from 'rxjs';
import { Store, select } from '@ngrx/store';
import { TargetService } from '../../service/target.service';
import { InfraService } from '@overflow/infra/service/infra.service';
import {PageParams} from '@overflow/commons-typescript/model/commons/PageParams';
import { catchError, map, tap, take } from 'rxjs/operators';
import {Page} from '@overflow/commons-typescript/model/commons/Page';
@Component({
selector: 'of-target-list',
@ -20,14 +24,13 @@ export class ListComponent implements OnInit, AfterContentInit, OnDestroy {
// target: Target = null;
// sensorSettingDisplay = false;
pageSize = '10';
totalLength = 0;
currPage = 0;
// pageSize = '10';
// totalLength = 0;
// currPage = 0;
constructor(
// private route: ActivatedRoute,
// private router: Router,
// private store: Store<any>,
private store: Store<any>,
private targetService: TargetService,
) {
}
@ -44,7 +47,27 @@ export class ListComponent implements OnInit, AfterContentInit, OnDestroy {
// console.log(error);
// }
// );
console.log('ddddddddddddddddddddd');
const pageParams: PageParams = {
pageNo: 0,
countPerPage: 10,
sortCol: 'id',
sortDirection: 'descending',
};
this.targetService.readAllByProbeID(1, pageParams)
.pipe(
tap(() => {
}),
map((r: Page<Target>) => {
console.log(r);
}),
catchError(err => {
console.log(err);
return err;
}),
take(1),
).subscribe();
}
ngAfterContentInit() {

View File

@ -1,5 +1,5 @@
import { TargetService } from './target.service';
export const SERVICES = [
// TargetService,
TargetService,
];

View File

@ -5,6 +5,9 @@ import { Observable } from 'rxjs';
import { Target } from '@overflow/commons-typescript/model/target';
import { Host, Service } from '@overflow/commons-typescript/model/discovery';
import {PageParams} from '@overflow/commons-typescript/model/commons/PageParams';
import {Page} from '@overflow/commons-typescript/model/commons/Page';
import {Notification} from '@overflow/commons-typescript/model/notification';
@Injectable()
export class TargetService {
@ -18,10 +21,10 @@ export class TargetService {
public registDiscoveredTargets(probeID: number, hosts: Host[], services: Service[]): Observable<Target> {
return this.rpcService.call('TargetService.registDiscoveredTargets', probeID, hosts, services);
}
public modify(target: Target): Observable<Target> {
return this.rpcService.call<Target>('TargetService.modify', target);
}
//
// public modify(target: Target): Observable<Target> {
// return this.rpcService.call<Target>('TargetService.modify', target);
// }
public findExistHostTarget(probeID: number, hostIP: string): Observable<Target> {
return this.rpcService.call<Target>('TargetService.readExistHostTarget', probeID, hostIP);
@ -30,4 +33,8 @@ export class TargetService {
public findExistServiceTarget(hostID: number, portNumber: number, portType: string): Observable<Target> {
return this.rpcService.call<Target>('TargetService.readExistServiceTarget', hostID, portNumber, portType);
}
public readAllByProbeID(probeID: number, pageParams: PageParams): Observable<Page<Target>> {
return this.rpcService.call<Page<Target>>('TargetService.readAllByProbeID', probeID, pageParams);
}
}

View File

@ -2,7 +2,7 @@
<div class="ui-g">
<div class="ui-g-12">
<div class="card no-margin">
<!--<of-target-list></of-target-list>-->
<of-target-list></of-target-list>
</div>
</div>
</div>

View File

@ -14,7 +14,7 @@ import { TargetPageComponent } from './target-page.component';
CommonModule,
UIModule,
TargetPageRoutingModule,
// TargetModule,
TargetModule,
// TabbarModule
],
declarations: [