diff --git a/@overflow/discovery/component/discovery.component.html b/@overflow/discovery/component/discovery.component.html index c04c1f3..b0bbb20 100644 --- a/@overflow/discovery/component/discovery.component.html +++ b/@overflow/discovery/component/discovery.component.html @@ -1,8 +1,9 @@

Discovery

- - + + +
diff --git a/@overflow/discovery/component/discovery.component.ts b/@overflow/discovery/component/discovery.component.ts index 8e63434..4d73f7c 100644 --- a/@overflow/discovery/component/discovery.component.ts +++ b/@overflow/discovery/component/discovery.component.ts @@ -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); diff --git a/@overflow/discovery/component/search-filter.component.ts b/@overflow/discovery/component/search-filter.component.ts index f868053..9b354f2 100644 --- a/@overflow/discovery/component/search-filter.component.ts +++ b/@overflow/discovery/component/search-filter.component.ts @@ -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); } diff --git a/@overflow/discovery/component/search-result.component.ts b/@overflow/discovery/component/search-result.component.ts index ea5e50b..9984376 100644 --- a/@overflow/discovery/component/search-result.component.ts +++ b/@overflow/discovery/component/search-result.component.ts @@ -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; } diff --git a/@overflow/infra/component/infra-map.component.ts b/@overflow/infra/component/infra-map.component.ts index 46068dc..b4173c1 100644 --- a/@overflow/infra/component/infra-map.component.ts +++ b/@overflow/infra/component/infra-map.component.ts @@ -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) { diff --git a/@overflow/infra/component/infra-tree.component.html b/@overflow/infra/component/infra-tree.component.html index ad6c22a..a1cdf99 100644 --- a/@overflow/infra/component/infra-tree.component.html +++ b/@overflow/infra/component/infra-tree.component.html @@ -4,63 +4,27 @@ -
+
{{node.label}}
- {{node.label}} +
+ {{node.label}} +
- {{node.label}} +
+ {{node.label}} +
- - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/@overflow/infra/component/infra-tree.component.ts b/@overflow/infra/component/infra-tree.component.ts index e2765d3..73125fe 100644 --- a/@overflow/infra/component/infra-tree.component.ts +++ b/@overflow/infra/component/infra-tree.component.ts @@ -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; error$: Observable; - 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) => { 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; + } } diff --git a/@overflow/infra/service/infra.service.ts b/@overflow/infra/service/infra.service.ts index 9406542..d36f8d3 100644 --- a/@overflow/infra/service/infra.service.ts +++ b/@overflow/infra/service/infra.service.ts @@ -27,4 +27,8 @@ export class InfraService { public read(id: string): Observable { return this.rpcService.call('InfraService.read', id); } + + public readAllInfraZoneByProbeID(probeID: number): Observable { + return this.rpcService.call('InfraService.readAllInfraZoneByProbeID', probeID); + } } diff --git a/@overflow/meta/service/index.ts b/@overflow/meta/service/index.ts index 76f95b2..2e899c8 100644 --- a/@overflow/meta/service/index.ts +++ b/@overflow/meta/service/index.ts @@ -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, ]; diff --git a/@overflow/meta/service/meta-infra-vendor.service.ts b/@overflow/meta/service/meta-infra-vendor.service.ts deleted file mode 100644 index 329ca93..0000000 --- a/@overflow/meta/service/meta-infra-vendor.service.ts +++ /dev/null @@ -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 { - return this.rpcService.call('MetaInfraVendorService.readAllByMetaInfraTypeID', metaInfraTypeID); - } -} diff --git a/@overflow/meta/service/meta-notification.service.ts b/@overflow/meta/service/meta-notification.service.ts deleted file mode 100644 index a8ffa3c..0000000 --- a/@overflow/meta/service/meta-notification.service.ts +++ /dev/null @@ -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, - ) { - - } -} diff --git a/@overflow/meta/service/meta-probe-architecture.service.ts b/@overflow/meta/service/meta-probe-architecture.service.ts deleted file mode 100644 index b4dccee..0000000 --- a/@overflow/meta/service/meta-probe-architecture.service.ts +++ /dev/null @@ -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 { - return this.rpcService.call('MetaProbeArchitectureService.readAll'); - } -} diff --git a/@overflow/meta/service/meta-probe-os.service.ts b/@overflow/meta/service/meta-probe-os.service.ts deleted file mode 100644 index 105b8cf..0000000 --- a/@overflow/meta/service/meta-probe-os.service.ts +++ /dev/null @@ -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 { - return this.rpcService.call('MetaProbeOsService.readAll'); - } -} diff --git a/@overflow/meta/service/meta-probe-package.service.ts b/@overflow/meta/service/meta-probe-package.service.ts deleted file mode 100644 index 695baf9..0000000 --- a/@overflow/meta/service/meta-probe-package.service.ts +++ /dev/null @@ -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 { - return this.rpcService.call('MetaProbePackageService.readAllByMetaProbeOsID', metaProbeOsID); - } -} diff --git a/@overflow/meta/service/meta-probe-task-type.service.ts b/@overflow/meta/service/meta-probe-task-type.service.ts deleted file mode 100644 index e32f1ac..0000000 --- a/@overflow/meta/service/meta-probe-task-type.service.ts +++ /dev/null @@ -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 { - return this.rpcService.call('MetaProbeTaskTypeService.readAll'); - } -} diff --git a/@overflow/meta/service/meta-probe-version.service.ts b/@overflow/meta/service/meta-probe-version.service.ts deleted file mode 100644 index 1ba35be..0000000 --- a/@overflow/meta/service/meta-probe-version.service.ts +++ /dev/null @@ -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 { - return this.rpcService.call('MetaProbeVersionService.readAll'); - } -} diff --git a/@overflow/noauth-probe/component/noauth-probe-list.component.ts b/@overflow/noauth-probe/component/noauth-probe-list.component.ts index b2939f7..270ca8c 100644 --- a/@overflow/noauth-probe/component/noauth-probe-list.component.ts +++ b/@overflow/noauth-probe/component/noauth-probe-list.component.ts @@ -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; } diff --git a/@overflow/probe/component/probe-general.component.ts b/@overflow/probe/component/probe-general.component.ts index cd0367c..1b1f166 100644 --- a/@overflow/probe/component/probe-general.component.ts +++ b/@overflow/probe/component/probe-general.component.ts @@ -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) diff --git a/@overflow/sensor-item/service/sensor-item-dependency.service.ts b/@overflow/sensor-item/service/sensor-item-dependency.service.ts index ff46a91..888c77d 100644 --- a/@overflow/sensor-item/service/sensor-item-dependency.service.ts +++ b/@overflow/sensor-item/service/sensor-item-dependency.service.ts @@ -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 { - return this.rpcService.call('SensorItemDependencyService.regist', dependency); - } - - public readAllByDisplayItem(displayItem: MetaSensorDisplayItem): Observable { - return this.rpcService.call('SensorItemDependencyService.readAllByDisplayItem', displayItem); - } - } diff --git a/@overflow/sensor/component/setting/sensor-item-selector/sensor-item-selector.component.ts b/@overflow/sensor/component/setting/sensor-item-selector/sensor-item-selector.component.ts index b4114fe..9461c66 100644 --- a/@overflow/sensor/component/setting/sensor-item-selector/sensor-item-selector.component.ts +++ b/@overflow/sensor/component/setting/sensor-item-selector/sensor-item-selector.component.ts @@ -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(); - items$ = this.listStore.pipe(select(ReadAllSensorDisplayItemByCrawlerSelector.select('list'))); - selectedItems: TreeNode[]; itemTreeNode: TreeNode[]; constructor( private router: Router, - private listStore: Store, ) { } 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; } } diff --git a/@overflow/sensor/service/sensor.service.ts b/@overflow/sensor/service/sensor.service.ts index 4935822..e3cd956 100644 --- a/@overflow/sensor/service/sensor.service.ts +++ b/@overflow/sensor/service/sensor.service.ts @@ -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'; diff --git a/@overflow/target/component/list/list.component.ts b/@overflow/target/component/list/list.component.ts index e3d09b0..bce9619 100644 --- a/@overflow/target/component/list/list.component.ts +++ b/@overflow/target/component/list/list.component.ts @@ -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']) { diff --git a/package-lock.json b/package-lock.json index 20c3855..c4a3f79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 26f39b6..245bc44 100644 --- a/package.json +++ b/package.json @@ -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",