diff --git a/back/loaders/initData.ts b/back/loaders/initData.ts index 68a71b79..382bf915 100644 --- a/back/loaders/initData.ts +++ b/back/loaders/initData.ts @@ -4,24 +4,6 @@ import { Crontab, CrontabStatus } from '../data/cron'; import CronService from '../services/cron'; import EnvService from '../services/env'; -const initData = [ - { - name: '更新面板', - command: `ql update`, - schedule: `${randomSchedule(60, 1)} ${randomSchedule( - 6, - 1, - ).toString()} * * *`, - isDisabled: 1, - }, - { - name: '删除日志', - command: 'ql rmlog 7', - schedule: '30 7 */7 * *', - isDisabled: 1, - }, -]; - export default async () => { const cronService = Container.get(CronService); const envService = Container.get(EnvService); @@ -32,24 +14,6 @@ export default async () => { cronDb.persistence.compactDatafile(); envDb.persistence.compactDatafile(); - cronDb.count({}, async (err, count) => { - if (count === 0) { - const data = initData.map((x: any) => { - const tab = new Crontab(x); - tab.created = new Date().valueOf(); - tab.saved = false; - if (tab.name === '更新面板') { - tab.isSystem = 1; - } else { - tab.isSystem = 0; - } - return tab; - }); - cronDb.insert(data); - await cronService.autosave_crontab(); - } - }); - // 初始化更新所有任务状态为空闲 cronDb.update( { status: { $in: [CrontabStatus.running, CrontabStatus.queued] } }, diff --git a/src/pages/setting/index.tsx b/src/pages/setting/index.tsx index fc77bd66..69902714 100644 --- a/src/pages/setting/index.tsx +++ b/src/pages/setting/index.tsx @@ -328,6 +328,12 @@ const Setting = ({ buttonStyle="solid" /> + + + + + +