mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-05 06:35:39 +00:00
v4.5.1 (#417)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import { Flex, useTheme, Box } from '@chakra-ui/react';
|
||||
import { useGlobalStore } from '@/web/common/store/global';
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import MyIcon from '@/components/Icon';
|
||||
import Tag from '@/components/Tag';
|
||||
import Avatar from '@/components/Avatar';
|
||||
@@ -25,7 +25,7 @@ const ChatHeader = ({
|
||||
}) => {
|
||||
const router = useRouter();
|
||||
const theme = useTheme();
|
||||
const { isPc } = useGlobalStore();
|
||||
const { isPc } = useSystemStore();
|
||||
const title = useMemo(
|
||||
() => history[history.length - 2]?.value?.slice(0, 8) || appName || '新对话',
|
||||
[appName, history]
|
||||
|
@@ -10,7 +10,7 @@ import {
|
||||
MenuItem,
|
||||
IconButton
|
||||
} from '@chakra-ui/react';
|
||||
import { useGlobalStore } from '@/web/common/store/global';
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { useEditTitle } from '@/web/common/hooks/useEditTitle';
|
||||
import { useRouter } from 'next/router';
|
||||
import Avatar from '@/components/Avatar';
|
||||
@@ -19,7 +19,7 @@ import MyIcon from '@/components/Icon';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useConfirm } from '@/web/common/hooks/useConfirm';
|
||||
import Tabs from '@/components/Tabs';
|
||||
import { useUserStore } from '@/web/support/store/user';
|
||||
import { useUserStore } from '@/web/support/user/useUserStore';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
type HistoryItemType = {
|
||||
@@ -62,7 +62,7 @@ const ChatHistorySlider = ({
|
||||
const theme = useTheme();
|
||||
const router = useRouter();
|
||||
const { t } = useTranslation();
|
||||
const { isPc } = useGlobalStore();
|
||||
const { isPc } = useSystemStore();
|
||||
const { myApps, loadMyApps, userInfo } = useUserStore();
|
||||
|
||||
const [currentTab, setCurrentTab] = useState<`${TabEnum}`>(TabEnum.history);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Flex, Box, IconButton } from '@chakra-ui/react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useUserStore } from '@/web/support/store/user';
|
||||
import { useUserStore } from '@/web/support/user/useUserStore';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import MyIcon from '@/components/Icon';
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import React, { useCallback, useRef } from 'react';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
import { getInitChatSiteInfo, delChatRecordById, putChatHistory } from '@/web/core/api/chat';
|
||||
import { getInitChatSiteInfo, delChatRecordById, putChatHistory } from '@/web/core/chat/api';
|
||||
import {
|
||||
Box,
|
||||
Flex,
|
||||
@@ -11,10 +11,10 @@ import {
|
||||
DrawerContent,
|
||||
useTheme
|
||||
} from '@chakra-ui/react';
|
||||
import { useGlobalStore } from '@/web/common/store/global';
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { streamFetch } from '@/web/common/api/fetch';
|
||||
import { useChatStore } from '@/web/core/store/chat';
|
||||
import { useChatStore } from '@/web/core/chat/storeChat';
|
||||
import { useLoading } from '@/web/common/hooks/useLoading';
|
||||
import { useToast } from '@/web/common/hooks/useToast';
|
||||
import { customAlphabet } from 'nanoid';
|
||||
@@ -28,8 +28,8 @@ import SideBar from '@/components/SideBar';
|
||||
import ChatHistorySlider from './components/ChatHistorySlider';
|
||||
import SliderApps from './components/SliderApps';
|
||||
import ChatHeader from './components/ChatHeader';
|
||||
import { getErrText } from '@/utils/tools';
|
||||
import { useUserStore } from '@/web/support/store/user';
|
||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||
import { useUserStore } from '@/web/support/user/useUserStore';
|
||||
import { serviceSideProps } from '@/web/common/utils/i18n';
|
||||
|
||||
const Chat = ({ appId, chatId }: { appId: string; chatId: string }) => {
|
||||
@@ -56,7 +56,7 @@ const Chat = ({ appId, chatId }: { appId: string; chatId: string }) => {
|
||||
} = useChatStore();
|
||||
const { myApps, loadMyApps, userInfo } = useUserStore();
|
||||
|
||||
const { isPc } = useGlobalStore();
|
||||
const { isPc } = useSystemStore();
|
||||
const { Loading, setIsLoading } = useLoading();
|
||||
const { isOpen: isOpenSlider, onClose: onCloseSlider, onOpen: onOpenSlider } = useDisclosure();
|
||||
|
||||
|
@@ -1,16 +1,16 @@
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
import { initShareChatInfo } from '@/web/support/api/outLink';
|
||||
import { initShareChatInfo } from '@/web/support/outLink/api';
|
||||
import { Box, Flex, useDisclosure, Drawer, DrawerOverlay, DrawerContent } from '@chakra-ui/react';
|
||||
import { useToast } from '@/web/common/hooks/useToast';
|
||||
import { useGlobalStore } from '@/web/common/store/global';
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { streamFetch } from '@/web/common/api/fetch';
|
||||
import { useShareChatStore, defaultHistory } from '@/web/core/store/shareChat';
|
||||
import { useShareChatStore, defaultHistory } from '@/web/core/chat/storeShareChat';
|
||||
import SideBar from '@/components/SideBar';
|
||||
import { gptMessage2ChatType } from '@/utils/adapt';
|
||||
import { getErrText } from '@/utils/tools';
|
||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||
import { ChatSiteItemType } from '@/types/chat';
|
||||
import { customAlphabet } from 'nanoid';
|
||||
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 12);
|
||||
@@ -35,7 +35,7 @@ const OutLink = ({
|
||||
const router = useRouter();
|
||||
const { toast } = useToast();
|
||||
const { isOpen: isOpenSlider, onClose: onCloseSlider, onOpen: onOpenSlider } = useDisclosure();
|
||||
const { isPc } = useGlobalStore();
|
||||
const { isPc } = useSystemStore();
|
||||
const forbidRefresh = useRef(false);
|
||||
const [isEmbed, setIdEmbed] = useState(true);
|
||||
|
||||
|
Reference in New Issue
Block a user