-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,734 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
_demo/marsh-admin-demo1/src/main/resources/WEB-INF/templates/cfg/whitelist.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<title>${app} - 安全名单</title> | ||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8 "/> | ||
<link rel="stylesheet" href="${css}/main.css"/> | ||
<script src="/_session/domain.js"></script> | ||
<script src="${js}/jtadmin.js"></script> | ||
<script> | ||
var tagName = '${tag_name!}'; | ||
$(function () { | ||
if (tagName) { | ||
$('#'+tagName).addClass('sel'); | ||
} else { | ||
$('tree li:first').addClass('sel'); | ||
} | ||
}); | ||
function node_onclick(tag_name,obj) { | ||
tagName = tag_name | ||
$('li.sel').removeClass('sel'); | ||
$(obj).addClass("sel"); | ||
$("#table").attr('src',"/cfg/whitelist/inner?tag_name="+tagName); | ||
}; | ||
</script> | ||
</head> | ||
<body> | ||
<main> | ||
<left> | ||
<tree> | ||
<ul> | ||
<#list tags as m> | ||
<li onclick="node_onclick('${m.tag}',this)" id="${m.tag}">${m.tag} (${m.counts})</li> | ||
</#list> | ||
</ul> | ||
</tree> | ||
</left> | ||
<right class="frm"> | ||
<iframe src="/cfg/whitelist/inner?tag_name=${tag_name!}" frameborder="0" id="table"></iframe> | ||
</right> | ||
</main> | ||
</body> | ||
</html> |
122 changes: 122 additions & 0 deletions
122
_demo/marsh-admin-demo1/src/main/resources/WEB-INF/templates/cfg/whitelist_edit.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<!DOCTYPE HTML> | ||
<html class="frm10"> | ||
<head> | ||
<title>${app} - 安全名单</title> | ||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8 "/> | ||
<link rel="stylesheet" href="${css}/main.css"/> | ||
<script src="/_session/domain.js"></script> | ||
<script src="${js}/jtadmin.js"></script> | ||
<script src="${js}/layer/layer.js"></script> | ||
<script> | ||
function del(){ | ||
var row_id = ${m.row_id!0}; | ||
if(row_id < 1){ | ||
return; | ||
} | ||
var vm = formToMap("#form"); | ||
top.layer.confirm('确定删除', { | ||
btn: ['确定','取消'] //按钮 | ||
}, function(){ | ||
$.ajax({ | ||
type:"POST", | ||
url:"/cfg/whitelist/ajax/del", | ||
data:{"row_id":row_id}, | ||
success:function(rst){ | ||
if(rst.code == 200) { | ||
top.layer.msg('操作成功'); | ||
setTimeout(function () { | ||
parent.location.href = "/cfg/whitelist?tag_name=" + vm.tag; | ||
}, 800); | ||
}else{ | ||
top.layer.msg(rst.description); | ||
} | ||
} | ||
}); | ||
top.layer.close(top.layer.index); | ||
}); | ||
}; | ||
function save() { | ||
var vm = formToMap("#form"); | ||
if (!vm.value || !vm.type) { | ||
top.layer.msg("type 或 value 不能为空!"); | ||
return; | ||
} | ||
$.ajax({ | ||
type:"POST", | ||
url:"/cfg/whitelist/edit/ajax/save", | ||
data:vm, | ||
success:function (rst) { | ||
if(rst.code == 200) { | ||
top.layer.msg('操作成功') | ||
setTimeout(function(){ | ||
parent.location.href="/cfg/whitelist?tag_name="+vm.tag; | ||
},800); | ||
}else{ | ||
top.layer.msg(rst.description); | ||
} | ||
} | ||
}); | ||
}; | ||
$(function () { | ||
ctl_s_save_bind(document,save); | ||
}) | ||
</script> | ||
</head> | ||
<body> | ||
|
||
<toolbar class="blockquote"> | ||
<left> | ||
<h2 class="ln30"><a href="#" onclick="javascript:history.back();" class="noline">安全名单</a></h2> / 编辑 | ||
</left> | ||
<right class="form"> | ||
<n>ctrl + s 可快捷保存</n> | ||
<button type="button" onclick="save()">保存</button> | ||
<#if is_admin == 1> | ||
<button type="button" class="minor" onclick="del()">删除</button> | ||
</#if> | ||
</right> | ||
</toolbar> | ||
|
||
<detail> | ||
<form id="form"> | ||
<input type="hidden" id="row_id" value="${m.row_id!0}"> | ||
<table> | ||
<tr> | ||
<th>tag</th> | ||
<td><input type="text" id="tag" value="${tag_name!}" autofocus/></td> | ||
</tr> | ||
<tr> | ||
<th>type</th> | ||
<td> | ||
<boxlist> | ||
<label><input type="radio" name="type" value="ip" /><a>ip</a></label> | ||
<label><input type="radio" name="type" value="domain" /><a>domain</a></label> | ||
<label><input type="radio" name="type" value="mobile" /><a>mobile</a></label> | ||
</boxlist> | ||
<script> | ||
valToForm("type","${m.type!'ip'}") | ||
</script> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>value</th> | ||
<td><input type="text" id="value" value="${m.value!}" /></td> | ||
</tr> | ||
<tr> | ||
<th>note</th> | ||
<td><input type="text" id="note" value="${m.note!}" /></td> | ||
</tr> | ||
</table> | ||
</form> | ||
</detail> | ||
|
||
|
||
</body> | ||
</html> |
159 changes: 159 additions & 0 deletions
159
_demo/marsh-admin-demo1/src/main/resources/WEB-INF/templates/cfg/whitelist_inner.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
<!DOCTYPE HTML> | ||
<html class="frm10"> | ||
<head> | ||
<title>${app} - 安全名单</title> | ||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8 "/> | ||
<link rel="stylesheet" href="${css}/main.css"/> | ||
<script src="/_session/domain.js"></script> | ||
<script src="${js}/jtadmin.js"></script> | ||
<script src="${js}/layer/layer.js"></script> | ||
<script> | ||
function imp(file) { | ||
if(confirm("确定要导入吗?") == false){ | ||
return; | ||
} | ||
var fromData = new FormData(); | ||
fromData.append("file", file); | ||
fromData.append("tag","${tag_name!}"); | ||
$.ajax({ | ||
type:"POST", | ||
url:"ajax/import", | ||
data:fromData, | ||
processData: false, | ||
contentType: false, | ||
success:function (rst) { | ||
if(rst.code == 200) { | ||
top.layer.msg('操作成功'); | ||
setTimeout(function(){ | ||
location.reload(); | ||
},800); | ||
}else{ | ||
top.layer.msg(rst.description); | ||
} | ||
} | ||
}); | ||
} | ||
function exp() { | ||
var vm = formToMap(".sel_from"); | ||
if(!vm.sel_id){ | ||
alert("请选择.."); | ||
return; | ||
} | ||
window.open("ajax/export?tag=${tag_name!}&ids=" + vm.sel_id, "_blank"); | ||
} | ||
function del(act,hint){ | ||
var vm = formToMap(".sel_from"); | ||
if(!vm.sel_id){ | ||
alert("请选择.."); | ||
return; | ||
} | ||
if(confirm("确定要"+hint+"吗?") == false) { | ||
return; | ||
} | ||
$.ajax({ | ||
type:"POST", | ||
url:"ajax/batch", | ||
data:{act: act, ids: vm.sel_id}, | ||
success:function (rst) { | ||
if(rst.code == 200) { | ||
top.layer.msg('操作成功'); | ||
setTimeout(function(){ | ||
location.reload(); | ||
},800); | ||
}else{ | ||
top.layer.msg(rst.description); | ||
} | ||
} | ||
}); | ||
} | ||
$(function(){ | ||
$('#sel_all').change(function(){ | ||
var ckd= $(this).prop('checked'); | ||
$('[name=sel_id]').prop('checked',ckd); | ||
}); | ||
$("#imp_file").change(function () { | ||
imp(this.files[0]); | ||
}) | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<main> | ||
<toolbar> | ||
<left> | ||
<form> | ||
<input type="hidden" name="tag_name" value="${tag_name!}"> | ||
<input type="hidden" name="state" value="${state!}"> | ||
<a class="w60">关键字:</a><input type="text" name="key" placeholder="value" value="${key!}"class="w350"/> | ||
<button type="submit">查询</button> | ||
<#if is_admin == 1> | ||
<a class="btn edit mar10-l" href="/cfg/whitelist/edit?tag_name=${tag_name!}">新增</a> | ||
</#if> | ||
</form> | ||
<#if is_admin == 1> | ||
<div> | ||
<a class="w60"></a><file> | ||
<label><input id="imp_file" type="file" accept=".jsond"/><a class="btn minor w80">导入</a></label> | ||
</file> | ||
|
||
<button type='button' class="minor w80 mar10-l" onclick="exp()" >导出</button> | ||
|
||
<#if state==1> | ||
<button type='button' class="minor mar10-l" onclick="del(0,'禁用')" >禁用</button> | ||
<#else> | ||
<button type='button' class="minor mar10-l" onclick="del(1,'启用')" >启用</button> | ||
<button type='button' class="minor mar10-l" onclick="del(9,'删除')" >删除</button> | ||
</#if> | ||
</div> | ||
</#if> | ||
</left> | ||
<right> | ||
<selector> | ||
<a class="${(state =1)?string('sel','')}" href="inner?tag_name=${tag_name}&state=1">启用</a> | ||
<a class="${(state !=1)?string('sel','')}" href="inner?tag_name=${tag_name}&state=0">未启用</a> | ||
</selector> | ||
</right> | ||
</toolbar> | ||
<datagrid class="list"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<td width="20px"><checkbox><label><input type="checkbox" id="sel_all" /><a></a></label></checkbox></td> | ||
<td width="50px">ID</td> | ||
<td width="100px">type</td> | ||
<td width="250px">value</td> | ||
<td>note</td> | ||
<td width="60px">操作</td> | ||
</tr> | ||
</thead> | ||
<tbody id="tbody" class="sel_from" > | ||
|
||
<#list list as m> | ||
<tr> | ||
<td><checkbox><label><input type="checkbox" name="sel_id" value="${m.row_id}" /><a></a></label></checkbox></td> | ||
<td>${m.row_id}</td> | ||
<td class="left">${m.type!}</td> | ||
<td class="left">${m.value!}</td> | ||
<td class="left">${m.note!}</td> | ||
<#if is_admin == 1> | ||
<td><a class="t2" href="/cfg/whitelist/edit?id=${m.row_id}">编辑</a></td> | ||
</#if> | ||
</tr> | ||
</#list> | ||
</tbody> | ||
</table> | ||
</datagrid> | ||
</main> | ||
</body> | ||
</html> |
Oops, something went wrong.