♻️ refactor(components): refactor the components folder structure and related imports
This commit is contained in:
|
Before Width: | Height: | Size: 550 KiB After Width: | Height: | Size: 550 KiB |
@@ -1,15 +1,15 @@
|
|||||||
import React, { lazy, Suspense } from 'react';
|
import React, { lazy, Suspense } from 'react';
|
||||||
import { Route, Routes, useLocation } from 'react-router-dom';
|
import { Route, Routes, useLocation } from 'react-router-dom';
|
||||||
import Loading from './components/Loading';
|
import Loading from './components/common/Loading.js';
|
||||||
import User from './pages/User';
|
import User from './pages/User';
|
||||||
import { AuthRedirect, PrivateRoute } from './helpers';
|
import { AuthRedirect, PrivateRoute } from './helpers';
|
||||||
import RegisterForm from './components/RegisterForm';
|
import RegisterForm from './components/auth/RegisterForm.js';
|
||||||
import LoginForm from './components/LoginForm';
|
import LoginForm from './components/auth/LoginForm.js';
|
||||||
import NotFound from './pages/NotFound';
|
import NotFound from './pages/NotFound';
|
||||||
import Setting from './pages/Setting';
|
import Setting from './pages/Setting';
|
||||||
import EditUser from './pages/User/EditUser';
|
import EditUser from './pages/User/EditUser';
|
||||||
import PasswordResetForm from './components/PasswordResetForm';
|
import PasswordResetForm from './components/auth/PasswordResetForm.js';
|
||||||
import PasswordResetConfirm from './components/PasswordResetConfirm';
|
import PasswordResetConfirm from './components/auth/PasswordResetConfirm.js';
|
||||||
import Channel from './pages/Channel';
|
import Channel from './pages/Channel';
|
||||||
import Token from './pages/Token';
|
import Token from './pages/Token';
|
||||||
import EditChannel from './pages/Channel/EditChannel';
|
import EditChannel from './pages/Channel/EditChannel';
|
||||||
@@ -22,8 +22,8 @@ import Midjourney from './pages/Midjourney';
|
|||||||
import Pricing from './pages/Pricing/index.js';
|
import Pricing from './pages/Pricing/index.js';
|
||||||
import Task from './pages/Task/index.js';
|
import Task from './pages/Task/index.js';
|
||||||
import Playground from './pages/Playground/index.js';
|
import Playground from './pages/Playground/index.js';
|
||||||
import OAuth2Callback from './components/OAuth2Callback.js';
|
import OAuth2Callback from './components/auth/OAuth2Callback.js';
|
||||||
import PersonalSetting from './components/PersonalSetting.js';
|
import PersonalSetting from './components/settings/PersonalSetting.js';
|
||||||
import Setup from './pages/Setup/index.js';
|
import Setup from './pages/Setup/index.js';
|
||||||
import SetupCheck from './components/SetupCheck';
|
import SetupCheck from './components/SetupCheck';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useContext, useEffect, useState } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
|
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
|
||||||
import { UserContext } from '../context/User';
|
import { UserContext } from '../../context/User/index.js';
|
||||||
import {
|
import {
|
||||||
API,
|
API,
|
||||||
getLogo,
|
getLogo,
|
||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
onGitHubOAuthClicked,
|
onGitHubOAuthClicked,
|
||||||
onOIDCClicked,
|
onOIDCClicked,
|
||||||
onLinuxDOOAuthClicked
|
onLinuxDOOAuthClicked
|
||||||
} from '../helpers';
|
} from '../../helpers/index.js';
|
||||||
import Turnstile from 'react-turnstile';
|
import Turnstile from 'react-turnstile';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -28,11 +28,11 @@ import Text from '@douyinfe/semi-ui/lib/es/typography/text';
|
|||||||
import TelegramLoginButton from 'react-telegram-login';
|
import TelegramLoginButton from 'react-telegram-login';
|
||||||
|
|
||||||
import { IconGithubLogo, IconMail, IconLock } from '@douyinfe/semi-icons';
|
import { IconGithubLogo, IconMail, IconLock } from '@douyinfe/semi-icons';
|
||||||
import OIDCIcon from './common/logo/OIDCIcon.js';
|
import OIDCIcon from '../common/logo/OIDCIcon.js';
|
||||||
import WeChatIcon from './common/logo/WeChatIcon.js';
|
import WeChatIcon from '../common/logo/WeChatIcon.js';
|
||||||
import LinuxDoIcon from './common/logo/LinuxDoIcon.js';
|
import LinuxDoIcon from '../common/logo/LinuxDoIcon.js';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import Background from '../images/example.png';
|
import Background from '/example.png';
|
||||||
|
|
||||||
const LoginForm = () => {
|
const LoginForm = () => {
|
||||||
const [inputs, setInputs] = useState({
|
const [inputs, setInputs] = useState({
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useContext, useEffect, useState } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import { Spin, Typography, Space } from '@douyinfe/semi-ui';
|
import { Spin, Typography, Space } from '@douyinfe/semi-ui';
|
||||||
import { useNavigate, useSearchParams } from 'react-router-dom';
|
import { useNavigate, useSearchParams } from 'react-router-dom';
|
||||||
import { API, showError, showSuccess, updateAPI, setUserData } from '../helpers';
|
import { API, showError, showSuccess, updateAPI, setUserData } from '../../helpers';
|
||||||
import { UserContext } from '../context/User';
|
import { UserContext } from '../../context/User';
|
||||||
|
|
||||||
const OAuth2Callback = (props) => {
|
const OAuth2Callback = (props) => {
|
||||||
const [searchParams, setSearchParams] = useSearchParams();
|
const [searchParams, setSearchParams] = useSearchParams();
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { API, copy, showError, showNotice, getLogo, getSystemName } from '../helpers';
|
import { API, copy, showError, showNotice, getLogo, getSystemName } from '../../helpers';
|
||||||
import { useSearchParams, Link } from 'react-router-dom';
|
import { useSearchParams, Link } from 'react-router-dom';
|
||||||
import { Button, Card, Form, Typography } from '@douyinfe/semi-ui';
|
import { Button, Card, Form, Typography } from '@douyinfe/semi-ui';
|
||||||
import { IconMail, IconLock } from '@douyinfe/semi-icons';
|
import { IconMail, IconLock } from '@douyinfe/semi-icons';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import Background from '../images/example.png';
|
import Background from '/example.png';
|
||||||
|
|
||||||
const { Text, Title } = Typography;
|
const { Text, Title } = Typography;
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { API, getLogo, showError, showInfo, showSuccess, getSystemName } from '../helpers';
|
import { API, getLogo, showError, showInfo, showSuccess, getSystemName } from '../../helpers';
|
||||||
import Turnstile from 'react-turnstile';
|
import Turnstile from 'react-turnstile';
|
||||||
import { Button, Card, Form, Typography } from '@douyinfe/semi-ui';
|
import { Button, Card, Form, Typography } from '@douyinfe/semi-ui';
|
||||||
import { IconMail } from '@douyinfe/semi-icons';
|
import { IconMail } from '@douyinfe/semi-icons';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import Background from '../images/example.png';
|
import Background from '/example.png';
|
||||||
|
|
||||||
const { Text, Title } = Typography;
|
const { Text, Title } = Typography;
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
updateAPI,
|
updateAPI,
|
||||||
getSystemName,
|
getSystemName,
|
||||||
setUserData
|
setUserData
|
||||||
} from '../helpers';
|
} from '../../helpers/index.js';
|
||||||
import Turnstile from 'react-turnstile';
|
import Turnstile from 'react-turnstile';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -26,14 +26,14 @@ import {
|
|||||||
onGitHubOAuthClicked,
|
onGitHubOAuthClicked,
|
||||||
onLinuxDOOAuthClicked,
|
onLinuxDOOAuthClicked,
|
||||||
onOIDCClicked,
|
onOIDCClicked,
|
||||||
} from '../helpers';
|
} from '../../helpers/index.js';
|
||||||
import OIDCIcon from './common/logo/OIDCIcon.js';
|
import OIDCIcon from '../common/logo/OIDCIcon.js';
|
||||||
import LinuxDoIcon from './common/logo/LinuxDoIcon.js';
|
import LinuxDoIcon from '../common/logo/LinuxDoIcon.js';
|
||||||
import WeChatIcon from './common/logo/WeChatIcon.js';
|
import WeChatIcon from '../common/logo/WeChatIcon.js';
|
||||||
import TelegramLoginButton from 'react-telegram-login/src';
|
import TelegramLoginButton from 'react-telegram-login/src';
|
||||||
import { UserContext } from '../context/User/index.js';
|
import { UserContext } from '../../context/User/index.js';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import Background from '../images/example.png';
|
import Background from '/example.png';
|
||||||
|
|
||||||
const RegisterForm = () => {
|
const RegisterForm = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useEffect, useState, useMemo, useContext } from 'react';
|
import React, { useEffect, useState, useMemo, useContext } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Typography } from '@douyinfe/semi-ui';
|
import { Typography } from '@douyinfe/semi-ui';
|
||||||
import { getFooterHTML, getLogo, getSystemName } from '../helpers';
|
import { getFooterHTML, getLogo, getSystemName } from '../../helpers';
|
||||||
import { StatusContext } from '../context/Status';
|
import { StatusContext } from '../../context/Status';
|
||||||
|
|
||||||
const FooterBar = () => {
|
const FooterBar = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import React, { useContext, useEffect, useState } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import { Link, useNavigate, useLocation } from 'react-router-dom';
|
import { Link, useNavigate, useLocation } from 'react-router-dom';
|
||||||
import { UserContext } from '../context/User';
|
import { UserContext } from '../../context/User/index.js';
|
||||||
import { useSetTheme, useTheme } from '../context/Theme';
|
import { useSetTheme, useTheme } from '../../context/Theme/index.js';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { API, getLogo, getSystemName, showSuccess, stringToColor } from '../helpers';
|
import { API, getLogo, getSystemName, showSuccess, stringToColor } from '../../helpers/index.js';
|
||||||
import fireworks from 'react-fireworks';
|
import fireworks from 'react-fireworks';
|
||||||
import { CN, GB } from 'country-flag-icons/react/3x2';
|
import { CN, GB } from 'country-flag-icons/react/3x2';
|
||||||
import NoticeModal from './NoticeModal';
|
import NoticeModal from './NoticeModal.js';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IconClose,
|
IconClose,
|
||||||
@@ -29,8 +29,8 @@ import {
|
|||||||
Typography,
|
Typography,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
} from '@douyinfe/semi-ui';
|
} from '@douyinfe/semi-ui';
|
||||||
import { StatusContext } from '../context/Status/index.js';
|
import { StatusContext } from '../../context/Status/index.js';
|
||||||
import { useStyle, styleActions } from '../context/Style/index.js';
|
import { useStyle, styleActions } from '../../context/Style/index.js';
|
||||||
|
|
||||||
const HeaderBar = () => {
|
const HeaderBar = () => {
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Button, Modal, Empty } from '@douyinfe/semi-ui';
|
import { Button, Modal, Empty } from '@douyinfe/semi-ui';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { API, showError } from '../helpers';
|
import { API, showError } from '../../helpers';
|
||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
import { IllustrationNoContent, IllustrationNoContentDark } from '@douyinfe/semi-illustrations';
|
import { IllustrationNoContent, IllustrationNoContentDark } from '@douyinfe/semi-illustrations';
|
||||||
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import HeaderBar from './HeaderBar.js';
|
import HeaderBar from './HeaderBar.js';
|
||||||
import { Layout } from '@douyinfe/semi-ui';
|
import { Layout } from '@douyinfe/semi-ui';
|
||||||
import SiderBar from './SiderBar.js';
|
import SiderBar from './SiderBar.js';
|
||||||
import App from '../App.js';
|
import App from '../../App.js';
|
||||||
import FooterBar from './Footer.js';
|
import FooterBar from './Footer.js';
|
||||||
import { ToastContainer } from 'react-toastify';
|
import { ToastContainer } from 'react-toastify';
|
||||||
import React, { useContext, useEffect } from 'react';
|
import React, { useContext, useEffect } from 'react';
|
||||||
import { useStyle } from '../context/Style/index.js';
|
import { useStyle } from '../../context/Style/index.js';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { API, getLogo, getSystemName, showError, setStatusData } from '../helpers';
|
import { API, getLogo, getSystemName, showError, setStatusData } from '../../helpers/index.js';
|
||||||
import { UserContext } from '../context/User/index.js';
|
import { UserContext } from '../../context/User/index.js';
|
||||||
import { StatusContext } from '../context/Status/index.js';
|
import { StatusContext } from '../../context/Status/index.js';
|
||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
const { Sider, Content, Header, Footer } = Layout;
|
const { Sider, Content, Header, Footer } = Layout;
|
||||||
|
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
||||||
import { Link, useNavigate, useLocation } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
import { UserContext } from '../context/User';
|
import { StatusContext } from '../../context/Status/index.js';
|
||||||
import { StatusContext } from '../context/Status';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
isAdmin,
|
isAdmin,
|
||||||
showError
|
showError
|
||||||
} from '../helpers';
|
} from '../../helpers/index.js';
|
||||||
import '../index.css';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IconCalendarClock,
|
IconCalendarClock,
|
||||||
@@ -17,26 +15,19 @@ import {
|
|||||||
IconTerminal,
|
IconTerminal,
|
||||||
IconCreditCard,
|
IconCreditCard,
|
||||||
IconGift,
|
IconGift,
|
||||||
IconHelpCircle,
|
|
||||||
IconHistogram,
|
IconHistogram,
|
||||||
IconHome,
|
|
||||||
IconImage,
|
IconImage,
|
||||||
IconKey,
|
IconKey,
|
||||||
IconLayers,
|
IconLayers,
|
||||||
IconPriceTag,
|
|
||||||
IconSetting,
|
IconSetting,
|
||||||
IconUser,
|
IconUser,
|
||||||
} from '@douyinfe/semi-icons';
|
} from '@douyinfe/semi-icons';
|
||||||
import {
|
import {
|
||||||
Avatar,
|
|
||||||
Dropdown,
|
|
||||||
Layout,
|
|
||||||
Nav,
|
Nav,
|
||||||
Switch,
|
|
||||||
Divider,
|
Divider,
|
||||||
} from '@douyinfe/semi-ui';
|
} from '@douyinfe/semi-ui';
|
||||||
import { useSetTheme, useTheme } from '../context/Theme/index.js';
|
import { useSetTheme, useTheme } from '../../context/Theme/index.js';
|
||||||
import { useStyle, styleActions } from '../context/Style/index.js';
|
import { useStyle, styleActions } from '../../context/Style/index.js';
|
||||||
import Text from '@douyinfe/semi-ui/lib/es/typography/text';
|
import Text from '@douyinfe/semi-ui/lib/es/typography/text';
|
||||||
|
|
||||||
// 自定义侧边栏按钮样式
|
// 自定义侧边栏按钮样式
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Card, Spin, Tabs } from '@douyinfe/semi-ui';
|
import { Card, Spin, Tabs } from '@douyinfe/semi-ui';
|
||||||
|
|
||||||
import { API, showError, showSuccess } from '../helpers';
|
import { API, showError, showSuccess } from '../../helpers';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import SettingGeminiModel from '../pages/Setting/Model/SettingGeminiModel.js';
|
import SettingGeminiModel from '../../pages/Setting/Model/SettingGeminiModel.js';
|
||||||
import SettingClaudeModel from '../pages/Setting/Model/SettingClaudeModel.js';
|
import SettingClaudeModel from '../../pages/Setting/Model/SettingClaudeModel.js';
|
||||||
import SettingGlobalModel from '../pages/Setting/Model/SettingGlobalModel.js';
|
import SettingGlobalModel from '../../pages/Setting/Model/SettingGlobalModel.js';
|
||||||
|
|
||||||
const ModelSetting = () => {
|
const ModelSetting = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Card, Spin, Tabs } from '@douyinfe/semi-ui';
|
import { Card, Spin, Tabs } from '@douyinfe/semi-ui';
|
||||||
import SettingsGeneral from '../pages/Setting/Operation/SettingsGeneral.js';
|
import SettingsGeneral from '../../pages/Setting/Operation/SettingsGeneral.js';
|
||||||
import SettingsDrawing from '../pages/Setting/Operation/SettingsDrawing.js';
|
import SettingsDrawing from '../../pages/Setting/Operation/SettingsDrawing.js';
|
||||||
import SettingsSensitiveWords from '../pages/Setting/Operation/SettingsSensitiveWords.js';
|
import SettingsSensitiveWords from '../../pages/Setting/Operation/SettingsSensitiveWords.js';
|
||||||
import SettingsLog from '../pages/Setting/Operation/SettingsLog.js';
|
import SettingsLog from '../../pages/Setting/Operation/SettingsLog.js';
|
||||||
import SettingsDataDashboard from '../pages/Setting/Operation/SettingsDataDashboard.js';
|
import SettingsDataDashboard from '../../pages/Setting/Operation/SettingsDataDashboard.js';
|
||||||
import SettingsMonitoring from '../pages/Setting/Operation/SettingsMonitoring.js';
|
import SettingsMonitoring from '../../pages/Setting/Operation/SettingsMonitoring.js';
|
||||||
import SettingsCreditLimit from '../pages/Setting/Operation/SettingsCreditLimit.js';
|
import SettingsCreditLimit from '../../pages/Setting/Operation/SettingsCreditLimit.js';
|
||||||
import ModelSettingsVisualEditor from '../pages/Setting/Operation/ModelSettingsVisualEditor.js';
|
import ModelSettingsVisualEditor from '../../pages/Setting/Operation/ModelSettingsVisualEditor.js';
|
||||||
import GroupRatioSettings from '../pages/Setting/Operation/GroupRatioSettings.js';
|
import GroupRatioSettings from '../../pages/Setting/Operation/GroupRatioSettings.js';
|
||||||
import ModelRatioSettings from '../pages/Setting/Operation/ModelRatioSettings.js';
|
import ModelRatioSettings from '../../pages/Setting/Operation/ModelRatioSettings.js';
|
||||||
|
|
||||||
import { API, showError, showSuccess } from '../helpers';
|
import { API, showError, showSuccess } from '../../helpers';
|
||||||
import SettingsChats from '../pages/Setting/Operation/SettingsChats.js';
|
import SettingsChats from '../../pages/Setting/Operation/SettingsChats.js';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import ModelRatioNotSetEditor from '../pages/Setting/Operation/ModelRationNotSetEditor.js';
|
import ModelRatioNotSetEditor from '../../pages/Setting/Operation/ModelRationNotSetEditor.js';
|
||||||
|
|
||||||
const OperationSetting = () => {
|
const OperationSetting = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -9,10 +9,10 @@ import {
|
|||||||
Space,
|
Space,
|
||||||
Card,
|
Card,
|
||||||
} from '@douyinfe/semi-ui';
|
} from '@douyinfe/semi-ui';
|
||||||
import { API, showError, showSuccess, timestamp2string } from '../helpers';
|
import { API, showError, showSuccess, timestamp2string } from '../../helpers';
|
||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { StatusContext } from '../context/Status/index.js';
|
import { StatusContext } from '../../context/Status/index.js';
|
||||||
import Text from '@douyinfe/semi-ui/lib/es/typography/text';
|
import Text from '@douyinfe/semi-ui/lib/es/typography/text';
|
||||||
|
|
||||||
const OtherSetting = () => {
|
const OtherSetting = () => {
|
||||||
@@ -15,9 +15,9 @@ import {
|
|||||||
onGitHubOAuthClicked,
|
onGitHubOAuthClicked,
|
||||||
onOIDCClicked,
|
onOIDCClicked,
|
||||||
onLinuxDOOAuthClicked
|
onLinuxDOOAuthClicked
|
||||||
} from '../helpers';
|
} from '../../helpers';
|
||||||
import Turnstile from 'react-turnstile';
|
import Turnstile from 'react-turnstile';
|
||||||
import { UserContext } from '../context/User';
|
import { UserContext } from '../../context/User';
|
||||||
import {
|
import {
|
||||||
Avatar,
|
Avatar,
|
||||||
Banner,
|
Banner,
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Card, Spin, Tabs } from '@douyinfe/semi-ui';
|
import { Card, Spin, Tabs } from '@douyinfe/semi-ui';
|
||||||
|
|
||||||
import { API, showError, showSuccess } from '../helpers';
|
import { API, showError, showSuccess } from '../../helpers/index.js';
|
||||||
import SettingsChats from '../pages/Setting/Operation/SettingsChats.js';
|
import SettingsChats from '../../pages/Setting/Operation/SettingsChats.js';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import RequestRateLimit from '../pages/Setting/RateLimit/SettingsRequestRateLimit.js';
|
import RequestRateLimit from '../../pages/Setting/RateLimit/SettingsRequestRateLimit.js';
|
||||||
|
|
||||||
const RateLimitSetting = () => {
|
const RateLimitSetting = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
showError,
|
showError,
|
||||||
showSuccess,
|
showSuccess,
|
||||||
verifyJSON
|
verifyJSON
|
||||||
} from '../helpers';
|
} from '../../helpers';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const SystemSetting = () => {
|
const SystemSetting = () => {
|
||||||
@@ -8,9 +8,9 @@ import {
|
|||||||
renderGroup,
|
renderGroup,
|
||||||
renderNumberWithPoint,
|
renderNumberWithPoint,
|
||||||
renderQuota
|
renderQuota
|
||||||
} from '../helpers';
|
} from '../../helpers/index.js';
|
||||||
|
|
||||||
import { CHANNEL_OPTIONS, ITEMS_PER_PAGE } from '../constants';
|
import { CHANNEL_OPTIONS, ITEMS_PER_PAGE } from '../../constants/index.js';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Divider,
|
Divider,
|
||||||
@@ -29,7 +29,7 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
Select
|
Select
|
||||||
} from '@douyinfe/semi-ui';
|
} from '@douyinfe/semi-ui';
|
||||||
import EditChannel from '../pages/Channel/EditChannel';
|
import EditChannel from '../../pages/Channel/EditChannel.js';
|
||||||
import {
|
import {
|
||||||
IconList,
|
IconList,
|
||||||
IconTreeTriangleDown,
|
IconTreeTriangleDown,
|
||||||
@@ -46,8 +46,8 @@ import {
|
|||||||
IconCopy,
|
IconCopy,
|
||||||
IconSmallTriangleRight
|
IconSmallTriangleRight
|
||||||
} from '@douyinfe/semi-icons';
|
} from '@douyinfe/semi-icons';
|
||||||
import { loadChannelModels } from '../helpers';
|
import { loadChannelModels } from '../../helpers/index.js';
|
||||||
import EditTagModal from '../pages/Channel/EditTagModal.js';
|
import EditTagModal from '../../pages/Channel/EditTagModal.js';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const ChannelsTable = () => {
|
const ChannelsTable = () => {
|
||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
renderQuota,
|
renderQuota,
|
||||||
stringToColor,
|
stringToColor,
|
||||||
getLogOther
|
getLogOther
|
||||||
} from '../helpers';
|
} from '../../helpers';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Avatar,
|
Avatar,
|
||||||
@@ -41,7 +41,7 @@ import {
|
|||||||
Input,
|
Input,
|
||||||
DatePicker,
|
DatePicker,
|
||||||
} from '@douyinfe/semi-ui';
|
} from '@douyinfe/semi-ui';
|
||||||
import { ITEMS_PER_PAGE } from '../constants';
|
import { ITEMS_PER_PAGE } from '../../constants';
|
||||||
import Paragraph from '@douyinfe/semi-ui/lib/es/typography/paragraph';
|
import Paragraph from '@douyinfe/semi-ui/lib/es/typography/paragraph';
|
||||||
import {
|
import {
|
||||||
IconRefresh,
|
IconRefresh,
|
||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
showError,
|
showError,
|
||||||
showSuccess,
|
showSuccess,
|
||||||
timestamp2string,
|
timestamp2string,
|
||||||
} from '../helpers';
|
} from '../../helpers';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
Tag,
|
Tag,
|
||||||
Typography,
|
Typography,
|
||||||
} from '@douyinfe/semi-ui';
|
} from '@douyinfe/semi-ui';
|
||||||
import { ITEMS_PER_PAGE } from '../constants';
|
import { ITEMS_PER_PAGE } from '../../constants';
|
||||||
import {
|
import {
|
||||||
IconEyeOpened,
|
IconEyeOpened,
|
||||||
IconSearch,
|
IconSearch,
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext, useEffect, useRef, useMemo, useState } from 'react';
|
import React, { useContext, useEffect, useRef, useMemo, useState } from 'react';
|
||||||
import { API, copy, showError, showInfo, showSuccess } from '../helpers';
|
import { API, copy, showError, showInfo, showSuccess } from '../../helpers/index.js';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -26,9 +26,9 @@ import {
|
|||||||
IconInfoCircle,
|
IconInfoCircle,
|
||||||
IconCrown,
|
IconCrown,
|
||||||
} from '@douyinfe/semi-icons';
|
} from '@douyinfe/semi-icons';
|
||||||
import { UserContext } from '../context/User/index.js';
|
import { UserContext } from '../../context/User/index.js';
|
||||||
import { AlertCircle } from 'lucide-react';
|
import { AlertCircle } from 'lucide-react';
|
||||||
import { MODEL_CATEGORIES } from '../constants';
|
import { MODEL_CATEGORIES } from '../../constants/index.js';
|
||||||
|
|
||||||
const ModelPricing = () => {
|
const ModelPricing = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
showSuccess,
|
showSuccess,
|
||||||
timestamp2string,
|
timestamp2string,
|
||||||
renderQuota
|
renderQuota
|
||||||
} from '../helpers';
|
} from '../../helpers';
|
||||||
|
|
||||||
import { ITEMS_PER_PAGE } from '../constants';
|
import { ITEMS_PER_PAGE } from '../../constants';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
@@ -33,7 +33,7 @@ import {
|
|||||||
IconPlay,
|
IconPlay,
|
||||||
IconMore,
|
IconMore,
|
||||||
} from '@douyinfe/semi-icons';
|
} from '@douyinfe/semi-icons';
|
||||||
import EditRedemption from '../pages/Redemption/EditRedemption';
|
import EditRedemption from '../../pages/Redemption/EditRedemption';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
showError,
|
showError,
|
||||||
showSuccess,
|
showSuccess,
|
||||||
timestamp2string,
|
timestamp2string,
|
||||||
} from '../helpers';
|
} from '../../helpers';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
Tag,
|
Tag,
|
||||||
Typography,
|
Typography,
|
||||||
} from '@douyinfe/semi-ui';
|
} from '@douyinfe/semi-ui';
|
||||||
import { ITEMS_PER_PAGE } from '../constants';
|
import { ITEMS_PER_PAGE } from '../../constants';
|
||||||
import {
|
import {
|
||||||
IconEyeOpened,
|
IconEyeOpened,
|
||||||
IconSearch,
|
IconSearch,
|
||||||
@@ -8,9 +8,9 @@ import {
|
|||||||
timestamp2string,
|
timestamp2string,
|
||||||
renderGroup,
|
renderGroup,
|
||||||
renderQuota
|
renderQuota
|
||||||
} from '../helpers';
|
} from '../../helpers';
|
||||||
|
|
||||||
import { ITEMS_PER_PAGE } from '../constants';
|
import { ITEMS_PER_PAGE } from '../../constants';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
@@ -40,9 +40,9 @@ import {
|
|||||||
IconHistogram,
|
IconHistogram,
|
||||||
IconRotate,
|
IconRotate,
|
||||||
} from '@douyinfe/semi-icons';
|
} from '@douyinfe/semi-icons';
|
||||||
import EditToken from '../pages/Token/EditToken';
|
import EditToken from '../../pages/Token/EditToken';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { UserContext } from '../context/User';
|
import { UserContext } from '../../context/User';
|
||||||
|
|
||||||
function renderTimestamp(timestamp) {
|
function renderTimestamp(timestamp) {
|
||||||
return <>{timestamp2string(timestamp)}</>;
|
return <>{timestamp2string(timestamp)}</>;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { API, showError, showSuccess, renderGroup, renderNumber, renderQuota } from '../helpers';
|
import { API, showError, showSuccess, renderGroup, renderNumber, renderQuota } from '../../helpers';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
@@ -25,9 +25,9 @@ import {
|
|||||||
IconArrowUp,
|
IconArrowUp,
|
||||||
IconArrowDown,
|
IconArrowDown,
|
||||||
} from '@douyinfe/semi-icons';
|
} from '@douyinfe/semi-icons';
|
||||||
import { ITEMS_PER_PAGE } from '../constants';
|
import { ITEMS_PER_PAGE } from '../../constants';
|
||||||
import AddUser from '../pages/User/AddUser';
|
import AddUser from '../../pages/User/AddUser';
|
||||||
import EditUser from '../pages/User/EditUser';
|
import EditUser from '../../pages/User/EditUser';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
@@ -7,8 +7,9 @@ import { StatusProvider } from './context/Status';
|
|||||||
import { Layout } from '@douyinfe/semi-ui';
|
import { Layout } from '@douyinfe/semi-ui';
|
||||||
import { ThemeProvider } from './context/Theme';
|
import { ThemeProvider } from './context/Theme';
|
||||||
import { StyleProvider } from './context/Style/index.js';
|
import { StyleProvider } from './context/Style/index.js';
|
||||||
import PageLayout from './components/PageLayout.js';
|
import PageLayout from './components/layout/PageLayout.js';
|
||||||
import './i18n/i18n.js';
|
import './i18n/i18n.js';
|
||||||
|
import './index.css';
|
||||||
|
|
||||||
// initialization
|
// initialization
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ChannelsTable from '../../components/ChannelsTable';
|
import ChannelsTable from '../../components/table/ChannelsTable';
|
||||||
|
|
||||||
const File = () => {
|
const File = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import { StatusContext } from '../../context/Status';
|
|||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { IconGithubLogo } from '@douyinfe/semi-icons';
|
import { IconGithubLogo } from '@douyinfe/semi-icons';
|
||||||
import exampleImage from '../../images/example.png';
|
import exampleImage from '..//example.png';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import NoticeModal from '../../components/NoticeModal';
|
import NoticeModal from '../../components/layout/NoticeModal';
|
||||||
import { Moonshot, OpenAI, XAI, Zhipu, Volcengine, Cohere, Claude, Gemini, Suno, Minimax, Wenxin, Spark, Qingyan, DeepSeek, Qwen, Midjourney, Grok, AzureAI, Hunyuan, Xinference } from '@lobehub/icons';
|
import { Moonshot, OpenAI, XAI, Zhipu, Volcengine, Cohere, Claude, Gemini, Suno, Minimax, Wenxin, Spark, Qingyan, DeepSeek, Qwen, Midjourney, Grok, AzureAI, Hunyuan, Xinference } from '@lobehub/icons';
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import LogsTable from '../../components/LogsTable';
|
import LogsTable from '../../components/table/LogsTable';
|
||||||
|
|
||||||
const Token = () => (
|
const Token = () => (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import MjLogsTable from '../../components/MjLogsTable';
|
import MjLogsTable from '../../components/table/MjLogsTable';
|
||||||
|
|
||||||
const Midjourney = () => (
|
const Midjourney = () => (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ModelPricing from '../../components/ModelPricing.js';
|
import ModelPricing from '../../components/table/ModelPricing.js';
|
||||||
|
|
||||||
const Pricing = () => (
|
const Pricing = () => (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import RedemptionsTable from '../../components/RedemptionsTable';
|
import RedemptionsTable from '../../components/table/RedemptionsTable';
|
||||||
|
|
||||||
const Redemption = () => {
|
const Redemption = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ import { Layout, TabPane, Tabs } from '@douyinfe/semi-ui';
|
|||||||
import { useNavigate, useLocation } from 'react-router-dom';
|
import { useNavigate, useLocation } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import SystemSetting from '../../components/SystemSetting';
|
import SystemSetting from '../../components/settings/SystemSetting.js';
|
||||||
import { isRoot } from '../../helpers';
|
import { isRoot } from '../../helpers';
|
||||||
import OtherSetting from '../../components/OtherSetting';
|
import OtherSetting from '../../components/settings/OtherSetting';
|
||||||
import PersonalSetting from '../../components/PersonalSetting';
|
import PersonalSetting from '../../components/settings/PersonalSetting.js';
|
||||||
import OperationSetting from '../../components/OperationSetting';
|
import OperationSetting from '../../components/settings/OperationSetting.js';
|
||||||
import RateLimitSetting from '../../components/RateLimitSetting.js';
|
import RateLimitSetting from '../../components/settings/RateLimitSetting.js';
|
||||||
import ModelSetting from '../../components/ModelSetting.js';
|
import ModelSetting from '../../components/settings/ModelSetting.js';
|
||||||
|
|
||||||
const Setting = () => {
|
const Setting = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import TaskLogsTable from '../../components/TaskLogsTable.js';
|
import TaskLogsTable from '../../components/table/TaskLogsTable.js';
|
||||||
|
|
||||||
const Task = () => (
|
const Task = () => (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import TokensTable from '../../components/TokensTable';
|
import TokensTable from '../../components/table/TokensTable';
|
||||||
|
|
||||||
const Token = () => {
|
const Token = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import UsersTable from '../../components/UsersTable';
|
import UsersTable from '../../components/table/UsersTable';
|
||||||
|
|
||||||
const User = () => {
|
const User = () => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user