This commit is contained in:
Eugene Pankov
2021-06-28 09:32:13 +02:00
parent df108d9071
commit 6bd5aff8b7
9 changed files with 124 additions and 11 deletions

View File

@@ -1,3 +1,8 @@
import { HttpClient } from '@angular/common/http'
import { Injectable } from '@angular/core'
import { Resolve } from '@angular/router'
import { Observable } from 'rxjs'
export interface User {
active_config: number
active_version: string
@@ -17,3 +22,16 @@ export interface Config {
export interface Version {
version: string
}
export interface InstanceInfo {
login_enabled: boolean
}
@Injectable({ providedIn: 'root' })
export class InstanceInfoResolver implements Resolve<Observable<InstanceInfo>> {
constructor (private http: HttpClient) { }
resolve(): Observable<InstanceInfo> {
return this.http.get('/api/1/instance-info').toPromise()
}
}