diff --git a/plugins/migration_api/index.html b/plugins/migration_api/index.html index ca7d94d10..2973244d3 100755 --- a/plugins/migration_api/index.html +++ b/plugins/migration_api/index.html @@ -252,7 +252,7 @@ label.checkbox_label span { 网站 - +
@@ -261,7 +261,7 @@ label.checkbox_label span { 数据库 - +
diff --git a/plugins/migration_api/index.py b/plugins/migration_api/index.py index 3b440b278..357319538 100755 --- a/plugins/migration_api/index.py +++ b/plugins/migration_api/index.py @@ -242,8 +242,10 @@ def get_src_info(args): data = {} data['sites'] = mw.M('sites').field( "id,name,path,ps,status,addtime").order("id desc").select() - data['databases'] = mw.M('databases').field( - 'id,name,ps').order("id desc").select() + + my_db_pos = mw.getServerDir() + '/mysql' + conn = mw.M('databases').dbPos(my_db_pos, 'mysql') + data['databases'] = conn.field('id,name,ps').order("id desc").select() return data diff --git a/plugins/migration_api/js/app.js b/plugins/migration_api/js/app.js index 1f0927181..930ff5a17 100755 --- a/plugins/migration_api/js/app.js +++ b/plugins/migration_api/js/app.js @@ -130,14 +130,62 @@ function initStep2(){ $('.psync_path').html(body); $('.psync_path').show(); + + $('.pathNext').click(function(){ + selectProgress(3); + initStep3(); + }); } },{ icon: rdata.status ? 1 : 2 }); }); } function initStep3(){ - maPost('step_one',{}, function(rdata){ + maPost('step_three',{}, function(rdata){ + var rdata = $.parseJSON(rdata.data); console.log(rdata); + showMsg(rdata.msg,function(){ + if (rdata.status){ + var pdata = rdata.data; + var site_li = ''; + for (var i = 0; i < pdata.sites.length; i++) { + site_li+='
  • \ + \ +
  • '; + } + + $('#sites_li').html(site_li); + + + var db_li = ''; + for (var i = 0; i < pdata.databases.length; i++) { + db_li+='
  • \ + \ +
  • '; + } + $('#db_li').html(db_li); + + + $('.psync_path').hide(); + $('.psync_data').show(); + $('.dataMigrate').click(function(){ + selectProgress(4); + initStep3(); + }); + + $('.dataBack').click(function(){ + selectProgress(3); + $('.psync_data').hide(); + $('.psync_path').show(); + }); + } + },{ icon: rdata.status ? 1 : 2 }); }); }