= ({
}
>
| {item.question} |
{item.answer} |
- {formatTime(item.created_at, t('appLog.dateTimeFormat') as string)} |
- {item.hit_count} |
- e.stopPropagation()}>
+ | {formatTime(item.created_at, t('appLog.dateTimeFormat') as string)} |
+ {item.hit_count} |
+ e.stopPropagation()}>
{/* Actions */}
= ({ isChatMode, appId, queryParams, setQueryPara
if (!data)
return null
return (
-
- ({ value: item.value, name: t(`appLog.filter.period.${item.name}`) }))}
- className='mt-0 !w-40'
+
+ }
+ value={queryParams.period || 7}
onSelect={(item) => {
- setQueryParams({ ...queryParams, period: item.value })
+ setQueryParams({ ...queryParams, period: item.value as string })
}}
- defaultValue={queryParams.period} />
-
- {
- setQueryParams({ ...queryParams, annotation_status: item.value as string })
- }
- }
- items={[{ value: 'all', name: t('appLog.filter.annotation.all') },
- { value: 'annotated', name: t('appLog.filter.annotation.annotated', { count: data?.count }) },
- { value: 'not_annotated', name: t('appLog.filter.annotation.not_annotated') }]}
- />
-
-
-
-
-
- {
- setQueryParams({ ...queryParams, keyword: e.target.value })
- }}
- />
-
+ onClear={() => setQueryParams({ ...queryParams, period: 7 })}
+ items={TIME_PERIOD_LIST.map(item => ({ value: item.value, name: t(`appLog.filter.period.${item.name}`) }))}
+ />
+ {
+ setQueryParams({ ...queryParams, annotation_status: item.value as string })
+ }}
+ onClear={() => setQueryParams({ ...queryParams, annotation_status: 'all' })}
+ items={[
+ { value: 'all', name: t('appLog.filter.annotation.all') },
+ { value: 'annotated', name: t('appLog.filter.annotation.annotated', { count: data?.count }) },
+ { value: 'not_annotated', name: t('appLog.filter.annotation.not_annotated') },
+ ]}
+ />
+ {
+ setQueryParams({ ...queryParams, keyword: e.target.value })
+ }}
+ onClear={() => setQueryParams({ ...queryParams, keyword: '' })}
+ />
{isChatMode && (
<>
diff --git a/web/app/components/app/log/index.tsx b/web/app/components/app/log/index.tsx
index dd6ebd08f0..a9a11aa493 100644
--- a/web/app/components/app/log/index.tsx
+++ b/web/app/components/app/log/index.tsx
@@ -39,12 +39,12 @@ const EmptyElement: FC<{ appUrl: string }> = ({ appUrl }) => {
const pathSegments = pathname.split('/')
pathSegments.pop()
return
-
- {t('appLog.table.empty.element.title')}
-
+
+ {t('appLog.table.empty.element.title')}
+
, testLink: }}
+ components={{ shareLink: , testLink: }}
/>
@@ -101,7 +101,7 @@ const Logs: FC = ({ appDetail }) => {
return (
- {t('appLog.description')}
+ {t('appLog.description')}
{total === undefined
diff --git a/web/app/components/app/log/list.tsx b/web/app/components/app/log/list.tsx
index 40d171761b..f156721abf 100644
--- a/web/app/components/app/log/list.tsx
+++ b/web/app/components/app/log/list.tsx
@@ -17,7 +17,6 @@ import timezone from 'dayjs/plugin/timezone'
import { createContext, useContext } from 'use-context-selector'
import { useShallow } from 'zustand/react/shallow'
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'
@@ -642,14 +641,14 @@ const ConversationList: FC = ({ logs, appDetail, onRefresh })
return (
+
{`${t('appLog.detail.annotationTip', { user: annotation?.account?.name })} ${formatTime(annotation?.created_at || dayjs().unix(), 'MM-DD hh:mm A')}`}
}
className={(isHighlight && !isChatMode) ? '' : '!hidden'}
selector={`highlight-${randomString(16)}`}
>
-
+
{value || '-'}
@@ -667,40 +666,46 @@ const ConversationList: FC = ({ logs, appDetail, onRefresh })
return (
-
-
+
+
- |
- {isChatMode ? t('appLog.table.header.summary') : t('appLog.table.header.input')} |
- {t('appLog.table.header.endUser')} |
- {isChatMode ? t('appLog.table.header.messageCount') : t('appLog.table.header.output')} |
- {t('appLog.table.header.userRate')} |
- {t('appLog.table.header.adminRate')} |
- {t('appLog.table.header.updatedTime')} |
- {t('appLog.table.header.time')} |
+ |
+ {isChatMode ? t('appLog.table.header.summary') : t('appLog.table.header.input')} |
+ {t('appLog.table.header.endUser')} |
+ {isChatMode ? t('appLog.table.header.messageCount') : t('appLog.table.header.output')} |
+ {t('appLog.table.header.userRate')} |
+ {t('appLog.table.header.adminRate')} |
+ {t('appLog.table.header.updatedTime')} |
+ {t('appLog.table.header.time')} |
-
+
{logs.data.map((log: any) => {
const endUser = log.from_end_user_session_id
const leftValue = get(log, isChatMode ? 'name' : 'message.inputs.query') || (!isChatMode ? (get(log, 'message.query') || get(log, 'message.inputs.default_input')) : '') || ''
const rightValue = get(log, isChatMode ? 'message_count' : 'message.answer')
return {
setShowDrawer(true)
setCurrentConversation(log)
}}>
- | {!log.read_at && } |
-
+ |
+ {!log.read_at && (
+
+
+
+ )}
+ |
+
{renderTdValue(leftValue || t('appLog.table.empty.noChat'), !leftValue, isChatMode && log.annotated)}
|
- {renderTdValue(endUser || defaultValue, !endUser)} |
-
+ | {renderTdValue(endUser || defaultValue, !endUser)} |
+
{renderTdValue(rightValue === 0 ? 0 : (rightValue || t('appLog.table.empty.noOutput')), !rightValue, !isChatMode && !!log.annotation?.content, log.annotation)}
|
-
+ |
{(!log.user_feedback_stats.like && !log.user_feedback_stats.dislike)
? renderTdValue(defaultValue, true)
: <>
@@ -709,7 +714,7 @@ const ConversationList: FC = ({ logs, appDetail, onRefresh })
>
}
|
-
+ |
{(!log.admin_feedback_stats.like && !log.admin_feedback_stats.dislike)
? renderTdValue(defaultValue, true)
: <>
@@ -718,8 +723,8 @@ const ConversationList: FC = ({ logs, appDetail, onRefresh })
>
}
|
- {formatTime(log.updated_at, t('appLog.dateTimeFormat') as string)} |
- {formatTime(log.created_at, t('appLog.dateTimeFormat') as string)} |
+ {formatTime(log.updated_at, t('appLog.dateTimeFormat') as string)} |
+ {formatTime(log.created_at, t('appLog.dateTimeFormat') as string)} |
})}
diff --git a/web/app/components/app/log/style.module.css b/web/app/components/app/log/style.module.css
index 67a9fe3bf5..adb32a39db 100644
--- a/web/app/components/app/log/style.module.css
+++ b/web/app/components/app/log/style.module.css
@@ -1,9 +1,3 @@
-.logTable td {
- padding: 7px 8px;
- box-sizing: border-box;
- max-width: 200px;
-}
-
.pagination li {
list-style: none;
}
diff --git a/web/app/components/app/workflow-log/filter.tsx b/web/app/components/app/workflow-log/filter.tsx
index 9f03c4dc3d..466e9b8fda 100644
--- a/web/app/components/app/workflow-log/filter.tsx
+++ b/web/app/components/app/workflow-log/filter.tsx
@@ -14,21 +14,19 @@ type IFilterProps = {
const Filter: FC = ({ queryParams, setQueryParams }: IFilterProps) => {
const { t } = useTranslation()
return (
-
-
- {
- setQueryParams({ ...queryParams, status: item.value as string })
- }}
- onClear={() => setQueryParams({ ...queryParams, status: 'all' })}
- items={[{ value: 'all', name: 'All' },
- { value: 'succeeded', name: 'Success' },
- { value: 'failed', name: 'Fail' },
- { value: 'stopped', name: 'Stop' },
- ]}
- />
-
+
+ {
+ setQueryParams({ ...queryParams, status: item.value as string })
+ }}
+ onClear={() => setQueryParams({ ...queryParams, status: 'all' })}
+ items={[{ value: 'all', name: 'All' },
+ { value: 'succeeded', name: 'Success' },
+ { value: 'failed', name: 'Fail' },
+ { value: 'stopped', name: 'Stop' },
+ ]}
+ />
void
@@ -22,6 +25,9 @@ type Props = {
}
const Chip: FC = ({
className,
+ panelClassName,
+ showLeftIcon = true,
+ leftIcon,
value,
items,
onSelect,
@@ -46,22 +52,23 @@ const Chip: FC = ({
className='block'
>
-
-
-
-
+ {showLeftIcon && (
+
+ {leftIcon || (
+
+ )}
+
+ )}
+
{triggerContent}
- {/* {value.length > 1 && (
- {`+${value.length - 1}`}
- )} */}
{!value && }
{!!value && (
@@ -75,7 +82,7 @@ const Chip: FC = ({
-
+
{items.map(item => (
= ({
className='block'
>
@@ -80,7 +80,7 @@ const Sort: FC = ({
- onSelect(`${order ? '' : '-'}${value}`)}>
+ onSelect(`${order ? '' : '-'}${value}`)}>
{!order && }
{order && }
|