refactor(frontend): UI/UX改进和组件优化
- DataTable组件操作列自适应 - 优化各种Modal弹窗 - 统一API调用方式(AbortSignal) - 添加全局订阅状态管理 - 优化各管理视图的交互和布局 - 修复国际化翻译问题
This commit is contained in:
@@ -90,8 +90,12 @@ export async function list(
|
||||
* @param params - Query parameters for filtering and pagination
|
||||
* @returns Paginated list of usage logs
|
||||
*/
|
||||
export async function query(params: UsageQueryParams): Promise<PaginatedResponse<UsageLog>> {
|
||||
export async function query(
|
||||
params: UsageQueryParams,
|
||||
config: { signal?: AbortSignal } = {}
|
||||
): Promise<PaginatedResponse<UsageLog>> {
|
||||
const { data } = await apiClient.get<PaginatedResponse<UsageLog>>('/usage', {
|
||||
...config,
|
||||
params
|
||||
})
|
||||
return data
|
||||
@@ -232,15 +236,22 @@ export interface BatchApiKeysUsageResponse {
|
||||
/**
|
||||
* Get batch usage stats for user's own API keys
|
||||
* @param apiKeyIds - Array of API key IDs
|
||||
* @param options - Optional request options
|
||||
* @returns Usage stats map keyed by API key ID
|
||||
*/
|
||||
export async function getDashboardApiKeysUsage(
|
||||
apiKeyIds: number[]
|
||||
apiKeyIds: number[],
|
||||
options?: {
|
||||
signal?: AbortSignal
|
||||
}
|
||||
): Promise<BatchApiKeysUsageResponse> {
|
||||
const { data } = await apiClient.post<BatchApiKeysUsageResponse>(
|
||||
'/usage/dashboard/api-keys-usage',
|
||||
{
|
||||
api_key_ids: apiKeyIds
|
||||
},
|
||||
{
|
||||
signal: options?.signal
|
||||
}
|
||||
)
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user