mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
add setting UI
This commit is contained in:
parent
93ad218d68
commit
df7edbd7d0
@ -236,7 +236,7 @@ export function Home() {
|
|||||||
let running = true;
|
let running = true;
|
||||||
|
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
if (running && syncStore.cloudSync()) {
|
if (running && syncStore.cloudSync() && syncStore.autoSync.onStart) {
|
||||||
try {
|
try {
|
||||||
await syncStore.sync();
|
await syncStore.sync();
|
||||||
showToast(Locale.Settings.Sync.Success);
|
showToast(Locale.Settings.Sync.Success);
|
||||||
|
@ -475,6 +475,21 @@ function SyncConfigModal(props: { onClose?: () => void }) {
|
|||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
<List>
|
||||||
|
<ListItem title={Locale.Settings.Sync.Config.AutoSync.OnStartup}>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={syncStore.autoSync.onStart}
|
||||||
|
onChange={(e) => {
|
||||||
|
syncStore.update(
|
||||||
|
(config) =>
|
||||||
|
(config.autoSync.onStart = e.currentTarget.checked),
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</ListItem>
|
||||||
|
</List>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -254,6 +254,10 @@ const cn = {
|
|||||||
UserName: "备份名称",
|
UserName: "备份名称",
|
||||||
Password: "UpStash Redis REST Token",
|
Password: "UpStash Redis REST Token",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
AutoSync: {
|
||||||
|
OnStartup: "启动时自动同步",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
LocalState: "本地数据",
|
LocalState: "本地数据",
|
||||||
|
@ -257,6 +257,10 @@ const en: LocaleType = {
|
|||||||
UserName: "Backup Name",
|
UserName: "Backup Name",
|
||||||
Password: "UpStash Redis REST Token",
|
Password: "UpStash Redis REST Token",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
AutoSync: {
|
||||||
|
OnStartup: "Sync on startup",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
LocalState: "Local Data",
|
LocalState: "Local Data",
|
||||||
|
@ -40,7 +40,7 @@ const DEFAULT_SYNC_STATE = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
autoSync: {
|
autoSync: {
|
||||||
onStart: true,
|
onStart: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
lastSyncTime: 0,
|
lastSyncTime: 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user