mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-18 18:50:49 +08:00
feat: initialize new React application structure with TypeScript, ESLint, and Prettier configurations, while removing legacy files and adding new components and pages for enhanced functionality
This commit is contained in:
52
src/types/usage.ts
Normal file
52
src/types/usage.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* 使用统计相关类型
|
||||
* 基于原项目 src/modules/usage.js
|
||||
*/
|
||||
|
||||
// 时间段类型
|
||||
export type TimePeriod = 'hour' | 'day';
|
||||
|
||||
// 数据点
|
||||
export interface DataPoint {
|
||||
timestamp: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
// 模型使用统计
|
||||
export interface ModelUsage {
|
||||
modelName: string;
|
||||
requests: number;
|
||||
inputTokens: number;
|
||||
outputTokens: number;
|
||||
totalTokens: number;
|
||||
cost: number;
|
||||
}
|
||||
|
||||
// 使用统计数据
|
||||
export interface UsageStats {
|
||||
overview: {
|
||||
totalRequests: number;
|
||||
totalTokens: number;
|
||||
totalCost: number;
|
||||
};
|
||||
requestsData: {
|
||||
hour: DataPoint[];
|
||||
day: DataPoint[];
|
||||
};
|
||||
tokensData: {
|
||||
hour: DataPoint[];
|
||||
day: DataPoint[];
|
||||
};
|
||||
costData: {
|
||||
hour: DataPoint[];
|
||||
day: DataPoint[];
|
||||
};
|
||||
modelStats: ModelUsage[];
|
||||
}
|
||||
|
||||
// 模型价格
|
||||
export interface ModelPrice {
|
||||
modelName: string;
|
||||
inputPricePer1M: number;
|
||||
outputPricePer1M: number;
|
||||
}
|
||||
Reference in New Issue
Block a user