From 0d17ff7db83437bc5cc78f396ad2a2d8537e9cc9 Mon Sep 17 00:00:00 2001 From: insanity Date: Mon, 16 Apr 2018 12:52:51 +0900 Subject: [PATCH] .... --- .../probe/component/list/list.component.ts | 53 ++++------- src/packages/sensor/component/index.ts | 4 - .../setting-result.component.html | 90 ------------------- .../setting-result.component.scss | 25 ------ .../setting-result.component.spec.ts | 25 ------ .../setting-result.component.ts | 71 --------------- .../component/setting/setting.component.html | 43 +++++---- .../component/setting/setting.component.ts | 6 +- 8 files changed, 49 insertions(+), 268 deletions(-) delete mode 100644 src/packages/sensor/component/setting-result/setting-result.component.html delete mode 100644 src/packages/sensor/component/setting-result/setting-result.component.scss delete mode 100644 src/packages/sensor/component/setting-result/setting-result.component.spec.ts delete mode 100644 src/packages/sensor/component/setting-result/setting-result.component.ts diff --git a/src/packages/probe/component/list/list.component.ts b/src/packages/probe/component/list/list.component.ts index 075e38e..eb3bd32 100644 --- a/src/packages/probe/component/list/list.component.ts +++ b/src/packages/probe/component/list/list.component.ts @@ -26,45 +26,28 @@ export class ListComponent implements OnInit, AfterContentInit { } ngAfterContentInit() { + this.store.select(AuthSelector.select('domain')).subscribe( + (domain: Domain) => { + this.store.dispatch(new ListStore.ReadAllByDomain(domain)); + }, + (error) => { + console.log(error); + } + ); - // this.store.select(AuthSelector.select('domain')).subscribe( - // (domain: Domain) => { - // this.store.dispatch(new ListStore.ReadAllByDomain(domain)); - // }, - // (error) => { - // console.log(error); - // } - // ); - - // this.probes$.subscribe( - // (probes: Probe[]) => { - // console.log(probes); - // }, - // (error: RPCClientError) => { - // console.log(error.response.message); - // } - // ); + this.probes$.subscribe( + (probes: Probe[]) => { + console.log(probes); + this.probes = probes; + }, + (error: RPCClientError) => { + console.log(error.response.message); + } + ); } - ngOnInit() { - // Temporary data - this.probes = new Array(); - for (let i = 0; i < 10; i++) { - const p: Probe = { - id: i, - createDate: new Date(), - description: 'Description' + i, - displayName: 'DisplayName' + i, - cidr: 'CIDR' + i, - authorizeDate: new Date(), - authorizeMember: { - name: 'MemberName' + i, - }, - }; - this.probes.push(p); - } - } + ngOnInit() {} onRowSelect(event) { this.router.navigate(['probe', event.data.id, 'info']); diff --git a/src/packages/sensor/component/index.ts b/src/packages/sensor/component/index.ts index 4b1caec..cd7f7ce 100644 --- a/src/packages/sensor/component/index.ts +++ b/src/packages/sensor/component/index.ts @@ -6,12 +6,9 @@ import { CrawlerSelectorComponent } from './setting/crawler-selector/crawler-sel import { CrawlerAuthComponent } from './setting/crawler-auth/crawler-auth.component'; import { SensorItemSelectorComponent } from './setting/sensor-item-selector/sensor-item-selector.component'; import { SettingETCComponent } from './setting/setting-etc/setting-etc.component'; -// import { SettingResultComponent } from './setting-result/setting-result.component'; // import { FilterComponent } from './list/filter/filter.component'; -// import { ListComponent } from './list/list.component'; // import { DetailComponent } from './detail/detail.component'; // import { TargetSelectorComponent } from './setting/target-selector/target-selector.component'; -// import { SettingETCComponent } from './setting/setting-etc/setting-etc.component'; // import { NameTagComponent } from './name-tag/name-tag.component'; export const COMPONENTS = [ @@ -21,7 +18,6 @@ export const COMPONENTS = [ CrawlerAuthComponent, SensorItemSelectorComponent, SettingETCComponent, - // SettingResultComponent, ListComponent, // FilterComponent, // DetailComponent, diff --git a/src/packages/sensor/component/setting-result/setting-result.component.html b/src/packages/sensor/component/setting-result/setting-result.component.html deleted file mode 100644 index 7cc9eeb..0000000 --- a/src/packages/sensor/component/setting-result/setting-result.component.html +++ /dev/null @@ -1,90 +0,0 @@ -
- - - - - - -
주기 : {{selectInterval}} 초
- - - {{interval}} 초 - - - -
-
- - - -
- IP : 192.168.1.209 -
-
- MAC : 1111111111 -
-
- OS : Windows 7 -
-
- WMI Crawler -
- -
-
- - -
- -
- - - - - {{sir.sensorItemName}} - {{sir.sensorItemUnit}} - {{sir.sensorItemKey}} - - - - - - - - -
\ No newline at end of file diff --git a/src/packages/sensor/component/setting-result/setting-result.component.scss b/src/packages/sensor/component/setting-result/setting-result.component.scss deleted file mode 100644 index 25396dd..0000000 --- a/src/packages/sensor/component/setting-result/setting-result.component.scss +++ /dev/null @@ -1,25 +0,0 @@ -.example-card { - width: 400px; -} - -.example-card2 { - width: 600px; -} - - -.example-radio-group { - display: inline-flex; - flex-direction: column; -} - -.example-radio-button { - margin: 5px; -} - -.example-selected-value { - margin: 15px 0; -} - -.example-full-width22 { - width: 10%; -} \ No newline at end of file diff --git a/src/packages/sensor/component/setting-result/setting-result.component.spec.ts b/src/packages/sensor/component/setting-result/setting-result.component.spec.ts deleted file mode 100644 index 4cfedb8..0000000 --- a/src/packages/sensor/component/setting-result/setting-result.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SettingResultComponent } from './setting-result.component'; - -describe('SettingResultComponent', () => { - let component: SettingResultComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ SettingResultComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(SettingResultComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/packages/sensor/component/setting-result/setting-result.component.ts b/src/packages/sensor/component/setting-result/setting-result.component.ts deleted file mode 100644 index 0faee6e..0000000 --- a/src/packages/sensor/component/setting-result/setting-result.component.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { AfterContentInit } from '@angular/core/src/metadata/lifecycle_hooks'; -import {FormsModule} from '@angular/forms'; - -export class SensorItemResult { - id?: number; - sensorItemName?: String; - sensorItemUnit?: String; - sensorKeyName?: String; -} - - -@Component({ - selector: 'of-sensor-setting-result', - templateUrl: './setting-result.component.html', - styleUrls: ['./setting-result.component.scss'] -}) -export class SettingResultComponent implements OnInit, AfterContentInit { - - selectInterval: string; - sensorItemResultList: Array; - optionList: Array; - - constructor() { } - - intervals = [ - '600', - '400', - '200', - ]; - - ngAfterContentInit() { - - this.sensorItemResultList = new Array(); - this.optionList = new Array(); - - const ctu: SensorItemResult = { - id: 1, - sensorItemName: 'CPU Total Usage', - sensorItemUnit: '%', - sensorKeyName: 'wmi.cpu.usage.total' - }; - - const cfu: SensorItemResult = { - id: 2, - sensorItemName: 'CPU Free Usage', - sensorItemUnit: 'kb', - sensorKeyName: 'wmi.cpu.usage.free' - }; - - const mtu: SensorItemResult = { - id: 3, - sensorItemName: 'Mem Total Usage', - sensorItemUnit: '%', - sensorKeyName: 'wmi.mem.usage.total' - }; - - this.sensorItemResultList.push(ctu); - this.sensorItemResultList.push(cfu); - this.sensorItemResultList.push(mtu); - - for ( let indexI = 0; indexI < this.sensorItemResultList.length; ++indexI) { - this.optionList.push(this.sensorItemResultList[indexI].id); - } - - } - - ngOnInit() { - } - -} diff --git a/src/packages/sensor/component/setting/setting.component.html b/src/packages/sensor/component/setting/setting.component.html index d9b408f..c6b527a 100644 --- a/src/packages/sensor/component/setting/setting.component.html +++ b/src/packages/sensor/component/setting/setting.component.html @@ -1,23 +1,34 @@ - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + +
+ + + +
- - + + + + +
+ +