mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-08-09 16:13:21 +08:00
- Implemented AuthSettingsTab for managing authentication settings including user registration and default roles. - Created UsersPage for managing users and roles, including user creation, editing, and deletion functionalities. - Added components for user and role management: UserEditorDrawer, RoleEditorDrawer, UsersTable, RolesTable, and PathRuleEditorDrawer. - Introduced QuickCreateRoleModal for quick role creation within user management. - Implemented permission management within roles, including path rules and user assignments. - Enhanced user experience with loading states and error handling in API interactions.
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import request from './client';
|
|
|
|
export async function getConfig(key: string) {
|
|
return request<{ key: string; value: string }>('/config/?key=' + encodeURIComponent(key));
|
|
}
|
|
|
|
export async function setConfig(key: string, value?: string | null) {
|
|
const form = new FormData();
|
|
form.append('key', key);
|
|
form.append('value', value ?? '');
|
|
return request('/config/', { method: 'POST', formData: form });
|
|
}
|
|
|
|
export async function getAllConfig() {
|
|
return request<Record<string, string>>('/config/all');
|
|
}
|
|
|
|
export async function getPublicConfig() {
|
|
return request<Record<string, string>>('/config/public');
|
|
}
|
|
|
|
export interface SystemStatus {
|
|
version: string;
|
|
title: string;
|
|
logo: string;
|
|
favicon: string;
|
|
is_initialized: boolean;
|
|
app_domain?: string;
|
|
file_domain?: string;
|
|
}
|
|
|
|
export async function status() {
|
|
return request<SystemStatus>('/config/status');
|
|
}
|
|
|
|
export async function getLatestVersion() {
|
|
return request<{ latest_version: string | null, body: string | null }>('/config/latest-version');
|
|
}
|