<%@ page contentType="text/html;charset=UTF-8"%>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
<c:set var="ctx" value="${pageContext.request.contextPath}" />
|
<html>
|
<head>
|
<title>添加机器</title>
|
<style type="text/css">
|
* {
|
padding: 0px;
|
margin: 0px;
|
font-family: "microsoft yahei", "Helvetica Neue", Helvetica, Arial,
|
sans-serif;
|
}
|
|
#Top {
|
display: block;
|
margin-bottom: 10px;
|
padding: 5px;
|
padding-left: 6px;
|
padding-right: 15px;
|
line-height: 22px;
|
/* border-left: 5px solid #15c142; */
|
border-radius: 0 2px 2px 0;
|
background-color: #f2f2f2;
|
}
|
|
.btn {
|
height: 35px;
|
line-height: 35px;
|
background-color: #0dc316;
|
padding: 0 15px;
|
color: #fff;
|
border: none;
|
border-radius: 2px;
|
}
|
|
#Table_Minche thead tr {
|
background-color: #00BFFF;
|
font-weight:800;
|
}
|
#Table_Minche thead td{
|
border:1px solid #00BFFF;
|
}
|
#Table_Minche td {
|
border: 1px solid #f2f2f2;
|
height: 20px;
|
line-height: 20px;
|
text-align:center;
|
padding: 9px 15px 9px 15px;
|
}
|
</style>
|
<script type="text/javascript" src="${ctx}/static/jquery/jquery-3.1.0.min.js"></script>
|
<script>
|
var interval = setInterval('refreshStatus()', 20000);
|
// 设备页面自动刷新
|
function refreshStatus() {
|
window.location.reload();
|
}
|
// 停止页面自动刷新
|
function disableAutoRefresh() {
|
clearInterval(interval);
|
}
|
function modifyraw(){
|
disableAutoRefresh()
|
$("#add-fix-info").modal('show');
|
}
|
function checkAll() {
|
var checkedAll=document.getElementById("checkall");
|
var ischeked=false;
|
if(checkedAll.checked){
|
ischeked=true;
|
}
|
var checkboxs=document.getElementsByClassName("checkboxs");
|
for(var i=0;i<checkboxs.length;i++){
|
checkboxs[i].checked=ischeked;
|
}
|
}
|
/*启用Enable */ /*禁用Disables */ /*重置Reset */
|
function EnableDisablesReset(flag,machineid){
|
if("0"!=machineid){
|
$.ajax({
|
cache:false,
|
type:"POST",
|
dataType : "json",
|
url:"${ctx}/Config/EnableDisablesReset",
|
data:{
|
"MachineId":machineid,
|
"flag":flag
|
},success:function(data){
|
window.location.href="${ctx}/Config/minche";
|
}
|
});
|
}else{
|
var checkboxs=document.getElementsByClassName("checkboxs");
|
for(var i=0;i<checkboxs.length;i++){
|
var checkbox=checkboxs[i];
|
if(checkbox.checked){
|
var RowHtml=checkbox.parentNode.parentNode;
|
var MachineIdHtml=RowHtml.getElementsByClassName("MachineId")[0].innerHTML;
|
$.ajax({
|
cache:false,
|
type:"POST",
|
dataType : "json",
|
url:"${ctx}/Config/EnableDisablesReset",
|
data:{
|
"MachineId":MachineIdHtml,
|
"flag":flag
|
},success:function(data){
|
window.location.href="${ctx}/Config/minche";
|
}
|
});
|
}
|
}
|
}
|
|
}
|
|
/*删除 */
|
function delAll(){
|
var checkboxs=document.getElementsByClassName("checkboxs");
|
for(var i=0;i<checkboxs.length;i++){
|
var checkbox=checkboxs[i];
|
if(checkbox.checked){
|
var RowHtml=checkbox.parentNode.parentNode;
|
var MachineId=RowHtml.getElementsByClassName("MachineId")[0].innerHTML;
|
$.ajax({
|
cache:false,
|
type:"POST",
|
dataType : "json",
|
url:"${ctx}/Config/machinedelete",
|
data:{
|
"MachineId":MachineId
|
},success:function(data){
|
alert("删除成功");
|
window.location.href="${ctx}/Config/minche";
|
}
|
});
|
}
|
}
|
}
|
</script>
|
</head>
|
<body>
|
<div class="content-wrapper" style="background-color: white;">
|
<section class="content-header">
|
<div class="modal fade" id="add-fix-info" tabindex="-1" role="dialog"
|
aria-labelledby="myModalLabel" aria-hidden="true">
|
<div class="modal-dialog" style="width:100%;height:100%;">
|
<div class="modal-content" style="width:500px;height:400px;margin:auto;">
|
<div class="modal-header">
|
<button type="button" class="close" data-dismiss="modal"
|
aria-hidden="true" data-backdrop="static">×</button>
|
<h3 class="modal-title" id="myModalLabel"
|
style="font-weight: bolder;">添加机器</h3>
|
</div>
|
<form class="form-horizontal" role="form" id="category_add"
|
action="${ctx}/Config/addminche" method="post">
|
<input type="hidden" id="add-fix" name="Ids">
|
<div class="modal-body">
|
<div id="addminche">
|
<div style="margin-top:20px;">
|
<span>机器名:</span><input style="margin-left:15px;" type="text" name="Number">
|
</div>
|
<div style="margin-top:20px;">
|
机器类型: ${Machinetypehtml}
|
</div>
|
|
<div style="margin-top:20px;">
|
<span>端口:</span><input style="margin-left:30px;" type="text" name="port">
|
</div>
|
<div style="margin-top:20px;">
|
<span>IP地址:</span><input style="margin-left:18px;" type="text" name="ip_address">
|
</div>
|
</div>
|
</div>
|
<div class="modal-footer">
|
<button type="button" class="btn btn-default btn-lg"
|
data-dismiss="modal">关闭</button>
|
<button type="submit" class="btn btn-primary btn-lg"
|
id="addbtnsubmit">提交</button>
|
</div>
|
</form>
|
</div>
|
</div>
|
</div>
|
</section>
|
<!-- 内容 -->
|
<section class="content container-fluid">
|
<div id="Top">
|
<!-- <button class="btn" onclick="EnableDisablesReset('开机','0')">开机</button> -->
|
<!-- <button class="btn" onclick="EnableDisablesReset('关机','0')">关机</button> -->
|
<!-- <button class="btn" onclick="EnableDisablesReset('启用')">启用</button>
|
<button class="btn" style="background-color: #fd5f56;" onclick="EnableDisablesReset('禁用')">禁用</button> -->
|
<!-- <button class="btn" onclick="EnableDisablesReset('重置','0')">重置</button> -->
|
<button class="btn" onclick="modifyraw()">添加</button>
|
<button class="btn" onclick="delAll()">删除</button>
|
<span style="float: right; line-height: 40px">共有机器:${MachineCount} 台</span>
|
</div>
|
<div>
|
<table id="Table_Minche"
|
style="width: 100%; border-collapse: collapse; border-spacing: 0;">
|
<thead>
|
<tr>
|
<td style="text-align: center;"><input id="checkall" onclick="checkAll()" type="checkbox" /></td>
|
<td>ID</td>
|
<td>机器名称</td>
|
<td>机器类型</td>
|
<!-- <td>端口号</td>
|
<td>机器状态</td> -->
|
<td>连接状态</td>
|
<td>IP地址</td>
|
<td>工作状态</td>
|
<td>工作id</td>
|
<td>连接时间</td>
|
<td>请求字</td>
|
<td>发送字</td>
|
<td>完成字</td>
|
<td>完成确认字</td>
|
<!-- <td style="width:100px;">操作</td> -->
|
</tr>
|
</thead>
|
<tbody>
|
${Machinehtml}
|
</tbody>
|
</table>
|
</div>
|
</section>
|
</div>
|
</body>
|
</html>
|