325 lines
9.5 KiB
HTML
325 lines
9.5 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
|
|
<meta charset="utf-8" />
|
|
<title>#(_res.get("system.config"))</title>
|
|
<meta name="author" content="Matthew Wagerfield" />
|
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
|
<style type="text/css">
|
|
.box-content table {
|
|
margin-top: 10px;
|
|
width: 100%;
|
|
border: 1px solid #fff;
|
|
}
|
|
|
|
.box-content .form-horizontal .control-label {
|
|
width: 100px;
|
|
}
|
|
|
|
.box-content table td>div.control-group {
|
|
margin: 10px 5px !important;
|
|
}
|
|
|
|
.box-content table td>div.control-group div.controls {
|
|
margin-left: 60px !important;
|
|
}
|
|
|
|
.config-buttons {
|
|
margin: 20px auto 0px;
|
|
width: 180px;
|
|
text-transform: capitalize;
|
|
}
|
|
|
|
td.board-name {
|
|
width: 106px;
|
|
background-color: #DDB413;
|
|
text-align: center;
|
|
color: #000;
|
|
}
|
|
|
|
label.control-label{
|
|
text-transform: capitalize;
|
|
}
|
|
</style>
|
|
</head>
|
|
#include("/common/header.html")
|
|
<body id='testLoading'>
|
|
#if(session.successMessage!=null&&session.successMessage!="")
|
|
<input id="successMessage" value="#(_res.get(session.successMessage))"
|
|
style="display:none"> #else
|
|
<input id="successMessage" value="#(session.successMessage)"
|
|
style="display:none"> #end
|
|
|
|
#if(session.errorMessage!=null&&session.errorMessage!="")
|
|
<input id="errorMessage" value="#(_res.get(session.errorMessage))"
|
|
style="display:none"> #else
|
|
<input id="errorMessage" value="#(session.errorMessage)"
|
|
style="display:none"> #end
|
|
<div class="row-fluid sortable" style="margin:10px 20px; width:95%">
|
|
<div class="box span12">
|
|
<div class="box-header" data-original-title>
|
|
<h2>
|
|
<i class="halflings-icon edit"></i><span class="break"></span>#(_res.get("system.config"))
|
|
</h2>
|
|
</div>
|
|
<div class="box-content">
|
|
|
|
<form class="form-horizontal" id="deviceConfig">
|
|
#for(deviceData:deviceInfos)
|
|
#for(deviceInfo:deviceData.value)
|
|
<table style="border: 1px solid #fff;" cellpadding="10">
|
|
<input type='hidden' name='count' value='#(for.index)'>
|
|
<tr>
|
|
<input type="hidden" value="#(deviceInfo.manageName)" name="deviceInfo#(for.index).manageName">
|
|
<td rowspan="2" class="board-name">#(deviceInfo.manageName)</td>
|
|
#if(deviceInfo.manageName.contains(':'))
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("software.type"))</label>
|
|
<div class="controls">
|
|
<input readonly='readonly' class="input-medium focused" id="" type="text"
|
|
value=""
|
|
name="">
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("software.release"))</label>
|
|
<div class="controls">
|
|
<input readonly='readonly' class="input-medium focused" id="" type="text"
|
|
value=""
|
|
name="">
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("ip"))</label>
|
|
<div class="controls">
|
|
<input readonly='readonly' class="input-medium focused" id=""
|
|
type="text" value="#(deviceInfo.manageAddr)"
|
|
name="deviceInfo#(for.index).manageAddr"
|
|
>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("mac"))</label>
|
|
<div class="controls">
|
|
<input readonly='readonly' class="input-medium focused" id=""
|
|
type="text" value="#(deviceInfo.manageMac)"
|
|
name="deviceInfo#(for.index).manageMac"
|
|
>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("mask"))</label>
|
|
<div class="controls">
|
|
<input readonly='readonly' class="input-medium focused" id="" type="text"
|
|
value="#(deviceInfo.manageMask)"
|
|
name="deviceInfo#(for.index).manageMask"
|
|
>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("gateway"))</label>
|
|
<div class="controls">
|
|
<input readonly='readonly' class="input-medium focused" id="" type="text"
|
|
value="#(deviceInfo.manageGateway)"
|
|
name="deviceInfo#(for.index).manageGateway"
|
|
>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
#else
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("software.type"))</label>
|
|
<div class="controls">
|
|
<input class="input-medium focused" id="" type="text"
|
|
value=""
|
|
name="">
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("software.release"))</label>
|
|
<div class="controls">
|
|
<input class="input-medium focused" id="" type="text"
|
|
value=""
|
|
name="">
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("ip"))</label>
|
|
<div class="controls">
|
|
<input class="input-medium focused" id=""
|
|
type="text" value="#(deviceInfo.manageAddr)"
|
|
name="deviceInfo#(for.index).manageAddr"
|
|
onblur="checkIp(this)">
|
|
</div>
|
|
</div>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("mac"))</label>
|
|
<div class="controls">
|
|
<input class="input-medium focused" id=""
|
|
type="text" value="#(deviceInfo.manageMac)"
|
|
name="deviceInfo#(for.index).manageMac"
|
|
onblur="checkMac(this)">
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("mask"))</label>
|
|
<div class="controls">
|
|
<input class="input-medium focused" id="" type="text"
|
|
value="#(deviceInfo.manageMask)"
|
|
name="deviceInfo#(for.index).manageMask"
|
|
onblur='checkMask(this)'>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="control-group">
|
|
<label class="control-label" for="focusedInput">#(_res.get("gateway"))</label>
|
|
<div class="controls">
|
|
<input class="input-medium focused" id="" type="text"
|
|
value="#(deviceInfo.manageGateway)"
|
|
name="deviceInfo#(for.index).manageGateway"
|
|
onblur="checkGateway(this)">
|
|
</div>
|
|
</div>
|
|
</td>
|
|
#end
|
|
#end
|
|
</tr>
|
|
</table>
|
|
#end
|
|
#if(deviceInfos)
|
|
<div class="config-buttons" >
|
|
<button type="button" onclick="modifyDialog()"
|
|
class="btn btn-primary">#(_res.get("save.changes"))</button>
|
|
<button type="reset" class="btn">#(_res.get("reset"))</button>
|
|
</div>
|
|
#else
|
|
<p style="text-align:center">暂无数据信息</p>
|
|
#end
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<!--/span-->
|
|
</div>
|
|
</body>
|
|
|
|
<script>
|
|
changeFlag=true;
|
|
$(function(){
|
|
$("div.config-buttons").each(function(i,e){
|
|
$(e).css("width",function(){
|
|
var $this = $(this);
|
|
var width = 10;
|
|
$this.find("button").each(function(i,n){
|
|
var $n = $(n);
|
|
width += parseInt($n.css("width"));
|
|
});
|
|
return width;
|
|
});
|
|
});
|
|
});
|
|
|
|
// 修改配置信息
|
|
function changeData(){
|
|
if(changeFlag){
|
|
//调用loading动画效果
|
|
$('body').loading({
|
|
loadingWidth:240,
|
|
title:'#(_res.get("waitInfo"))',
|
|
name:'test',
|
|
discription:'这是一个描述...',
|
|
direction:'row',
|
|
type:'origin',
|
|
originBg:'#71EA71',
|
|
originDivWidth:30,
|
|
originDivHeight:30,
|
|
originWidth:4,
|
|
originHeight:4,
|
|
smallLoading:false,
|
|
titleColor:'#388E7A',
|
|
loadingBg:'rgba(56,43,14,0.8)',
|
|
loadingMaskBg:'rgba(22,22,22,0.2)'
|
|
});
|
|
|
|
|
|
$.ajax({
|
|
type:"post",
|
|
dataType:'json',
|
|
url:"/config/modifyConfig",
|
|
data:$('#deviceConfig').serialize(),
|
|
async:true,
|
|
success:function (res){
|
|
console.log(res)
|
|
//关闭loading动画 同时重定向
|
|
removeLoading('test');
|
|
location.href="/config"
|
|
}
|
|
})
|
|
}else{
|
|
alert("请修改不正确数值");
|
|
return;
|
|
}
|
|
}
|
|
// 执行操作后提示信息
|
|
$(function(){
|
|
var successMessage=$("#successMessage").val();
|
|
var errorMessage=$("#errorMessage").val();
|
|
if(successMessage!=null&&successMessage!=''&&successMessage!=undefined){
|
|
xcsoft.success(successMessage,2000);
|
|
#(session.removeAttribute("successMessage"))
|
|
}else if(errorMessage!=null&&errorMessage!=''&&errorMessage!=undefined){
|
|
xcsoft.error(errorMessage,2000);
|
|
#(session.removeAttribute("errorMessage"))
|
|
}
|
|
})
|
|
|
|
|
|
function modifyDialog(){
|
|
var dialog=BootstrapDialog.confirm({
|
|
title: 'WARNING',
|
|
message: '<div style="text-align:center;font-size:20px">#(_res.get("modify.message"))</div>',
|
|
cssClass: 'remove-dialog',
|
|
closable: true,
|
|
draggable: true,
|
|
btnCancelLabel: '#(_res.get("cancel"))',
|
|
btnOKLabel: '#(_res.get("modify"))',
|
|
callback: function(result) {
|
|
if(result){
|
|
changeData();
|
|
}else{
|
|
dialog.close();
|
|
}
|
|
}
|
|
});
|
|
dialog.getModalHeader().hide();
|
|
}
|
|
</script>
|
|
</html>
|