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