Authored by jack.xue

Merge branch 'master' of http://git.yoho.cn/ops/monitor-ui

... ... @@ -24,9 +24,7 @@
<%--<span>更新时间</span>--%>
<%--</div>--%>
<%--</div>--%>
<%--</div>--%>
</div>
</div>
</div>
... ... @@ -83,6 +81,24 @@
};
var createTimeStr = function (checkTime) {
var now = new Date(); //当前时间
var ctime = new Date(Date.parse(checkTime.replace(/-/g, "/")));
var timediff = now.getTime() - ctime.getTime(); //时间差的毫秒数
var leave1 = timediff % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
var hours = Math.floor(leave1 / (3600 * 1000));//计算相差分钟数
var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
var minutes = Math.floor(leave2 / (60 * 1000));//计算相差秒数
var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
var seconds = Math.round(leave3 / 1000);
return minutes + " 分钟 " + seconds + " 秒" + "前更新";
}
var refreshDashBoard = function () {
$.ajax({
url: contextPath + "/javaApi/allStatus",
... ... @@ -98,7 +114,9 @@
console.log($("#btn_" + val.cloudType + "_" + val.serviceType));
var btn = $("#btn_" + val.cloudType + "_" + val.serviceType);
if (val.updateTime != undefined && val.updateTime != "") {
$("#span_time_" + val.serviceType).html(val.updateTime.slice(5));
var timestr = createTimeStr(val.updateTime)
$("#span_time_" + val.serviceType).html(timestr);
}
console.log(val);
if (val.errNum > 0) {
... ... @@ -123,15 +141,12 @@
function timer() {
refreshDashBoard();
setTimeout("timer()", 30000);
}
;
setTimeout("timer()", 15000);
};
$(function () {
getJavaAppType();
});
... ...