diff --git a/web/src/components/page-header.tsx b/web/src/components/page-header.tsx index cc52e3795..85c476bd3 100644 --- a/web/src/components/page-header.tsx +++ b/web/src/components/page-header.tsx @@ -1,25 +1,8 @@ -import { ArrowLeft } from 'lucide-react'; -import { PropsWithChildren, ReactNode } from 'react'; -import { Button } from './ui/button'; +import { PropsWithChildren } from 'react'; -interface IPageHeaderProps extends PropsWithChildren { - back(): void; - title: ReactNode; -} - -export function PageHeader({ back, title, children }: IPageHeaderProps) { +export function PageHeader({ children }: PropsWithChildren) { return ( -
-
-
- -
-
-

{title}

-
-
+
{children}
); diff --git a/web/src/components/ui/breadcrumb.tsx b/web/src/components/ui/breadcrumb.tsx index f1eb7e913..5c16396cf 100644 --- a/web/src/components/ui/breadcrumb.tsx +++ b/web/src/components/ui/breadcrumb.tsx @@ -33,7 +33,10 @@ const BreadcrumbItem = React.forwardRef< >(({ className, ...props }, ref) => (
  • )); diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts index 882dc6cb5..881a5ebe6 100644 --- a/web/src/locales/en.ts +++ b/web/src/locales/en.ts @@ -1302,6 +1302,10 @@ This delimiter is used to split the input text into several text pieces echo of tavilySearchDescription: 'Search results via Tavily service.', tavilyExtract: 'Tavily Extract', tavilyExtractDescription: 'Tavily Extract', + log: 'Log', + management: 'Management', + import: 'Import', + export: 'Export', }, llmTools: { bad_calculator: { diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts index b37e6e2c3..772dd5469 100644 --- a/web/src/locales/zh.ts +++ b/web/src/locales/zh.ts @@ -1255,6 +1255,10 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于 tavilySearchDescription: '通过 Tavily 服务搜索结果', tavilyExtract: 'Tavily Extract', tavilyExtractDescription: 'Tavily Extract', + log: '日志', + management: '管理', + import: '导入', + export: '导出', }, footer: { profile: 'All rights reserved @ React', diff --git a/web/src/pages/agent/index.tsx b/web/src/pages/agent/index.tsx index dba6850f7..2eb850683 100644 --- a/web/src/pages/agent/index.tsx +++ b/web/src/pages/agent/index.tsx @@ -1,4 +1,12 @@ import { PageHeader } from '@/components/page-header'; +import { + Breadcrumb, + BreadcrumbItem, + BreadcrumbLink, + BreadcrumbList, + BreadcrumbPage, + BreadcrumbSeparator, +} from '@/components/ui/breadcrumb'; import { Button, ButtonLoading } from '@/components/ui/button'; import { DropdownMenu, @@ -89,32 +97,45 @@ export default function Agent() { return (
    - -
    + + + + + + Agent + + + + + {flowDetail.title} + + + +
    saveGraph()} loading={loading} > - Save + {t('flow.save')} @@ -125,12 +146,12 @@ export default function Agent() { - Import + {t('flow.import')} - Export + {t('flow.export')} diff --git a/web/src/pages/chunk/index-old.tsx b/web/src/pages/chunk/index-old.tsx deleted file mode 100644 index 99761dcbd..000000000 --- a/web/src/pages/chunk/index-old.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { PageHeader } from '@/components/page-header'; -import { Button } from '@/components/ui/button'; -import { Segmented, SegmentedValue } from '@/components/ui/segmented'; -import { - QueryStringMap, - useNavigatePage, -} from '@/hooks/logic-hooks/navigate-hooks'; -import { Routes } from '@/routes'; -import { EllipsisVertical, Save } from 'lucide-react'; -import { useMemo } from 'react'; -import { Outlet, useLocation } from 'umi'; - -export default function ChunkPage() { - const { navigateToDataset, getQueryString, navigateToChunk } = - useNavigatePage(); - const location = useLocation(); - - const options = useMemo(() => { - return [ - { - label: 'Parsed results', - value: Routes.ParsedResult, - }, - { - label: 'Chunk result', - value: Routes.ChunkResult, - }, - { - label: 'Result view', - value: Routes.ResultView, - }, - ]; - }, []); - - const path = useMemo(() => { - return location.pathname.split('/').slice(0, 3).join('/'); - }, [location.pathname]); - - return ( -
    - -
    - void} - className="bg-colors-background-inverse-standard text-colors-text-neutral-standard" - > -
    -
    - - -
    -
    - -
    - ); -} diff --git a/web/src/pages/chunk/index.tsx b/web/src/pages/chunk/index.tsx index 99761dcbd..19a6b00ef 100644 --- a/web/src/pages/chunk/index.tsx +++ b/web/src/pages/chunk/index.tsx @@ -1,4 +1,12 @@ import { PageHeader } from '@/components/page-header'; +import { + Breadcrumb, + BreadcrumbItem, + BreadcrumbLink, + BreadcrumbList, + BreadcrumbPage, + BreadcrumbSeparator, +} from '@/components/ui/breadcrumb'; import { Button } from '@/components/ui/button'; import { Segmented, SegmentedValue } from '@/components/ui/segmented'; import { @@ -38,12 +46,24 @@ export default function ChunkPage() { return (
    - + + + + + + Agent + + + + + xxx + + +
    { @@ -47,6 +56,7 @@ const Chunk = () => { } = useFetchNextChunkList(); const { handleChunkCardClick, selectedChunkId } = useHandleChunkCardClick(); const isPdf = documentInfo?.type === 'pdf'; + const { data: dataset } = useFetchKnowledgeBaseConfiguration(); const { t } = useTranslation(); const { changeChunkTextMode, textMode } = useChangeChunkTextMode(); @@ -61,7 +71,8 @@ const Chunk = () => { chunkUpdatingVisible, documentId, } = useUpdateChunk(); - const { navigateToDataset, getQueryString } = useNavigatePage(); + const { navigateToDataset, getQueryString, navigateToDatasetList } = + useNavigatePage(); useEffect(() => { setChunkList(data); }, [data]); @@ -164,10 +175,31 @@ const Chunk = () => { return ( <> - + + + + + + {t('knowledgeDetails.dataset')} + + + + + + {dataset.name} + + + + + {documentInfo.name} + + + +
    diff --git a/web/src/pages/chunk/parsed-result/index-old.tsx b/web/src/pages/chunk/parsed-result/index-old.tsx deleted file mode 100644 index 0fecb95a3..000000000 --- a/web/src/pages/chunk/parsed-result/index-old.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import ParsedResultPanel from '../parsed-result-panel'; - -export default function ParsedResult() { - return ( -
    -
    - -
    - ); -} diff --git a/web/src/pages/dataset/index.tsx b/web/src/pages/dataset/index.tsx index d5be364dd..6830569f0 100644 --- a/web/src/pages/dataset/index.tsx +++ b/web/src/pages/dataset/index.tsx @@ -1,17 +1,40 @@ import { PageHeader } from '@/components/page-header'; +import { + Breadcrumb, + BreadcrumbItem, + BreadcrumbLink, + BreadcrumbList, + BreadcrumbPage, + BreadcrumbSeparator, +} from '@/components/ui/breadcrumb'; import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks'; +import { useFetchKnowledgeBaseConfiguration } from '@/hooks/use-knowledge-request'; +import { useTranslation } from 'react-i18next'; import { Outlet } from 'umi'; import { SideBar } from './sidebar'; export default function DatasetWrapper() { const { navigateToDatasetList } = useNavigatePage(); + const { t } = useTranslation(); + const { data } = useFetchKnowledgeBaseConfiguration(); return (
    - + + + + + + {t('knowledgeDetails.dataset')} + + + + + {data.name} + + + +
    diff --git a/web/src/pages/profile-setting/index.tsx b/web/src/pages/profile-setting/index.tsx index 3601e5196..88be7acd9 100644 --- a/web/src/pages/profile-setting/index.tsx +++ b/web/src/pages/profile-setting/index.tsx @@ -1,34 +1,45 @@ import { PageHeader } from '@/components/page-header'; +import { + Breadcrumb, + BreadcrumbItem, + BreadcrumbLink, + BreadcrumbList, + BreadcrumbPage, + BreadcrumbSeparator, +} from '@/components/ui/breadcrumb'; import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks'; +import { House } from 'lucide-react'; +import { useTranslation } from 'react-i18next'; import { Outlet } from 'umi'; import { SideBar } from './sidebar'; export default function ProfileSetting() { const { navigateToHome } = useNavigatePage(); + const { t } = useTranslation(); return (
    - {/*
    -
    - -
    -
    -

    - Profile & settings -

    -
    -
    */} - - + + + + + + + + + + + {t('setting.profile')} + + + +
    - {/*

    {title}

    */}