Skip to content

Commit 174d25f

Browse files
authored
website sync ui (#4466)
1 parent c0c2ee4 commit 174d25f

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

projects/app/src/pageComponents/dataset/detail/CollectionCard/Context.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ const CollectionPageContextProvider = ({ children }: { children: ReactNode }) =>
7676
});
7777
const syncWebsite = async () => {
7878
await checkTeamWebSyncLimit();
79-
await postWebsiteSync({ datasetId: datasetId });
80-
await loadDatasetDetail(datasetId);
79+
postWebsiteSync({ datasetId: datasetId }).then(() => {
80+
loadDatasetDetail(datasetId);
81+
});
8182
};
8283
const {
8384
isOpen: isOpenWebsiteModal,

projects/app/src/pageComponents/dataset/detail/CollectionCard/Header.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip';
3737

3838
const FileSourceSelector = dynamic(() => import('../Import/components/FileSourceSelector'));
3939

40-
const Header = ({}: {}) => {
40+
const Header = ({ hasTrainingData }: { hasTrainingData: boolean }) => {
4141
const { t } = useTranslation();
4242
const { feConfigs } = useSystemStore();
4343
const { isPc } = useSystem();
@@ -283,13 +283,15 @@ const Header = ({}: {}) => {
283283
>
284284
{t('dataset:params_config')}
285285
</Button>
286-
<Button
287-
variant={'whitePrimary'}
288-
onClick={openWebSyncConfirm}
289-
leftIcon={<Icon name="common/confirm/restoreTip" w={'1rem'} />}
290-
>
291-
{t('dataset:immediate_sync')}
292-
</Button>
286+
{!hasTrainingData && (
287+
<Button
288+
variant={'whitePrimary'}
289+
onClick={openWebSyncConfirm}
290+
leftIcon={<Icon name="common/confirm/restoreTip" w={'1rem'} />}
291+
>
292+
{t('dataset:immediate_sync')}
293+
</Button>
294+
)}
293295
</HStack>
294296
)}
295297
{datasetDetail.status === DatasetStatusEnum.syncing && (

projects/app/src/pageComponents/dataset/detail/CollectionCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ const CollectionCard = () => {
196196
<MyBox isLoading={isLoading} h={'100%'} py={[2, 4]}>
197197
<Flex ref={BoxRef} flexDirection={'column'} py={[1, 0]} h={'100%'} px={[2, 6]}>
198198
{/* header */}
199-
<Header />
199+
<Header hasTrainingData={hasTrainingData} />
200200

201201
{/* collection table */}
202202
<TableContainer mt={3} overflowY={'auto'} fontSize={'sm'}>

0 commit comments

Comments
 (0)