parent
ece971fd01
commit
f33cef6bb6
8 changed files with 133 additions and 86 deletions
@ -1,7 +1,7 @@ |
|||||||
log4j.rootLogger=warn,stdout |
log4j.rootLogger=info,stdout |
||||||
|
|
||||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender |
log4j.appender.stdout=org.apache.log4j.ConsoleAppender |
||||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout |
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout |
||||||
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n |
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n |
||||||
|
|
||||||
#log4j.logger.io.netty=warn |
#log4j.logger.io.netty=warn |
@ -1,72 +1,75 @@ |
|||||||
<div class="layui-tab layui-tab-brief"> |
<div class="layui-tab layui-tab-brief"> |
||||||
<ul class="layui-tab-title site-demo-title"> |
<ul class="layui-tab-title site-demo-title"> |
||||||
<li class="layui-this detail-page"></li> |
<li class="layui-this detail-page"></li> |
||||||
</ul> |
</ul> |
||||||
<div class="main-content"></div> |
<div class="main-content"></div> |
||||||
</div> |
</div> |
||||||
<script> |
<script> |
||||||
$(".layui-this.detail-page").html($.i18n.prop('client.list')); |
$(".layui-this.detail-page").html($.i18n.prop('client.list')); |
||||||
window.clientList = []; |
window.clientList = []; |
||||||
api_invoke("/config/detail", {}, function(data) { |
api_invoke("/config/detail", {}, function(data) { |
||||||
if (data.code == 20000) { |
if (data.code == 20000) { |
||||||
clientList = data.data; |
clientList = data.data; |
||||||
var html = template($("#client-tpl").html(), data); |
var html = template($("#client-tpl").html(), data); |
||||||
$(".main-content").html(html); |
$(".main-content").html(html); |
||||||
$(".mapping-config").click(function() { |
$(".mapping-config").click(function() { |
||||||
window.clientIndex = $(this).attr("data-index"); |
window.clientIndex = $(this).attr("data-index"); |
||||||
load_page("html/lan/list.html"); |
load_page("html/lan/list.html"); |
||||||
}); |
}); |
||||||
$(".client-edit").click(function() { |
$(".client-edit").click(function() { |
||||||
window.clientIndex = $(this).attr("data-index"); |
window.clientIndex = $(this).attr("data-index"); |
||||||
load_page("html/client/edit.html"); |
load_page("html/client/edit.html"); |
||||||
}); |
}); |
||||||
$(".client-delete").click(function() { |
$(".client-delete").click(function() { |
||||||
window.clientIndex = $(this).attr("data-index"); |
window.clientIndex = $(this).attr("data-index"); |
||||||
layer.confirm($.i18n.prop('public.confirm.delete'), { |
layer.confirm($.i18n.prop('public.confirm.delete'), { |
||||||
title: $.i18n.prop('public.tips'), |
title: $.i18n.prop('public.tips'), |
||||||
btn : [ $.i18n.prop('public.ok'), $.i18n.prop('public.cancel') ] |
btn : [ $.i18n.prop('public.ok'), $.i18n.prop('public.cancel') ] |
||||||
}, function(i) { |
}, function(i) { |
||||||
layer.close(i); |
layer.close(i); |
||||||
clientList.splice(clientIndex, 1); |
clientList.splice(clientIndex, 1); |
||||||
api_invoke("/config/update", clientList, function(data) { |
api_invoke("/config/update", clientList, function(data) { |
||||||
if (data.code != 20000) { |
if (data.code != 20000) { |
||||||
layer.alert(data.message); |
layer.alert(data.message); |
||||||
} else { |
} else { |
||||||
location.reload(); |
location.reload(); |
||||||
} |
} |
||||||
}) |
}) |
||||||
}); |
}); |
||||||
}); |
}); |
||||||
$(".th-client-name").html($.i18n.prop('client.name')); |
} else { |
||||||
$(".th-client-key").html($.i18n.prop('client.key')); |
alert(data.message); |
||||||
$(".th-options").html($.i18n.prop('public.options')); |
} |
||||||
$(".client-edit").html($.i18n.prop('public.edit')); |
}); |
||||||
$(".client-delete").html($.i18n.prop('public.delete')); |
</script> |
||||||
} else { |
<script id="client-tpl" type="text/html"> |
||||||
alert(data.message); |
<table class="layui-table" lay-skin="line"> |
||||||
} |
<thead> |
||||||
}); |
<tr> |
||||||
</script> |
<th class="th-client-name"><%:=$.i18n.prop('client.name')%></th> |
||||||
<script id="client-tpl" type="text/html"> |
<th class="th-client-key"><%:=$.i18n.prop('client.key')%></th> |
||||||
<table class="layui-table" lay-skin="line"> |
<th class="th-status"><%:=$.i18n.prop('client.status')%></th> |
||||||
<thead> |
<th class="th-options"><%:=$.i18n.prop('public.options')%></th> |
||||||
<tr> |
</tr> |
||||||
<th class="th-client-name"></th> |
</thead> |
||||||
<th class="th-client-key"></th> |
<tbody> |
||||||
<th class="th-options"></th> |
<%for(var i = 0; i < data.length; i++) {%> |
||||||
</tr> |
<tr> |
||||||
</thead> |
<td><%:=data[i].name%></td> |
||||||
<tbody> |
<td><%:=data[i].clientKey%></td> |
||||||
<%for(var i = 0; i < data.length; i++) {%> |
<td> |
||||||
<tr> |
<% if(data[i].status == 1){ %> |
||||||
<td><%:=data[i].name%></td> |
<span class="layui-badge layui-bg-green"><%:=$.i18n.prop('client.status.online')%></span> |
||||||
<td><%:=data[i].clientKey%></td> |
<% } else { %> |
||||||
<td> |
<span class="layui-badge layui-bg-gray"><%:=$.i18n.prop('client.status.offline')%></span> |
||||||
<a data-index="<%:=i%>" class="layui-btn layui-btn-mini client-edit"></a> |
<% }%> |
||||||
<a data-index="<%:=i%>" class="layui-btn layui-btn-danger layui-btn-mini client-delete"></a> |
</td> |
||||||
</td> |
<td> |
||||||
</tr> |
<a data-index="<%:=i%>" class="layui-btn layui-btn-mini client-edit"><%:=$.i18n.prop('public.edit')%></a> |
||||||
<%}%> |
<a data-index="<%:=i%>" class="layui-btn layui-btn-danger layui-btn-mini client-delete"><%:=$.i18n.prop('public.delete')%></a> |
||||||
</tbody> |
</td> |
||||||
</table> |
</tr> |
||||||
|
<%}%> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
</script> |
</script> |
Loading…
Reference in new issue