diff --git a/src/packages/infra/model/Infra.ts b/src/packages/infra/model/Infra.ts index d507ee1..88b4832 100644 --- a/src/packages/infra/model/Infra.ts +++ b/src/packages/infra/model/Infra.ts @@ -1,7 +1,7 @@ -import { MetaInfraType } from 'packages/meta/model'; import { Probe } from 'packages/probe/model'; import { Target } from 'packages/target/model'; +import { MetaInfraType } from '../../meta/infra-type/model/MetaInfraType'; export interface Infra { id?: number; diff --git a/src/packages/infra/model/InfraOS.ts b/src/packages/infra/model/InfraOS.ts index 3ad790d..04da32f 100644 --- a/src/packages/infra/model/InfraOS.ts +++ b/src/packages/infra/model/InfraOS.ts @@ -1,6 +1,6 @@ import { InfraMachine } from './InfraMachine'; -import { MetaInfraVendor } from 'packages/meta/model'; import { Infra } from './Infra'; +import { MetaInfraVendor } from '../../meta/infra-vendor/model/MetaInfraVendor'; export interface InfraOS extends Infra { // id?: number; diff --git a/src/packages/infra/model/InfraOSPort.ts b/src/packages/infra/model/InfraOSPort.ts index f264115..d5ea526 100644 --- a/src/packages/infra/model/InfraOSPort.ts +++ b/src/packages/infra/model/InfraOSPort.ts @@ -1,6 +1,6 @@ import { InfraOS } from './InfraOS'; -import { MetaInfraVendor } from 'packages/meta/model'; import { Infra } from './Infra'; +import { MetaInfraVendor } from 'packages/meta/infra-vendor/model/MetaInfraVendor'; export interface InfraOSPort extends Infra { // id?: number; diff --git a/src/packages/infra/model/InfraService.ts b/src/packages/infra/model/InfraService.ts index 20e39d6..a7a9e2b 100644 --- a/src/packages/infra/model/InfraService.ts +++ b/src/packages/infra/model/InfraService.ts @@ -1,6 +1,6 @@ import { InfraHost } from './InfraHost'; -import { MetaInfraVendor } from 'packages/meta/model'; import { Infra } from './Infra'; +import { MetaInfraVendor } from 'packages/meta/infra-vendor/model/MetaInfraVendor'; export interface InfraService extends Infra { // id?: number; diff --git a/src/packages/member/model/Member.ts b/src/packages/member/model/Member.ts index 05913ef..c1de12a 100644 --- a/src/packages/member/model/Member.ts +++ b/src/packages/member/model/Member.ts @@ -1,4 +1,4 @@ -import { MetaMemberStatus } from 'packages/meta/model'; +import { MetaMemberStatus } from 'packages/meta/member-status/model/MetaMemberStatus'; export interface Member { id?: number; diff --git a/src/packages/meta/model/MetaCrawlerInputItem.ts b/src/packages/meta/crawler-input-item/model/MetaCrawlerInputItem.ts similarity index 64% rename from src/packages/meta/model/MetaCrawlerInputItem.ts rename to src/packages/meta/crawler-input-item/model/MetaCrawlerInputItem.ts index 5fdc870..b63ebc6 100644 --- a/src/packages/meta/model/MetaCrawlerInputItem.ts +++ b/src/packages/meta/crawler-input-item/model/MetaCrawlerInputItem.ts @@ -1,6 +1,6 @@ +import { MetaInputType } from 'packages/meta/input-type/model/MetaInputType'; +import { MetaCrawler } from 'packages/meta/crawler/model/MetaCrawler'; -import { MetaInputType } from './MetaInputType'; -import { MetaCrawler } from './MetaCrawler'; export interface MetaCrawlerInputItem { id?: number; diff --git a/src/packages/meta/meta-store.module.ts b/src/packages/meta/crawler/crawler-store.module.ts similarity index 86% rename from src/packages/meta/meta-store.module.ts rename to src/packages/meta/crawler/crawler-store.module.ts index fc47af5..f47c903 100644 --- a/src/packages/meta/meta-store.module.ts +++ b/src/packages/meta/crawler/crawler-store.module.ts @@ -13,7 +13,7 @@ import { EFFECTS, } from './store'; -import { MODULE } from './meta.constant'; +import { MODULE } from './crawler.constant'; @NgModule({ imports: [ @@ -21,4 +21,4 @@ import { MODULE } from './meta.constant'; EffectsModule.forFeature(EFFECTS), ], }) -export class MetaStoreModule { } +export class MetaCrawlerStoreModule { } diff --git a/src/packages/meta/crawler/crawler.constant.ts b/src/packages/meta/crawler/crawler.constant.ts new file mode 100644 index 0000000..5edb6c9 --- /dev/null +++ b/src/packages/meta/crawler/crawler.constant.ts @@ -0,0 +1,3 @@ +export const MODULE = { + name: 'metaCrawler' +}; diff --git a/src/packages/meta/meta.module.ts b/src/packages/meta/crawler/crawler.module.ts similarity index 66% rename from src/packages/meta/meta.module.ts rename to src/packages/meta/crawler/crawler.module.ts index 300548c..35a55bf 100644 --- a/src/packages/meta/meta.module.ts +++ b/src/packages/meta/crawler/crawler.module.ts @@ -1,15 +1,16 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { } from './crawler.module'; + import { MaterialModule } from 'packages/commons/material/material.module'; - import { SERVICES } from './service'; - +import { MetaCrawlerStoreModule } from './crawler-store.module'; @NgModule({ imports: [ CommonModule, - MaterialModule, + MetaCrawlerStoreModule ], declarations: [ ], @@ -17,6 +18,6 @@ import { SERVICES } from './service'; ], providers: [ SERVICES, - ], + ] }) -export class MetaModule { } +export class MetaCrawlerModule { } diff --git a/src/packages/meta/model/MetaCrawler.ts b/src/packages/meta/crawler/model/MetaCrawler.ts similarity index 100% rename from src/packages/meta/model/MetaCrawler.ts rename to src/packages/meta/crawler/model/MetaCrawler.ts diff --git a/src/packages/meta/service/crawler.service.ts b/src/packages/meta/crawler/service/crawler.service.ts similarity index 69% rename from src/packages/meta/service/crawler.service.ts rename to src/packages/meta/crawler/service/crawler.service.ts index 6238586..d62458f 100644 --- a/src/packages/meta/service/crawler.service.ts +++ b/src/packages/meta/crawler/service/crawler.service.ts @@ -5,10 +5,10 @@ import 'rxjs/add/operator/map'; import { RPCClient } from 'packages/core/rpc/client/RPCClient'; -import { MetaCrawler } from '../model'; +import { MetaCrawler } from '../model/MetaCrawler'; @Injectable() -export class CrawlerService { +export class MetaCrawlerService { public constructor( private rpcClient: RPCClient, @@ -17,6 +17,6 @@ export class CrawlerService { } public readAll(): Observable { - return this.rpcClient.call('CrawlerService.readAll'); + return this.rpcClient.call('CrawlerService.readAll'); } } diff --git a/src/packages/meta/crawler/service/index.ts b/src/packages/meta/crawler/service/index.ts new file mode 100644 index 0000000..e4f7b70 --- /dev/null +++ b/src/packages/meta/crawler/service/index.ts @@ -0,0 +1,5 @@ +import { MetaCrawlerService } from './crawler.service'; + +export const SERVICES = [ + MetaCrawlerService, +]; diff --git a/src/packages/meta/crawler/store/index.ts b/src/packages/meta/crawler/store/index.ts new file mode 100644 index 0000000..e0ceebd --- /dev/null +++ b/src/packages/meta/crawler/store/index.ts @@ -0,0 +1,30 @@ +import { + createSelector, + createFeatureSelector, + ActionReducerMap, +} from '@ngrx/store'; + +import { StateSelector } from 'packages/core/ngrx/store'; + +import { MODULE } from '../crawler.constant'; + +import * as ListStore from './list'; + +export interface State { + crawlers: ListStore.State; +} + +export const REDUCERS = { + crawlers: ListStore.reducer, +}; + +export const EFFECTS = [ + ListStore.Effects, +]; + +export const selectNotificationState = createFeatureSelector(MODULE.name); + +export const ReadAllCrawlerSelector = new StateSelector(createSelector( + selectNotificationState, + (state: State) => state.crawlers +)); diff --git a/src/packages/meta/store/crawler/list/index.ts b/src/packages/meta/crawler/store/list/index.ts similarity index 100% rename from src/packages/meta/store/crawler/list/index.ts rename to src/packages/meta/crawler/store/list/index.ts diff --git a/src/packages/meta/store/crawler/list/list.action.ts b/src/packages/meta/crawler/store/list/list.action.ts similarity index 89% rename from src/packages/meta/store/crawler/list/list.action.ts rename to src/packages/meta/crawler/store/list/list.action.ts index 8b1942c..ed2bec5 100644 --- a/src/packages/meta/store/crawler/list/list.action.ts +++ b/src/packages/meta/crawler/store/list/list.action.ts @@ -1,10 +1,9 @@ import { Action } from '@ngrx/store'; import { RPCError } from 'packages/core/rpc/error'; +import { MetaCrawler } from '../../model/MetaCrawler'; -import { MetaCrawler } from '../../../model'; - export enum ActionType { ReadAll = '[meta.crawler-readall] ReadAll', ReadAllSuccess = '[meta.crawler-readall] ReadAllSuccess', @@ -14,7 +13,7 @@ export enum ActionType { export class ReadAll implements Action { readonly type = ActionType.ReadAll; - constructor(public payload: {}) {} + constructor() {} } export class ReadAllSuccess implements Action { diff --git a/src/packages/meta/store/crawler/list/list.effect.spec.ts b/src/packages/meta/crawler/store/list/list.effect.spec.ts similarity index 100% rename from src/packages/meta/store/crawler/list/list.effect.spec.ts rename to src/packages/meta/crawler/store/list/list.effect.spec.ts diff --git a/src/packages/meta/store/crawler/list/list.effect.ts b/src/packages/meta/crawler/store/list/list.effect.ts similarity index 84% rename from src/packages/meta/store/crawler/list/list.effect.ts rename to src/packages/meta/crawler/store/list/list.effect.ts index 7bb3524..1aeaae7 100644 --- a/src/packages/meta/store/crawler/list/list.effect.ts +++ b/src/packages/meta/crawler/store/list/list.effect.ts @@ -18,8 +18,6 @@ import { RPCError } from 'packages/core/rpc/error'; import { DomainMember } from 'packages/domain/model'; -import { MetaCrawler } from '../../../model'; -import { CrawlerService } from '../../../service/crawler.service'; import { ReadAll, @@ -27,20 +25,21 @@ import { ReadAllFailure, ActionType, } from './list.action'; +import { MetaCrawlerService } from '../../service/crawler.service'; @Injectable() export class Effects { constructor( private actions$: Actions, - private crawlerService: CrawlerService, + private crawlerService: MetaCrawlerService, private router: Router ) { } @Effect() readAll$: Observable = this.actions$ .ofType(ActionType.ReadAll) - .map((action: ReadAll) => action.payload) + .map((action: ReadAll) => action) .switchMap(payload => this.crawlerService.readAll()) .map(list => { return new ReadAllSuccess(list); diff --git a/src/packages/meta/store/crawler/list/list.reducer.ts b/src/packages/meta/crawler/store/list/list.reducer.ts similarity index 93% rename from src/packages/meta/store/crawler/list/list.reducer.ts rename to src/packages/meta/crawler/store/list/list.reducer.ts index 3a5d4de..42e1225 100644 --- a/src/packages/meta/store/crawler/list/list.reducer.ts +++ b/src/packages/meta/crawler/store/list/list.reducer.ts @@ -8,8 +8,6 @@ import { initialState, } from './list.state'; -import { MetaCrawler } from '../../../model'; - export function reducer(state = initialState, action: Actions): State { switch (action.type) { case ActionType.ReadAll: { diff --git a/src/packages/meta/store/crawler/list/list.state.ts b/src/packages/meta/crawler/store/list/list.state.ts similarity index 82% rename from src/packages/meta/store/crawler/list/list.state.ts rename to src/packages/meta/crawler/store/list/list.state.ts index 2787826..4f19659 100644 --- a/src/packages/meta/store/crawler/list/list.state.ts +++ b/src/packages/meta/crawler/store/list/list.state.ts @@ -1,5 +1,5 @@ import { RPCError } from 'packages/core/rpc/error'; -import { MetaCrawler } from '../../../model'; +import { MetaCrawler } from '../../model/MetaCrawler'; export interface State { diff --git a/src/packages/meta/model/MetaHistoryType.ts b/src/packages/meta/history-type/model/MetaHistoryType.ts similarity index 100% rename from src/packages/meta/model/MetaHistoryType.ts rename to src/packages/meta/history-type/model/MetaHistoryType.ts diff --git a/src/packages/meta/model/MetaInfraType.ts b/src/packages/meta/infra-type/model/MetaInfraType.ts similarity index 100% rename from src/packages/meta/model/MetaInfraType.ts rename to src/packages/meta/infra-type/model/MetaInfraType.ts diff --git a/src/packages/meta/model/MetaInfraVendor.ts b/src/packages/meta/infra-vendor/model/MetaInfraVendor.ts similarity index 92% rename from src/packages/meta/model/MetaInfraVendor.ts rename to src/packages/meta/infra-vendor/model/MetaInfraVendor.ts index a070ad6..9d58741 100644 --- a/src/packages/meta/model/MetaInfraVendor.ts +++ b/src/packages/meta/infra-vendor/model/MetaInfraVendor.ts @@ -1,5 +1,5 @@ +import { MetaInfraType } from 'packages/meta/infra-type/model/MetaInfraType'; -import { MetaInfraType } from './MetaInfraType'; export interface MetaInfraVendor { id?: number; diff --git a/src/packages/meta/model/MetaInputType.ts b/src/packages/meta/input-type/model/MetaInputType.ts similarity index 100% rename from src/packages/meta/model/MetaInputType.ts rename to src/packages/meta/input-type/model/MetaInputType.ts diff --git a/src/packages/meta/model/MetaMemberStatus.ts b/src/packages/meta/member-status/model/MetaMemberStatus.ts similarity index 100% rename from src/packages/meta/model/MetaMemberStatus.ts rename to src/packages/meta/member-status/model/MetaMemberStatus.ts diff --git a/src/packages/meta/meta.constant.ts b/src/packages/meta/meta.constant.ts deleted file mode 100644 index d9302c8..0000000 --- a/src/packages/meta/meta.constant.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const MODULE = { - name: 'meta' - }; diff --git a/src/packages/meta/model-temp/MetaVendorCrawler.ts b/src/packages/meta/model-temp/MetaVendorCrawler.ts new file mode 100644 index 0000000..f446ca0 --- /dev/null +++ b/src/packages/meta/model-temp/MetaVendorCrawler.ts @@ -0,0 +1,10 @@ + +import { MetaCrawler } from 'packages/meta/crawler/model/MetaCrawler'; +import { MetaInfraVendor } from 'packages/meta/infra-vendor/model/MetaInfraVendor'; + +export interface MetaVendorCrawler { + id?: number; + crawler: MetaCrawler; + infraVendor: MetaInfraVendor; + createDate: Date; +} diff --git a/src/packages/meta/model/MetaVendorCrawlerSensorItem.ts b/src/packages/meta/model-temp/MetaVendorCrawlerSensorItem.ts similarity index 55% rename from src/packages/meta/model/MetaVendorCrawlerSensorItem.ts rename to src/packages/meta/model-temp/MetaVendorCrawlerSensorItem.ts index 1a2484a..f23f054 100644 --- a/src/packages/meta/model/MetaVendorCrawlerSensorItem.ts +++ b/src/packages/meta/model-temp/MetaVendorCrawlerSensorItem.ts @@ -1,6 +1,6 @@ +import { MetaSensorItem } from 'packages/meta/sensor-item/model/MetaSensorItem'; +import { MetaInfraVendor } from 'packages/meta/infra-vendor/model/MetaInfraVendor'; -import { MetaInfraVendor } from './MetaInfraVendor'; -import { MetaSensorItem } from './MetaSensorItem'; export interface MetaVendorCrawlerSensorItem { id?: number; diff --git a/src/packages/meta/model-temp/index.ts b/src/packages/meta/model-temp/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/packages/meta/model/MetaProbePackage.ts b/src/packages/meta/model/MetaProbePackage.ts deleted file mode 100644 index f7b15ce..0000000 --- a/src/packages/meta/model/MetaProbePackage.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { MetaProbeVersion } from './MetaProbeVersion'; -import { MetaProbeOs } from './MetaProbeOs'; -import { MetaProbeArchitecture } from './MetaProbeArchitecture'; - -export interface MetaProbePackage { - id?: number; - version: MetaProbeVersion; - os: MetaProbeOs; - architecture: MetaProbeArchitecture; - createDate: Date; -} diff --git a/src/packages/meta/model/MetaVendorCrawler.ts b/src/packages/meta/model/MetaVendorCrawler.ts deleted file mode 100644 index 4621418..0000000 --- a/src/packages/meta/model/MetaVendorCrawler.ts +++ /dev/null @@ -1,10 +0,0 @@ - -import { MetaInfraVendor } from './MetaInfraVendor'; -import { MetaCrawler } from './MetaCrawler'; - -export interface MetaVendorCrawler { - id?: number; - crawler: MetaCrawler; - infraVendor: MetaInfraVendor; - createDate: Date; -} diff --git a/src/packages/meta/model/index.ts b/src/packages/meta/model/index.ts deleted file mode 100644 index 5a6ec42..0000000 --- a/src/packages/meta/model/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -export * from './MetaCrawlerInputItem'; -export * from './MetaCrawler'; -export * from './MetaHistoryType'; -export * from './MetaInfraType'; -export * from './MetaInfraVendor'; -export * from './MetaInputType'; -export * from './MetaMemberStatus'; -export * from './MetaNoAuthProbeStatus'; -export * from './MetaNotification'; -export * from './MetaProbeArchitecture'; -export * from './MetaProbeOs'; -export * from './MetaProbePackage'; -export * from './MetaProbeStatus'; -export * from './MetaProbeTaskType'; -export * from './MetaProbeVersion'; -export * from './MetaSensorDisplayItem'; -export * from './MetaSensorItemKey'; -export * from './MetaSensorItem'; -export * from './MetaSensorItemType'; -export * from './MetaSensorItemUnit'; -export * from './MetaSensorStatus'; -export * from './MetaVendorCrawlerSensorItem'; -export * from './MetaVendorCrawler'; diff --git a/src/packages/meta/model/MetaNoAuthProbeStatus.ts b/src/packages/meta/noauth-probe-status/model/MetaNoAuthProbeStatus.ts similarity index 100% rename from src/packages/meta/model/MetaNoAuthProbeStatus.ts rename to src/packages/meta/noauth-probe-status/model/MetaNoAuthProbeStatus.ts diff --git a/src/packages/meta/model/MetaNotification.ts b/src/packages/meta/notification/model/MetaNotification.ts similarity index 100% rename from src/packages/meta/model/MetaNotification.ts rename to src/packages/meta/notification/model/MetaNotification.ts diff --git a/src/packages/meta/model/MetaProbeArchitecture.ts b/src/packages/meta/probe-architecture/model/MetaProbeArchitecture.ts similarity index 100% rename from src/packages/meta/model/MetaProbeArchitecture.ts rename to src/packages/meta/probe-architecture/model/MetaProbeArchitecture.ts diff --git a/src/packages/meta/model/MetaProbeOs.ts b/src/packages/meta/probe-os/model/MetaProbeOs.ts similarity index 100% rename from src/packages/meta/model/MetaProbeOs.ts rename to src/packages/meta/probe-os/model/MetaProbeOs.ts diff --git a/src/packages/meta/probe-package/model/MetaProbePackage.ts b/src/packages/meta/probe-package/model/MetaProbePackage.ts new file mode 100644 index 0000000..09e65c1 --- /dev/null +++ b/src/packages/meta/probe-package/model/MetaProbePackage.ts @@ -0,0 +1,11 @@ +import { MetaProbeVersion } from 'packages/meta/probe-version/model/MetaProbeVersion'; +import { MetaProbeOs } from 'packages/meta/probe-os/model/MetaProbeOs'; +import { MetaProbeArchitecture } from 'packages/meta/probe-architecture/model/MetaProbeArchitecture'; + +export interface MetaProbePackage { + id?: number; + version: MetaProbeVersion; + os: MetaProbeOs; + architecture: MetaProbeArchitecture; + createDate: Date; +} diff --git a/src/packages/meta/model/MetaProbeStatus.ts b/src/packages/meta/probe-status/model/MetaProbeStatus.ts similarity index 100% rename from src/packages/meta/model/MetaProbeStatus.ts rename to src/packages/meta/probe-status/model/MetaProbeStatus.ts diff --git a/src/packages/meta/model/MetaProbeTaskType.ts b/src/packages/meta/probe-task-type/model/MetaProbeTaskType.ts similarity index 100% rename from src/packages/meta/model/MetaProbeTaskType.ts rename to src/packages/meta/probe-task-type/model/MetaProbeTaskType.ts diff --git a/src/packages/meta/model/MetaProbeVersion.ts b/src/packages/meta/probe-version/model/MetaProbeVersion.ts similarity index 100% rename from src/packages/meta/model/MetaProbeVersion.ts rename to src/packages/meta/probe-version/model/MetaProbeVersion.ts diff --git a/src/packages/meta/model/MetaSensorDisplayItem.ts b/src/packages/meta/sensor-display-item/model/MetaSensorDisplayItem.ts similarity index 51% rename from src/packages/meta/model/MetaSensorDisplayItem.ts rename to src/packages/meta/sensor-display-item/model/MetaSensorDisplayItem.ts index 9fe1cc4..790cc06 100644 --- a/src/packages/meta/model/MetaSensorDisplayItem.ts +++ b/src/packages/meta/sensor-display-item/model/MetaSensorDisplayItem.ts @@ -1,6 +1,6 @@ -import { MetaCrawler } from './MetaCrawler'; -import { MetaSensorItemUnit } from './MetaSensorItemUnit'; -import { MetaSensorItemType } from './MetaSensorItemType'; +import { MetaCrawler } from 'packages/meta/crawler/model/MetaCrawler'; +import { MetaSensorItemUnit } from 'packages/meta/sensor-item-unit/model/MetaSensorItemUnit'; +import { MetaSensorItemType } from 'packages/meta/sensor-item-type/model/MetaSensorItemType'; export interface MetaSensorDisplayItem { id?: number; diff --git a/src/packages/meta/model/MetaSensorItemKey.ts b/src/packages/meta/sensor-item-key/model/MetaSensorItemKey.ts similarity index 55% rename from src/packages/meta/model/MetaSensorItemKey.ts rename to src/packages/meta/sensor-item-key/model/MetaSensorItemKey.ts index 9b9dcea..7b8d708 100644 --- a/src/packages/meta/model/MetaSensorItemKey.ts +++ b/src/packages/meta/sensor-item-key/model/MetaSensorItemKey.ts @@ -1,5 +1,5 @@ -import { MetaSensorItem } from './MetaSensorItem'; -import { MetaCrawler } from './MetaCrawler'; +import { MetaSensorItem } from 'packages/meta/sensor-item/model/MetaSensorItem'; +import { MetaCrawler } from 'packages/meta/crawler/model/MetaCrawler'; export interface MetaSensorItemKey { id: number; diff --git a/src/packages/meta/model/MetaSensorItemType.ts b/src/packages/meta/sensor-item-type/model/MetaSensorItemType.ts similarity index 100% rename from src/packages/meta/model/MetaSensorItemType.ts rename to src/packages/meta/sensor-item-type/model/MetaSensorItemType.ts diff --git a/src/packages/meta/model/MetaSensorItemUnit.ts b/src/packages/meta/sensor-item-unit/model/MetaSensorItemUnit.ts similarity index 100% rename from src/packages/meta/model/MetaSensorItemUnit.ts rename to src/packages/meta/sensor-item-unit/model/MetaSensorItemUnit.ts diff --git a/src/packages/meta/model/MetaSensorItem.ts b/src/packages/meta/sensor-item/model/MetaSensorItem.ts similarity index 53% rename from src/packages/meta/model/MetaSensorItem.ts rename to src/packages/meta/sensor-item/model/MetaSensorItem.ts index ada3786..8fecfcd 100644 --- a/src/packages/meta/model/MetaSensorItem.ts +++ b/src/packages/meta/sensor-item/model/MetaSensorItem.ts @@ -1,6 +1,5 @@ +import { MetaSensorItemType } from 'packages/meta/sensor-item-type/model/MetaSensorItemType'; -import { MetaProbeArchitecture } from './MetaProbeArchitecture'; -import { MetaSensorItemType } from './MetaSensorItemType'; export interface MetaSensorItem { id?: number; diff --git a/src/packages/meta/model/MetaSensorStatus.ts b/src/packages/meta/sensor-status/model/MetaSensorStatus.ts similarity index 100% rename from src/packages/meta/model/MetaSensorStatus.ts rename to src/packages/meta/sensor-status/model/MetaSensorStatus.ts diff --git a/src/packages/meta/service/index.ts b/src/packages/meta/service/index.ts deleted file mode 100644 index c80504c..0000000 --- a/src/packages/meta/service/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CrawlerService } from './crawler.service'; - -export const SERVICES = [ - CrawlerService, -]; diff --git a/src/packages/meta/store/index.ts b/src/packages/meta/store/index.ts deleted file mode 100644 index 73fcb20..0000000 --- a/src/packages/meta/store/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { - createSelector, - createFeatureSelector, - ActionReducerMap, - } from '@ngrx/store'; - - import { StateSelector } from 'packages/core/ngrx/store'; - - import { MODULE } from '../meta.constant'; - - import * as ListStore from './crawler/list'; - - export interface State { - list: ListStore.State; - } - - export const REDUCERS = { - list: ListStore.reducer, - }; - - export const EFFECTS = [ - ListStore.Effects, - ]; - - export const selectCrawlerListState = createFeatureSelector(MODULE.name); - - export const CrawlerListSelector = new StateSelector(createSelector( - selectCrawlerListState, - (state: State) => state.list - )); - diff --git a/src/packages/noauth/model/NoAuthProbe.ts b/src/packages/noauth/model/NoAuthProbe.ts index 3b27b1d..9c352b4 100644 --- a/src/packages/noauth/model/NoAuthProbe.ts +++ b/src/packages/noauth/model/NoAuthProbe.ts @@ -1,6 +1,6 @@ import { Probe } from 'packages/probe/model'; -import { MetaNoAuthProbeStatus } from 'packages/meta/model'; import { Domain } from 'packages/domain/model'; +import { MetaNoAuthProbeStatus } from 'packages/meta/noauth-probe-status/model/MetaNoAuthProbeStatus'; export interface NoAuthProbe { // id?: number; diff --git a/src/packages/probe/model/Probe.ts b/src/packages/probe/model/Probe.ts index 3d3b1bb..33745ee 100644 --- a/src/packages/probe/model/Probe.ts +++ b/src/packages/probe/model/Probe.ts @@ -1,7 +1,7 @@ -import { MetaProbeStatus } from 'packages/meta/model'; import { Domain } from 'packages/domain/model'; import { Member } from 'packages/member/model'; import { Infra } from 'packages/infra/model'; +import { MetaProbeStatus } from 'packages/meta/probe-status/model/MetaProbeStatus'; export interface Probe { id?: number; diff --git a/src/packages/probe/model/ProbeTask.ts b/src/packages/probe/model/ProbeTask.ts index 481ca6e..e2ec770 100644 --- a/src/packages/probe/model/ProbeTask.ts +++ b/src/packages/probe/model/ProbeTask.ts @@ -1,5 +1,5 @@ import { Probe } from './Probe'; -import { MetaProbeTaskType } from 'packages/meta/model'; +import { MetaProbeTaskType } from 'packages/meta/probe-task-type/model/MetaProbeTaskType'; export interface ProbeTask { id?: number; diff --git a/src/packages/sensor/component/setting/crawler-selector/crawler-selector.component.ts b/src/packages/sensor/component/setting/crawler-selector/crawler-selector.component.ts index ac44844..5a3bb9d 100644 --- a/src/packages/sensor/component/setting/crawler-selector/crawler-selector.component.ts +++ b/src/packages/sensor/component/setting/crawler-selector/crawler-selector.component.ts @@ -1,7 +1,12 @@ import { Component, OnInit, Input, OnChanges, AfterContentInit } from '@angular/core'; import { Router } from '@angular/router'; import { Target } from 'packages/target/model'; -import { MetaCrawler } from '../../../../meta/model'; + +import { Store, select } from '@ngrx/store'; +import { RPCError } from 'packages/core/rpc/error'; +import * as ListStore from 'packages/meta/crawler/store/list'; +import { ReadAllCrawlerSelector } from 'packages/meta/crawler/store'; +import { MetaCrawler } from 'packages/meta/crawler/model/MetaCrawler'; @Component({ @@ -11,17 +16,31 @@ import { MetaCrawler } from '../../../../meta/model'; }) export class CrawlerSelectorComponent implements OnInit, OnChanges, AfterContentInit { + crawlers$ = this.listStore.pipe(select(ReadAllCrawlerSelector.select('list'))); + @Input() selectedTarget: Target; crawlers: MetaCrawler[]; - constructor(private router: Router) { - } + constructor( + private router: Router, + private listStore: Store, + ) {} ngOnInit() { + this.crawlers$.subscribe( + (list: MetaCrawler[]) => { + if (list !== null) { + console.log(list); + } + }, + (error: RPCError) => { + console.log(error.response.message); + } + ); } ngAfterContentInit() { - + this.listStore.dispatch(new ListStore.ReadAll()); } ngOnChanges() { diff --git a/src/packages/sensor/model/Sensor.ts b/src/packages/sensor/model/Sensor.ts index 8fa516b..8f28d9d 100644 --- a/src/packages/sensor/model/Sensor.ts +++ b/src/packages/sensor/model/Sensor.ts @@ -1,5 +1,6 @@ import { Target } from 'packages/target/model'; -import { MetaCrawler, MetaSensorStatus } from 'packages/meta/model'; +import { MetaSensorStatus } from 'packages/meta/sensor-status/model/MetaSensorStatus'; +import { MetaCrawler } from 'packages/meta/crawler/model/MetaCrawler'; export interface Sensor { id?: number; diff --git a/src/packages/sensor/model/SensorItem.ts b/src/packages/sensor/model/SensorItem.ts index 4d7202b..440f8a9 100644 --- a/src/packages/sensor/model/SensorItem.ts +++ b/src/packages/sensor/model/SensorItem.ts @@ -1,5 +1,5 @@ import { Sensor } from './Sensor'; -import { MetaSensorDisplayItem } from 'packages/meta/model'; +import { MetaSensorDisplayItem } from 'packages/meta/sensor-display-item/model/MetaSensorDisplayItem'; export interface SensorItem { id?: number; diff --git a/src/packages/sensor/model/SensorRegistInfo.ts b/src/packages/sensor/model/SensorRegistInfo.ts index 806911f..b82bc9c 100644 --- a/src/packages/sensor/model/SensorRegistInfo.ts +++ b/src/packages/sensor/model/SensorRegistInfo.ts @@ -1,6 +1,7 @@ -import { MetaCrawler, MetaSensorDisplayItem } from 'packages/meta/model'; import { Infra } from 'packages/infra/model'; +import { MetaCrawler } from 'packages/meta/crawler/model/MetaCrawler'; +import { MetaSensorDisplayItem } from 'packages/meta/sensor-display-item/model/MetaSensorDisplayItem'; export interface SensorRegistInfo { sensorItemMap: Map>; diff --git a/src/packages/sensor/sensor.module.ts b/src/packages/sensor/sensor.module.ts index 42183ee..7f318b0 100644 --- a/src/packages/sensor/sensor.module.ts +++ b/src/packages/sensor/sensor.module.ts @@ -10,6 +10,7 @@ import { SensorStoreModule } from './sensor-store.module'; import { SettingComponent } from './component/setting/setting.component'; import { TreeModule } from 'angular-tree-component'; import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; +import { MetaCrawlerModule } from '../meta/crawler/crawler.module'; @NgModule({ imports: [ @@ -18,7 +19,8 @@ import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; FormsModule, SensorStoreModule, TreeModule, - PerfectScrollbarModule + PerfectScrollbarModule, + MetaCrawlerModule ], declarations: [ COMPONENTS,