|
|
<%@page language="java" contentType="text/html;charset=utf-8" %>
|
|
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
|
<%
|
|
|
String path = request.getContextPath();
|
|
|
String basePath = request.getScheme() + "://"
|
|
|
+ request.getServerName() + ":" + request.getServerPort()
|
|
|
+ path + "/";
|
|
|
%>
|
|
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/jquery.gritter.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
|
|
|
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css" class="skin-color"/>
|
|
|
|
|
|
<script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>/js/bootstrap.min.js"></script>
|
|
|
<script src="<%=basePath %>/js/unicorn.js"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.validate.js" charset="UTF-8"
|
|
|
type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/layer/layer.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.select.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/jstree/jstree.min.js"></script>
|
|
|
<script src="<%=basePath %>js/jquery.toaster.js"></script>
|
|
|
<script src="<%=basePath %>js/jquery.gritter.min.js"></script>
|
|
|
<script>
|
|
|
var contextPath = '<%=basePath %>';
|
|
|
</script>
|
|
|
<title>YOHO!运维</title>
|
|
|
</head>
|
|
|
<body>
|
|
|
<!-- 右侧具体内容 -->
|
|
|
|
|
|
<input type="hidden" id="hidden_ip" value="${ip}">
|
|
|
<input type="hidden" id="hidden_project" value="${project}">
|
|
|
<input type="hidden" id="hidden_exe" value="${exe}">
|
|
|
<input type="hidden" id="hidden_cloud" value="${cloud}">
|
|
|
|
|
|
|
|
|
<div id="infoTable">
|
|
|
</div>
|
|
|
|
|
|
</body>
|
|
|
<script>
|
|
|
var myArray = new Array();
|
|
|
var removeArray = new Array();
|
|
|
|
|
|
$(function () {
|
|
|
var ip = $("#hidden_ip").val();
|
|
|
var cloud = $("#hidden_cloud").val();
|
|
|
var exe = $("#hidden_exe").val();
|
|
|
var project = $("#hidden_project").val();
|
|
|
var tableParam = {
|
|
|
columnAutoWidth: false,
|
|
|
url: contextPath + "/javaRestart/stopOrRestart",
|
|
|
striped: true,
|
|
|
title: "java服务操作进程",
|
|
|
dataType: "json",
|
|
|
loadFilter: function (data) {
|
|
|
return defaultLoadFilter(data);
|
|
|
},
|
|
|
onLoadSuccess: function (data) {
|
|
|
$.each(data, function (idx, val) {
|
|
|
myArray[idx] = val.id;
|
|
|
});
|
|
|
setStatus();
|
|
|
},
|
|
|
columns: [{
|
|
|
title: "项目名称",
|
|
|
field: "project",
|
|
|
width: "10%"
|
|
|
}, {
|
|
|
title: "操作",
|
|
|
field: "exe",
|
|
|
width: "10%"
|
|
|
}, {
|
|
|
title: "云",
|
|
|
field: "cloud",
|
|
|
width: "10%"
|
|
|
}, {
|
|
|
title: "已执行IP",
|
|
|
field: "id",
|
|
|
formatter: function (value, rowData, rowIndex) {
|
|
|
var div = $("<div >").attr('id', 'done_' + value);
|
|
|
return div;
|
|
|
},
|
|
|
width: "25%"
|
|
|
}, {
|
|
|
title: "待执行IP",
|
|
|
field: "id",
|
|
|
formatter: function (value, rowData, rowIndex) {
|
|
|
var div = $("<div >").attr('id', 'todo_' + value);
|
|
|
return div;
|
|
|
},
|
|
|
width: "25%"
|
|
|
}, {
|
|
|
title: "进度",
|
|
|
field: "id",
|
|
|
formatter: function (value, rowData, rowIndex) {
|
|
|
var div = $("<div id=\"process_" + value + "\">");
|
|
|
return div;
|
|
|
},
|
|
|
width: "20%"
|
|
|
}]
|
|
|
};
|
|
|
|
|
|
//加载表格
|
|
|
$("#infoTable").table(tableParam);
|
|
|
$("#infoTable").table("load", {
|
|
|
'ip': ip,
|
|
|
'cloud': cloud,
|
|
|
'exe': exe,
|
|
|
'project': project
|
|
|
});
|
|
|
|
|
|
var interval = setInterval(function () {//查后台,展示数据
|
|
|
setStatus();
|
|
|
}, 3000);
|
|
|
|
|
|
});
|
|
|
|
|
|
function setStatus() {
|
|
|
if (myArray.length == 0)
|
|
|
return;
|
|
|
|
|
|
$.each(myArray, function (idx, val) {
|
|
|
if(jQuery.inArray(val, removeArray) != -1){
|
|
|
return;
|
|
|
}
|
|
|
$.ajax({
|
|
|
type: 'post',
|
|
|
url: contextPath + "/javaRestart/getMessage?id=" + val,
|
|
|
dataType: 'json',
|
|
|
success: function (resp) {
|
|
|
if (resp == null || resp.code == 300) {
|
|
|
removeArray[removeArray.length+1] = val;
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$("#done_" + val).html("");
|
|
|
$("#done_" + val).html(resp.data.doneList);
|
|
|
|
|
|
$("#todo_" + val).html("");
|
|
|
$("#todo_" + val).html(resp.data.toDoList);
|
|
|
|
|
|
|
|
|
$("#process_" + val).html("");
|
|
|
$("#process_" + val).html(resp.data.donePersent);
|
|
|
|
|
|
},
|
|
|
error: function (resp) {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
</script> |
|
|
|
|
|
\ No newline at end of file |
...
|
...
|
|