소스 검색

feat: logs show reject reason

Seefs 1 개월 전
부모
커밋
dda40ef62a
2개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 0 3
      web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx
  2. 6 0
      web/src/hooks/usage-logs/useUsageLogsData.jsx

+ 0 - 3
web/src/components/table/usage-logs/UsageLogsColumnDefs.jsx

@@ -578,9 +578,6 @@ export const getLogsColumns = ({
               other?.is_system_prompt_overwritten,
               'openai',
             );
-        if (isAdminUser && other?.reject_reason) {
-          content += `\nBlock reason: ${other.reject_reason}`;
-        }
         return (
           <Typography.Paragraph
             ellipsis={{

+ 6 - 0
web/src/hooks/usage-logs/useUsageLogsData.jsx

@@ -397,6 +397,12 @@ export const useLogsData = () => {
             value: logs[i].content,
           });
         }
+        if (isAdminUser && other?.reject_reason) {
+          expandDataLocal.push({
+            key: t('拦截原因'),
+            value: other.reject_reason,
+          });
+        }
       }
       if (logs[i].type === 2) {
         let modelMapped =