|
|
|
@ -43,7 +43,7 @@ |
|
|
|
margin-left: 16px; |
|
|
|
} |
|
|
|
|
|
|
|
.hschange{ |
|
|
|
.hschange { |
|
|
|
background-color: #da1616; |
|
|
|
} |
|
|
|
|
|
|
|
@ -177,13 +177,13 @@ |
|
|
|
var chknum = 0; |
|
|
|
var scip = ""; //目标服务器ip |
|
|
|
var urlpath = ".";// 当前的操作目录 |
|
|
|
var bfsarr= new Array; // base file infomation array |
|
|
|
//var bfsarr = new Array; // base file infomation array |
|
|
|
|
|
|
|
$(function () { |
|
|
|
// read sessionStorage |
|
|
|
var oscip = sessionStorage.getItem("scip"); |
|
|
|
var otip = sessionStorage.getItem("tscip"); |
|
|
|
if (oscip != "" || otip!='') { |
|
|
|
if (oscip != "" || otip != '') { |
|
|
|
$("input[name='sip']").val(oscip); |
|
|
|
$("input[name='tsip']").val(otip); |
|
|
|
} |
|
|
|
@ -192,7 +192,7 @@ |
|
|
|
scfs(); |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 目标服务器的文件信息 |
|
|
|
var scfs = function () { |
|
|
|
// |
|
|
|
@ -202,15 +202,16 @@ |
|
|
|
//监视目录 |
|
|
|
var jsdir = $("input[name='sdir']").val(); |
|
|
|
if (jsdir != '') { |
|
|
|
urlpath = encodeURIComponent(btoa(jsdir)); |
|
|
|
urlpath = bsrqst(jsdir) |
|
|
|
//urlpath = encodeURIComponent(btoa(jsdir)); |
|
|
|
} |
|
|
|
// |
|
|
|
var html = "<li class=\"list-group-item\">输入源服务器" + scip + "</li>"; |
|
|
|
$("#mbip").text("源站(" + scip + ")"); |
|
|
|
|
|
|
|
// 获取信息 |
|
|
|
gescinfo("#scsc",scip,urlpath); |
|
|
|
// 获取基础结构信息 |
|
|
|
bsfinfo(urlpath); |
|
|
|
gescinfo("#scsc", scip, urlpath); |
|
|
|
|
|
|
|
// |
|
|
|
$("#rstatus").append(html); |
|
|
|
} |
|
|
|
@ -235,37 +236,51 @@ |
|
|
|
// 目标站 |
|
|
|
$("#mbip").text("目标站(" + tsip + ")"); |
|
|
|
// 获取信息 |
|
|
|
gescinfo("#tgsc",tsip,urlpath); |
|
|
|
gescinfo("#tgsc", tsip, urlpath); |
|
|
|
// |
|
|
|
$("#rstatus").append(html); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获取目标服务器的信息 |
|
|
|
var gescinfo = function (elemnt,scip,upath) { |
|
|
|
var gescinfo = function (elemnt, scip, upath) { |
|
|
|
upath = upath.replace("/\\/g", "\/"); |
|
|
|
// 获取基础结构信息 |
|
|
|
var bfsarr = new Array; |
|
|
|
bfsarr = bsfinfo(upath); |
|
|
|
// console.log("in gsc", bfsarr) |
|
|
|
|
|
|
|
// 客户端的状态地址 |
|
|
|
var url = "http://" + scip + ":9099/sc?p=" + upath.replace("/\\/g", "\/"); |
|
|
|
var url = "http://" + scip + ":9099/sc?p=" + upath; |
|
|
|
// |
|
|
|
var html = ""; |
|
|
|
$.getJSON(url, function (res) { |
|
|
|
|
|
|
|
// |
|
|
|
var chgflag; |
|
|
|
// res.curdir |
|
|
|
$.each(res.data.list, function (k, v) { |
|
|
|
// console.log("kn",btoa(v.fname)) |
|
|
|
// console.log("kkkk "+k,bfsarr[btoa(v.fname)]) |
|
|
|
// 处理后的base64 |
|
|
|
var bsfn=""; |
|
|
|
// 判读是否存在 变化 |
|
|
|
if(!v.dirflag){ |
|
|
|
var chgflag=bfsarr[v.fname] == v.hash?" nochage":" hschange"; |
|
|
|
if (!v.dirflag) { |
|
|
|
bsfn=btoa(v.fname) |
|
|
|
chgflag = bfsarr[bsfn] == v.hash ? " nochage" : " hschange"; |
|
|
|
// chgflag = bfsarr["'" + v.fname + "'"] == v.hash ? " nochage" : " hschange"; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// |
|
|
|
html += "<li class=\"list-group-item optzone "+chgflag+"\"><div class=\"col-md-10\">"; |
|
|
|
html+="<input type=\"checkbox\" name=\"sfiles\" value="+v.fname+" />"; |
|
|
|
html += "<li class=\"list-group-item optzone " + chgflag + "\"><div class=\"col-md-10\">"; |
|
|
|
html += "<input type=\"checkbox\" name=\"sfiles\" value=" + v.fname + " />"; |
|
|
|
if (v.dirflag) { |
|
|
|
html += "<span class=\"icon folder-icon\"></span>" + v.fname + "</div>"; |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
html += "<span class=\"icon file-icon\"></span>" + |
|
|
|
"<a href=\"javascript:void(0);\" hsval='"+v.hash+"' bhasval='"+bfsarr[v.fname]+"'>"+v.fname + "</a></div>"; |
|
|
|
|
|
|
|
|
|
|
|
html += "<span class=\"icon file-icon\"></span>" + |
|
|
|
"<a href=\"javascript:void(0);\" hsval='" + v.hash + "' bhasval='" + bfsarr[bsfn] + "'>" + v.fname + "</a></div>"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (v.isbackup == 1) { |
|
|
|
@ -352,26 +367,28 @@ |
|
|
|
} |
|
|
|
//解码base64 |
|
|
|
var dbsresp = function (bsStr) { |
|
|
|
console.log("respone base64 string ",bsStr) |
|
|
|
if(bsStr=="."){ |
|
|
|
// console.log("respone base64 string ", bsStr) |
|
|
|
if (bsStr == ".") { |
|
|
|
return "." |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return decodeURIComponent(atob(bsStr)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 获取基础结构,存入数组 |
|
|
|
var bsfinfo = function(upath){ |
|
|
|
console.log("get basic file infomation ",upath) |
|
|
|
bfsarr.splice() |
|
|
|
$.getJSON("/bs",{p:upath},function(ret){ |
|
|
|
// upath 的方式存入 session storage |
|
|
|
var bsfinfo = function (upath) { |
|
|
|
var barr= new Array; |
|
|
|
$.getJSON("/bs?p="+upath, function (ret) { |
|
|
|
// 遍历存入数组 |
|
|
|
$.each(ret.data,function(k,v){ |
|
|
|
bfsarr[v.fname] = v.fhash |
|
|
|
$.each(ret.data, function (k, v) { |
|
|
|
var kn = btoa(v.fname) |
|
|
|
barr[kn] = v.fhash |
|
|
|
}); |
|
|
|
// console.log(ttarr["UkVBRE1FLm1k"]) |
|
|
|
}) |
|
|
|
|
|
|
|
console.log (bfsarr) |
|
|
|
// console.log(barr[0]) |
|
|
|
return barr; |
|
|
|
} |
|
|
|
|
|
|
|
// 另外的base64的解码 |
|
|
|
|