2021-06-28 09:32:13 +02:00
|
|
|
import { HttpClient } from '@angular/common/http'
|
|
|
|
|
import { Injectable } from '@angular/core'
|
|
|
|
|
import { Resolve } from '@angular/router'
|
|
|
|
|
import { Observable } from 'rxjs'
|
|
|
|
|
|
2021-06-25 21:55:40 +02:00
|
|
|
export interface User {
|
|
|
|
|
active_config: number
|
|
|
|
|
active_version: string
|
|
|
|
|
custom_connection_gateway: string|null
|
|
|
|
|
custom_connection_gateway_token: string|null
|
|
|
|
|
is_pro: boolean
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Config {
|
|
|
|
|
id: number
|
|
|
|
|
content: string
|
|
|
|
|
last_used_with_version: string
|
|
|
|
|
created_at: Date
|
|
|
|
|
modified_at: Date
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Version {
|
|
|
|
|
version: string
|
|
|
|
|
}
|
2021-06-28 09:32:13 +02:00
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
}
|
|
|
|
|
}
|