用户生成资源容量管控
This commit is contained in:
@@ -7,6 +7,7 @@ export interface User {
|
||||
isAdmin: boolean;
|
||||
userType: string;
|
||||
allowedMenus?: string[] | null;
|
||||
resourceCapacity?: ResourceCapacityUsage | null;
|
||||
}
|
||||
|
||||
export interface CreditRecord {
|
||||
@@ -93,6 +94,43 @@ export interface LoginParams {
|
||||
password: string;
|
||||
}
|
||||
|
||||
|
||||
export type ResourceCapacityUnit = 'MB' | 'GB' | 'TB';
|
||||
export type ResourceCapacitySource = 'user' | 'global' | 'disabled';
|
||||
|
||||
export interface ResourceCapacityUsage {
|
||||
enabled: boolean;
|
||||
source: ResourceCapacitySource;
|
||||
hasUserConfig: boolean;
|
||||
usedBytes: number;
|
||||
availableBytes: number | null;
|
||||
totalBytes: number | null;
|
||||
usagePercent: number | null;
|
||||
exceeded: boolean;
|
||||
limitValue: string | null;
|
||||
limitUnit: ResourceCapacityUnit | null;
|
||||
}
|
||||
|
||||
export interface ResourceCapacityConfigOut {
|
||||
enabled: boolean;
|
||||
limitValue: string;
|
||||
limitUnit: ResourceCapacityUnit;
|
||||
limitBytes: number;
|
||||
}
|
||||
|
||||
export interface ResourceCapacityConfigPayload {
|
||||
enabled: boolean;
|
||||
limitValue?: string | number | null;
|
||||
limitUnit?: ResourceCapacityUnit | null;
|
||||
}
|
||||
|
||||
export interface AdminUserResourceCapacityOut {
|
||||
hasUserConfig: boolean;
|
||||
userConfig: ResourceCapacityConfigOut | null;
|
||||
globalConfig: ResourceCapacityConfigOut;
|
||||
effective: ResourceCapacityUsage;
|
||||
}
|
||||
|
||||
// ── Admin Types ──────────────────────────────────────
|
||||
|
||||
export interface AdminUser {
|
||||
@@ -108,6 +146,7 @@ export interface AdminUser {
|
||||
createdAt: string;
|
||||
lastLoginAt?: string;
|
||||
allowedMenus?: string[] | null;
|
||||
resourceCapacity?: ResourceCapacityUsage | null;
|
||||
}
|
||||
|
||||
export interface AdminStats {
|
||||
|
||||
Reference in New Issue
Block a user