Add account type

This commit is contained in:
2025-04-14 23:25:45 +02:00
parent 342af2c443
commit 5a51dee8b0
16 changed files with 176 additions and 6 deletions

View File

@ -1,4 +1,5 @@
import { APIClient } from "./ApiClient";
import { ServerApi } from "./ServerApi";
export interface Account {
id: number;
@ -6,6 +7,7 @@ export interface Account {
user_id: number;
time_create: number;
time_update: number;
type: string;
default_account: boolean;
}
@ -66,6 +68,7 @@ export class AccountApi {
method: "POST",
jsonData: {
name,
type: ServerApi.Config.accounts_types[0].code,
},
});
}
@ -79,6 +82,7 @@ export class AccountApi {
method: "PUT",
jsonData: {
name: account.name,
type: account.type,
},
});
}

View File

@ -3,9 +3,16 @@ import { APIClient } from "./ApiClient";
export interface ServerConfig {
auth_disabled: boolean;
oidc_provider_name: string;
accounts_types: AccountType[];
constraints: ServerConstraints;
}
export interface AccountType {
label: string;
code: string;
icon: string;
}
export interface ServerConstraints {
token_name: LenConstraint;
token_ip_net: LenConstraint;