From 1e4167427c5e07dad95c236dc7841cb32459bf42 Mon Sep 17 00:00:00 2001 From: twwu Date: Tue, 26 Nov 2024 16:56:27 +0800 Subject: [PATCH] refactor: update processing status UI and add new CSS variables for success and error states --- .../documents/detail/segment-add/index.tsx | 40 ++++++++++++------- web/tailwind.config.js | 2 + web/themes/manual-dark.css | 2 + web/themes/manual-light.css | 2 + 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/web/app/components/datasets/documents/detail/segment-add/index.tsx b/web/app/components/datasets/documents/detail/segment-add/index.tsx index c1cb0629ed..17ddc86f74 100644 --- a/web/app/components/datasets/documents/detail/segment-add/index.tsx +++ b/web/app/components/datasets/documents/detail/segment-add/index.tsx @@ -26,7 +26,6 @@ export enum ProcessStatus { ERROR = 'error', } -// todo: Modify processing status const SegmentAdd: FC = ({ importStatus, clearProcessStatus, @@ -39,25 +38,36 @@ const SegmentAdd: FC = ({ return ( <> {(importStatus === ProcessStatus.WAITING || importStatus === ProcessStatus.PROCESSING) && ( -
- {importStatus === ProcessStatus.WAITING &&
} - {importStatus === ProcessStatus.PROCESSING &&
} - - {t('datasetDocuments.list.batchModal.processing')} +
+
+ + {t('datasetDocuments.list.batchModal.processing')}
)} {importStatus === ProcessStatus.COMPLETED && ( -
- - {t('datasetDocuments.list.batchModal.completed')} - {t('datasetDocuments.list.batchModal.ok')} +
+
+ + {t('datasetDocuments.list.batchModal.completed')} +
+
+ {t('datasetDocuments.list.batchModal.ok')} +
+
)} {importStatus === ProcessStatus.ERROR && ( -
- - {t('datasetDocuments.list.batchModal.error')} - {t('datasetDocuments.list.batchModal.ok')} +
+
+ + {t('datasetDocuments.list.batchModal.error')} +
+
+ {t('datasetDocuments.list.batchModal.ok')} +
+
)} @@ -68,7 +78,7 @@ const SegmentAdd: FC = ({
diff --git a/web/tailwind.config.js b/web/tailwind.config.js index 014af3f840..956cfb66f5 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -97,6 +97,8 @@ module.exports = { 'chatbot-bg': 'var(--color-chatbot-bg)', 'chat-bubble-bg': 'var(--color-chat-bubble-bg)', 'workflow-process-bg': 'var(--color-workflow-process-bg)', + 'dataset-chunk-process-success-bg': 'var(--color-dataset-chunk-process-success-bg)', + 'dataset-chunk-process-error-bg': 'var(--color-dataset-chunk-process-error-bg)', }, }, }, diff --git a/web/themes/manual-dark.css b/web/themes/manual-dark.css index 047554f4b4..26604370c4 100644 --- a/web/themes/manual-dark.css +++ b/web/themes/manual-dark.css @@ -2,4 +2,6 @@ html[data-theme="dark"] { --color-chatbot-bg: linear-gradient(180deg, rgba(34, 34, 37, 0.90) 0%, rgba(29, 29, 32, 0.90) 90.48%); --color-chat-bubble-bg: linear-gradient(180deg, rgba(200, 206, 218, 0.08) 0%, rgba(200, 206, 218, 0.02) 100%); --color-workflow-process-bg: linear-gradient(90deg, rgba(24, 24, 27, 0.25) 0%, rgba(24, 24, 27, 0.04) 100%); + --color-dataset-chunk-process-success-bg: linear-gradient(92deg, rgba(23, 178, 106, 0.30) 0%, rgba(0, 0, 0, 0.00) 100%); + --color-dataset-chunk-process-error-bg: linear-gradient(92deg, rgba(240, 68, 56, 0.30) 0%, rgba(0, 0, 0, 0.00) 100%); } \ No newline at end of file diff --git a/web/themes/manual-light.css b/web/themes/manual-light.css index 09b9338184..2113ef7fc0 100644 --- a/web/themes/manual-light.css +++ b/web/themes/manual-light.css @@ -2,4 +2,6 @@ html[data-theme="light"] { --color-chatbot-bg: linear-gradient(180deg, rgba(249, 250, 251, 0.90) 0%, rgba(242, 244, 247, 0.90) 90.48%); --color-chat-bubble-bg: linear-gradient(180deg, #FFF 0%, rgba(255, 255, 255, 0.60) 100%); --color-workflow-process-bg: linear-gradient(90deg, rgba(200, 206, 218, 0.20) 0%, rgba(200, 206, 218, 0.04) 100%); + --color-dataset-chunk-process-success-bg: linear-gradient(92deg, rgba(23, 178, 106, 0.25) 0%, rgba(255, 255, 255, 0.00) 100%); + --color-dataset-chunk-process-error-bg: linear-gradient(92deg, rgba(240, 68, 56, 0.25) 0%, rgba(255, 255, 255, 0.00) 100%); } \ No newline at end of file