import { Component, OnInit } from '@angular/core'; import { AlertSystem, AlertMetric } from '../../model'; @Component({ selector: 'of-alert-list', templateUrl: './list.component.html', styleUrls: ['./list.component.css'] }) export class ListComponent implements OnInit { metricAlerts: AlertMetric[] = exampleAlerts; systemAlerts: AlertSystem[] = exampleSystemAlerts; bgMap: Map = new Map(); constructor() { } ngOnInit() { this.bgMap.set('Warn', '#ffc107'); this.bgMap.set('Error', '#f30000'); this.bgMap.set('Down', '#607D8B'); } } const exampleSystemAlerts = [ { created: '2018-04-19', msg: 'Geek 님이 새로운 Probe를 설치했습니다.', }, { created: '2018-04-19', msg: 'Geek 님이 새로운 Probe를 설치했습니다.', }, { created: '2018-04-19', msg: 'Geek 님이 새로운 Probe를 설치했습니다.', }, { created: '2018-04-19', msg: 'Geek 님이 새로운 Probe를 설치했습니다.', }, { created: '2018-04-19', msg: 'Geek 님이 새로운 Probe를 설치했습니다.', }, { created: '2018-04-19', msg: 'Geek 님이 새로운 Probe를 설치했습니다.', }, { created: '2018-04-19', msg: 'Geek 님이 새로운 Probe를 설치했습니다.', }, { created: '2018-04-19', msg: 'Geek 님이 새로운 Probe를 설치했습니다.', }, { created: '2018-04-19', msg: 'Geek 님이 새로운 Probe를 설치했습니다.', }, ]; const exampleAlerts = [ { created: '2018-04-19', msg: 'Host 192.168.1.106 disk < 5%', status: 'Warn' }, { created: '2018-04-19', msg: 'Host 192.168.1.106 disk < 5%', status: 'Down' }, { created: '2018-04-19', msg: 'Host 192.168.1.106 disk < 5%', status: 'Error' }, { created: '2018-04-19', msg: 'Host 192.168.1.106 disk < 5%', status: 'Warn' }, { created: '2018-04-19', msg: 'Host 192.168.1.106 disk < 5%', status: 'Warn' }, { created: '2018-04-19', msg: 'Host 192.168.1.106 disk < 5%', status: 'Warn' }, { created: '2018-04-19', msg: 'Host 192.168.1.106 disk < 5%', status: 'Warn' }, { created: '2018-04-19', msg: 'Host 192.168.1.106 disk < 5%', status: 'Warn' }, { created: '2018-04-19', msg: 'Host 192.168.1.106 disk < 5%', status: 'Warn' } ];