Browse Source

修正ip显示错误

master
453530270@qq.com 1 year ago
parent
commit
7043389437
  1. 64
      fss/fsw/index.html

64
fss/fsw/index.html

@ -109,10 +109,14 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="panel panel-default"> <div class="panel panel-default">
<!-- Default panel contents --> <!-- Default panel contents -->
<div class="panel-heading">源站(192.168.66.100)</div> <div class="panel-heading" id="ssip">源站</div>
<div class="panel-body"> <div class="panel-body">
<p>监听目录:<span class="sc01"></span></p> <p>监听目录:<span class="sc01"></span></p>
<p>相对目录: <span class="sc02"></span> </p> <p>相对目录: <span class="sc02"></span> </p>
<div class="col-md-12">
<a href="javascript:void(0);" class="btn btn-success btn-sm" id="slall">全选</a>
<a href="javascript:void(0);" class="btn btn-info btn-sm" id="sybtn">同步</a>
</div>
</div> </div>
<!-- List group --> <!-- List group -->
@ -181,6 +185,7 @@
var chknum = 0; var chknum = 0;
var scip = ""; //目标服务器ip var scip = ""; //目标服务器ip
var urlpath = ".";// 当前的操作目录 var urlpath = ".";// 当前的操作目录
var chkarr = new Array; //选中的文件或目录
//var bfsarr = new Array; // base file infomation array //var bfsarr = new Array; // base file infomation array
$(function () { $(function () {
@ -198,7 +203,8 @@
// 目标服务器的文件信息 // 目标服务器的文件信息
var scfs = function () { // st 源站 或 目标站
var scfs = function (st) {
// //
scip = $("input[name='sip']").val(); scip = $("input[name='sip']").val();
// ip storage // ip storage
@ -216,7 +222,7 @@
$("input[name='tsdir']").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>";
$("#mbip").text("源站(" + scip + ")"); $("#ssip").text("源站(" + scip + ")");
// 获取信息 // 获取信息
gescinfo("#scsc", scip, urlpath); gescinfo("#scsc", scip, urlpath);
@ -227,6 +233,7 @@
// button click function for TARGET SERVER // button click function for TARGET SERVER
$("#tentsip").on("click", function () { $("#tentsip").on("click", function () {
$("#mbip").text("目标站(" + scip + ")");
tgfs(); tgfs();
}) })
@ -276,22 +283,27 @@
// //
html += "<li class=\"list-group-item optzone " + chgflag + "\"><div class=\"col-md-10\">"; html += "<li class=\"list-group-item optzone " + chgflag + "\"><div class=\"col-md-10\">";
html += "<input type=\"checkbox\" name=\"sfiles\" value=" + v.fname + " />"; html += "<input type=\"checkbox\" class=\"mfile\" name=\"sfiles[]\" value=" + v.fname + " />";
if (v.dirflag) { if (v.dirflag) { //如果是文件夹
html += "<span class=\"icon folder-icon\"></span>" + v.fname + "</div>"; html += "<span class=\"icon folder-icon\"></span>" ;
html += v.fname
// html += "<a href=\"javascript:void(0);\" onclick='"+getDirList(elemnt, scip,v.fname)+"'>"+v.fname +"</a>";
html += "</div>";
} else { } else {
html += "<span class=\"icon file-icon\"></span>" + html += "<span class=\"icon file-icon\"></span>" +
"<a href=\"javascript:void(0);\" hsval='" + v.hash + "' bhasval='" + v.rehash + "'>" + v.fname + "</a></div>"; "<a href=\"javascript:void(0);\" hsval='" + v.hash + "' bhasval='"
+ v.rehash + "'>"
+ v.fname + "</a></div>";
} }
if (v.isbackup == 1) { // if (v.isbackup == 1) {
html += "<div class=\"col-md-2\"><a href=\"#\" class=\"btn btn-warning btn-sm\">恢复</a></div>"; // html += "<div class=\"col-md-2\"><a href=\"#\" class=\"btn btn-warning btn-sm\">恢复</a></div>";
} else { // } else {
html += "<div class=\"col-md-2\"></div>"; // html += "<div class=\"col-md-2\"></div>";
} // }
html += "</li>"; html += "</li>";
}) })
@ -328,17 +340,17 @@
}) })
//全选按钮设置点击事件 //全选按钮设置点击事件
$("#slall").click(function () { $("#slall").click(function () {
//1、循环设置其它多选框选中状态,跟标识用的变量一样 //1、循环设置其它多选框选中状态,跟标识用的变量一样
$(".mfile").prop("checked", chkall); $(".mfile").prop("checked", chkall);
// down button toggle // down button toggle
if (chkall || chknum > 2) { if (chkall || chknum > 2) {
$("#tropt").show()
chknum += 1 chknum += 1
} else { } else {
$("#tropt").hide()
chknum -= 1 chknum -= 1
} }
//2、标识的变量取反 //2、标识的变量取反
@ -347,14 +359,20 @@
//同步操作 //同步操作
$("#sybtn").on("click", function () { $("#sybtn").on("click", function () {
var ttsip = $("input[name='serverip']").val(); // 获取选中的文件 或者文件夹
if (ttsip == "") { chkarr.push($("input[name='sfiles[]']:checked").val());
alert("老天鹅,你还没填写目标服务器地址。"); console.log(chkarr)
} else { // var ss = $("input[name='sfiles[]']:checked").val();
$("#hscip").val(scip); //var ss = $(".mfile").has("checked").val()
// 提交表单 // console.log(ss)
$(".form-inline").submit(); // var ttsip = $("input[name='serverip']").val();
} // if (ttsip == "") {
// alert("老天鹅,你还没填写目标服务器地址。");
// } else {
// $("#hscip").val(scip);
// // 提交表单
// $(".form-inline").submit();
// }
}); });

Loading…
Cancel
Save