models changed
This commit is contained in:
parent
0f69c63a98
commit
d8cb5f4d41
|
@ -1,8 +1,9 @@
|
|||
<h1>Discovery</h1>
|
||||
<div class="ui-g">
|
||||
<div class="ui-g-12">
|
||||
<of-probe-selector [probeHostID]="probeHostID" (select)="selectedProbe=$event"></of-probe-selector>
|
||||
<of-probe-summary *ngIf="selectedProbe" @discoveryFilterAnim [probeHost]="selectedProbe"></of-probe-summary>
|
||||
<of-zone-selector></of-zone-selector>
|
||||
<!-- <of-probe-selector [probeHostID]="probeHostID" (select)="selectedProbe=$event"></of-probe-selector> -->
|
||||
<!-- <of-probe-summary *ngIf="selectedProbe" @discoveryFilterAnim [probeHost]="selectedProbe"></of-probe-summary> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-g">
|
||||
|
|
|
@ -61,10 +61,9 @@ export class DiscoveryComponent implements OnDestroy {
|
|||
// TODO: fix
|
||||
const zone: Zone = {
|
||||
network: '192.168.1.0/24',
|
||||
ipv4: '192.168.1.103',
|
||||
address: '192.168.1.103',
|
||||
iface: 'enp3s0',
|
||||
mac: '44:8a:5b:44:8c:e8',
|
||||
hosts: null,
|
||||
};
|
||||
this.discoveryService.discoverHost(this.selectedProbe.probe.probeKey, zone, dz.discoverHost);
|
||||
|
||||
|
|
|
@ -36,20 +36,20 @@ export class SearchFilterComponent implements OnInit {
|
|||
}
|
||||
|
||||
addService(service: Service) {
|
||||
if (service.serviceName.indexOf('Not Supported Service') >= 0) {
|
||||
const tempName = service.serviceName.split('Perhaps ')[1].split('[')[0];
|
||||
service.serviceName = '*' + tempName;
|
||||
if (service.name.indexOf('Not Supported Service') >= 0) {
|
||||
const tempName = service.name.split('Perhaps ')[1].split('[')[0];
|
||||
service.name = '*' + tempName;
|
||||
}
|
||||
let exist = false;
|
||||
this.services.forEach(value => {
|
||||
if (value.serviceName === service.serviceName) {
|
||||
if (value.name === service.name) {
|
||||
exist = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
if (!exist) {
|
||||
this.services.push(service);
|
||||
this.filterServices[service.serviceName] = true;
|
||||
this.filterServices[service.name] = true;
|
||||
}
|
||||
this.serviceSelect.emit(this.filterServices);
|
||||
}
|
||||
|
|
|
@ -12,8 +12,6 @@ import { DiscoverZone, Zone, Host, Port, Service } from '@overflow/commons-types
|
|||
import { TreeNode, Message, Tree } from 'primeng/primeng';
|
||||
import { ProbeHost } from '@overflow/commons-typescript/model/probe';
|
||||
import { Anim } from './animation';
|
||||
import { DiscoveryNotify } from '../subscriber/discovery.subscriber';
|
||||
import { InfraHost, InfraService } from '@overflow/commons-typescript/model/infra';
|
||||
import { TargetService } from '@overflow/target/service/target.service';
|
||||
import { Target } from '@overflow/commons-typescript/model/target';
|
||||
|
||||
|
@ -83,11 +81,11 @@ export class SearchResultComponent implements OnInit, OnChanges {
|
|||
const idx = this.findHostIndex(host);
|
||||
this.hostNode.splice(idx, 0, {
|
||||
type: 'HOST',
|
||||
label: host.ipv4,
|
||||
label: host.address,
|
||||
data: {
|
||||
exist: false,
|
||||
ip: this.convertIPtoNumber(host.ipv4),
|
||||
ipv6: host.ipv6,
|
||||
ip: this.convertIPtoNumber(host.address),
|
||||
ipv6: host.address,
|
||||
mac: host.mac,
|
||||
openPorts: [],
|
||||
target: host
|
||||
|
@ -102,22 +100,22 @@ export class SearchResultComponent implements OnInit, OnChanges {
|
|||
const idx = this.findServiceIndex(targetHostNode.children, service);
|
||||
targetHostNode.children.splice(idx, 0, {
|
||||
type: 'SERVICE',
|
||||
label: service.serviceName + ' (' + service.port.portNumber + ')',
|
||||
label: service.name + ' (' + service.port.portNumber + ')',
|
||||
data: {
|
||||
name: service.serviceName,
|
||||
portType: service.port.portType,
|
||||
name: service.name,
|
||||
portType: service.port.metaPortTypeKey,
|
||||
portNumber: service.port.portNumber,
|
||||
target: service
|
||||
},
|
||||
});
|
||||
}
|
||||
addPort(port: Port) {
|
||||
this.hostNode.forEach(node => {
|
||||
if (node.data.id === port.host.id) {
|
||||
node.data.openPorts.push(port);
|
||||
return;
|
||||
}
|
||||
});
|
||||
// this.hostNode.forEach(node => {
|
||||
// if (node.data.id === port.host.id) {
|
||||
// node.data.openPorts.push(port);
|
||||
// return;
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
onTargetSelect(e, node: TreeNode) {
|
||||
|
@ -134,7 +132,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
|
|||
findHostIndex(host: Host): number {
|
||||
let index = 0;
|
||||
this.hostNode.forEach(node => {
|
||||
if (node.data.ip < this.convertIPtoNumber(host.ipv4)) {
|
||||
if (node.data.ip < this.convertIPtoNumber(host.address)) {
|
||||
index++;
|
||||
}
|
||||
});
|
||||
|
@ -147,7 +145,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
|
|||
// if (node.data.portNumber < service.port.portNumber) {
|
||||
// index++;
|
||||
// }
|
||||
if (node.data.name.toUpperCase().localeCompare(service.serviceName.toUpperCase()) === -1) {
|
||||
if (node.data.name.toUpperCase().localeCompare(service.name.toUpperCase()) === -1) {
|
||||
index++;
|
||||
}
|
||||
});
|
||||
|
@ -157,7 +155,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
|
|||
findHostNodeByService(service: Service) {
|
||||
let targetHost = null;
|
||||
this.hostNode.forEach((value, i) => {
|
||||
if (value.data.ip === this.convertIPtoNumber(service.port.host.ipv4)) {
|
||||
if (value.data.ip === this.convertIPtoNumber(service.port.host.address)) {
|
||||
targetHost = value;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ export class InfraMapComponent implements OnInit {
|
|||
.pipe(
|
||||
map((probeHosts: ProbeHost[]) => {
|
||||
this.probeHosts = probeHosts;
|
||||
this.selectedProbeHost = probeHosts[0];
|
||||
this.generateTabs();
|
||||
}),
|
||||
catchError(error => {
|
||||
|
@ -75,14 +74,7 @@ export class InfraMapComponent implements OnInit {
|
|||
label: ph.probe.cidr
|
||||
});
|
||||
});
|
||||
|
||||
this.tabs.push({
|
||||
label: 'fake probe1'
|
||||
});
|
||||
|
||||
this.tabs.push({
|
||||
label: 'fake probe2'
|
||||
});
|
||||
this.selectedProbeHost = this.probeHosts[0];
|
||||
}
|
||||
|
||||
onProbeChange(event) {
|
||||
|
|
|
@ -4,63 +4,27 @@
|
|||
<p-tree [value]="zoneNode" layout="horizontal">
|
||||
<!-- ZONE node template -->
|
||||
<ng-template let-node pTemplate="ZONE">
|
||||
<div>
|
||||
<div (contextmenu)="showContextMenu($event, node)">
|
||||
{{node.label}}
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<!-- HOST node template -->
|
||||
<ng-template let-node pTemplate="HOST">
|
||||
{{node.label}}
|
||||
<div (contextmenu)="showContextMenu($event, node)">
|
||||
{{node.label}}
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<!-- SERVICE node template -->
|
||||
<ng-template let-node pTemplate="SERVICE">
|
||||
{{node.label}}
|
||||
<div (contextmenu)="showContextMenu($event, node)">
|
||||
{{node.label}}
|
||||
</div>
|
||||
</ng-template>
|
||||
</p-tree>
|
||||
|
||||
</p-panel>
|
||||
|
||||
<!-- <p-tree [value]="infraTree" selectionMode="single" [(selection)]="selectedTree" (onNodeSelect)="onNodeSelect($event)">
|
||||
|
||||
<ng-template let-node pTemplate="default">
|
||||
<div>{{node.label}}</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template let-node pTemplate="infra">
|
||||
<div (contextmenu)="nodeMenu($event, node)">
|
||||
<div>{{node.label}}</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template let-node pTemplate="probe">
|
||||
<div (contextmenu)="nodeMenu($event, node)">
|
||||
<div>{{node.label}}</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template let-node pTemplate="host">
|
||||
<div (contextmenu)="nodeMenu($event, node)">
|
||||
<div>{{node.label}}</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template let-node pTemplate="service">
|
||||
<div (contextmenu)="nodeMenu($event, node)">
|
||||
<div>{{node.label}}</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template let-node pTemplate="sensor">
|
||||
<div (contextmenu)="nodeMenu($event, node)">
|
||||
<div>
|
||||
<i class="fa ui-icon-stop ui-status-icon ui-status-success"></i>{{node.label}}
|
||||
</div>
|
||||
<div>
|
||||
{{node.obj.itemCount}} SensorItems
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
</p-tree> -->
|
||||
<p-contextMenu #cmZone [model]="contextMenuZone" appendTo="body"></p-contextMenu>
|
||||
<p-contextMenu #cmHost [model]="contextMenuHost" appendTo="body"></p-contextMenu>
|
||||
<p-contextMenu #cmService [model]="contextMenuService" appendTo="body"></p-contextMenu>
|
||||
</p-panel>
|
|
@ -1,12 +1,12 @@
|
|||
import {
|
||||
Component, Input, OnChanges, SimpleChanges, OnInit
|
||||
Component, Input, OnChanges, SimpleChanges, OnInit, ViewChild
|
||||
} from '@angular/core';
|
||||
import { Infra } from '@overflow/commons-typescript/model/infra';
|
||||
import { InfraHost as InfraTypeHost } from '@overflow/commons-typescript/model/infra';
|
||||
import { InfraService as InfraTypeService } from '@overflow/commons-typescript/model/infra';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators';
|
||||
import { TreeNode } from 'primeng/primeng';
|
||||
import { TreeNode, MenuItem, ContextMenu } from 'primeng/primeng';
|
||||
import { PageParams, Page } from '@overflow/commons-typescript/core/model';
|
||||
import { ProbeHost } from '@overflow/commons-typescript';
|
||||
import { InfraService } from '../service/infra.service';
|
||||
|
@ -23,8 +23,17 @@ export class InfraTreeComponent implements OnInit, OnChanges {
|
|||
pending$: Observable<boolean>;
|
||||
error$: Observable<any>;
|
||||
|
||||
zoneNode: TreeNode[] = [];
|
||||
hostNode: TreeNode[] = [];
|
||||
zoneNode: TreeNode[];
|
||||
hostNode: TreeNode[];
|
||||
|
||||
contextMenuZone: MenuItem[];
|
||||
contextMenuHost: MenuItem[];
|
||||
contextMenuService: MenuItem[];
|
||||
selectedNode: TreeNode;
|
||||
|
||||
@ViewChild('cmZone') cmZone: ContextMenu;
|
||||
@ViewChild('cmHost') cmHost: ContextMenu;
|
||||
@ViewChild('cmService') cmService: ContextMenu;
|
||||
|
||||
constructor(
|
||||
private infraService: InfraService,
|
||||
|
@ -40,10 +49,36 @@ export class InfraTreeComponent implements OnInit, OnChanges {
|
|||
children: this.hostNode,
|
||||
expanded: true
|
||||
});
|
||||
this.initContextMenu();
|
||||
}
|
||||
|
||||
initContextMenu() {
|
||||
this.contextMenuZone = [
|
||||
{ label: 'Zone Menu', command: (event) => this.cmZone.hide() },
|
||||
{ separator: true },
|
||||
{ label: 'Discovery', icon: 'fa-plus', command: (event) => alert('Discovery') },
|
||||
];
|
||||
this.contextMenuHost = [
|
||||
{ label: 'Host Menu', command: (event) => this.cmHost.hide() },
|
||||
{ separator: true },
|
||||
{ label: 'Add sensor', icon: 'fa-plus', command: (event) => alert('Add sensor') },
|
||||
{ label: 'Traceroute', icon: 'fa-plus' },
|
||||
{ label: 'ARP Test', icon: 'fa-plus' },
|
||||
];
|
||||
this.contextMenuService = [
|
||||
{ label: 'Service Menu', command: (event) => this.cmService.hide() },
|
||||
{ separator: true },
|
||||
{ label: 'Add sensor', icon: 'fa-plus', command: (event) => alert('Add sensor') },
|
||||
];
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
this.getInfras();
|
||||
console.log(changes);
|
||||
if (changes['probeHost'].isFirstChange ) {
|
||||
this.zoneNode = [];
|
||||
this.hostNode = [];
|
||||
this.getInfras();
|
||||
}
|
||||
}
|
||||
|
||||
getInfras() {
|
||||
|
@ -60,6 +95,7 @@ export class InfraTreeComponent implements OnInit, OnChanges {
|
|||
}),
|
||||
map((infraPage: Page<Infra>) => {
|
||||
this.infras = infraPage.content;
|
||||
console.log(this.infras);
|
||||
this.generateTreeData(this.infras);
|
||||
}),
|
||||
catchError(error => {
|
||||
|
@ -80,7 +116,7 @@ export class InfraTreeComponent implements OnInit, OnChanges {
|
|||
this.addHost(infra);
|
||||
break;
|
||||
case 7: // InfraService
|
||||
// this.addService(infra);
|
||||
this.addService(infra);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -91,7 +127,7 @@ export class InfraTreeComponent implements OnInit, OnChanges {
|
|||
addHost(infraHost: InfraTypeHost) {
|
||||
this.hostNode.push({
|
||||
type: 'HOST',
|
||||
label: infraHost.ipv4,
|
||||
label: infraHost.infraHostIPs[0].address,
|
||||
data: {
|
||||
target: infraHost
|
||||
},
|
||||
|
@ -101,7 +137,13 @@ export class InfraTreeComponent implements OnInit, OnChanges {
|
|||
}
|
||||
|
||||
addService(infraService: InfraTypeService) {
|
||||
this.hostNode[0].children.push({
|
||||
const idx = this.findHostIndex(infraService);
|
||||
if (idx === -1) {
|
||||
// this.addHost(infraService.infraHost);
|
||||
// this.addService(infraService);
|
||||
return;
|
||||
}
|
||||
this.hostNode[idx].children.push({
|
||||
type: 'SERVICE',
|
||||
label: 'TODO',
|
||||
data: {
|
||||
|
@ -109,4 +151,34 @@ export class InfraTreeComponent implements OnInit, OnChanges {
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
findHostIndex(infraService: InfraTypeService): number {
|
||||
const idx = -1;
|
||||
this.hostNode.forEach((node, index) => {
|
||||
// if (node.data.target.id === infraService.infraHost.id) {
|
||||
// idx = index;
|
||||
// return;
|
||||
// }
|
||||
});
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
||||
showContextMenu(event: MouseEvent, node: any) {
|
||||
this.selectedNode = node;
|
||||
|
||||
this.cmZone.hide();
|
||||
this.cmHost.hide();
|
||||
this.cmService.hide();
|
||||
|
||||
if (node.type === 'ZONE') {
|
||||
this.cmZone.show(event);
|
||||
} else if (node.type === 'HOST') {
|
||||
this.cmHost.show(event);
|
||||
} else if (node.type === 'SERVICE') {
|
||||
this.cmService.show(event);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,4 +27,8 @@ export class InfraService {
|
|||
public read(id: string): Observable<Infra> {
|
||||
return this.rpcService.call<Infra>('InfraService.read', id);
|
||||
}
|
||||
|
||||
public readAllInfraZoneByProbeID(probeID: number): Observable<Infra[]> {
|
||||
return this.rpcService.call<Infra[]>('InfraService.readAllInfraZoneByProbeID', probeID);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,10 @@ import { MetaCrawlerService } from './meta-crawler.service';
|
|||
import { MetaCrawlerInputItemService } from './meta-crawler-input-item.service';
|
||||
import { MetaHistoryTypeService } from './meta-history-type.service';
|
||||
import { MetaInfraTypeService } from './meta-infra-type.service';
|
||||
import { MetaInfraVendorService } from './meta-infra-vendor.service';
|
||||
import { MetaInputTypeService } from './meta-input-type.service';
|
||||
import { MetaMemberStatusService } from './meta-member-status.service';
|
||||
import { MetaNoAuthProbeStatusService } from './meta-noauth-probe-status.service';
|
||||
import { MetaNotificationService } from './meta-notification.service';
|
||||
import { MetaProbeArchitectureService } from './meta-probe-architecture.service';
|
||||
import { MetaProbeOsService } from './meta-probe-os.service';
|
||||
import { MetaProbePackageService } from './meta-probe-package.service';
|
||||
import { MetaProbeStatusService } from './meta-probe-status.service';
|
||||
import { MetaProbeTaskTypeService } from './meta-probe-task-type.service';
|
||||
import { MetaProbeVersionService } from './meta-probe-version.service';
|
||||
import { MetaSensorDisplayItemService } from './meta-sensor-display-item.service';
|
||||
import { MetaSensorDisplayMappingService } from './meta-sensor-display-mapping.service';
|
||||
import { MetaSensorItemService } from './meta-sensor-item.service';
|
||||
|
@ -20,25 +13,16 @@ import { MetaSensorItemKeyService } from './meta-sensor-item-key.service';
|
|||
import { MetaSensorItemTypeService } from './meta-sensor-item-type.service';
|
||||
import { MetaSensorItemUnitService } from './meta-sensor-item-unit.service';
|
||||
import { MetaSensorStatusService } from './meta-sensor-status.service';
|
||||
import { MetaVendorCrawlerService } from './meta-vendor-crawler.service';
|
||||
import { MetaVendorCrawlerSensorItemService } from './meta-vendor-crawler-sensor-item.service';
|
||||
|
||||
export const SERVICES = [
|
||||
MetaCrawlerService,
|
||||
MetaCrawlerInputItemService,
|
||||
MetaHistoryTypeService,
|
||||
MetaInfraTypeService,
|
||||
MetaInfraVendorService,
|
||||
MetaInputTypeService,
|
||||
MetaMemberStatusService,
|
||||
MetaNoAuthProbeStatusService,
|
||||
MetaNotificationService,
|
||||
MetaProbeArchitectureService,
|
||||
MetaProbeOsService,
|
||||
MetaProbePackageService,
|
||||
MetaProbeStatusService,
|
||||
MetaProbeTaskTypeService,
|
||||
MetaProbeVersionService,
|
||||
MetaSensorDisplayItemService,
|
||||
MetaSensorDisplayMappingService,
|
||||
MetaSensorItemService,
|
||||
|
@ -46,6 +30,4 @@ export const SERVICES = [
|
|||
MetaSensorItemTypeService,
|
||||
MetaSensorItemUnitService,
|
||||
MetaSensorStatusService,
|
||||
MetaVendorCrawlerService,
|
||||
MetaVendorCrawlerSensorItemService,
|
||||
];
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RPCService } from '@loafer/ng-rpc';
|
||||
import { MetaInfraType, MetaInfraVendor } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class MetaInfraVendorService {
|
||||
|
||||
public constructor(
|
||||
private rpcService: RPCService,
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
public readAllByMetaInfraTypeID(metaInfraTypeID: number): Observable<MetaInfraVendor[]> {
|
||||
return this.rpcService.call('MetaInfraVendorService.readAllByMetaInfraTypeID', metaInfraTypeID);
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RPCService } from '@loafer/ng-rpc';
|
||||
import { MetaCrawler, MetaNotification } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class MetaNotificationService {
|
||||
|
||||
public constructor(
|
||||
private rpcService: RPCService,
|
||||
) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RPCService } from '@loafer/ng-rpc';
|
||||
import { MetaProbeArchitecture } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class MetaProbeArchitectureService {
|
||||
|
||||
public constructor(
|
||||
private rpcService: RPCService,
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
public readAll(): Observable<MetaProbeArchitecture[]> {
|
||||
return this.rpcService.call('MetaProbeArchitectureService.readAll');
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RPCService } from '@loafer/ng-rpc';
|
||||
import { MetaProbeOs } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class MetaProbeOsService {
|
||||
|
||||
public constructor(
|
||||
private rpcService: RPCService,
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
public readAll(): Observable<MetaProbeOs[]> {
|
||||
return this.rpcService.call('MetaProbeOsService.readAll');
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RPCService } from '@loafer/ng-rpc';
|
||||
import { MetaProbeOs, MetaProbePackage } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class MetaProbePackageService {
|
||||
|
||||
public constructor(
|
||||
private rpcService: RPCService,
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
public readAllByMetaProbeOsID(metaProbeOsID: number): Observable<MetaProbePackage[]> {
|
||||
return this.rpcService.call('MetaProbePackageService.readAllByMetaProbeOsID', metaProbeOsID);
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RPCService } from '@loafer/ng-rpc';
|
||||
import { MetaProbeTaskType } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class MetaProbeTaskTypeService {
|
||||
|
||||
public constructor(
|
||||
private rpcService: RPCService,
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
public readAll(): Observable<MetaProbeTaskType[]> {
|
||||
return this.rpcService.call('MetaProbeTaskTypeService.readAll');
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RPCService } from '@loafer/ng-rpc';
|
||||
import { MetaProbeVersion } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
@Injectable()
|
||||
export class MetaProbeVersionService {
|
||||
|
||||
public constructor(
|
||||
private rpcService: RPCService,
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
public readAll(): Observable<MetaProbeVersion[]> {
|
||||
return this.rpcService.call('MetaProbeVersionService.readAll');
|
||||
}
|
||||
}
|
|
@ -140,7 +140,8 @@ export class NoAuthProbeListComponent implements OnInit, OnDestroy {
|
|||
return;
|
||||
}
|
||||
noauthProbes.forEach(noauthProbe => {
|
||||
noauthProbe.descriptions = JSON.parse(noauthProbe.description);
|
||||
// FIXME
|
||||
// noauthProbe.descriptions = JSON.parse(noauthProbe.description);
|
||||
});
|
||||
this.noauthProbes = noauthProbes;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ export class ProbeGeneralComponent implements OnInit {
|
|||
}
|
||||
|
||||
onEditSave() {
|
||||
this.probe.displayName = this.displayName ? this.displayName : this.probe.displayName;
|
||||
this.probe.name = this.displayName ? this.displayName : this.probe.name;
|
||||
this.probe.description = this.description ? this.description : this.probe.description;
|
||||
|
||||
this.probeService.modify(this.probe)
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { RPCService } from '@loafer/ng-rpc';
|
||||
import { SensorItemDependency } from '@overflow/commons-typescript/model/sensor-item';
|
||||
import { MetaSensorItemKey } from '@overflow/commons-typescript/model/meta';
|
||||
import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta';
|
||||
|
||||
|
||||
|
||||
|
@ -17,13 +13,5 @@ export class SensorItemDependencyService {
|
|||
|
||||
}
|
||||
|
||||
public regist(dependency: SensorItemDependency): Observable<SensorItemDependency> {
|
||||
return this.rpcService.call('SensorItemDependencyService.regist', dependency);
|
||||
}
|
||||
|
||||
public readAllByDisplayItem(displayItem: MetaSensorDisplayItem): Observable<MetaSensorItemKey[]> {
|
||||
return this.rpcService.call('SensorItemDependencyService.readAllByDisplayItem', displayItem);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
import { Component, OnInit, OnChanges, Input, Output, EventEmitter, ViewChild, AfterViewInit, OnDestroy } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Store, select } from '@ngrx/store';
|
||||
import { RPCClientError } from '@loafer/ng-rpc';
|
||||
import * as ListStore from '@overflow/meta/sensor-display-item/store/list';
|
||||
import { ReadAllSensorDisplayItemByCrawlerSelector } from '@overflow/meta/sensor-display-item/store';
|
||||
import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta';
|
||||
import { MetaCrawler } from '@overflow/commons-typescript/model/meta';
|
||||
import { MetaSensorItemType } from '@overflow/commons-typescript/model/meta';
|
||||
|
@ -20,14 +16,11 @@ export class SensorItemSelectorComponent implements OnInit, OnChanges {
|
|||
@Input() crawler: MetaCrawler;
|
||||
@Output() sensorItemsSelected = new EventEmitter<TreeNode[]>();
|
||||
|
||||
items$ = this.listStore.pipe(select(ReadAllSensorDisplayItemByCrawlerSelector.select('list')));
|
||||
|
||||
selectedItems: TreeNode[];
|
||||
itemTreeNode: TreeNode[];
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private listStore: Store<ListStore.State>,
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
@ -66,10 +59,9 @@ export class SensorItemSelectorComponent implements OnInit, OnChanges {
|
|||
const si: MetaSensorDisplayItem = {
|
||||
id: i,
|
||||
key: 'SensorDisplayItemKey' + i,
|
||||
displayName: 'this.is.display.item.name' + i,
|
||||
description: 'Description' + i,
|
||||
name: 'this.is.display.item.name' + i,
|
||||
default: isDefault,
|
||||
itemType: t
|
||||
metaSensorItemType: t
|
||||
};
|
||||
displayItems.push(si);
|
||||
}
|
||||
|
@ -109,7 +101,7 @@ export class SensorItemSelectorComponent implements OnInit, OnChanges {
|
|||
existCategory(item: MetaSensorDisplayItem) {
|
||||
let categoryNode = null;
|
||||
for (const node of this.itemTreeNode) {
|
||||
if (node.label === item.itemType.name) {
|
||||
if (node.label === item.metaSensorItemType.name) {
|
||||
categoryNode = node;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,7 @@ import { Observable } from 'rxjs';
|
|||
import { RPCService } from '@loafer/ng-rpc';
|
||||
|
||||
// import { PageParams, Page } from 'app/commons/model';
|
||||
import { SensorItem } from '@overflow/commons-typescript/model/sensor-item';
|
||||
import { Sensor } from '@overflow/commons-typescript/model/sensor';
|
||||
import { Sensor, SensorItem } from '@overflow/commons-typescript/model/sensor';
|
||||
import { Domain } from '@overflow/commons-typescript/model/domain';
|
||||
import { Target } from '@overflow/commons-typescript/model/target';
|
||||
import { Page, PageParams } from '@overflow/commons-typescript/core/model';
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
Input,
|
||||
EventEmitter,
|
||||
Output,
|
||||
|
@ -32,7 +31,7 @@ import {PlatformLocation} from '@angular/common';
|
|||
selector: 'of-target-list',
|
||||
templateUrl: './list.component.html',
|
||||
})
|
||||
export class ListComponent implements OnInit {
|
||||
export class ListComponent implements OnChanges {
|
||||
|
||||
@Input() probeID;
|
||||
@Input() pageIdx;
|
||||
|
@ -55,9 +54,6 @@ export class ListComponent implements OnInit {
|
|||
this.countPerPage = 2;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
// console.log(changes);
|
||||
if (changes['pageIdx']) {
|
||||
|
|
6
package-lock.json
generated
6
package-lock.json
generated
|
@ -453,9 +453,9 @@
|
|||
}
|
||||
},
|
||||
"@overflow/commons-typescript": {
|
||||
"version": "0.0.9",
|
||||
"resolved": "https://nexus.loafle.net/repository/npm-all/@overflow/commons-typescript/-/commons-typescript-0.0.9.tgz",
|
||||
"integrity": "sha512-7cfXq9arDj6CnHqfQg0N8wmWzgad3cr4q5gJL95dYCBj+f31MZG0ttwMwmqFz12HsjiS2Pvhumz3rIcBDkm/Sg=="
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://nexus.loafle.net/repository/npm-all/@overflow/commons-typescript/-/commons-typescript-0.0.10.tgz",
|
||||
"integrity": "sha512-caZTr0lFFrJ5PF4G9pWYciOK7FGsxvpXBfhhECKrxdX5RqRS3cnai98aUiYsH6hB1mrQl+WaA5Twjp6miNt3NQ=="
|
||||
},
|
||||
"@schematics/angular": {
|
||||
"version": "0.6.5",
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
"@ngrx/router-store": "^5.2.0",
|
||||
"@ngrx/store": "^5.2.0",
|
||||
"@ngrx/store-devtools": "^5.2.0",
|
||||
"@overflow/commons-typescript": "^0.0.9",
|
||||
"@overflow/commons-typescript": "^0.0.10",
|
||||
"angular-google-recaptcha": "^1.0.3",
|
||||
"angular-l10n": "^5.0.0",
|
||||
"angularx-qrcode": "^1.1.7",
|
||||
|
|
Loading…
Reference in New Issue
Block a user