diff --git a/class/core/crontab_api.py b/class/core/crontab_api.py index b1a9eadc6..276db8bca 100755 --- a/class/core/crontab_api.py +++ b/class/core/crontab_api.py @@ -377,10 +377,11 @@ class crontab_api: stype = request.form.get('type', '') bak_data = [] - hookPath = mw.getPanelDataDir() + "/hook_backup.json" - if os.path.exists(hookPath): - t = mw.readFile(hookPath) - bak_data = json.loads(t) + if stype == 'sites' or stype == 'database' or stype.find('database_') > -1 or stype == 'path': + hookPath = mw.getPanelDataDir() + "/hook_backup.json" + if os.path.exists(hookPath): + t = mw.readFile(hookPath) + bak_data = json.loads(t) if stype == 'database' or stype.find('database_') > -1: sqlite3_name = 'mysql' @@ -411,10 +412,11 @@ class crontab_api: data = {} data['orderOpt'] = bak_data - if stype == 'site' or stype == 'logs': - stype == 'sites' + default_db = 'sites' + # if stype == 'site' or stype == 'logs': + # stype == 'sites' - data['data'] = mw.M(stype).field('name,ps').select() + data['data'] = mw.M(default_db).field('name,ps').select() return mw.getJson(data) ##### ----- start ----- ### diff --git a/route/static/app/crontab.js b/route/static/app/crontab.js index f3c13a580..78d3a6b76 100755 --- a/route/static/app/crontab.js +++ b/route/static/app/crontab.js @@ -462,7 +462,7 @@ function toBackup(type){ break; case 'logs': sMsg = '切割日志'; - sType = "sites"; + sType = "logs"; break; case 'path': sMsg = '备份目录';