mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-13 13:10:29 +00:00
fix: 启动报错
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { apiInterceptors, getDialogueList, getUsableModels, queryAdminList } from '@/client/api';
|
||||
import { apiInterceptors, getUsableModels, queryAdminList } from '@/client/api';
|
||||
import { ChatHistoryResponse, DialogueListResponse, IChatDialogueSchema } from '@/types/chat';
|
||||
import { UserInfoResponse } from '@/types/userinfo';
|
||||
import { STORAGE_THEME_KEY } from '@/utils/constants/index';
|
||||
import { useRequest } from 'ahooks';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
import { createContext, useEffect, useMemo, useState } from 'react';
|
||||
import { createContext, useEffect, useState } from 'react';
|
||||
|
||||
type ThemeMode = 'dark' | 'light';
|
||||
|
||||
|
@@ -1,13 +1,10 @@
|
||||
import UserBar from '@/ant-components/layout/UserBar';
|
||||
import { ChatContext } from '@/app/chat-context';
|
||||
import { apiInterceptors, delDialogue } from '@/client/api';
|
||||
import { DarkSvg, ModelSvg, SunnySvg } from '@/components/icons';
|
||||
import { IChatDialogueSchema } from '@/types/chat';
|
||||
import { STORAGE_LANG_KEY, STORAGE_THEME_KEY, STORAGE_USERINFO_KEY } from '@/utils/constants/index';
|
||||
import cls from 'classnames';
|
||||
import 'moment/locale/zh-cn';
|
||||
|
||||
import Icon, {
|
||||
AppstoreAddOutlined,
|
||||
AppstoreOutlined,
|
||||
BuildOutlined,
|
||||
ConsoleSqlOutlined,
|
||||
@@ -16,18 +13,19 @@ import Icon, {
|
||||
MenuFoldOutlined,
|
||||
MenuUnfoldOutlined,
|
||||
MessageOutlined,
|
||||
PartitionOutlined,
|
||||
PartitionOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { ConfigProvider, Dropdown, Modal, Popover, Tooltip, message } from 'antd';
|
||||
import { Modal, Popover, Tooltip, message } from 'antd';
|
||||
import { ItemType } from 'antd/es/menu/hooks/useItems';
|
||||
import cls from 'classnames';
|
||||
import copy from 'copy-to-clipboard';
|
||||
import moment from 'moment';
|
||||
import 'moment/locale/zh-cn';
|
||||
import Image from 'next/image';
|
||||
import Link from 'next/link';
|
||||
import { useRouter } from 'next/router';
|
||||
import { ReactNode, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
||||
import { ReactNode, useCallback, useContext, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import UserBar from '@/ant-components/layout/UserBar';
|
||||
import moment from 'moment';
|
||||
|
||||
type SettingItem = {
|
||||
key: string;
|
||||
@@ -72,6 +70,7 @@ function SideBar() {
|
||||
const { user_id } = JSON.parse(localStorage.getItem(STORAGE_USERINFO_KEY) || '{}');
|
||||
return adminList.some((admin) => admin.user_id === user_id);
|
||||
}, [adminList]);
|
||||
|
||||
const routes = useMemo(() => {
|
||||
const items: RouteItem[] = [
|
||||
{
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import FloatHelper from '@/ant-components/layout/FloatHelper';
|
||||
import { ChatContext, ChatContextProvider } from '@/app/chat-context';
|
||||
import SideBar from '@/components/layout/side-bar';
|
||||
import { STORAGE_LANG_KEY } from '@/utils/constants/index';
|
||||
import { App, ConfigProvider, MappingAlgorithm, theme } from 'antd';
|
||||
import enUS from 'antd/locale/en_US';
|
||||
import zhCN from 'antd/locale/zh_CN';
|
||||
import classNames from 'classnames';
|
||||
import type { AppProps } from 'next/app';
|
||||
import dynamic from 'next/dynamic';
|
||||
import Head from 'next/head';
|
||||
import { useRouter } from 'next/router';
|
||||
import React, { useContext, useEffect } from 'react';
|
||||
@@ -15,6 +15,8 @@ import '../app/i18n';
|
||||
import '../nprogress.css';
|
||||
import '../styles/globals.css';
|
||||
|
||||
const SideBar = dynamic(() => import('@/components/layout/side-bar'), { ssr: false });
|
||||
|
||||
const antdDarkTheme: MappingAlgorithm = (seedToken, mapToken) => {
|
||||
return {
|
||||
...theme.darkAlgorithm(seedToken, mapToken),
|
||||
|
@@ -1,4 +1,3 @@
|
||||
export * from './storage';
|
||||
export * from './error-code';
|
||||
export * from './header';
|
||||
export * from './cookie';
|
||||
|
Reference in New Issue
Block a user