|
@@ -5,10 +5,9 @@ import useSWR from 'swr'
|
|
|
import {
|
|
|
HandThumbDownIcon,
|
|
|
HandThumbUpIcon,
|
|
|
- InformationCircleIcon,
|
|
|
XMarkIcon,
|
|
|
} from '@heroicons/react/24/outline'
|
|
|
-import { RiEditFill } from '@remixicon/react'
|
|
|
+import { RiEditFill, RiQuestionLine } from '@remixicon/react'
|
|
|
import { get } from 'lodash-es'
|
|
|
import InfiniteScroll from 'react-infinite-scroll-component'
|
|
|
import dayjs from 'dayjs'
|
|
@@ -20,7 +19,6 @@ import { useTranslation } from 'react-i18next'
|
|
|
import s from './style.module.css'
|
|
|
import VarPanel from './var-panel'
|
|
|
import cn from '@/utils/classnames'
|
|
|
-import { randomString } from '@/utils'
|
|
|
import type { FeedbackFunc, Feedbacktype, IChatItem, SubmitAnnotationFunc } from '@/app/components/base/chat/chat/type'
|
|
|
import type { Annotation, ChatConversationFullDetailResponse, ChatConversationGeneralDetail, ChatConversationsResponse, ChatMessage, ChatMessagesRequest, CompletionConversationFullDetailResponse, CompletionConversationGeneralDetail, CompletionConversationsResponse, LogAnnotation } from '@/models/log'
|
|
|
import type { App } from '@/types/app'
|
|
@@ -28,7 +26,6 @@ import Loading from '@/app/components/base/loading'
|
|
|
import Drawer from '@/app/components/base/drawer'
|
|
|
import Popover from '@/app/components/base/popover'
|
|
|
import Chat from '@/app/components/base/chat/chat'
|
|
|
-import Tooltip from '@/app/components/base/tooltip'
|
|
|
import { ToastContext } from '@/app/components/base/toast'
|
|
|
import { fetchChatConversationDetail, fetchChatMessages, fetchCompletionConversationDetail, updateLogMessageAnnotations, updateLogMessageFeedbacks } from '@/service/log'
|
|
|
import { TONE_LIST } from '@/config'
|
|
@@ -42,7 +39,7 @@ import MessageLogModal from '@/app/components/base/message-log-modal'
|
|
|
import { useStore as useAppStore } from '@/app/components/app/store'
|
|
|
import { useAppContext } from '@/context/app-context'
|
|
|
import useTimestamp from '@/hooks/use-timestamp'
|
|
|
-import TooltipPlus from '@/app/components/base/tooltip-plus'
|
|
|
+import Tooltip from '@/app/components/base/tooltip'
|
|
|
import { CopyIcon } from '@/app/components/base/copy-icon'
|
|
|
|
|
|
dayjs.extend(utc)
|
|
@@ -346,11 +343,11 @@ function DetailPanel<T extends ChatConversationFullDetailResponse | CompletionCo
|
|
|
<div className='text-gray-500 text-[10px] leading-[14px]'>{isChatMode ? t('appLog.detail.conversationId') : t('appLog.detail.time')}</div>
|
|
|
{isChatMode && (
|
|
|
<div className='flex items-center text-gray-700 text-[13px] leading-[18px]'>
|
|
|
- <TooltipPlus
|
|
|
- hideArrow
|
|
|
- popupContent={detail.id}>
|
|
|
+ <Tooltip
|
|
|
+ popupContent={detail.id}
|
|
|
+ >
|
|
|
<div className='max-w-[105px] truncate'>{detail.id}</div>
|
|
|
- </TooltipPlus>
|
|
|
+ </Tooltip>
|
|
|
<CopyIcon content={detail.id} />
|
|
|
</div>
|
|
|
)}
|
|
@@ -380,7 +377,7 @@ function DetailPanel<T extends ChatConversationFullDetailResponse | CompletionCo
|
|
|
btnClassName='mr-4 !bg-gray-50 !py-1.5 !px-2.5 border-none font-normal'
|
|
|
btnElement={<>
|
|
|
<span className='text-[13px]'>{targetTone}</span>
|
|
|
- <InformationCircleIcon className='h-4 w-4 text-gray-800 ml-1.5' />
|
|
|
+ <RiQuestionLine className='h-4 w-4 text-gray-800 ml-1.5' />
|
|
|
</>}
|
|
|
htmlContent={<div className='w-[280px]'>
|
|
|
<div className='flex justify-between py-2 px-4 font-medium text-sm text-gray-700'>
|
|
@@ -641,13 +638,12 @@ const ConversationList: FC<IConversationList> = ({ logs, appDetail, onRefresh })
|
|
|
const renderTdValue = (value: string | number | null, isEmptyStyle: boolean, isHighlight = false, annotation?: LogAnnotation) => {
|
|
|
return (
|
|
|
<Tooltip
|
|
|
- htmlContent={
|
|
|
+ popupContent={
|
|
|
<span className='text-xs text-gray-500 inline-flex items-center'>
|
|
|
<RiEditFill className='w-3 h-3 mr-1' />{`${t('appLog.detail.annotationTip', { user: annotation?.account?.name })} ${formatTime(annotation?.created_at || dayjs().unix(), 'MM-DD hh:mm A')}`}
|
|
|
</span>
|
|
|
}
|
|
|
- className={(isHighlight && !isChatMode) ? '' : '!hidden'}
|
|
|
- selector={`highlight-${randomString(16)}`}
|
|
|
+ popupClassName={(isHighlight && !isChatMode) ? '' : '!hidden'}
|
|
|
>
|
|
|
<div className={cn(isEmptyStyle ? 'text-gray-400' : 'text-gray-700', !isHighlight ? '' : 'bg-orange-100', 'text-sm overflow-hidden text-ellipsis whitespace-nowrap')}>
|
|
|
{value || '-'}
|