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