diff --git a/class/core/crontab_api.py b/class/core/crontab_api.py index f22fcaa65..7e0056622 100755 --- a/class/core/crontab_api.py +++ b/class/core/crontab_api.py @@ -378,16 +378,21 @@ class crontab_api: bak_data = [] - if stype == 'sites' or stype == 'databases': + if stype == 'sites' or stype == 'database': hookPath = mw.getPanelDataDir() + "/hook_backup.json" if os.path.exists(hookPath): t = mw.readFile(hookPath) bak_data = json.loads(t) - if stype == 'databases': + if stype == 'database' or stype == 'database_mariadb' or stype == 'database_mysql-apt' or stype == 'database_mysql-yum': + path = mw.getServerDir() + '/mysql' + if stype != 'database': + soft_name = stype.replace('database_', '') + path = mw.getServerDir() + '/' + soft_name + db_list = {} db_list['orderOpt'] = bak_data - path = mw.getServerDir() + '/mysql' + if not os.path.exists(path + '/mysql.db'): db_list['data'] = [] else: diff --git a/route/static/app/crontab.js b/route/static/app/crontab.js index 25850e2cc..dcffe8710 100755 --- a/route/static/app/crontab.js +++ b/route/static/app/crontab.js @@ -407,7 +407,7 @@ function initDropdownMenu(){ case 'database_mysql-apt': case 'database_mysql-yum': case 'database': - toBackup('databases'); + toBackup(type); $(".controls").html('备份数据库'); break; case 'logs': @@ -431,16 +431,24 @@ function toBackup(type){ sMsg = '备份网站'; sType = "sites"; break; - case 'databases': + case 'database_mariadb': + case 'database_mysql-apt': + case 'database_mysql-yum': + case 'database': sMsg = '备份数据库'; - sType = "databases"; + suffix = type.replace('database','') + if (suffix != ''){ + suffix = suffix.replace('_','') + sMsg = '备份数据库['+suffix+']'; + } + sType = type; break; case 'logs': sMsg = '切割日志'; sType = "sites"; break; } - var data='type='+sType + var data = 'type='+sType; $.post('/crontab/get_data_list',data,function(rdata){ $(".planname input[name='name']").attr('readonly','true').css({"background-color":"#f6f6f6","color":"#666"}); var sOpt = "";