Feature: add interval for sync setting

This commit is contained in:
萌萌哒赫萝
2023-05-02 12:03:21 +08:00
parent ab4e31f62a
commit 7150bf381c
7 changed files with 53 additions and 19 deletions

View File

@@ -808,6 +808,15 @@
:placeholder="$T('SETTINGS_SYNC_CONFIG_PROXY_PLACEHOLDER')"
/>
</el-form-item>
<el-form-item
:label="$T('SETTINGS_SYNC_CONFIG_INTERVAL')"
>
<el-input-number
v-model="sync.interval"
:min="10"
:step="1"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button
@@ -1252,7 +1261,8 @@ const sync = ref({
repo: '',
branch: '',
token: '',
proxy: ''
proxy: '',
interval: 60
})
const syncType = [
@@ -1278,7 +1288,8 @@ async function cancelSyncSetting () {
repo: '',
branch: '',
token: '',
proxy: ''
proxy: '',
interval: 60
}
}
@@ -1354,7 +1365,8 @@ async function initData () {
repo: '',
branch: '',
token: '',
proxy: ''
proxy: '',
interval: 60
}
form.logFileSizeLimit = enforceNumber(settings.logFileSizeLimit) || 10
}

View File

@@ -1,10 +1,7 @@
class LS {
get (name: string) {
if (localStorage.getItem(name)) {
return JSON.parse(localStorage.getItem(name) as string)
} else {
return {}
}
const item = localStorage.getItem(name) as string
return item ? JSON.parse(item) : {}
}
set (name: string, value: any) {