import {Component, OnInit} from '@angular/core'; import {BaseComponent} from '../openaireLibrary/sharedComponents/base/base.component'; import {ActivatedRoute, Router} from '@angular/router'; import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service'; import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; import {Meta, Title} from '@angular/platform-browser'; import {LogService} from "../openaireLibrary/utils/log/log.service"; import {Breadcrumb} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.component'; @Component({ selector: 'public-logs', template: `

Web Statistics & Activity Logs

Viewing last {{logs.length}} actions.
No logs yet.
On {{log.date | date: 'd/M/yyyy, hh:mm':'GMT' }} {{log.message}}
` }) export class PublicLogsComponent extends BaseComponent implements OnInit { breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'resources - web statistics & activity logs'}]; isConsent = false; redirectUrl = null; startDate = new Date(); today = new Date(); months = []; years = []; constructor(protected _router: Router, protected _route: ActivatedRoute, protected seoService: SEOService, protected _piwikService: PiwikService, protected _title: Title, protected _meta: Meta, private _logService: LogService) { super(); this.startDate.setFullYear(2024,0,10) this.months = Array.from({ length:12 }, (_, index) => 12 - index); this.years = Array.from({ length:this.today.getFullYear() + 1 - this.startDate.getFullYear() }, (_, index) => this.today.getFullYear() - index); } ngOnInit() { this.title = 'Public logs'; this.description = 'Public logs of user actions in OA monitor - Ireland'; this.setMetadata(); } show(year, month){ return (year > this.startDate.getFullYear() && year < this.today.getFullYear()) || (year == this.startDate.getFullYear() && year < this.today.getFullYear() && month >= this.startDate.getMonth() + 1 ) || (year > this.startDate.getFullYear() && year == this.today.getFullYear() && month <= this.today.getMonth() + 1 ) || (year == this.startDate.getFullYear() && year == this.today.getFullYear() && month >= this.startDate.getMonth() + 1 && month <= this.today.getMonth()+1 ) || ( year == this.today.getFullYear() && month < this.today.getMonth()+1 ) } }