Files
DiunaBI/Frontend/src/app/main-view/main-view.component.ts

61 lines
1.6 KiB
TypeScript
Raw Normal View History

2022-11-29 21:25:19 +01:00
import { OnInit } from '@angular/core';
2022-11-29 19:21:24 +01:00
import { Component, ViewChild } from '@angular/core';
import { MatSidenav } from '@angular/material/sidenav';
import * as moment from 'moment';
import packageInfo from 'package.json';
import { DataService } from '../services/data.service';
import { DeviceService } from '../services/device.service';
@Component({
selector: 'app-main-view',
templateUrl: './main-view.component.html',
styleUrls: ['./main-view.component.scss']
})
2022-11-29 21:25:19 +01:00
export class MainViewComponent implements OnInit {
2022-11-29 19:21:24 +01:00
@ViewChild('snav') snav?: MatSidenav;
appVersion = packageInfo.version;
submenus = {
administration: false,
};
currentDate = moment().toDate();
flipPhone: boolean = false;
loading: boolean = false;
constructor(
public _data: DataService,
public _device: DeviceService
2022-11-29 21:25:19 +01:00
) { }
ngOnInit(): void {
// @ts-ignore
google.accounts.id.initialize({
client_id: "107631825312-bkfe438ehr9k9ecb2h76g802tj6advma.apps.googleusercontent.com",
callback: this.handleCredentialResponse.bind(this),
auto_select: false,
cancel_on_tap_outside: true,
});
// @ts-ignore
google.accounts.id.renderButton(
// @ts-ignore
document.getElementById("google-button"),
{ theme: "outline", size: "large", width: "100%" }
);
// @ts-ignore
google.accounts.id.prompt((notification: PromptMomentNotification) => { });
}
async handleCredentialResponse(response: any) {
// Here will be your response from Google.
console.log(response);
}
2022-11-29 19:21:24 +01:00
reloadApp() {
document.location.reload();
}
logout() {
}
}