Add base web app

This commit is contained in:
2025-11-04 18:58:41 +01:00
parent 1cdd3d9e60
commit d05747e60e
21 changed files with 1511 additions and 181 deletions

View File

@@ -0,0 +1,48 @@
import { APIClient } from "./ApiClient";
export interface ServerConfig {
auth_disabled: boolean;
oidc_provider_name: string;
constraints: ServerConstraints;
}
export interface AccountType {
label: string;
code: string;
icon: string;
}
export interface ServerConstraints {
token_name: LenConstraint;
token_ip_net: LenConstraint;
token_max_inactivity: LenConstraint;
}
export interface LenConstraint {
min: number;
max: number;
}
let config: ServerConfig | null = null;
export class ServerApi {
/**
* Get server configuration
*/
static async LoadConfig(): Promise<void> {
config = (
await APIClient.exec({
uri: "/server/config",
method: "GET",
})
).data;
}
/**
* Get cached configuration
*/
static get Config(): ServerConfig {
if (config === null) throw new Error("Missing configuration!");
return config;
}
}