5f4317fb3684f368d1c6365e9361f84d5d998819
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / ei-coordinator / ei-coordinator.component.ts
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 Nordix Foundation
6  * %%
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ========================LICENSE_END===================================
19  */
20 import { Component, OnInit, ViewChild } from '@angular/core';
21
22 import { UiService } from '../services/ui/ui.service';
23 import { JobsListComponent } from './jobs-list/jobs-list.component';
24 import { ProducersListComponent } from './producers-list/producers-list.component';
25
26 @Component({
27     selector: 'nrcp-ei-coordinator',
28     templateUrl: './ei-coordinator.component.html',
29     styleUrls: ['./ei-coordinator.component.scss'],
30     providers: [
31         ProducersListComponent,
32         JobsListComponent
33     ]
34 })
35 export class EICoordinatorComponent implements OnInit {
36
37     darkMode: boolean;
38     @ViewChild(ProducersListComponent) producersList: ProducersListComponent;
39     @ViewChild(JobsListComponent) jobComponent: JobsListComponent;
40
41
42     constructor(
43         private ui: UiService) {
44     }
45
46     ngOnInit() {
47         this.ui.darkModeState.subscribe((isDark) => {
48             this.darkMode = isDark;
49         });
50     }
51
52     refreshTables() {
53         this.jobComponent.loadJobs();
54         this.jobComponent.clearFilter();
55         this.producersList.loadProducers();
56         this.producersList.clearFilter();
57     }
58 }