1 /* Copyright (c) 2019 AT&T Intellectual Property. #
\r
3 # Licensed under the Apache License, Version 2.0 (the "License"); #
\r
4 # you may not use this file except in compliance with the License. #
\r
5 # You may obtain a copy of the License at #
\r
7 # http://www.apache.org/licenses/LICENSE-2.0 #
\r
9 # Unless required by applicable law or agreed to in writing, software #
\r
10 # distributed under the License is distributed on an "AS IS" BASIS, #
\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
\r
12 # See the License for the specific language governing permissions and #
\r
13 # limitations under the License. #
\r
14 ##############################################################################*/
\r
17 import { Component, OnInit, NgZone, ChangeDetectorRef } from '@angular/core';
\r
18 //import material from "@amcharts/amcharts4/themes/material";
\r
19 import am4themes_animated from "@amcharts/amcharts4/themes/animated";
\r
20 import { GroupService } from 'app/shared/services/group.service';
\r
21 import { StatsService } from '../stats.service';
\r
22 import { Observable, Subject } from 'rxjs';
\r
24 export interface ScheduleElement {
\r
31 selector: 'app-schedule',
\r
32 templateUrl: './schedule.component.pug',
\r
33 styleUrls: ['./schedule.component.scss']
\r
36 export class ScheduleComponent implements OnInit {
\r
38 protected stats: StatsService;
\r
39 public doneLoadingfalse;
\r
42 displayedColumns: string[] = ['name', 'dateExec', 'timeExec'];
\r
44 constructor(private zone: NgZone, private _groups: GroupService, private statsService: StatsService, private changeDetector: ChangeDetectorRef) {
\r
45 this.stats = statsService;
\r
50 this.stats.onDefaultDataCallFinished().subscribe(res => {
\r
51 this.dataSource = this.stats.getData("Schedule");
\r
53 this.dataSource = this.stats.getData("Schedule");
\r
58 defaultDataListener(): Observable<Object> {
\r
59 return this.stats.finishedDefaultData;
\r
63 this.stats.onScheduleChangeFinished().subscribe(res => {
\r
64 this.dataSource = this.stats.getData("Schedule");
\r
65 this.dataSource = this.dataSource.slice();
\r
67 this.changeDetector.detectChanges();
\r