fix: deleted tag

This commit is contained in:
jialin
2026-04-22 13:16:48 +08:00
committed by jialin
parent 5f3b9b88ff
commit d48aa99dcc
20 changed files with 248 additions and 130 deletions
+15 -28
View File
@@ -1,35 +1,22 @@
import { BreakdownItem } from '../config/types';
export const getBreakdownRowKey = (record: BreakdownItem): string => {
const identity = record?.identity;
const current = identity?.current;
const value = identity?.value;
export const getBreakdownRowKey = (
record: BreakdownItem,
type: string
): string => {
if (type === 'models') {
return `${record.model.label}`;
}
const key = [
current?.model_id,
current?.user_id,
current?.api_key_id,
value?.model_name,
value?.user_name,
value?.api_key_name,
value?.cluster_name,
value?.provider_name,
value?.provider_type,
record?.label,
record?.cluster_name,
record?.model_name,
record?.user_name,
record?.api_key_name,
record?.last_active,
record?.input_tokens,
record?.output_tokens,
record?.total_tokens,
record?.api_requests
]
.filter((item) => item !== null && item !== undefined && item !== '')
.join('__');
if (type === 'users') {
return `${record.user.label}`;
}
return key || JSON.stringify(record);
if (type === 'api_keys') {
return `${record.api_key.label}`;
}
return record.last_active;
};
export default getBreakdownRowKey;