mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-28 00:56:26 +00:00
fix: chat log get member info
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
Flex,
|
Flex,
|
||||||
Box,
|
Box,
|
||||||
@@ -23,7 +23,6 @@ import MyModal from '@fastgpt/web/components/common/MyModal';
|
|||||||
import { addDays } from 'date-fns';
|
import { addDays } from 'date-fns';
|
||||||
import { usePagination } from '@fastgpt/web/hooks/usePagination';
|
import { usePagination } from '@fastgpt/web/hooks/usePagination';
|
||||||
import DateRangePicker, { DateRangeType } from '@fastgpt/web/components/common/DateRangePicker';
|
import DateRangePicker, { DateRangeType } from '@fastgpt/web/components/common/DateRangePicker';
|
||||||
import { useI18n } from '@/web/context/I18n';
|
|
||||||
import EmptyTip from '@fastgpt/web/components/common/EmptyTip';
|
import EmptyTip from '@fastgpt/web/components/common/EmptyTip';
|
||||||
import { useContextSelector } from 'use-context-selector';
|
import { useContextSelector } from 'use-context-selector';
|
||||||
import { AppContext } from '../context';
|
import { AppContext } from '../context';
|
||||||
@@ -37,11 +36,15 @@ const DetailLogsModal = dynamic(() => import('./DetailLogsModal'));
|
|||||||
|
|
||||||
const Logs = () => {
|
const Logs = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { appT } = useI18n();
|
|
||||||
const { isPc } = useSystem();
|
const { isPc } = useSystem();
|
||||||
|
|
||||||
const appId = useContextSelector(AppContext, (v) => v.appId);
|
const appId = useContextSelector(AppContext, (v) => v.appId);
|
||||||
const { teamMembers } = useUserStore();
|
const { teamMembers, loadAndGetTeamMembers } = useUserStore();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (teamMembers.length) return;
|
||||||
|
loadAndGetTeamMembers(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const [dateRange, setDateRange] = useState<DateRangeType>({
|
const [dateRange, setDateRange] = useState<DateRangeType>({
|
||||||
from: addDays(new Date(), -7),
|
from: addDays(new Date(), -7),
|
||||||
@@ -77,10 +80,10 @@ const Logs = () => {
|
|||||||
{isPc && (
|
{isPc && (
|
||||||
<Box {...cardStyles} boxShadow={2} px={[4, 8]} py={[4, 6]}>
|
<Box {...cardStyles} boxShadow={2} px={[4, 8]} py={[4, 6]}>
|
||||||
<Box fontWeight={'bold'} fontSize={['md', 'lg']} mb={2}>
|
<Box fontWeight={'bold'} fontSize={['md', 'lg']} mb={2}>
|
||||||
{appT('chat_logs')}
|
{t('app:chat_logs')}
|
||||||
</Box>
|
</Box>
|
||||||
<Box color={'myGray.500'} fontSize={'sm'}>
|
<Box color={'myGray.500'} fontSize={'sm'}>
|
||||||
{appT('chat_logs_tips')},{' '}
|
{t('app:chat_logs_tips')},{' '}
|
||||||
<Box
|
<Box
|
||||||
as={'span'}
|
as={'span'}
|
||||||
mr={2}
|
mr={2}
|
||||||
@@ -201,7 +204,7 @@ const Logs = () => {
|
|||||||
))}
|
))}
|
||||||
</Tbody>
|
</Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
{logs.length === 0 && !isLoading && <EmptyTip text={appT('logs_empty')}></EmptyTip>}
|
{logs.length === 0 && !isLoading && <EmptyTip text={t('app:logs_empty')}></EmptyTip>}
|
||||||
</TableContainer>
|
</TableContainer>
|
||||||
|
|
||||||
<HStack w={'100%'} mt={3} justifyContent={'flex-end'}>
|
<HStack w={'100%'} mt={3} justifyContent={'flex-end'}>
|
||||||
|
Reference in New Issue
Block a user