From b40c2e1071d987b86f1db5217dc682221b82d65b Mon Sep 17 00:00:00 2001
From: CalciumIon <1808837298@qq.com>
Date: Tue, 5 Nov 2024 20:44:22 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BE=8E=E5=8C=96=E6=97=A5=E5=BF=97?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
(cherry picked from commit 90daa38d5bea7b158ebed9990f042f6bf8567eb3)
---
web/src/components/LogsTable.js | 134 ++++++++++++++++++--------------
1 file changed, 74 insertions(+), 60 deletions(-)
diff --git a/web/src/components/LogsTable.js b/web/src/components/LogsTable.js
index 13b2997..93fa4f1 100644
--- a/web/src/components/LogsTable.js
+++ b/web/src/components/LogsTable.js
@@ -336,33 +336,33 @@ const LogsTable = () => {
);
},
},
- // {
- // title: '重试',
- // dataIndex: 'retry',
- // className: isAdmin() ? 'tableShow' : 'tableHiddle',
- // render: (text, record, index) => {
- // let content = '渠道:' + record.channel;
- // if (record.other !== '') {
- // let other = JSON.parse(record.other);
- // if (other === null) {
- // return <>>;
- // }
- // if (other.admin_info !== undefined) {
- // if (
- // other.admin_info.use_channel !== null &&
- // other.admin_info.use_channel !== undefined &&
- // other.admin_info.use_channel !== ''
- // ) {
- // // channel id array
- // let useChannel = other.admin_info.use_channel;
- // let useChannelStr = useChannel.join('->');
- // content = `渠道:${useChannelStr}`;
- // }
- // }
- // }
- // return isAdminUser ?
{content}
: <>>;
- // },
- // },
+ {
+ title: '重试',
+ dataIndex: 'retry',
+ className: isAdmin() ? 'tableShow' : 'tableHiddle',
+ render: (text, record, index) => {
+ let content = '渠道:' + record.channel;
+ if (record.other !== '') {
+ let other = JSON.parse(record.other);
+ if (other === null) {
+ return <>>;
+ }
+ if (other.admin_info !== undefined) {
+ if (
+ other.admin_info.use_channel !== null &&
+ other.admin_info.use_channel !== undefined &&
+ other.admin_info.use_channel !== ''
+ ) {
+ // channel id array
+ let useChannel = other.admin_info.use_channel;
+ let useChannelStr = useChannel.join('->');
+ content = `渠道:${useChannelStr}`;
+ }
+ }
+ }
+ return isAdminUser ? {content}
: <>>;
+ },
+ },
{
title: '详情',
dataIndex: 'content',
@@ -384,25 +384,24 @@ const LogsTable = () => {
);
}
- let content = renderModelPrice(
- record.prompt_tokens,
- record.completion_tokens,
- other.model_ratio,
- other.model_price,
- other.completion_ratio,
- other.group_ratio,
- );
+
+ // let content = renderModelPrice(
+ // record.prompt_tokens,
+ // record.completion_tokens,
+ // other.model_ratio,
+ // other.model_price,
+ // other.completion_ratio,
+ // other.group_ratio,
+ // );
return (
-
- {text}
+ 调用消费
-
);
},
},
@@ -520,23 +519,23 @@ const LogsTable = () => {
let other = getLogOther(logs[i].other);
let expandDataLocal = [];
if (isAdmin()) {
- let content = '渠道:' + logs[i].channel;
- if (other.admin_info !== undefined) {
- if (
- other.admin_info.use_channel !== null &&
- other.admin_info.use_channel !== undefined &&
- other.admin_info.use_channel !== ''
- ) {
- // channel id array
- let useChannel = other.admin_info.use_channel;
- let useChannelStr = useChannel.join('->');
- content = `渠道:${useChannelStr}`;
- }
- }
- expandDataLocal.push({
- key: '渠道重试',
- value: content,
- })
+ // let content = '渠道:' + logs[i].channel;
+ // if (other.admin_info !== undefined) {
+ // if (
+ // other.admin_info.use_channel !== null &&
+ // other.admin_info.use_channel !== undefined &&
+ // other.admin_info.use_channel !== ''
+ // ) {
+ // // channel id array
+ // let useChannel = other.admin_info.use_channel;
+ // let useChannelStr = useChannel.join('->');
+ // content = `渠道:${useChannelStr}`;
+ // }
+ // }
+ // expandDataLocal.push({
+ // key: '渠道重试',
+ // value: content,
+ // })
}
if (other?.ws) {
expandDataLocal.push({
@@ -557,9 +556,24 @@ const LogsTable = () => {
});
}
expandDataLocal.push({
- key: '倍率详情',
+ key: '日志详情',
value: logs[i].content,
})
+ if (logs[i].type === 2) {
+ let content = renderModelPrice(
+ logs[i].prompt_tokens,
+ logs[i].completion_tokens,
+ other.model_ratio,
+ other.model_price,
+ other.completion_ratio,
+ other.group_ratio,
+ );
+ expandDataLocal.push({
+ key: '计费过程',
+ value: content,
+ });
+ }
+
expandDatesLocal[logs[i].key] = expandDataLocal;
}