pull/310/head
midoks 2 years ago
parent 58503722c0
commit 70d260dd5a
  1. 4
      class/core/crontab_api.py
  2. 18
      route/static/app/crontab.js

@ -378,14 +378,14 @@ class crontab_api:
bak_data = []
if stype == 'sites' or stype == 'database':
if stype == 'sites' or stype == 'database' or stype.find('database_') > -1:
hookPath = mw.getPanelDataDir() + "/hook_backup.json"
if os.path.exists(hookPath):
t = mw.readFile(hookPath)
bak_data = json.loads(t)
sqlite3_name = 'mysql'
if stype == 'database' or stype == 'database_mariadb' or stype == 'database_mysql-apt' or stype == 'database_mysql-yum' or stype == 'database_postgresql':
if stype == 'database' or stype.find('database_') > -1:
path = mw.getServerDir() + '/mysql'
if stype != 'database':
soft_name = stype.replace('database_', '')

@ -534,11 +534,17 @@ function editTaskInfo(id){
sNameArray:[],
backupsArray:[],
create:function(callback){
for(var i = 0; i <obj['sTypeArray'].length; i++){
if(obj.from['stype'] == obj['sTypeArray'][i][0]){
sTypeName = obj['sTypeArray'][i][1];
if (obj.from['stype'].indexOf('database_')>-1){
name = obj.from['stype'].replace('database_','');
sTypeName = '备份数据库['+name+']';
sTypeDom += '<li><a role="menuitem" href="javascript:;" value="'+ obj.from['stype'] +'">'+ sTypeName +'</a></li>';
} else {
for(var i = 0; i <obj['sTypeArray'].length; i++){
if(obj.from['stype'] == obj['sTypeArray'][i][0]){
sTypeName = obj['sTypeArray'][i][1];
}
sTypeDom += '<li><a role="menuitem" href="javascript:;" value="'+ obj['sTypeArray'][i][0] +'">'+ obj['sTypeArray'][i][1] +'</a></li>';
}
sTypeDom += '<li><a role="menuitem" href="javascript:;" value="'+ obj['sTypeArray'][i][0] +'">'+ obj['sTypeArray'][i][1] +'</a></li>';
}
for(var i = 0; i <obj['cycleArray'].length; i++){
@ -551,8 +557,8 @@ function editTaskInfo(id){
weekDom += '<li><a role="menuitem" href="javascript:;" value="'+ obj['weekArray'][i][0] +'">'+ obj['weekArray'][i][1] +'</a></li>';
}
if(obj.from.stype == 'site' || obj.from.stype == 'database' || obj.from.stype == 'path' || obj.from.stype == 'logs'){
$.post('/crontab/get_data_list',{type:obj.from.stype == 'databases'?'database':'sites'},function(rdata){
if(obj.from.stype == 'site' || obj.from.stype == 'database' || obj.from.stype == 'path' || obj.from.stype == 'logs' || obj.from['stype'].indexOf('database_')>-1){
$.post('/crontab/get_data_list',{type:obj.from.stype},function(rdata){
// console.log(rdata);
obj.sNameArray = rdata.data;
obj.sNameArray.unshift({name:'ALL',ps:'所有'});

Loading…
Cancel
Save