From 62c5fa2b99b74e8ec23cb610c5070c6bbba3d0d4 Mon Sep 17 00:00:00 2001 From: insanity Date: Wed, 18 Apr 2018 21:56:57 +0900 Subject: [PATCH] key-value component --- .../key-value/key-value.component.html | 7 ++ .../key-value/key-value.component.ts | 23 ++++ .../component/key-value/key-value.module.ts | 18 +++ .../component/detail/detail.component.html | 110 +++++++----------- .../component/detail/detail.component.ts | 3 + src/packages/sensor/sensor.module.ts | 4 +- 6 files changed, 98 insertions(+), 67 deletions(-) create mode 100644 src/app/commons/component/key-value/key-value.component.html create mode 100644 src/app/commons/component/key-value/key-value.component.ts create mode 100644 src/app/commons/component/key-value/key-value.module.ts diff --git a/src/app/commons/component/key-value/key-value.component.html b/src/app/commons/component/key-value/key-value.component.html new file mode 100644 index 0000000..9817a2a --- /dev/null +++ b/src/app/commons/component/key-value/key-value.component.html @@ -0,0 +1,7 @@ +
+ {{key}} + + {{value}} + + {{value}} +
\ No newline at end of file diff --git a/src/app/commons/component/key-value/key-value.component.ts b/src/app/commons/component/key-value/key-value.component.ts new file mode 100644 index 0000000..f1c7d2b --- /dev/null +++ b/src/app/commons/component/key-value/key-value.component.ts @@ -0,0 +1,23 @@ +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + selector: 'of-key-value', + templateUrl: './key-value.component.html' +}) +export class KeyValueComponent implements OnInit { + + @Input() key: string; + @Input() value: string; + @Input() clickable = false; + @Output() click = new EventEmitter(); + + constructor( + ) { } + + ngOnInit() { + } + + onClick() { + this.click.emit(this.value); + } +} diff --git a/src/app/commons/component/key-value/key-value.module.ts b/src/app/commons/component/key-value/key-value.module.ts new file mode 100644 index 0000000..418f324 --- /dev/null +++ b/src/app/commons/component/key-value/key-value.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { KeyValueComponent } from './key-value.component'; +import { CommonModule } from '@angular/common'; +import { PrimeNGModules } from 'packages/commons/prime-ng/prime-ng.module'; + +@NgModule({ + imports: [ + CommonModule, + PrimeNGModules + ], + declarations: [ + KeyValueComponent, + ], + exports: [ + KeyValueComponent, + ] +}) +export class KeyValueModule { } diff --git a/src/packages/sensor/component/detail/detail.component.html b/src/packages/sensor/component/detail/detail.component.html index 0b00084..505b1f3 100644 --- a/src/packages/sensor/component/detail/detail.component.html +++ b/src/packages/sensor/component/detail/detail.component.html @@ -1,72 +1,50 @@ -

Sensor Alias 출력

+
+

{{sensor.crawler.name}}

-
-
- -
    -
  • - RUNNING -
  • -
-
-
- -
- -
    -
  • - STOPPED -
  • -
-
-
- -
- - - -
- -
-
-
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
-
- - - - -
+
+
+ +
    +
  • + RUNNING +
  • +
+ +
+ +
    +
  • + STOPPED +
  • +
+
+
-
-

Monitored Items

- +
+ + +
-
- \ No newline at end of file +
+
+
+ + + + + + + +
+
+ +
+

Monitored Items

+ +
+
+ +
\ No newline at end of file diff --git a/src/packages/sensor/component/detail/detail.component.ts b/src/packages/sensor/component/detail/detail.component.ts index 7e0c491..a60cfec 100644 --- a/src/packages/sensor/component/detail/detail.component.ts +++ b/src/packages/sensor/component/detail/detail.component.ts @@ -61,5 +61,8 @@ export class DetailComponent implements OnInit, AfterContentInit { } }); } + + onTargetClick(event) { + } } diff --git a/src/packages/sensor/sensor.module.ts b/src/packages/sensor/sensor.module.ts index 3a17a56..e4956a5 100644 --- a/src/packages/sensor/sensor.module.ts +++ b/src/packages/sensor/sensor.module.ts @@ -6,6 +6,7 @@ import { COMPONENTS } from './component'; import { SERVICES } from './service'; import { SensorStoreModule } from './sensor-store.module'; import { SensorItemModule } from '../sensor-item/sensor-item.module'; +import { KeyValueModule } from 'app/commons/component/key-value/key-value.module'; // import { MetaCrawlerModule } from '../meta/crawler/crawler.module'; // import { MetaSensorDisplayItemModule } from '../meta/sensor-display-item/sensor-display-item.module'; // import { MetaCrawlerInputItemModule } from '../meta/crawler-input-item/crawler-input.module'; @@ -16,9 +17,10 @@ import { SensorItemModule } from '../sensor-item/sensor-item.module'; FormsModule, SensorStoreModule, PrimeNGModules, - SensorItemModule + SensorItemModule, // MetaCrawlerModule, // MetaSensorDisplayItemModule, + KeyValueModule ], declarations: [ COMPONENTS,