Add account type
This commit is contained in:
@ -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,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user