47e768eb05954a542eb1ca23d9903a0c4a0a53c5
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / footer / footer.component.ts
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 AT&T Intellectual Property
6  * Modifications Copyright (C) 2019 Nordix Foundation
7  * Modifications Copyright (C) 2020 Nordix Foundation
8  * %%
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ========================LICENSE_END===================================
21  */
22 import { Component, OnInit } from '@angular/core';
23 import { ControlpanelSuccessTransport } from '../interfaces/controlpanel.types';
24 import { ControlpanelService } from '../services/controlpanel/controlpanel.service';
25 import { UiService } from '../services/ui/ui.service';
26
27 @Component({
28   selector: 'rd-footer',
29   templateUrl: './footer.component.html',
30   styleUrls: ['./footer.component.scss']
31 })
32
33 /**
34  * Fetches the version on load for display in the footer
35  */
36 export class FooterComponent implements OnInit {
37   darkMode: boolean;
38   controlpanelVersion: string;
39
40   // Inject the service
41   constructor(private controlpanelService: ControlpanelService,
42     private ui: UiService) { }
43
44   ngOnInit() {
45     this.controlpanelVersion = '0.0';
46     // this.controlpanelService.getVersion().subscribe((res: ControlpanelSuccessTransport) => this.controlpanelVersion = res.data);
47     this.ui.darkModeState.subscribe((isDark) => {
48       this.darkMode = isDark;
49     });
50   }
51
52 }