ing
This commit is contained in:
parent
1bbd827596
commit
418947dfc0
|
@ -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);
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
];
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { TargetService } from './target.service';
|
||||
|
||||
export const SERVICES = [
|
||||
// TargetService,
|
||||
TargetService,
|
||||
];
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -14,7 +14,7 @@ import { TargetPageComponent } from './target-page.component';
|
|||
CommonModule,
|
||||
UIModule,
|
||||
TargetPageRoutingModule,
|
||||
// TargetModule,
|
||||
TargetModule,
|
||||
// TabbarModule
|
||||
],
|
||||
declarations: [
|
||||
|
|
Loading…
Reference in New Issue
Block a user