|
|
@ -71,6 +71,11 @@ |
|
|
overflow-y: auto; |
|
|
overflow-y: auto; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.nav { |
|
|
|
|
|
background-color: #ccc; |
|
|
|
|
|
padding-top: 12px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.sticky { |
|
|
.sticky { |
|
|
position: fixed; |
|
|
position: fixed; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
@ -98,27 +103,52 @@ |
|
|
<!-- 输入服务器ip --> |
|
|
<!-- 输入服务器ip --> |
|
|
<div class="container"> |
|
|
<div class="container"> |
|
|
|
|
|
|
|
|
<div class="form-group col-md-6"> |
|
|
<div class="form-group col-md-6" style="display: none;"> |
|
|
<div class="input-group"> |
|
|
<div class="input-group"> |
|
|
<div class="input-group-addon">服务器ip</div> |
|
|
<div class="input-group-addon">服务器ip</div> |
|
|
<input type="text" class="form-control" name="sip" id="scip" value="0.0.0.0" placeholder="eg:192.168.66.99"> |
|
|
<input type="text" class="form-control" name="sip" id="scip" value="0.0.0.0" |
|
|
|
|
|
placeholder="eg:192.168.66.99"> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="form-group"> |
|
|
<div class="form-group col-md-10"> |
|
|
<div class="input-group"> |
|
|
<div class="input-group"> |
|
|
<div class="input-group-addon">监视目录</div> |
|
|
<div class="input-group-addon">监视目录</div> |
|
|
<input type="text" class="form-control" name="sdir" placeholder="eg :/www/wwwroot/aa_com/" /> |
|
|
<input type="text" class="form-control" name="sdir" placeholder="空白查询根目录.eg :/www/wwwroot/aa_com/" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="form-group col-md-12"> |
|
|
<div class="form-group col-md-2"> |
|
|
<button type="button" id="entsip" class="btn btn-primary">查看信息</button> |
|
|
<button type="button" id="scbtn" class="btn btn-primary">查看文件信息</button> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 罗列文件的列表信息 --> |
|
|
<!-- 目标服务器配置信息 --> |
|
|
<div class="container"> |
|
|
<div class="container"> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 目标的服务器信息 --> |
|
|
|
|
|
<div class="form-group col-md-4"> |
|
|
|
|
|
<div class="input-group"> |
|
|
|
|
|
<div class="input-group-addon">目标ip</div> |
|
|
|
|
|
<input type="text" class="form-control" name="tsip" id="tcip" placeholder="eg:192.168.66.99"> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group col-md-4"> |
|
|
|
|
|
<div class="input-group "> |
|
|
|
|
|
<div class="input-group-addon">目标目录</div> |
|
|
|
|
|
<input type="text" class="form-control" name="tsdir" id="" placeholder="eg :/www/wwwroot/aa_com/" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group col-md-4"> |
|
|
|
|
|
<div class="input-group"> |
|
|
|
|
|
<div class="input-group-addon">来源ip</div> |
|
|
|
|
|
<input type="text" class="form-control" name="masterip" readonly id="masteripd" value="" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 罗列文件的列表信息 --> |
|
|
|
|
|
<div class="container" id="scfzone"> |
|
|
<!-- 源服务器 --> |
|
|
<!-- 源服务器 --> |
|
|
<div class="col-md-12"> |
|
|
<div class="col-md-12"> |
|
|
<div class="panel panel-default"> |
|
|
<div class="panel panel-default"> |
|
|
@ -129,7 +159,6 @@ |
|
|
<p>相对目录: <span class="sc02"></span> </p> |
|
|
<p>相对目录: <span class="sc02"></span> </p> |
|
|
<div class="col-md-12"> |
|
|
<div class="col-md-12"> |
|
|
<a href="javascript:void(0);" class="btn btn-success btn-sm" id="slall" data-st="ss">全选</a> |
|
|
<a href="javascript:void(0);" class="btn btn-success btn-sm" id="slall" data-st="ss">全选</a> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
@ -139,30 +168,6 @@ |
|
|
</form> |
|
|
</form> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 目标服务器 --> |
|
|
|
|
|
<div class="container"> |
|
|
|
|
|
<!-- 目标的服务器信息 --> |
|
|
|
|
|
<div class="form-group col-md-4"> |
|
|
|
|
|
<div class="input-group"> |
|
|
|
|
|
<div class="input-group-addon">服务器ip</div> |
|
|
|
|
|
<input type="text" class="form-control" name="tsip" id="tcip" placeholder="eg:192.168.66.99"> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group"> |
|
|
|
|
|
<div class="input-group"> |
|
|
|
|
|
<div class="input-group-addon">监视目录</div> |
|
|
|
|
|
<input type="text" class="form-control" name="tsdir" id="" placeholder="eg :/www/wwwroot/aa_com/" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group"> |
|
|
|
|
|
<a href="javascript:void(0);" class="btn btn-info btn-sm" id="sybtn" data-st="ss">同步</a> |
|
|
|
|
|
<button class="btn-info btn-sm">同步</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 状态信息 --> |
|
|
<!-- 状态信息 --> |
|
|
@ -179,11 +184,25 @@ |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 提交按钮 --> |
|
|
|
|
|
<div class="nav"> |
|
|
|
|
|
<div class="container"> |
|
|
|
|
|
<!-- submit --> |
|
|
|
|
|
<div class="col-md-12"> |
|
|
|
|
|
<div class="form-group"> |
|
|
|
|
|
<button class="btn btn-info btn-sm" onclick="dosync()">同步选中的文件</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<script type="text/javascript"> |
|
|
<script type="text/javascript"> |
|
|
// add sticky |
|
|
// add sticky 滚动黏贴效果 |
|
|
$(document).ready(function () { |
|
|
$(document).ready(function () { |
|
|
// grab the initial top offset of the navigation |
|
|
// grab the initial top offset of the navigation |
|
|
// var stickyNavTop = $('.nav').offset().top; |
|
|
// var stickyNavTop = $('.nav').offset().top; |
|
|
|
|
|
var stickyNavTop = $('.nav').offset().top; |
|
|
// console.log(stickyNavTop) |
|
|
// console.log(stickyNavTop) |
|
|
|
|
|
|
|
|
// our function that decides weather the navigation bar should have "fixed" css position or not. |
|
|
// our function that decides weather the navigation bar should have "fixed" css position or not. |
|
|
@ -192,11 +211,11 @@ |
|
|
|
|
|
|
|
|
// if we've scrolled more than the navigation, change its position to fixed to stick to top, |
|
|
// if we've scrolled more than the navigation, change its position to fixed to stick to top, |
|
|
// otherwise change it back to relative |
|
|
// otherwise change it back to relative |
|
|
// if (scrollTop > stickyNavTop) { |
|
|
if (scrollTop < stickyNavTop) { |
|
|
// $('.nav').addClass('sticky'); |
|
|
$('.nav').addClass('sticky'); |
|
|
// } else { |
|
|
} else { |
|
|
// $('.nav').removeClass('sticky'); |
|
|
$('.nav').removeClass('sticky'); |
|
|
// } |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
stickyNav(); |
|
|
stickyNav(); |
|
|
@ -207,27 +226,23 @@ |
|
|
}) |
|
|
}) |
|
|
</script> |
|
|
</script> |
|
|
<script type="text/javascript"> |
|
|
<script type="text/javascript"> |
|
|
|
|
|
// 控制全选与否 |
|
|
var chkall = true; |
|
|
var chkall = true; |
|
|
var chknum = 0; |
|
|
var chknum = 0; |
|
|
var scip = ""; //目标服务器ip |
|
|
|
|
|
|
|
|
var tgip = ""; //目标服务器ip |
|
|
|
|
|
var masterip = ""; // 主控地址 |
|
|
var urlpath = ".";// 当前的操作目录 |
|
|
var urlpath = ".";// 当前的操作目录 |
|
|
var chkarr = new Array; //选中的文件或目录 |
|
|
var chkarr = new Array; //选中的文件或目录 |
|
|
//var bfsarr = new Array; // base file infomation array |
|
|
//var bfsarr = new Array; // base file infomation array |
|
|
|
|
|
|
|
|
$(function () { |
|
|
$(function () { |
|
|
// read sessionStorage |
|
|
// read sessionStorage 当前 |
|
|
var oscip = sessionStorage.getItem("scip"); |
|
|
var oscip = sessionStorage.getItem("scip"); |
|
|
var otip = sessionStorage.getItem("tscip"); |
|
|
|
|
|
if (oscip != "" || otip != '') { |
|
|
if (oscip != "" || otip != '') { |
|
|
$("input[name='sip']").val(oscip); |
|
|
$("input[name='sip']").val(oscip); |
|
|
$("input[name='tsip']").val(otip); |
|
|
|
|
|
} |
|
|
} |
|
|
// click function SOURCE SERVER |
|
|
|
|
|
$("#entsip").on("click", function () { |
|
|
|
|
|
scfs("ss"); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 目标服务器的文件信息 |
|
|
// 目标服务器的文件信息 |
|
|
// st 源站 或 目标站 |
|
|
// st 源站 或 目标站 |
|
|
var scfs = function (st) { |
|
|
var scfs = function (st) { |
|
|
@ -245,7 +260,6 @@ |
|
|
} |
|
|
} |
|
|
// 输入框也显示东西 |
|
|
// 输入框也显示东西 |
|
|
$("input[name='sdir']").val(urlpath); |
|
|
$("input[name='sdir']").val(urlpath); |
|
|
$("input[name='tsdir']").val(urlpath) |
|
|
|
|
|
// |
|
|
// |
|
|
var html = "<li class=\"list-group-item\">输入源服务器" + scip + "</li>"; |
|
|
var html = "<li class=\"list-group-item\">输入源服务器" + scip + "</li>"; |
|
|
$("#ssip").text("源站(" + scip + ")"); |
|
|
$("#ssip").text("源站(" + scip + ")"); |
|
|
@ -258,38 +272,38 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// button click function for TARGET SERVER |
|
|
// button click function for TARGET SERVER |
|
|
$("#tentsip").on("click", function () { |
|
|
$("#scbtn").on("click", function () { |
|
|
$("#mbip").text("目标站(" + scip + ")"); |
|
|
$("#mbip").text("目标站(" + scip + ")"); |
|
|
tgfs("tg"); |
|
|
// 检查目标ip 是否已经输入 |
|
|
|
|
|
var ttsip = $("input[name='tsip']").val(); |
|
|
|
|
|
if(ttsip==""){ |
|
|
|
|
|
alert("输入目标ip信息"); |
|
|
|
|
|
return false; |
|
|
|
|
|
}else{ |
|
|
|
|
|
localStorage.setItem("tgip",ttsip); |
|
|
|
|
|
tgip = ttsip |
|
|
|
|
|
scfs("ss"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 目标服务器的文件信息 |
|
|
|
|
|
var tgfs = function (st) { |
|
|
|
|
|
tsip = $("input[name='tsip']").val(); |
|
|
|
|
|
// ip storage |
|
|
|
|
|
sessionStorage.setItem("tscip", tsip); |
|
|
|
|
|
// |
|
|
|
|
|
var html = "<li class=\"list-group-item\">输入目标服务器" + tsip + "</li>"; |
|
|
|
|
|
// 目标站 |
|
|
|
|
|
$("#mbip").text("目标站(" + tsip + ")"); |
|
|
|
|
|
// 获取信息 |
|
|
|
|
|
gescinfo("#tgsc", tsip, urlpath, st); |
|
|
|
|
|
// |
|
|
|
|
|
$("#rstatus").append(html); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获取目标服务器的信息 |
|
|
// 获取目标服务器的信息 |
|
|
var gescinfo = function (elemnt, scip, upath, st) { |
|
|
var gescinfo = function (elemnt, scip, upath, st) { |
|
|
|
|
|
// |
|
|
upath = upath.replace("/\\/g", "\/"); |
|
|
upath = upath.replace("/\\/g", "\/"); |
|
|
var url = ""; // 客户端的状态地址 |
|
|
var url = ""; // 客户端的状态地址 |
|
|
if (scip == '' || scip=="0.0.0.0" || scip == '127.0.0.1' || scip == "localhost") { |
|
|
if (scip == '' || scip == "0.0.0.0" || scip == '127.0.0.1' || scip == "localhost") { |
|
|
url = "./sc?p=" + upath; |
|
|
url = "./sc?p=" + upath; |
|
|
} else { |
|
|
} else { |
|
|
url = "http://" + scip + ":9099/sc?p=" + upath; |
|
|
url = "http://" + scip + ":9099/sc?p=" + upath; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// |
|
|
// |
|
|
var html = ""; |
|
|
var html = ""; |
|
|
$.getJSON(url, function (res) { |
|
|
$.getJSON(url, function (res) { |
|
|
|
|
|
// 主控ip |
|
|
|
|
|
// masterip = res.hostid |
|
|
|
|
|
$("#masteripd").val(res.hostip) |
|
|
// |
|
|
// |
|
|
var chgflag; |
|
|
var chgflag; |
|
|
$.each(res.data.list, function (k, v) { |
|
|
$.each(res.data.list, function (k, v) { |
|
|
@ -323,21 +337,16 @@ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// if (v.isbackup == 1) { |
|
|
|
|
|
// html += "<div class=\"col-md-2\"><a href=\"#\" class=\"btn btn-warning btn-sm\">恢复</a></div>"; |
|
|
|
|
|
// } else { |
|
|
|
|
|
// html += "<div class=\"col-md-2\"></div>"; |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
html += "</li>"; |
|
|
html += "</li>"; |
|
|
}) |
|
|
}) |
|
|
// append to html |
|
|
// append to html |
|
|
html += "<input type='hidden' name='curpath' value='" + upath + "'>"; |
|
|
html += "<input type='hidden' name='curpath' value='" + upath + "'>"; |
|
|
if (st == "tg") { |
|
|
html += "<input type='hidden' name='serverip' value='" + tgip + "'>"; |
|
|
html += "<input type='hidden' name='serverip' value='" + scip + "'>"; |
|
|
// if (st == "tg") { |
|
|
} else { |
|
|
// html += "<input type='hidden' name='serverip' value='" + scip + "'>"; |
|
|
html += "<input type='hidden' name='serverip' value='192.168.66.16'>"; |
|
|
// } else { |
|
|
} |
|
|
// html += "<input type='hidden' name='serverip' value='" + masterip + "'>"; |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
// $("#tgsc").html(html) |
|
|
// $("#tgsc").html(html) |
|
|
$(elemnt).html(html); |
|
|
$(elemnt).html(html); |
|
|
@ -368,37 +377,8 @@ |
|
|
//2、标识的变量取反 |
|
|
//2、标识的变量取反 |
|
|
chkall = !chkall; |
|
|
chkall = !chkall; |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//同步操作 |
|
|
|
|
|
$("#sybtn").on("click", function () { |
|
|
|
|
|
// var st = $(this).data("st") |
|
|
|
|
|
// $(".ssform").submit(); |
|
|
|
|
|
// var ss = $("."+st+"mfile").hasClass("checked").val() |
|
|
|
|
|
// console.log(ss) |
|
|
|
|
|
// 获取选中的文件 或者文件夹 |
|
|
|
|
|
// chkarr.push($("input[name='sfiles[]']:checked").val()); |
|
|
|
|
|
|
|
|
|
|
|
// console.log(chkarr) |
|
|
|
|
|
// var ss = $("input[name='sfiles[]']:checked").val(); |
|
|
|
|
|
//var ss = $(".mfile").has("checked").val() |
|
|
|
|
|
// console.log(ss) |
|
|
|
|
|
var ttsip = $("input[name='tsip']").val(); |
|
|
|
|
|
if (ttsip == "") { |
|
|
|
|
|
alert("老天鹅,你还没填写目标服务器地址。"); |
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
// 提交表单 |
|
|
|
|
|
$(".ssform").submit(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 勾选是否同步的选项 |
|
|
|
|
|
$("#sw_sybtn").on("click", function () { |
|
|
|
|
|
let swval = $(this).has("checked").val(); |
|
|
|
|
|
// 设置相反的值 |
|
|
|
|
|
alert(swval); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//base64 编码防止请求错误 |
|
|
//base64 编码防止请求错误 |
|
|
var bsrqst = function (path) { |
|
|
var bsrqst = function (path) { |
|
|
@ -431,6 +411,17 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//同步操作 |
|
|
|
|
|
var dosync = function () { |
|
|
|
|
|
// var ttsip = $("input[name='tsip']").val(); |
|
|
|
|
|
if (tgip == "") { |
|
|
|
|
|
alert("老天鹅,你还没填写目标服务器地址。"); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 提交表单 |
|
|
|
|
|
$(".ssform").submit(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
</body> |
|
|
</body> |
|
|
|
|
|
|
|
|
|