mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
remove showDeleteConfirm function and center the Empty of knowledge list and extract the text of the login page to en.json (#203)
feat: remove showDeleteConfirm function feat: center the Empty of knowledge list feat: extract the text of the login page to en.json #204
This commit is contained in:
@ -44,4 +44,7 @@
|
||||
.knowledgeCardContainer {
|
||||
padding: 0 60px;
|
||||
overflow: auto;
|
||||
.knowledgeEmpty {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,22 +6,22 @@ import { Button, Empty, Flex, Space, Spin } from 'antd';
|
||||
import KnowledgeCard from './knowledge-card';
|
||||
import KnowledgeCreatingModal from './knowledge-creating-modal';
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import styles from './index.less';
|
||||
|
||||
const Knowledge = () => {
|
||||
const { list, loading } = useFetchKnowledgeList();
|
||||
const userInfo = useSelectUserInfo();
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'knowledgeList' });
|
||||
|
||||
return (
|
||||
<Flex className={styles.knowledge} vertical flex={1}>
|
||||
<div className={styles.topWrapper}>
|
||||
<div>
|
||||
<span className={styles.title}>
|
||||
Welcome back, {userInfo.nickname}
|
||||
{t('welcome')}, {userInfo.nickname}
|
||||
</span>
|
||||
<p className={styles.description}>
|
||||
Which database are we going to use today?
|
||||
</p>
|
||||
<p className={styles.description}>{t('description')}</p>
|
||||
</div>
|
||||
<Space size={'large'}>
|
||||
{/* <Button icon={<FilterIcon />} className={styles.filterButton}>
|
||||
@ -38,7 +38,7 @@ const Knowledge = () => {
|
||||
}}
|
||||
className={styles.topButton}
|
||||
>
|
||||
Create knowledge base
|
||||
{t('createKnowledgeBase')}
|
||||
</Button>
|
||||
<KnowledgeCreatingModal
|
||||
visible={visible}
|
||||
@ -62,7 +62,7 @@ const Knowledge = () => {
|
||||
);
|
||||
})
|
||||
) : (
|
||||
<Empty></Empty>
|
||||
<Empty className={styles.knowledgeEmpty}></Empty>
|
||||
)}
|
||||
</Flex>
|
||||
</Spin>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ReactComponent as MoreIcon } from '@/assets/svg/more.svg';
|
||||
import { KnowledgeRouteKey } from '@/constants/knowledge';
|
||||
import { useShowDeleteConfirm } from '@/hooks/commonHooks';
|
||||
import { IKnowledge } from '@/interfaces/database/knowledge';
|
||||
import { formatDate } from '@/utils/date';
|
||||
import {
|
||||
@ -11,7 +12,6 @@ import {
|
||||
import { Avatar, Card, Dropdown, MenuProps, Space } from 'antd';
|
||||
import { useDispatch, useNavigate } from 'umi';
|
||||
|
||||
import showDeleteConfirm from '@/components/deleting-confirm';
|
||||
import styles from './index.less';
|
||||
|
||||
interface IProps {
|
||||
@ -21,6 +21,7 @@ interface IProps {
|
||||
const KnowledgeCard = ({ item }: IProps) => {
|
||||
const navigate = useNavigate();
|
||||
const dispatch = useDispatch();
|
||||
const showDeleteConfirm = useShowDeleteConfirm();
|
||||
|
||||
const removeKnowledge = () => {
|
||||
return dispatch({
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { IModalManagerChildrenProps } from '@/components/modal-manager';
|
||||
import { KnowledgeRouteKey } from '@/constants/knowledge';
|
||||
import { Form, Input, Modal } from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useDispatch, useNavigate, useSelector } from 'umi';
|
||||
|
||||
type FieldType = {
|
||||
@ -17,6 +18,7 @@ const KnowledgeCreatingModal = ({
|
||||
(state: any) => state.loading.effects['kSModel/createKb'],
|
||||
);
|
||||
const navigate = useNavigate();
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'knowledgeList' });
|
||||
|
||||
const handleOk = async () => {
|
||||
const ret = await form.validateFields();
|
||||
@ -50,7 +52,7 @@ const KnowledgeCreatingModal = ({
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Create knowledge base"
|
||||
title={t('createKnowledgeBase')}
|
||||
open={visible}
|
||||
onOk={handleOk}
|
||||
onCancel={handleCancel}
|
||||
@ -67,11 +69,11 @@ const KnowledgeCreatingModal = ({
|
||||
form={form}
|
||||
>
|
||||
<Form.Item<FieldType>
|
||||
label="Name"
|
||||
label={t('name')}
|
||||
name="name"
|
||||
rules={[{ required: true, message: 'Please input name!' }]}
|
||||
rules={[{ required: true, message: t('namePlaceholder') }]}
|
||||
>
|
||||
<Input />
|
||||
<Input placeholder={t('namePlaceholder')} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user