系统管理页面

This commit is contained in:
bwcx_jzy 2019-08-03 00:19:35 +08:00
parent b945eb5f01
commit 47df588881
6 changed files with 80 additions and 110 deletions

View File

@ -20,11 +20,10 @@
</div>
</form>
<script type="text/javascript"
th:src="@{${session.jpomProxyPath}+'/static/js/auto-line-number.js?v='+${staticCacheTime}}"></script>
th:src="@{${session.jpomProxyPath}+'/static/js/auto-line-number.js?v='+${session.staticCacheTime}}"></script>
<script type="text/javascript">
var line = 1;
var showLine = 0;
function loadSuccess() {
initPlugin();

View File

@ -64,7 +64,7 @@
<script type="text/html" id="menus_tpl">
{{# layui.each(d, function(index, item){ }}
<li class="layui-nav-item {{# if(index==0) { }} layui-this {{# } }} ">
<a href="javascript:" data-options="{{# if(!item.childs) { }}{{ JSON.stringify(item) }}{{# } }}">
<a href="javascript:" data-options={{# if(!item.childs) { }}{{ JSON.stringify(item) }}{{# } }}>
{{# if(item.icon && item.icon!=''){ }}
<i class="layui-icon {{ item.icon }}"></i>
{{# } }}
@ -108,6 +108,7 @@
try {
options = JSON.parse(dataJSON);
} catch (e) {
console.log(dataJSON);
options = eval('(' + dataJSON + ')');
}
tabChange(options);

View File

@ -1,14 +1,8 @@
<!DOCTYPE html>
<html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<title>Jpom-项目管理系统</title>
#parse("./common/head.vm")
<th:block th:include="common/head::head"></th:block>
<style>
body {
padding: 10px;
margin-top: 20px;
}
.clear {
margin-left: 20px;
@ -19,79 +13,59 @@
<body>
#if(!$node)
<blockquote class="layui-elem-quote">服务端文件缓存:$!cacheFileSize
<th:block th:unless="${node}">
<blockquote class="layui-elem-quote">服务端文件缓存:[[${cacheFileSize}]]
<button type="button" class="layui-btn layui-btn-sm clear" t="serviceCacheFileSize">清空</button>
</blockquote>
<blockquote class="layui-elem-quote">黑名单IP数量$!ipSize
<blockquote class="layui-elem-quote">黑名单IP数量[[${ipSize}]]
<button type="button" class="layui-btn layui-btn-sm clear" t="serviceIpSize">清空</button>
</blockquote>
<blockquote class="layui-elem-quote">在读取的日志文件数:$!readFileOnLineCount
<blockquote class="layui-elem-quote">在读取的日志文件数:[[${readFileOnLineCount}]]
</blockquote>
<blockquote class="layui-elem-quote">在线构建文件占用空间:$!cacheBuildFileSize
<blockquote class="layui-elem-quote">在线构建文件占用空间:[[${cacheBuildFileSize}]]
</blockquote>
#else
</th:block>
<th:block th:if="${node}">
<blockquote class="layui-elem-quote">文件缓存:
<span nodeId="$node.id" fileSize> </span>
<button type="button" class="layui-btn layui-btn-sm clear" nodeId="$node.id"
<span th:nodeId="${node?.id}" fileSize> </span>
<button type="button" class="layui-btn layui-btn-sm clear" th:nodeId="${node?.id}"
t="fileSize">清空
</button>
</blockquote>
<blockquote class="layui-elem-quote">进程名缓存:
<span nodeId="$node.id" pidName></span>
<button type="button" class="layui-btn layui-btn-sm clear" nodeId="$node.id"
<span th:nodeId="${node?.id}" pidName></span>
<button type="button" class="layui-btn layui-btn-sm clear" th:nodeId="${node?.id}"
t="pidName">清空
</button>
</blockquote>
<blockquote class="layui-elem-quote">进程端口缓存:
<span nodeId="$node.id" pidPort></span>
<button type="button" class="layui-btn layui-btn-sm clear" nodeId="$node.id"
<span th:nodeId="${node?.id}" pidPort></span>
<button type="button" class="layui-btn layui-btn-sm clear" th:nodeId="${node?.id}"
t="pidPort">清空
</button>
</blockquote>
<blockquote class="layui-elem-quote">错误进程缓存:
<span nodeId="$node.id" pidError></span>
<button type="button" class="layui-btn layui-btn-sm clear" nodeId="$node.id"
<span th:nodeId="${node?.id}" pidError></span>
<button type="button" class="layui-btn layui-btn-sm clear" th:nodeId="${node?.id}"
t="pidPort">清空
</button>
</blockquote>
<blockquote class="layui-elem-quote">在读取的日志文件数:
<span nodeId="$node.id" readFileOnLineCount></span>
<span th:nodeId="${node?.id}" readFileOnLineCount></span>
</blockquote>
#end
</th:block>
</body>
<script>
function loadSuccess() {
#if($user.isSystemUser())
if ([[${session.user.isSystemUser()}]]) {
$(".clear").show();
#end
#if($node)
getCache("$!node.id");
#end
}
function getCache(nodeId) {
$("button[nodeId='" + nodeId + "']").hide();
loadingAjax({
url: './node_cache.json',
data: {
nodeId: nodeId
},
success: function (data) {
if (200 != data.code) {
layer.msg(data.msg);
return;
if ([[${node!=null?true:false}]]) {
getCache("[[${node?.id}]]");
}
for (var key in data.data) {
$("span[" + key.toLowerCase() + "][nodeId='" + nodeId + "']").text(data.data[key]);
}
$("button[nodeId='" + nodeId + "']").show();
}
});
$(".clear").click(function () {
var nodeId = $(this).attr("nodeId");
@ -118,5 +92,24 @@
});
});
}
function getCache(nodeId) {
loadingAjax({
url: './node_cache.json',
data: {
nodeId: nodeId
},
success: function (data) {
if (200 != data.code) {
layer.msg(data.msg);
return;
}
for (var key in data.data) {
$("span[" + key.toLowerCase() + "][nodeId='" + nodeId + "']").text(data.data[key]);
}
$("button[nodeId='" + nodeId + "']").show();
}
});
}
</script>
</html>

View File

@ -1,19 +1,11 @@
<!DOCTYPE html>
<html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<title>Jpom-项目管理系统</title>
#parse("./common/head.vm")
<th:block th:include="common/head::head"></th:block>
<style>
body {
padding: 10px;
margin-top: 20px;
}
.context {
height: 90vh;
}
</style>
</head>
@ -28,12 +20,16 @@
</div>
</div>
</body>
<script type="text/javascript" src="$!jpomProxyPath/static/js/auto-line-number.js?v=$staticCacheTime"></script>
<script type="text/javascript"
th:src="@{${session.jpomProxyPath}+'/static/js/auto-line-number.js?v='+${session.staticCacheTime}}"></script>
<script type="text/javascript">
var treeData = [];
var tree;
var url = getSocketHost() + "/tomcat_log?userId=$user.getUserMd5Key()&tomcatId=system&nodeId=#if(!$node)system#else$!node.id#end&type=tomcat";
var nodeId = "system";
if ([[${node!=null?true:false}]]) {
nodeId = "[[${node?.id}]]";
}
var url = getSocketHost() + "/tomcat_log?userId=[[${session.user.getUserMd5Key()}]]&tomcatId=system&nodeId=" + nodeId + "&type=tomcat";
var ws;
function loadSuccess() {
@ -67,7 +63,7 @@
url: './log_del.json',
data: {
path: data.path,
nodeId: "$!node.id"
nodeId: "[[${node?.id}]]"
},
success: function (data) {
layer.msg(data.msg);
@ -90,7 +86,7 @@
if (data.children) {
layer.msg("不支持下载文件夹");
} else {
window.open("./log_download?path=" + data.path + "&nodeId=$!node.id");
window.open("./log_download?path=" + data.path + "&nodeId=[[${node?.id}]]");
}
reloadTree();
return false;

View File

@ -1,15 +1,7 @@
<!DOCTYPE html>
<html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<title>Jpom-项目管理系统</title>
#parse("./common/head.vm")
<style>
body {
padding: 10px;
margin-top: 20px;
}
</style>
<head th:replace="common/head::head">
</head>
<body>
@ -36,7 +28,7 @@
loadingAjax({
url: './info',
data: {
nodeId: "$!node.id"
nodeId: "[[${node?.id}]]"
},
success: function (data) {
if (200 != data.code) {

View File

@ -1,14 +1,6 @@
<!DOCTYPE html>
<html>
<head>
#parse("./common/head.vm")
<title>项目管理系统</title>
<style>
body {
padding: 10px;
}
</style>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="common/head::head">
</head>
<body>
@ -56,9 +48,7 @@
lay-search="">
<option value="">请选择</option>
<option value="-">无节点操作</option>
#foreach($item in $nodeArray)
<option value="$item.id">$item.name</option>
#end
<option th:each="item : ${nodeArray}" th:value="${item.id}" th:text="${item.name}"></option>
</select>
</div>
</div>
@ -68,9 +58,7 @@
<select name="selectUser" id="selectUser" lay-verify="required" lay-filter="selectUser"
lay-search="">
<option value="">请选择</option>
#foreach($item in $userArray)
<option value="$item.id">$item.name</option>
#end
<option th:each="item : ${userArray}" th:value="${item.id}" th:text="${item.name}"></option>
<option value="system">系统管理员</option>
</select>
</div>
@ -81,16 +69,7 @@
<script type="text/javascript">
const apiWhere = {};
var laydate;
function loadSuccess() {
tableRender({
id: 'tab_user',
elem: '#tab_user',
url: './list_data.json',
toolbar: '#toolbarDemo',
page: true,
where: apiWhere,
cols: [[
var col = [
{field: 'userId', title: '操作者'},
{field: 'ip', title: '操作ip'},
{field: 'nodeId', title: '节点Id'},
@ -103,7 +82,17 @@
}
},
{field: 'op', title: '操作', align: 'center', toolbar: '#bar_projects', fixed: 'right'}
]],
];
function loadSuccess() {
tableRender({
id: 'tab_user',
elem: '#tab_user',
url: './list_data.json',
toolbar: '#toolbarDemo',
page: true,
where: apiWhere,
cols: [col],
parseData: function (data) {
return {
"code": data.code,