Fixe: model provider issues and improved some features #10703 (#11168)

### What problem does this PR solve?

Fixes: Fixed model provider issues and improved some features
- Removed the old login page
- Updated model provider icons
- Added RAPTOR modification range parameter

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-11-11 16:26:26 +08:00
committed by GitHub
parent 377c0fb4fa
commit 522c7b7ac6
74 changed files with 203 additions and 10981 deletions

View File

@ -11,14 +11,14 @@ import { useQuery } from '@tanstack/react-query';
import { useCallback, useState } from 'react';
import { useParams, useSearchParams } from 'umi';
import { LogTabs } from './dataset-common';
import { IFileLogList, IOverviewTital } from './interface';
import { IFileLogList, IOverviewTotal } from './interface';
const useFetchOverviewTital = () => {
const [searchParams] = useSearchParams();
const { id } = useParams();
const knowledgeBaseId = searchParams.get('id') || id;
const { data } = useQuery<IOverviewTital>({
queryKey: ['overviewTital'],
const { data } = useQuery<IOverviewTotal>({
queryKey: ['overviewTotal'],
queryFn: async () => {
const { data: res = {} } = await kbService.getKnowledgeBasicInfo({
kb_id: knowledgeBaseId,

View File

@ -128,6 +128,10 @@ const FileLogsPage: FC = () => {
setTopAllData((prev) => {
return {
...prev,
downloads: {
...prev.downloads,
success: topData?.downloaded || 0,
},
processing: {
value: topData?.processing || 0,
success: topData?.finished || 0,

View File

@ -20,11 +20,12 @@ export interface FileLogsTableProps {
active: (typeof LogTabs)[keyof typeof LogTabs];
}
export interface IOverviewTital {
export interface IOverviewTotal {
cancelled: number;
failed: number;
finished: number;
processing: number;
downloaded: number;
}
export interface IFileLogItem {

View File

@ -37,6 +37,7 @@ export const formSchema = z
threshold: z.number().optional(),
max_cluster: z.number().optional(),
random_seed: z.number().optional(),
scope: z.string().optional(),
})
.refine(
(data) => {

View File

@ -73,6 +73,7 @@ export default function DatasetSettings() {
threshold: 0.1,
max_cluster: 64,
random_seed: 0,
scope: 'file',
prompt: t('knowledgeConfiguration.promptText'),
},
graphrag: {
@ -252,7 +253,7 @@ export default function DatasetSettings() {
<GeneralForm></GeneralForm>
<Divider />
<div className="text-base font-medium text-text-primary">
{t('knowledgeConfiguration.gobalIndex')}
{t('knowledgeConfiguration.globalIndex')}
</div>
<GraphRagItems
className="border-none p-0"

View File

@ -157,7 +157,7 @@ const Login = () => {
{/* <SpotlightTopRight opcity={0.7} coverage={10} /> */}
<div className="absolute top-3 flex flex-col items-center mb-12 w-full text-text-primary">
<div className="flex items-center mb-4 w-full pl-10 pt-10 ">
<div className="w-12 h-12 p-2 rounded-lg bg-bg-base border-2 border-border flex items-center justify-center mr-3">
<div className="w-12 h-12 p-2 rounded-lg bg-bg-base flex items-center justify-center mr-3">
<img
src={'/logo.svg'}
alt="logo"

View File

@ -1,133 +0,0 @@
@import '../../theme/vars';
.loginPage {
display: flex;
background-color: rgba(255, 255, 255, 0.1);
.loginLeft {
// width: 610px;
width: 40%;
background-color: rgba(255, 255, 255, 0.1);
height: 100vh;
display: flex;
align-items: center;
}
.leftContainer {
width: 60%;
padding: 5px, 0px, 5px, 0px;
margin: 0 auto;
}
.thirdPartyLoginButton {
margin-top: 10px;
border-top: 1px solid rgba(0, 0, 0, 0.06);
// padding-top: 0px;
.ant-btn {
display: flex;
align-items: center;
justify-content: center;
height: 40px;
font-size: 14px;
border-radius: 4px;
border: 1px solid #d9d9d9;
background: #fff;
color: rgba(0, 0, 0, 0.85);
transition: all 0.3s;
&:hover {
color: #40a9ff;
border-color: #40a9ff;
}
.anticon {
font-size: 16px;
margin-right: 8px;
}
}
}
.loginRight {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
position: relative;
&::before {
content: ' ';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(24, 73, 169, 0.6);
background-image: url('@/assets/svg/login-background.svg');
background-size: cover;
background-blend-mode: multiply;
filter: blur(3px);
background-position: center;
z-index: -1;
}
.white {
}
.pink {
color: #e9d7fe;
}
.rightPanel {
max-width: 670px;
.loginTitle {
font-size: 68px;
font-style: normal;
font-weight: 600;
line-height: 90px;
letter-spacing: -1.44px;
}
.loginDescription {
font-size: 20px;
font-style: normal;
font-weight: 500;
line-height: 30px;
}
.loginRateNumber {
font-size: 16px;
font-style: normal;
font-weight: 600;
line-height: 24px;
}
.loginRateReviews {
font-size: 16px;
font-style: normal;
font-weight: 500;
line-height: 24px;
}
}
}
.loginTitle {
//styleName: Heading/1;
font-size: 38px;
font-weight: 600;
line-height: 46px;
letter-spacing: 0em;
height: 80px;
margin-bottom: 69px;
// text-align: center;
span {
font-size: 16px;
line-height: 24px;
}
}
@media screen and (max-width: 957px) {
.loginLeft {
width: 100%;
height: 100%;
}
.modal {
width: 80%;
}
}
}

View File

@ -1,206 +0,0 @@
import SvgIcon from '@/components/svg-icon';
import { useAuth } from '@/hooks/auth-hooks';
import {
useLogin,
useLoginChannels,
useLoginWithChannel,
useRegister,
} from '@/hooks/login-hooks';
import { useSystemConfig } from '@/hooks/system-hooks';
import { rsaPsw } from '@/utils';
import { Button, Checkbox, Form, Input } from 'antd';
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'umi';
import RightPanel from './right-panel';
import styles from './index.less';
const Login = () => {
const [title, setTitle] = useState('login');
const navigate = useNavigate();
const { login, loading: signLoading } = useLogin();
const { register, loading: registerLoading } = useRegister();
const { channels, loading: channelsLoading } = useLoginChannels();
const { login: loginWithChannel, loading: loginWithChannelLoading } =
useLoginWithChannel();
const { t } = useTranslation('translation', { keyPrefix: 'login' });
const loading =
signLoading ||
registerLoading ||
channelsLoading ||
loginWithChannelLoading;
const { config } = useSystemConfig();
const registerEnabled = config?.registerEnabled !== 0;
const { isLogin } = useAuth();
useEffect(() => {
if (isLogin) {
navigate('/');
}
}, [isLogin, navigate]);
const handleLoginWithChannel = async (channel: string) => {
await loginWithChannel(channel);
};
const changeTitle = () => {
if (title === 'login' && !registerEnabled) {
return;
}
setTitle((title) => (title === 'login' ? 'register' : 'login'));
};
const [form] = Form.useForm();
useEffect(() => {
form.validateFields(['nickname']);
}, [form]);
const onCheck = async () => {
try {
const params = await form.validateFields();
const rsaPassWord = rsaPsw(params.password) as string;
if (title === 'login') {
const code = await login({
email: `${params.email}`.trim(),
password: rsaPassWord,
});
if (code === 0) {
navigate('/');
}
} else {
const code = await register({
nickname: params.nickname,
email: params.email,
password: rsaPassWord,
});
if (code === 0) {
setTitle('login');
}
}
} catch (errorInfo) {
console.log('Failed:', errorInfo);
}
};
const formItemLayout = {
labelCol: { span: 6 },
// wrapperCol: { span: 8 },
};
return (
<div className={styles.loginPage}>
<div className={styles.loginLeft}>
<div className={styles.leftContainer}>
<div className={styles.loginTitle}>
<div>{title === 'login' ? t('login') : t('register')}</div>
<span>
{title === 'login'
? t('loginDescription')
: t('registerDescription')}
</span>
</div>
<Form
form={form}
layout="vertical"
name="dynamic_rule"
style={{ maxWidth: 600 }}
>
<Form.Item
{...formItemLayout}
name="email"
label={t('emailLabel')}
rules={[{ required: true, message: t('emailPlaceholder') }]}
>
<Input size="large" placeholder={t('emailPlaceholder')} />
</Form.Item>
{title === 'register' && (
<Form.Item
{...formItemLayout}
name="nickname"
label={t('nicknameLabel')}
rules={[{ required: true, message: t('nicknamePlaceholder') }]}
>
<Input size="large" placeholder={t('nicknamePlaceholder')} />
</Form.Item>
)}
<Form.Item
{...formItemLayout}
name="password"
label={t('passwordLabel')}
rules={[{ required: true, message: t('passwordPlaceholder') }]}
>
<Input.Password
size="large"
placeholder={t('passwordPlaceholder')}
onPressEnter={onCheck}
/>
</Form.Item>
{title === 'login' && (
<Form.Item name="remember" valuePropName="checked">
<Checkbox> {t('rememberMe')}</Checkbox>
</Form.Item>
)}
<div>
{title === 'login' && registerEnabled && (
<div>
{t('signInTip')}
<Button type="link" onClick={changeTitle}>
{t('signUp')}
</Button>
</div>
)}
{title === 'register' && (
<div>
{t('signUpTip')}
<Button type="link" onClick={changeTitle}>
{t('login')}
</Button>
</div>
)}
</div>
<Button
type="primary"
block
size="large"
onClick={onCheck}
loading={loading}
>
{title === 'login' ? t('login') : t('continue')}
</Button>
{title === 'login' && channels && channels.length > 0 && (
<div className={styles.thirdPartyLoginButton}>
{channels.map((item) => (
<Button
key={item.channel}
block
size="large"
onClick={() => handleLoginWithChannel(item.channel)}
style={{ marginTop: 10 }}
>
<div className="flex items-center">
<SvgIcon
name={item.icon || 'sso'}
width={20}
height={20}
style={{ marginRight: 5 }}
/>
Sign in with {item.display_name}
</div>
</Button>
))}
</div>
)}
</Form>
</div>
</div>
<div className={styles.loginRight}>
<RightPanel></RightPanel>
</div>
</div>
);
};
export default Login;

View File

@ -1,47 +0,0 @@
import { ReactComponent as Avatars } from '@/assets/svg/login-avatars.svg';
import SvgIcon from '@/components/svg-icon';
import { Flex, Rate, Space, Typography } from 'antd';
import classNames from 'classnames';
import { useTranslate } from '@/hooks/common-hooks';
import styles from './index.less';
const { Title, Text } = Typography;
const LoginRightPanel = () => {
const { t } = useTranslate('login');
return (
<section className={styles.rightPanel}>
<SvgIcon name="login-star" width={80}></SvgIcon>
<Flex vertical gap={40}>
<Title
level={1}
className={classNames(styles.white, styles.loginTitle)}
>
{t('title')}
</Title>
<Text className={classNames(styles.pink, styles.loginDescription)}>
{t('description')}
</Text>
<Flex align="center" gap={16}>
<Avatars></Avatars>
<Flex vertical>
<Space>
<Rate disabled defaultValue={5} />
<span
className={classNames(styles.white, styles.loginRateNumber)}
>
5.0
</span>
</Space>
<span className={classNames(styles.pink, styles.loginRateReviews)}>
{t('review')}
</span>
</Flex>
</Flex>
</Flex>
</section>
);
};
export default LoginRightPanel;

View File

@ -108,6 +108,7 @@ export const DataSourceFormFields = {
name: 'config.prefix',
type: FormFieldType.Text,
required: false,
tooltip: t('setting.s3PrefixTip'),
},
],
[DataSourceKey.NOTION]: [
@ -164,16 +165,14 @@ export const DataSourceFormFields = {
name: 'config.wiki_base',
type: FormFieldType.Text,
required: false,
tooltip:
'The base URL of your Confluence instance (e.g., https://your-domain.atlassian.net/wiki)',
tooltip: t('setting.confluenceWikiBaseUrlTip'),
},
{
label: 'Is Cloud',
name: 'config.is_cloud',
type: FormFieldType.Checkbox,
required: false,
tooltip:
'Check if this is a Confluence Cloud instance, uncheck for Confluence Server/Data Center',
tooltip: t('setting.confluenceIsCloudTip'),
},
],
[DataSourceKey.GOOGLE_DRIVE]: [

View File

@ -45,7 +45,7 @@ export const AvailableModels: FC<{
const [selectedTag, setSelectedTag] = useState<string | null>(null);
const filteredModels = useMemo(() => {
return factoryList.filter((model) => {
const models = factoryList.filter((model) => {
const matchesSearch = model.name
.toLowerCase()
.includes(searchTerm.toLowerCase());
@ -54,6 +54,7 @@ export const AvailableModels: FC<{
model.tags.split(',').some((tag) => tag.trim() === selectedTag);
return matchesSearch && matchesTag;
});
return models;
}, [factoryList, searchTerm, selectedTag]);
const allTags = useMemo(() => {
@ -124,7 +125,7 @@ export const AvailableModels: FC<{
className=" border border-border-default rounded-lg p-3 hover:bg-bg-input transition-colors group"
>
<div className="flex items-center space-x-3 mb-3">
<LlmIcon name={model.name} imgClass="h-8 w-auto" />
<LlmIcon name={model.name} imgClass="h-8 w-8 text-text-primary" />
<div className="flex-1">
<h3 className="font-medium truncate">{model.name}</h3>
</div>

View File

@ -77,11 +77,11 @@ export function SideBar() {
)}
<span>{item.label}</span>
</section>
{item.key === Routes.System && (
{/* {item.key === Routes.System && (
<div className="mr-2 px-2 bg-accent-primary-5 text-accent-primary rounded-md">
{version}
</div>
)}
)} */}
{/* {active && (
<div className="absolute right-0 w-[5px] h-[66px] bg-primary rounded-l-xl shadow-[0_0_5.94px_#7561ff,0_0_11.88px_#7561ff,0_0_41.58px_#7561ff,0_0_83.16px_#7561ff,0_0_142.56px_#7561ff,0_0_249.48px_#7561ff]" />
)} */}
@ -93,7 +93,10 @@ export function SideBar() {
</div>
<div className="p-6 mt-auto ">
<div className="flex items-center gap-2 mb-6 justify-end">
<div className="flex items-center gap-2 mb-6 justify-between">
<div className="mr-2 px-2 text-accent-primary rounded-md">
{version}
</div>
<ThemeToggle />
</div>
<Button