From 9071207f33c91e312d48b034402ce9d4fa2a29bf Mon Sep 17 00:00:00 2001 From: "shiweisong.ssw" Date: Fri, 30 Jun 2023 15:19:36 +0800 Subject: [PATCH 1/5] feat: auto sync after created --- datacenter/app/datastores/documents/page.tsx | 55 +++++++++++++++++ datacenter/app/datastores/page.tsx | 62 +++++++++++++++++++- 2 files changed, 115 insertions(+), 2 deletions(-) diff --git a/datacenter/app/datastores/documents/page.tsx b/datacenter/app/datastores/documents/page.tsx index 02f2126d6..4936a2556 100644 --- a/datacenter/app/datastores/documents/page.tsx +++ b/datacenter/app/datastores/documents/page.tsx @@ -13,6 +13,8 @@ import { Input, Textarea, Chip, + Switch, + Typography, styled } from '@/lib/mui' import moment from 'moment' @@ -72,6 +74,7 @@ const Documents = () => { const [originFileObj, setOriginFileObj] = useState(null) const [total, setTotal] = useState(0) const [current, setCurrent] = useState(0) + const [synchChecked, setSynchChecked] = useState(true) const props: UploadProps = { name: 'file', multiple: false, @@ -422,6 +425,22 @@ const Documents = () => { /> )} + + setSynchChecked(event.target.checked) + } + /> + } + > + Synch: + - + {documents.length ? ( <> { Synch: - + + + )} diff --git a/datacenter/app/datastores/page.tsx b/datacenter/app/datastores/page.tsx index c1db62ecf..8884a93a5 100644 --- a/datacenter/app/datastores/page.tsx +++ b/datacenter/app/datastores/page.tsx @@ -144,7 +144,7 @@ const Index = () => { }, '& tbody tr a': { color: 'rgb(13, 96, 217)' - }, + } }} > @@ -387,130 +387,142 @@ const Index = () => { Synch: - + + + )} From c8044ddc96186e1ca271610a28b9e0460ddc8d49 Mon Sep 17 00:00:00 2001 From: "shiweisong.ssw" Date: Fri, 30 Jun 2023 16:19:03 +0800 Subject: [PATCH 4/5] fix: sync when sync switch is checked --- datacenter/app/datastores/documents/page.tsx | 7 +- datacenter/app/datastores/page.tsx | 79 +++++++++++--------- 2 files changed, 48 insertions(+), 38 deletions(-) diff --git a/datacenter/app/datastores/documents/page.tsx b/datacenter/app/datastores/documents/page.tsx index 584e80daa..41b1da7e3 100644 --- a/datacenter/app/datastores/documents/page.tsx +++ b/datacenter/app/datastores/documents/page.tsx @@ -467,7 +467,9 @@ const Documents = () => { variant="outlined" sx={{ marginRight: '20px' }} onClick={() => setActiveStep(0)} - >{'< Back'} + > + {'< Back'} + + > + {'< Back'} +