-
{app.title}
-
- {formatDate(app.update_time)}
-
+
+
+
+
+ CN
+
+
+
+ {app.title}
+
+
+ {formatDate(app.update_time)}
+
+
+
+
);
diff --git a/web/src/pages/home/applications.tsx b/web/src/pages/home/applications.tsx
index 29e8291b6..60ccba714 100644
--- a/web/src/pages/home/applications.tsx
+++ b/web/src/pages/home/applications.tsx
@@ -1,48 +1,21 @@
+import { IconFont } from '@/components/icon-font';
import { Segmented, SegmentedValue } from '@/components/ui/segmented';
import { Routes } from '@/routes';
-import { Cpu, MessageSquare, Search } from 'lucide-react';
import { useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'umi';
import { Agents } from './agent-list';
-import { ApplicationCard, SeeAllAppCard } from './application-card';
+import { SeeAllAppCard } from './application-card';
import { ChatList } from './chat-list';
-const applications = [
- {
- id: 1,
- title: 'Jarvis chatbot',
- type: 'Chat app',
- update_time: '11/24/2024',
- avatar:
,
- },
- {
- id: 2,
- title: 'Search app 01',
- type: 'Search app',
- update_time: '11/24/2024',
- avatar:
,
- },
- {
- id: 3,
- title: 'Chatbot 01',
- type: 'Chat app',
- update_time: '11/24/2024',
- avatar:
,
- },
- {
- id: 4,
- title: 'Workflow 01',
- type: 'Agent',
- update_time: '11/24/2024',
- avatar:
,
- },
-];
-
-const All = 'all';
+const IconMap = {
+ [Routes.Chats]: 'chat',
+ [Routes.Searches]: 'search',
+ [Routes.Agents]: 'agent',
+};
export function Applications() {
- const [val, setVal] = useState('all');
+ const [val, setVal] = useState(Routes.Chats);
const { t } = useTranslation();
const navigate = useNavigate();
@@ -52,10 +25,6 @@ export function Applications() {
const options = useMemo(
() => [
- {
- label: 'All',
- value: All,
- },
{ value: Routes.Chats, label: t('header.chat') },
{ value: Routes.Searches, label: t('header.search') },
{ value: Routes.Agents, label: t('header.flow') },
@@ -70,7 +39,13 @@ export function Applications() {
return (
-
Applications
+
+
+ {options.find((x) => x.value === val)?.label}
+
- {(val === All || val === Routes.Searches) &&
- [...Array(12)].map((_, i) => {
- const app = applications[i % 4];
- return
;
- })}
{val === Routes.Agents &&
}
{val === Routes.Chats &&
}
- {val === All ||
}
+ {
}
);
diff --git a/web/src/pages/home/banner.tsx b/web/src/pages/home/banner.tsx
index 84a784cef..284ceae94 100644
--- a/web/src/pages/home/banner.tsx
+++ b/web/src/pages/home/banner.tsx
@@ -1,5 +1,6 @@
import { Card, CardContent } from '@/components/ui/card';
import { ArrowRight, X } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
function BannerCard() {
return (
@@ -39,9 +40,10 @@ export function Banner() {
}
export function NextBanner() {
+ const { t } = useTranslation();
return (
- Welcome to
+ {t('header.welcome')}
RAGFlow
diff --git a/web/src/pages/home/datasets.tsx b/web/src/pages/home/datasets.tsx
index 183ea903f..85fdf848c 100644
--- a/web/src/pages/home/datasets.tsx
+++ b/web/src/pages/home/datasets.tsx
@@ -1,10 +1,13 @@
+import { IconFont } from '@/components/icon-font';
import { RenameDialog } from '@/components/rename-dialog';
import { CardSkeleton } from '@/components/ui/skeleton';
import { useFetchNextKnowledgeListByPage } from '@/hooks/use-knowledge-request';
+import { useTranslation } from 'react-i18next';
import { DatasetCard, SeeAllCard } from '../datasets/dataset-card';
import { useRenameDataset } from '../datasets/use-rename-dataset';
export function Datasets() {
+ const { t } = useTranslation();
const { kbs, loading } = useFetchNextKnowledgeListByPage();
const {
datasetRenameLoading,
@@ -17,7 +20,10 @@ export function Datasets() {
return (
- Datasets
+
+
+ {t('header.knowledgeBase')}
+