Files
easyai-ai-gateway/apps/web/src/app-state.ts
T
wangbo de10875439 feat(admin): 优化后台运维与任务管理
完善平台、基准模型、定价规则和实时负载的紧凑查询与滚动展示,并固定关键操作列。

新增管理员任务记录、批量计费结算和用户组限流、额度及模型权限维护能力,同时补充任务脱敏、查询索引与 OpenAPI 契约。

验证:pnpm openapi、Go 全量测试、pnpm lint、pnpm test、pnpm build、gofmt 与差异格式检查均通过。
2026-07-25 01:32:49 +08:00

69 lines
1.9 KiB
TypeScript

import type {
AdminGatewayTask,
AuthUser,
BaseModelCatalogItem,
CatalogProvider,
ClientCustomizationSettings,
FileStorageChannel,
FileStorageSettings,
GatewayAccessRule,
GatewayApiKey,
GatewayAuditLog,
GatewayNetworkProxyConfig,
GatewayRunnerPolicy,
GatewayTask,
GatewayTenant,
GatewayUser,
GatewayWalletAccount,
GatewayWalletTransaction,
IntegrationPlatform,
ModelCatalogResponse,
ModelRateLimitStatus,
PlatformModel,
PricingRule,
PricingRuleSet,
RateLimitWindow,
RuntimePolicySet,
SecurityEventConnectionResponse,
UserGroup,
} from '@easyai-ai-gateway/contracts';
export interface ConsoleData {
accessRules: GatewayAccessRule[];
adminTasks: AdminGatewayTask[];
auditLogs: GatewayAuditLog[];
apiKeys: GatewayApiKey[];
baseModels: BaseModelCatalogItem[];
currentUser: AuthUser | null;
currentUserGroups: UserGroup[];
clientCustomizationSettings: ClientCustomizationSettings | null;
fileStorageChannels: FileStorageChannel[];
fileStorageSettings: FileStorageSettings | null;
modelCatalog: ModelCatalogResponse;
models: PlatformModel[];
networkProxyConfig: GatewayNetworkProxyConfig | null;
runnerPolicy: GatewayRunnerPolicy | null;
platforms: IntegrationPlatform[];
pricingRules: PricingRule[];
pricingRuleSets: PricingRuleSet[];
providers: CatalogProvider[];
rateLimitWindows: RateLimitWindow[];
modelRateLimits: ModelRateLimitStatus[];
modelRateLimitsUpdatedAt: number | null;
runtimePolicySets: RuntimePolicySet[];
securityEventConnection: SecurityEventConnectionResponse | null;
taskResult: GatewayTask | null;
tasks: GatewayTask[];
tenants: GatewayTenant[];
userGroups: UserGroup[];
users: GatewayUser[];
walletAccounts: GatewayWalletAccount[];
walletTransactions: GatewayWalletTransaction[];
}
export interface StatItem {
label: string;
value: number | string;
tone: 'blue' | 'green' | 'violet' | 'amber' | 'cyan' | 'rose' | 'slate';
}