added last downtime log (closes #55)

added uptime statistics (closes #56)
added german translations (closes #57)
This commit is contained in:
Samuel Philipp 2021-01-10 16:06:18 +01:00
parent acb39f6b2a
commit e9599373ec
27 changed files with 819 additions and 265 deletions

View file

@ -0,0 +1,30 @@
import {Inject, Injectable, PLATFORM_ID} from '@angular/core';
import {isPlatformBrowser} from '@angular/common';
@Injectable({
providedIn: 'root'
})
export class StorageService {
constructor(@Inject(PLATFORM_ID) private platformId: Object) {
}
getValue(key: string): any {
if (!isPlatformBrowser(this.platformId)) {
return null;
}
try {
return JSON.parse(localStorage.getItem(key));
} catch (e) {
return null;
}
}
setValue(key: string, value: any): void {
if (isPlatformBrowser(this.platformId)) {
try {
localStorage.setItem(key, JSON.stringify(value));
} catch (e) {
}
}
}
}