From a103324f25ee7abc78a62b786126e90a43d27db7 Mon Sep 17 00:00:00 2001 From: twwu Date: Wed, 18 Jun 2025 18:03:43 +0800 Subject: [PATCH] refactor: enhance UI components with new icons and improved styling in billing and dataset processes --- .../billing/priority-label/index.tsx | 31 ++- .../create/embedding-process/index.tsx | 193 +++++++++--------- .../datasets/create/step-three/index.tsx | 60 ++++-- .../processing/embedding-process/index.tsx | 193 ++++++++++-------- 4 files changed, 256 insertions(+), 221 deletions(-) diff --git a/web/app/components/billing/priority-label/index.tsx b/web/app/components/billing/priority-label/index.tsx index d63d7ba460..98c6a982b8 100644 --- a/web/app/components/billing/priority-label/index.tsx +++ b/web/app/components/billing/priority-label/index.tsx @@ -6,11 +6,8 @@ import { } from '../type' import cn from '@/utils/classnames' import { useProviderContext } from '@/context/provider-context' -import { - ZapFast, - ZapNarrow, -} from '@/app/components/base/icons/src/vender/solid/general' import Tooltip from '@/app/components/base/tooltip' +import { RiAedFill } from '@remixicon/react' type PriorityLabelProps = { className?: string @@ -34,30 +31,26 @@ const PriorityLabel = ({ className }: PriorityLabelProps) => { return ( -
{`${t('billing.plansCommon.documentProcessingPriority')}: ${t(`billing.plansCommon.priority.${priority}`)}`}
+
{`${t('billing.plansCommon.documentProcessingPriority')}: ${t(`billing.plansCommon.priority.${priority}`)}`}
{ priority !== DocumentProcessingPriority.topPriority && ( -
{t('billing.plansCommon.documentProcessingPriorityTip')}
+
{t('billing.plansCommon.documentProcessingPriorityTip')}
) } }> - +
{ - plan.type === Plan.professional && ( - + (plan.type === Plan.professional || plan.type === Plan.team || plan.type === Plan.enterprise) && ( + ) } - { - (plan.type === Plan.team || plan.type === Plan.enterprise) && ( - - ) - } - {t(`billing.plansCommon.priority.${priority}`)} - + {t(`billing.plansCommon.priority.${priority}`)} +
) } diff --git a/web/app/components/datasets/create/embedding-process/index.tsx b/web/app/components/datasets/create/embedding-process/index.tsx index 2890670de3..3858057207 100644 --- a/web/app/components/datasets/create/embedding-process/index.tsx +++ b/web/app/components/datasets/create/embedding-process/index.tsx @@ -4,8 +4,8 @@ import useSWR from 'swr' import { useRouter } from 'next/navigation' import { useTranslation } from 'react-i18next' import { omit } from 'lodash-es' -import { ArrowRightIcon } from '@heroicons/react/24/solid' import { + RiArrowRightLine, RiCheckboxCircleFill, RiErrorWarningFill, RiLoader2Fill, @@ -31,6 +31,7 @@ import { sleep } from '@/utils' import { RETRIEVE_METHOD } from '@/types/app' import Tooltip from '@/app/components/base/tooltip' import { useInvalidDocumentList } from '@/service/knowledge/use-document' +import Divider from '@/app/components/base/divider' type Props = { datasetId: string @@ -252,102 +253,112 @@ const EmbeddingProcess: FC = ({ datasetId, batchId, documents = [], index return ( <> -
-
- {isEmbedding &&
- - {t('datasetDocuments.embedding.processing')} -
} +
+
+ {isEmbedding && ( + <> + + {t('datasetDocuments.embedding.processing')} + + )} {isEmbeddingCompleted && t('datasetDocuments.embedding.completed')}
-
- { - enableBilling && plan.type !== Plan.team && ( -
-
- -
-
- {t('billing.plansCommon.documentProcessingPriorityUpgrade')} -
- -
- ) - } -
- {indexingStatusBatchDetail.map(indexingStatusDetail => ( -
- {isSourceEmbedding(indexingStatusDetail) && ( -
- )} -
- {getSourceType(indexingStatusDetail.id) === DataSourceType.FILE && ( - //
- - )} - {getSourceType(indexingStatusDetail.id) === DataSourceType.NOTION && ( - - )} -
-
- {getSourceName(indexingStatusDetail.id)} -
- { - enableBilling && ( - - ) - } + { + enableBilling && plan.type !== Plan.team && ( +
+
+
- {isSourceEmbedding(indexingStatusDetail) && ( -
{`${getSourcePercent(indexingStatusDetail)}%`}
- )} - {indexingStatusDetail.indexing_status === 'error' && ( - - - - - - )} - {indexingStatusDetail.indexing_status === 'completed' && ( - - )} +
+ {t('billing.plansCommon.documentProcessingPriorityUpgrade')} +
+
-
- ))} + ) + } +
+ {indexingStatusBatchDetail.map(indexingStatusDetail => ( +
+ {isSourceEmbedding(indexingStatusDetail) && ( +
+ )} +
+ {getSourceType(indexingStatusDetail.id) === DataSourceType.FILE && ( + + )} + {getSourceType(indexingStatusDetail.id) === DataSourceType.NOTION && ( + + )} +
+
+ {getSourceName(indexingStatusDetail.id)} +
+ { + enableBilling && ( + + ) + } +
+ {isSourceEmbedding(indexingStatusDetail) && ( +
{`${getSourcePercent(indexingStatusDetail)}%`}
+ )} + {indexingStatusDetail.indexing_status === 'error' && ( + + + + + + )} + {indexingStatusDetail.indexing_status === 'completed' && ( + + )} +
+
+ ))} +
+ +
-
- -
- -
diff --git a/web/app/components/datasets/create/step-three/index.tsx b/web/app/components/datasets/create/step-three/index.tsx index cdaa003a23..3400313e99 100644 --- a/web/app/components/datasets/create/step-three/index.tsx +++ b/web/app/components/datasets/create/step-three/index.tsx @@ -7,6 +7,7 @@ import EmbeddingProcess from '../embedding-process' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import type { FullDocumentDetail, createDocumentResponse } from '@/models/datasets' import AppIcon from '@/app/components/base/app-icon' +import Divider from '@/app/components/base/divider' type StepThreeProps = { datasetId?: string @@ -21,31 +22,48 @@ const StepThree = ({ datasetId, datasetName, indexingType, creationCache, retrie const media = useBreakpoints() const isMobile = media === MediaType.mobile + const iconInfo = creationCache?.dataset?.icon_info || { + icon: '📙', + icon_type: 'emoji', + icon_background: '#FFF4ED', + icon_url: '', + } return ( -
-
-
+
+
+
{!datasetId && ( <> -
-
{t('datasetCreation.stepThree.creationTitle')}
-
{t('datasetCreation.stepThree.creationContent')}
-
- -
-
{t('datasetCreation.stepThree.label')}
-
{datasetName || creationCache?.dataset?.name}
+
+
{t('datasetCreation.stepThree.creationTitle')}
+
{t('datasetCreation.stepThree.creationContent')}
+
+
+ +
+
+ {t('datasetCreation.stepThree.label')} +
+
+ {datasetName || creationCache?.dataset?.name}
-
+ )} {datasetId && ( -
-
{t('datasetCreation.stepThree.additionTitle')}
-
{`${t('datasetCreation.stepThree.additionP1')} ${datasetName || creationCache?.dataset?.name} ${t('datasetCreation.stepThree.additionP2')}`}
+
+
{t('datasetCreation.stepThree.additionTitle')}
+
{`${t('datasetCreation.stepThree.additionP1')} ${datasetName || creationCache?.dataset?.name} ${t('datasetCreation.stepThree.additionP2')}`}
)}
{!isMobile && ( -
-
-
- +
+
+
+
-
{t('datasetCreation.stepThree.sideTipTitle')}
-
{t('datasetCreation.stepThree.sideTipContent')}
+
{t('datasetCreation.stepThree.sideTipTitle')}
+
{t('datasetCreation.stepThree.sideTipContent')}
)} diff --git a/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx index a01c208bb0..8a6720ec0d 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/index.tsx @@ -1,8 +1,9 @@ import React, { useEffect, useMemo, useState } from 'react' import { useRouter } from 'next/navigation' import { useTranslation } from 'react-i18next' -import { ArrowRightIcon } from '@heroicons/react/24/solid' import { + RiAedFill, + RiArrowRightLine, RiCheckboxCircleFill, RiErrorWarningFill, RiLoader2Fill, @@ -14,7 +15,6 @@ import type { IndexingStatusResponse } from '@/models/datasets' import NotionIcon from '@/app/components/base/notion-icon' import PriorityLabel from '@/app/components/billing/priority-label' import { Plan } from '@/app/components/billing/type' -import { ZapFast } from '@/app/components/base/icons/src/vender/solid/general' import UpgradeBtn from '@/app/components/billing/upgrade-btn' import { useProviderContext } from '@/context/provider-context' import Tooltip from '@/app/components/base/tooltip' @@ -25,6 +25,7 @@ import type { IndexingType } from '@/app/components/datasets/create/step-two' import type { RETRIEVE_METHOD } from '@/types/app' import { DatasourceType, type InitialDocumentDetail } from '@/models/pipeline' import { useIndexingStatusBatch, useProcessRule } from '@/service/knowledge/use-dataset' +import Divider from '@/app/components/base/divider' type EmbeddingProcessProps = { datasetId: string @@ -122,100 +123,112 @@ const EmbeddingProcess = ({ return ( <> -
-
- {isEmbedding &&
- - {t('datasetDocuments.embedding.processing')} -
} +
+
+ {isEmbedding && ( + <> + + {t('datasetDocuments.embedding.processing')} + + )} {isEmbeddingCompleted && t('datasetDocuments.embedding.completed')}
-
- { - enableBilling && plan.type !== Plan.team && ( -
-
- -
-
- {t('billing.plansCommon.documentProcessingPriorityUpgrade')} -
- -
- ) - } -
- {indexingStatusBatchDetail.map(indexingStatusDetail => ( -
- {isSourceEmbedding(indexingStatusDetail) && ( -
- )} -
- {getSourceType(indexingStatusDetail.id) === DatasourceType.localFile && ( - - )} - {getSourceType(indexingStatusDetail.id) === DatasourceType.onlineDocument && ( - - )} -
-
- {getSourceName(indexingStatusDetail.id)} -
- { - enableBilling && ( - - ) - } + { + enableBilling && plan.type !== Plan.team && ( +
+
+
- {isSourceEmbedding(indexingStatusDetail) && ( -
{`${getSourcePercent(indexingStatusDetail)}%`}
- )} - {indexingStatusDetail.indexing_status === 'error' && ( - - - - - - )} - {indexingStatusDetail.indexing_status === 'completed' && ( - - )} +
+ {t('billing.plansCommon.documentProcessingPriorityUpgrade')} +
+
-
- ))} + ) + } +
+ {indexingStatusBatchDetail.map(indexingStatusDetail => ( +
+ {isSourceEmbedding(indexingStatusDetail) && ( +
+ )} +
+ {getSourceType(indexingStatusDetail.id) === DatasourceType.localFile && ( + + )} + {getSourceType(indexingStatusDetail.id) === DatasourceType.onlineDocument && ( + + )} +
+
+ {getSourceName(indexingStatusDetail.id)} +
+ { + enableBilling && ( + + ) + } +
+ {isSourceEmbedding(indexingStatusDetail) && ( +
{`${getSourcePercent(indexingStatusDetail)}%`}
+ )} + {indexingStatusDetail.indexing_status === 'error' && ( + + + + + + )} + {indexingStatusDetail.indexing_status === 'completed' && ( + + )} +
+
+ ))} +
+ +
-
- -
- -