mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-02 20:08:40 +08:00
基本页面转化,
This commit is contained in:
parent
d49170f7f1
commit
a26fff46e2
@ -2,6 +2,7 @@ package cn.keepbx.jpom.common;
|
||||
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import cn.jiangzeyin.controller.base.AbstractController;
|
||||
import cn.keepbx.jpom.model.Role;
|
||||
@ -36,7 +37,8 @@ public abstract class BaseAgentController extends BaseJpomController {
|
||||
private static String getUserName(HttpServletRequest request) {
|
||||
String name = ServletUtil.getHeaderIgnoreCase(request, ConfigBean.JPOM_SERVER_USER_NAME);
|
||||
name = CharsetUtil.convert(name, CharsetUtil.CHARSET_ISO_8859_1, CharsetUtil.CHARSET_UTF_8);
|
||||
return StrUtil.emptyToDefault(name, StrUtil.DASHED);
|
||||
name = StrUtil.emptyToDefault(name, StrUtil.DASHED);
|
||||
return URLUtil.decode(name, CharsetUtil.CHARSET_UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,6 @@ import cn.keepbx.jpom.common.BaseServerController;
|
||||
import cn.keepbx.jpom.common.forward.NodeForward;
|
||||
import cn.keepbx.jpom.common.forward.NodeUrl;
|
||||
import cn.keepbx.jpom.model.RunMode;
|
||||
import cn.keepbx.jpom.model.data.AgentWhitelist;
|
||||
import cn.keepbx.jpom.model.data.NodeModel;
|
||||
import cn.keepbx.jpom.model.data.UserModel;
|
||||
import cn.keepbx.jpom.model.log.UserOperateLogV1;
|
||||
@ -24,7 +23,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -62,15 +60,6 @@ public class EditProjectController extends BaseServerController {
|
||||
List<String> jsonArray = whitelistDirectoryService.getProjectDirectory(getNode());
|
||||
setAttribute("whitelistDirectory", jsonArray);
|
||||
|
||||
if (projectInfo != null && jsonArray != null) {
|
||||
for (Object obj : jsonArray) {
|
||||
String itemWhitelistDirectory = AgentWhitelist.getItemWhitelistDirectory(projectInfo, obj.toString());
|
||||
if (itemWhitelistDirectory != null) {
|
||||
setAttribute("itemWhitelistDirectory", itemWhitelistDirectory);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
setAttribute("item", projectInfo);
|
||||
// 运行模式
|
||||
JSONArray runModes = (JSONArray) JSONArray.toJSON(RunMode.values());
|
||||
|
@ -87,26 +87,6 @@ public class OutGivingModel extends BaseModel {
|
||||
return getNodeProject(nodeId, projectId) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目的信息
|
||||
*
|
||||
* @param get 方式自动读取
|
||||
* @return json
|
||||
*/
|
||||
public JSONObject getFirstNodeProject(boolean get) {
|
||||
List<OutGivingNodeProject> outGivingNodeProjectList = getOutGivingNodeProjectList();
|
||||
if (outGivingNodeProjectList == null || outGivingNodeProjectList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
for (OutGivingNodeProject outGivingNodeProject : outGivingNodeProjectList) {
|
||||
JSONObject projectData = outGivingNodeProject.getProjectData(true);
|
||||
if (projectData != null) {
|
||||
return projectData;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点的项目信息
|
||||
*
|
||||
|
@ -1,13 +1,10 @@
|
||||
package cn.keepbx.jpom.model.data;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.jiangzeyin.common.DefaultSystemLog;
|
||||
import cn.jiangzeyin.common.spring.SpringUtil;
|
||||
import cn.keepbx.jpom.model.BaseEnum;
|
||||
import cn.keepbx.jpom.model.BaseJsonModel;
|
||||
import cn.keepbx.jpom.service.manage.ProjectInfoService;
|
||||
import cn.keepbx.jpom.service.node.NodeService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* 节点项目
|
||||
@ -16,7 +13,6 @@ import com.alibaba.fastjson.JSONObject;
|
||||
* @date 2019/4/22
|
||||
*/
|
||||
public class OutGivingNodeProject extends BaseJsonModel {
|
||||
private static ProjectInfoService projectInfoService;
|
||||
private static NodeService nodeService;
|
||||
|
||||
private String nodeId;
|
||||
@ -25,7 +21,6 @@ public class OutGivingNodeProject extends BaseJsonModel {
|
||||
private int status = Status.No.getCode();
|
||||
private String result;
|
||||
|
||||
private JSONObject projectInfo;
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
@ -71,31 +66,6 @@ public class OutGivingNodeProject extends BaseJsonModel {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对应的项目数据
|
||||
*
|
||||
* @param get 防止自动读取
|
||||
* @return json
|
||||
*/
|
||||
JSONObject getProjectData(boolean get) {
|
||||
if (projectInfo != null) {
|
||||
return projectInfo;
|
||||
}
|
||||
if (projectInfoService == null) {
|
||||
projectInfoService = SpringUtil.getBean(ProjectInfoService.class);
|
||||
}
|
||||
if (nodeService == null) {
|
||||
nodeService = SpringUtil.getBean(NodeService.class);
|
||||
}
|
||||
NodeModel nodeModel = nodeService.getItem(this.nodeId);
|
||||
try {
|
||||
projectInfo = projectInfoService.getItem(nodeModel, this.projectId);
|
||||
} catch (Exception e) {
|
||||
DefaultSystemLog.ERROR().error("获取信息异常", e);
|
||||
}
|
||||
return projectInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点的数据
|
||||
*
|
||||
|
@ -222,7 +222,10 @@
|
||||
function tableRender(data) {
|
||||
var done = data.done;
|
||||
delete data.done;
|
||||
|
||||
var cols = data.cols;
|
||||
if (!(cols[0] instanceof Array)) {
|
||||
data.cols = [cols];
|
||||
}
|
||||
var newWhere = {
|
||||
nodeId: getTopQueryString("nodeId")
|
||||
};
|
||||
|
@ -44,6 +44,11 @@
|
||||
.layui-tab-title li:first-child > i {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layui-logo {
|
||||
width: auto !important;
|
||||
left: 20px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="layui-side layui-bg-black">
|
||||
|
@ -10,9 +10,8 @@
|
||||
<div class="layui-logo">
|
||||
<a href="../index.html" style="color: #009688;">Jpom项目管理系统>> </a>
|
||||
<span th:title="'版本时间:'+${jpomManifest.timeStamp}+',进程ID:'+${jpomManifest.pid}">
|
||||
<span th:text="${node.name}"></span>
|
||||
<font style="font-size: 10px;"
|
||||
th:text="'('+${jpomManifest.version}+')'"></font>
|
||||
[[${node.name}]]<font style="font-size: 10px;"
|
||||
th:text="'('+${jpomManifest.version}+')'"></font>
|
||||
</span>
|
||||
</div>
|
||||
<div th:replace="common/userHead::userHead"></div>
|
||||
|
@ -1,9 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>项目管理系统</title>
|
||||
<th:block th:include="common/head::head"></th:block>
|
||||
<style>
|
||||
body {
|
||||
position: absolute;
|
||||
@ -59,31 +57,29 @@
|
||||
|
||||
<body>
|
||||
<div class="console">
|
||||
#if($manager)
|
||||
<div class="layui-row" id="optDiv">
|
||||
<!-- layui-elem-quote -->
|
||||
<a href="javascript:;" class="btn-op layui-btn layui-btn-sm" op="start">启动</a>
|
||||
<a href="javascript:;" class="btn-op layui-btn layui-btn-sm layui-btn-warm" op="restart">重启</a>
|
||||
<a href="javascript:;" class="btn-op layui-btn layui-btn-sm layui-btn-danger" op="stop">停止</a>
|
||||
#if($logSize)
|
||||
<div class="layui-btn-group">
|
||||
#if($logSize.logSize)
|
||||
<button id="export" class="layui-btn layui-btn-sm">导出日志</button>
|
||||
<button id="resetLog" class="layui-btn layui-btn-sm">重置日志(<span
|
||||
id="logSize">$logSize.logSize</span>)
|
||||
</button>
|
||||
#end
|
||||
#if($logSize.logBack)
|
||||
<button id="logBack" class="layui-btn layui-btn-sm">备份列表</button>
|
||||
#end
|
||||
</div>
|
||||
#end
|
||||
<div class="status">
|
||||
<div class="status-div"></div>
|
||||
<span></span>
|
||||
</div>
|
||||
|
||||
<div class="layui-row" id="optDiv" th:if="${manager}">
|
||||
<!-- layui-elem-quote -->
|
||||
<a href="javascript:;" class="btn-op layui-btn layui-btn-sm" op="start">启动</a>
|
||||
<a href="javascript:;" class="btn-op layui-btn layui-btn-sm layui-btn-warm" op="restart">重启</a>
|
||||
<a href="javascript:;" class="btn-op layui-btn layui-btn-sm layui-btn-danger" op="stop">停止</a>
|
||||
|
||||
<div th:if="${logSize}" class="layui-btn-group">
|
||||
|
||||
<th:block th:if="${logSize?.get('logSize')}">
|
||||
<button id="export" class="layui-btn layui-btn-sm">导出日志</button>
|
||||
<button id="resetLog" class="layui-btn layui-btn-sm">重置日志(<span
|
||||
id="logSize" th:text="${logSize?.logSize}"></span>)
|
||||
</button>
|
||||
</th:block>
|
||||
|
||||
<button th:if="${logSize?.logBack}" id="logBack" class="layui-btn layui-btn-sm">备份列表</button>
|
||||
</div>
|
||||
#end
|
||||
<div class="status">
|
||||
<div class="status-div"></div>
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="terminal"></div>
|
||||
</div>
|
||||
</body>
|
||||
@ -96,7 +92,7 @@
|
||||
function loadSuccess() {
|
||||
const showLogDom = $('.console .terminal');
|
||||
if ('WebSocket' in window) {
|
||||
var url = getSocketHost() + "/console?userId=$user.getUserMd5Key()&projectId=$!projectInfo.id&nodeId=$node.id";
|
||||
var url = getSocketHost() + "/console?userId=[[${session.user.getUserMd5Key()}]]&projectId=[[${projectInfo?.id}]]&nodeId=[[${node?.id}]]";
|
||||
const ws = new WebSocket(url);
|
||||
ws.onopen = function () {
|
||||
showLogDom.append('WebSocket连接成功!<br/>');
|
||||
@ -133,11 +129,9 @@
|
||||
$('.status .status-div').removeClass('status-run').addClass('status-stop');
|
||||
$('.status span').text(json_data.msg);
|
||||
setOpBtn(true);
|
||||
#if($logSize.logSize)
|
||||
if (op == 'status') {
|
||||
setMsg("showlog");
|
||||
}
|
||||
#end
|
||||
if (op == 'status') {
|
||||
setMsg("showlog");
|
||||
}
|
||||
}
|
||||
refreshProjectData();
|
||||
break;
|
||||
@ -166,7 +160,7 @@
|
||||
heart = setInterval(function () {
|
||||
const data = {
|
||||
op: "heart",
|
||||
projectId: "$!projectInfo.id"
|
||||
projectId: "[[${projectInfo?.id}]]"
|
||||
};
|
||||
ws.send(JSON.stringify(data));
|
||||
}, 5000);
|
||||
@ -175,7 +169,7 @@
|
||||
};
|
||||
|
||||
ws.onclose = function (er) {
|
||||
console.log(er)
|
||||
// console.log(er)
|
||||
showLogDom.append('WebSocket连接已关闭!<br/>');
|
||||
clearInterval(loopLogTime);
|
||||
clearInterval(heart);
|
||||
@ -207,7 +201,7 @@
|
||||
function setMsg(opt) {
|
||||
const data = {
|
||||
op: opt,
|
||||
projectId: "$!projectInfo.id"
|
||||
projectId: "[[${projectInfo?.id}]]"
|
||||
};
|
||||
layer.load(1, {
|
||||
shade: [0.3, '#fff']
|
||||
@ -247,19 +241,17 @@
|
||||
if (loopLog) {
|
||||
return;
|
||||
}
|
||||
#if($logSize)
|
||||
loopLog = true;
|
||||
loopLogTime = setInterval(function () {
|
||||
reqLogSize();
|
||||
}, 30000)
|
||||
#end
|
||||
loopLog = true;
|
||||
loopLogTime = setInterval(function () {
|
||||
reqLogSize();
|
||||
}, 30000);
|
||||
}
|
||||
|
||||
function reqLogSize() {
|
||||
silentAjax({
|
||||
url: './log/logSize',
|
||||
data: {
|
||||
id: "$!projectInfo.id"
|
||||
id: "[[${projectInfo?.id}]]"
|
||||
},
|
||||
success: function (data) {
|
||||
if (200 == data.code) {
|
||||
@ -276,7 +268,7 @@
|
||||
}
|
||||
|
||||
$('#export').on('click', function () {
|
||||
var url = "./log/export.html?id=$!projectInfo.id";
|
||||
var url = "./log/export.html?id=[[${projectInfo?.id}]]";
|
||||
url = appendNodeId(url);
|
||||
layer.msg('加载中..', {
|
||||
icon: 16,
|
||||
@ -294,7 +286,7 @@
|
||||
loadingAjax({
|
||||
url: './log/resetLog',
|
||||
data: {
|
||||
id: "$!projectInfo.id"
|
||||
id: "[[${projectInfo?.id}]]"
|
||||
},
|
||||
success: function (data) {
|
||||
layer.msg(data.msg);
|
||||
@ -313,11 +305,11 @@
|
||||
title: '备份列表',
|
||||
shade: 0.8,
|
||||
area: ['80%', '90%'],
|
||||
content: './log/logBack?id=$!projectInfo.id'
|
||||
content: './log/logBack?id=[[${projectInfo?.id}]]'
|
||||
});
|
||||
})
|
||||
}
|
||||
## 刷新项目数据
|
||||
|
||||
function refreshProjectData() {
|
||||
try {
|
||||
top.frames["manageList"].location.reload();
|
@ -1,9 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>项目管理系统</title>
|
||||
<th:block th:include="common/head::head"></th:block>
|
||||
<style>
|
||||
.div-project {
|
||||
width: 100%;
|
||||
@ -21,33 +19,30 @@
|
||||
|
||||
|
||||
<div class="layui-container div-project" id="div-project">
|
||||
#if($item.outGivingProject)
|
||||
<blockquote class="layui-elem-quote layui-quote-nm">
|
||||
节点分发项目请在节点分发管理页面中修改
|
||||
</blockquote>
|
||||
#end
|
||||
|
||||
<blockquote th:if="${item?.outGivingProject}" class="layui-elem-quote layui-quote-nm">
|
||||
节点分发项目请在节点分发管理页面中修改
|
||||
</blockquote>
|
||||
|
||||
<form action="saveProject" method="post" class="layui-form" id="form_project" lay-filter="form_project">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label"><span class="x-red">*</span>项目名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input #if($item.outGivingProject)readonly#end type="text" name="name" placeholder="项目名称" required
|
||||
<input th:readonly="${item?.outGivingProject}" type="text" name="name" placeholder="项目名称" required
|
||||
lay-verify="required"
|
||||
class="layui-input"
|
||||
value="#if($item)#if($item.name)$!item.name#else$!item.id#end#end">
|
||||
<div class="layui-hide">
|
||||
<input type="hidden" name="edit" value="#if($item)on#end">
|
||||
</div>
|
||||
|
||||
th:value="${item?.name}">
|
||||
<input type="hidden" name="edit" th:value="${item!=null}?'on':''">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">分组名称</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="group" lay-filter="group" #if($item.outGivingProject)disabled#end>
|
||||
#foreach($i in $groups)
|
||||
<option value="$i" #if($item.group==$i)selected#end>$i</option>
|
||||
#end
|
||||
<select name="group" lay-filter="group" th:disabled="${item?.outGivingProject}">
|
||||
|
||||
<option th:each="i : ${groups}" th:value="${i}" th:selected="${item?.group==$i}"
|
||||
th:text="${i}"></option>
|
||||
<option value="">选择手动添加</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -58,17 +53,18 @@
|
||||
<label class="layui-form-label"><span class="x-red">*</span>项目ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="id" placeholder="程序运行标志(设置后将不能修改)" required lay-verify="required"
|
||||
class="layui-input #if($item)layui-disabled#end" value="#if($item)$!item.id#end"
|
||||
#if($item)readonly#end>
|
||||
th:class="${item}?'layui-input layui-disabled':'layui-input'" th:value="${item?.id}"
|
||||
th:readonly="${item?.outGivingProject}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label"><span class="x-red">*</span>运行方式</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="runMode" lay-filter="runMode" #if($item.outGivingProject)disabled#end>
|
||||
#foreach($itemPath in $runModes)
|
||||
<option value="$itemPath" #if($item.runMode==$itemPath)selected#end>$itemPath</option>
|
||||
#end
|
||||
<select name="runMode" lay-filter="runMode" th:disabled="${item?.outGivingProject}">
|
||||
|
||||
<option th:each="itemPath : ${runModes}" th:value="${itemPath}"
|
||||
th:selected="${item?.runMode==itemPath}" th:text="${itemPath}">
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -77,24 +73,13 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label"><span class="x-red">*</span>项目路径</label>
|
||||
<div class="layui-input-block">
|
||||
|
||||
<select name="whitelistDirectory"
|
||||
#if($item.outGivingProject)disabled#end required lay-verify="required"
|
||||
th:disabled="${item?.outGivingProject}" required lay-verify="required"
|
||||
lay-filter="projectLib">
|
||||
#if(!$itemWhitelistDirectory)
|
||||
<option value="">请选择白名单</option>
|
||||
#end
|
||||
#foreach($itemPath in $whitelistDirectory)
|
||||
#if($item && $itemWhitelistDirectory.startsWith($itemPath))
|
||||
<option value="$itemPath" selected>$itemPath</option>
|
||||
#set($hasetPath=$itemPath)
|
||||
#else
|
||||
<option value="$itemPath">$itemPath</option>
|
||||
#end
|
||||
#end
|
||||
#if(!$whitelistDirectory || $whitelistDirectory.size()<=0)
|
||||
<option value="">请添加白名单</option>
|
||||
#end
|
||||
<option th:unless="${#lists.isEmpty(whitelistDirectory)}" value="">请选择白名单</option>
|
||||
<option th:each="itemPath : ${whitelistDirectory}" th:value="${itemPath}"
|
||||
th:selected="${item?.whitelistDirectory==itemPath}" th:text="${itemPath}"></option>
|
||||
<option value="" th:if="${#lists.isEmpty(whitelistDirectory)}">请添加白名单</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -102,33 +87,40 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" title="$!item.log"><span class="x-red">*</span>项目Jar包</label>
|
||||
<div class="layui-input-block">
|
||||
<input
|
||||
#if($item.outGivingProject)readonly#end type="text" name="lib" placeholder="jar存储的文件夹" required
|
||||
lay-verify="required"
|
||||
class="layui-input" value="#if($item)$!item.lib#end">
|
||||
<input th:readonly="${item?.outGivingProject}" type="text" name="lib" placeholder="jar存储的文件夹"
|
||||
required
|
||||
lay-verify="required"
|
||||
class="layui-input" th:value="${item?.lib}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux" style="padding: 0 !important;">
|
||||
<div class="layui-input-block" style="color: red;min-height: 0px;">
|
||||
结果:
|
||||
<span id="projectStart">#if($hasetPath)$hasetPath#else 请选择#end</span>
|
||||
<span id="projectEnd" style="margin-left: -4px">#if(!$item)请填写#else$!item.lib#end</span>
|
||||
#if($item)
|
||||
<span> 日志路径:$!item.log</span>
|
||||
#end
|
||||
<span id="projectStart">请选择</span>
|
||||
<span id="projectEnd" style="margin-left: -4px">请填写</span>
|
||||
<span th:if="${item}"> 日志路径:[[${item?.log}]]</span>
|
||||
</div>
|
||||
|
||||
<script th:if="${item}" th:inline="javascript" type="text/javascript">
|
||||
asyncFn.push(function () {
|
||||
$("#projectEnd").text([[${item?.lib}]]);
|
||||
$("#projectStart").text([[${item?.whitelistDirectory}]]);
|
||||
if ([[${item?.runMode}]] === 'ClassPath') {
|
||||
$("#mainClassDiv").show();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="layui-input-block" id="tipMsgDiv" style="color: red;min-height: 0px;display: none">
|
||||
提示:<span id="tipMsg"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" #if($item)style="display: none;"#end id="mainClassDiv">
|
||||
<div class="layui-form-item" th:style="${item!=null}?'display: none;':''" id="mainClassDiv">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">MainClass</label>
|
||||
<div class="layui-input-block">
|
||||
<input #if($item.outGivingProject)readonly#end type="text" name="mainClass"
|
||||
<input th:readonly="${item?.outGivingProject}" type="text" name="mainClass"
|
||||
placeholder="程序运行的 main 类(jar模式运行可以不填)" class="layui-input"
|
||||
value="#if($item)$!item.mainClass#end">
|
||||
th:value="${item?.mainClass}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -136,17 +128,17 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">Jvm参数</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea #if($item.outGivingProject)readonly#end name="jvm"
|
||||
placeholder="jvm参数,非必填.如:-Xmin=512m -Xmax=512m"
|
||||
class="layui-textarea">#if($item)$!item.jvm#end</textarea>
|
||||
<textarea th:readonly="${item?.outGivingProject}" name="jvm"
|
||||
placeholder="jvm参数,非必填.如:-Xmin=512m -Xmax=512m"
|
||||
class="layui-textarea" th:text="${item?.jvm}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">args参数</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea #if($item.outGivingProject)readonly#end name="args"
|
||||
<textarea th:readonly="${item?.outGivingProject}" name="args"
|
||||
placeholder="Main函数args参数,非必填.如:--service.port=8080"
|
||||
class="layui-textarea">#if($item)$!item.args#end</textarea>
|
||||
class="layui-textarea" th:text="${item?.args}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -154,34 +146,34 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">WebHooks</label>
|
||||
<div class="layui-input-block">
|
||||
<input #if($item.outGivingProject)readonly#end type="text" name="token" placeholder="关闭程序时自动请求,非必填,GET请求"
|
||||
class="layui-input"
|
||||
value="#if($item)$!item.token#end">
|
||||
<input th:readonly="${item?.outGivingProject}" type="text" name="token"
|
||||
placeholder="关闭程序时自动请求,非必填,GET请求"
|
||||
class="layui-input"
|
||||
th:value="${item?.token}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#if($item.runCommand)
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">运行命令</label>
|
||||
<div class="layui-input-block">
|
||||
<blockquote class="layui-elem-quote layui-quote-nm">
|
||||
$item.runCommand
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item" th:if="${item?.get('runCommand')}">
|
||||
<label class="layui-form-label">运行命令</label>
|
||||
<div class="layui-input-block">
|
||||
<blockquote class="layui-elem-quote layui-quote-nm" th:text="${item?.runCommand}">
|
||||
</blockquote>
|
||||
</div>
|
||||
#end
|
||||
#if(!$item || $user.isProject($node.id,$!item.id))
|
||||
<div class="layui-form-item" style="padding-left: 20%">
|
||||
#if(!$item.outGivingProject)
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="submitProject"
|
||||
id="project_submit">提交
|
||||
</button>
|
||||
#if($item)
|
||||
<a class="layui-btn layui-btn-warm" data-id="$item.id" id="delete_project">删除</a>
|
||||
#end
|
||||
#end
|
||||
</div>
|
||||
#end
|
||||
</div>
|
||||
|
||||
<div th:if="${item==null || session.user.isProject(node.id,item?.id)}" class="layui-form-item"
|
||||
style="padding-left: 20%">
|
||||
<th:block th:unless="${item?.outGivingProject}">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit
|
||||
lay-filter="submitProject"
|
||||
id="project_submit">提交
|
||||
</button>
|
||||
|
||||
<a th:if="${item}" class="layui-btn layui-btn-warm" data-id="$item.id" id="delete_project">删除</a>
|
||||
</th:block>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
@ -217,7 +209,7 @@
|
||||
}
|
||||
form.val("form_project", {
|
||||
"group": text
|
||||
})
|
||||
});
|
||||
form.render('select');
|
||||
});
|
||||
}
|
||||
@ -231,9 +223,7 @@
|
||||
$("#mainClassDiv").hide();
|
||||
}
|
||||
});
|
||||
#if($item.runMode=='ClassPath')
|
||||
$("#mainClassDiv").show();
|
||||
#end
|
||||
|
||||
|
||||
form.on('select(projectLib)', function (data) {
|
||||
let val = data.value;
|
||||
@ -314,7 +304,7 @@
|
||||
});
|
||||
});
|
||||
}
|
||||
## 刷新项目列表
|
||||
|
||||
function autoClose(group) {
|
||||
setTimeout(function () {
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
@ -1,10 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>项目管理系统</title>
|
||||
<link href="$!jpomProxyPath/static/ztree/zTreeStyle/zTreeStyle.css" rel="stylesheet">
|
||||
<th:block th:include="common/head::head"></th:block>
|
||||
<link th:href="@{${session.jpomProxyPath}+'/static/ztree/zTreeStyle/zTreeStyle.css'}" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
padding: 10px 10px 0px 10px;
|
||||
@ -42,7 +40,7 @@
|
||||
|
||||
<div class="layui-layout-right" style="padding-right: 20px;padding-top: 10px;">
|
||||
<div>
|
||||
文件位置:$absLib
|
||||
文件位置:[[${absLib}]]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -56,7 +54,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
## 删除按钮
|
||||
|
||||
<script type="text/html" id="bar_projects">
|
||||
<a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-danger" lay-event="delete">删除</a>
|
||||
{{# if(!d.isDirectory){ }}
|
||||
@ -83,7 +81,7 @@
|
||||
};
|
||||
|
||||
const tableWhre = {
|
||||
id: '$id'
|
||||
id: '[[${id}]]'
|
||||
};
|
||||
|
||||
var curenntNode = {
|
||||
@ -94,7 +92,7 @@
|
||||
|
||||
function loadSuccess() {
|
||||
//
|
||||
asyncLoadJs("$!jpomProxyPath/static/ztree/jquery.ztree.core.min.js", function () {
|
||||
asyncLoadJs("[[${session.jpomProxyPath}]]/static/ztree/jquery.ztree.core.min.js", function () {
|
||||
zTreeObj = $.fn.zTree.init($("#tree"), setting);
|
||||
zTreeObj.addNodes(null, curenntNode, false);
|
||||
curenntNode = zTreeObj.getNodeByTId("tree_1");
|
||||
@ -104,7 +102,7 @@
|
||||
elem: '#tab_file',
|
||||
url: './getFileList',
|
||||
where: tableWhre,
|
||||
cols: [[
|
||||
cols: [
|
||||
{field: 'index', title: '编号', width: '6%'},
|
||||
{
|
||||
field: 'filename', title: '文件名称', sort: true, width: '30%', templet: function (d) {
|
||||
@ -117,7 +115,7 @@
|
||||
{field: 'modifyTime', title: '修改时间', sort: true, width: '20%'},
|
||||
{field: 'fileSize', title: '文件大小', sort: true, width: '15%'},
|
||||
{field: 'op', title: '操作', toolbar: '#bar_projects'}
|
||||
]],
|
||||
],
|
||||
done: function (ret) {
|
||||
var child = ret.data;
|
||||
if (child) {
|
||||
@ -135,7 +133,7 @@
|
||||
elem: '#uploadFile',
|
||||
accept: 'file',
|
||||
data: {
|
||||
id: '$id',
|
||||
id: '[[${id}]]',
|
||||
levelName: function () {
|
||||
return $("#currentPath").text();
|
||||
}
|
||||
@ -207,7 +205,7 @@
|
||||
elem: '#uploadFile_Import_dom',
|
||||
accept: 'file',
|
||||
data: {
|
||||
id: '$id',
|
||||
id: '[[${id}]]',
|
||||
type: "unzip",
|
||||
clearType: function () {
|
||||
return $("#uploadFile_Import").attr("type");
|
||||
@ -247,7 +245,7 @@
|
||||
loadingAjax({
|
||||
url: './deleteFile',
|
||||
data: {
|
||||
id: '$id',
|
||||
id: '[[${id}]]',
|
||||
type: 'clear'
|
||||
},
|
||||
success: function (data) {
|
||||
@ -302,7 +300,7 @@
|
||||
|
||||
//下载文件
|
||||
function downloadFile(data) {
|
||||
var url = "./download?id=$id&filename=" + encodeURI(data.filename) + "&levelName=" + data.levelName;
|
||||
var url = "./download?id=[[${id}]]&filename=" + encodeURI(data.filename) + "&levelName=" + data.levelName;
|
||||
url = appendNodeId(url);
|
||||
self.location.href = url;
|
||||
}
|
||||
@ -322,7 +320,7 @@
|
||||
loadingAjax({
|
||||
url: './deleteFile',
|
||||
data: {
|
||||
id: '$id',
|
||||
id: '[[${id}]]',
|
||||
filename: data.filename,
|
||||
levelName: data.levelName
|
||||
},
|
@ -1,9 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>项目管理系统</title>
|
||||
<th:block th:include="common/head::head"></th:block>
|
||||
<style>
|
||||
body {
|
||||
padding: 20px;
|
||||
@ -25,8 +23,8 @@
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<button op="a" class="layui-btn layui-btn-sm layui-btn-normal" href="./stack?tag=$!tag">导出堆栈信息</button>
|
||||
<button op="a" class="layui-btn layui-btn-sm layui-btn-normal" href="./ram?tag=$!tag">导出内存信息</button>
|
||||
<button op="a" class="layui-btn layui-btn-sm layui-btn-normal" th:href="@{./stack(tag=${tag})}">导出堆栈信息</button>
|
||||
<button op="a" class="layui-btn layui-btn-sm layui-btn-normal" th:href="@{./ram(tag=${tag})}">导出内存信息</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal" id="threadInfos">查看线程</button>
|
||||
</div>
|
||||
<div class="info">
|
||||
@ -49,59 +47,54 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
#if($data.process)
|
||||
<tr>
|
||||
<td>$!data.process.pid</td>
|
||||
<td>$!data.process.command</td>
|
||||
<td>$!data.process.user</td>
|
||||
<td>$!data.process.res</td>
|
||||
<td>$!data.process.status</td>
|
||||
<td>$!data.process.cpu</td>
|
||||
<td>$!data.process.mem</td>
|
||||
<td>$!data.process.time</td>
|
||||
<td>$!data.process.pr</td>
|
||||
<td>$!data.process.ni</td>
|
||||
<td>$!data.process.virt</td>
|
||||
<td>$!data.process.shr</td>
|
||||
</tr>
|
||||
#else
|
||||
<tr>
|
||||
<td colspan=12 style="text-align:center">无数据</td>
|
||||
</tr>
|
||||
#end
|
||||
<tr th:if="${data?.process}">
|
||||
<td th:text="${data?.process?.pid}"></td>
|
||||
<td th:text="${data?.process?.command}"></td>
|
||||
<td th:text="${data?.process?.user}"></td>
|
||||
<td th:text="${data?.process?.res}"></td>
|
||||
<td th:text="${data?.process?.status}"></td>
|
||||
<td th:text="${data?.process?.cpu}"></td>
|
||||
<td th:text="${data?.process?.mem}"></td>
|
||||
<td th:text="${data?.process?.time}"></td>
|
||||
<td th:text="${data?.process?.pr}"></td>
|
||||
<td th:text="${data?.process?.ni}"></td>
|
||||
<td th:text="${data?.process?.virt}"></td>
|
||||
<td th:text="${data?.process?.shr}"></td>
|
||||
</tr>
|
||||
<tr th:unless="${data?.process}">
|
||||
<td colspan=12 style="text-align:center">无数据</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
#if($data.beanMem)
|
||||
<div class="info">
|
||||
<label> jvm内存</label>
|
||||
<table class="layui-table" style="margin-top: 10px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>已使用堆内存</th>
|
||||
<th>占用堆内存</th>
|
||||
<th>已分配堆内存</th>
|
||||
<th>已使用非堆内存</th>
|
||||
<th>占用非堆内存</th>
|
||||
<th>已分配非堆内存</th>
|
||||
<th>挂起的对象</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>$!data.beanMem.heapUsed</td>
|
||||
<td>$!data.beanMem.heapProportion</td>
|
||||
<td>$!data.beanMem.heapCommitted</td>
|
||||
<td>$!data.beanMem.nonHeapUsed</td>
|
||||
<td>$!data.beanMem.nonHeapProportion</td>
|
||||
<td>$!data.beanMem.nonHeapCommitted</td>
|
||||
<td>$!data.beanMem.mount</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
#end
|
||||
<div class="info" th:if="${data?.beanMem}">
|
||||
<label> jvm内存</label>
|
||||
<table class="layui-table" style="margin-top: 10px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>已使用堆内存</th>
|
||||
<th>占用堆内存</th>
|
||||
<th>已分配堆内存</th>
|
||||
<th>已使用非堆内存</th>
|
||||
<th>占用非堆内存</th>
|
||||
<th>已分配非堆内存</th>
|
||||
<th>挂起的对象</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td th:text="${data?.beanMem?.heapUsed}"></td>
|
||||
<td th:text="${data?.beanMem?.heapProportion}"></td>
|
||||
<td th:text="${data?.beanMem?.heapCommitted}"></td>
|
||||
<td th:text="${data?.beanMem?.nonHeapUsed}"></td>
|
||||
<td th:text="${data?.beanMem?.nonHeapProportion}"></td>
|
||||
<td th:text="${data?.beanMem?.nonHeapCommitted}"></td>
|
||||
<td th:text="${data?.beanMem?.mount}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<label>端口信息</label>
|
||||
@ -120,23 +113,20 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
#foreach($item in $data.netstat)
|
||||
#set($hashNetStat=true)
|
||||
<tr>
|
||||
<td>$!item.name</td>
|
||||
<td>$!item.protocol</td>
|
||||
<td>$!item.local</td>
|
||||
<td>$!item.foreign</td>
|
||||
<td>$!item.status</td>
|
||||
<td>$!item.receive</td>
|
||||
<td>$!item.send</td>
|
||||
</tr>
|
||||
#end
|
||||
#if(!$hashNetStat)
|
||||
<tr>
|
||||
<td colspan=7 style="text-align:center">无数据</td>
|
||||
</tr>
|
||||
#end
|
||||
|
||||
#set($hashNetStat=true)
|
||||
<tr th:each="item : ${data?.netstat}">
|
||||
<td th:text="${item?.name}"></td>
|
||||
<td th:text="${item?.protocol}"></td>
|
||||
<td th:text="${item?.local}"></td>
|
||||
<td th:text="${item?.foreign}"></td>
|
||||
<td th:text="${item?.status}"></td>
|
||||
<td th:text="${item?.receive}"></td>
|
||||
<td th:text="${item?.send}"></td>
|
||||
</tr>
|
||||
<tr th:if="${#lists.isEmpty(data?.netstat)}">
|
||||
<td colspan=7 style="text-align:center">无数据</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -1,14 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>logBack</title>
|
||||
<style>
|
||||
body {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
<head th:replace="common/head::head">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -17,11 +10,11 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>控制台日志路径</td>
|
||||
<td>$!data.logPath</td>
|
||||
<td th:text="${data?.logPath}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>控制台日志备份路径</td>
|
||||
<td>$!data.logBackPath</td>
|
||||
<td th:text="${data?.logBackPath}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -36,28 +29,24 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
#if($data.array && $data.array.size()>0)
|
||||
#foreach($item in $data.array)
|
||||
<tr>
|
||||
<td>$item.index</td>
|
||||
<td>$item.filename</td>
|
||||
<td>$item.modifyTime</td>
|
||||
<td>$item.fileSize</td>
|
||||
<td>
|
||||
<button op="a" href="logBack_download?key=$item.filename&id=$data.id"
|
||||
class="layui-btn layui-btn-warm layui-btn-sm">下载
|
||||
</button>
|
||||
<button name="delete" data-name="$item.filename" data-id="$data.id"
|
||||
class="layui-btn layui-btn-danger layui-btn-sm">删除
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
#end
|
||||
#else
|
||||
<tr>
|
||||
<td colspan="5">没有相关信息</td>
|
||||
</tr>
|
||||
#end
|
||||
|
||||
<tr th:each="item : ${data?.array}">
|
||||
<td th:text="${item.index}"></td>
|
||||
<td th:text="${item.filename}"></td>
|
||||
<td th:text="${item.modifyTime}"></td>
|
||||
<td th:text="${item.fileSize}"></td>
|
||||
<td>
|
||||
<button op="a" th:href="@{logBack_download(key=${item.filename},id=${data?.id})}"
|
||||
class="layui-btn layui-btn-warm layui-btn-sm">下载
|
||||
</button>
|
||||
<button name="delete" th:data-name="${item.filename}" th:data-id="${data?.id}"
|
||||
class="layui-btn layui-btn-danger layui-btn-sm">删除
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr th:if="${#lists.isEmpty(data?.array)}">
|
||||
<td colspan="5">没有相关信息</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -1,20 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>项目管理系统</title>
|
||||
<style>
|
||||
body {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
<head th:replace="common/head::head">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-row">
|
||||
#if($user.isManage($node.id))
|
||||
<button onclick="editProject('');" class="layui-btn layui-btn-sm">新增项目</button>
|
||||
#end
|
||||
|
||||
<button th:if="${session.user.isManage(node.id)}" onclick="editProject('');" class="layui-btn layui-btn-sm">新增项目
|
||||
</button>
|
||||
|
||||
<button onclick="reloadTable();" class="layui-btn layui-btn-sm">刷新表格</button>
|
||||
</div>
|
||||
<table class="layui-table" id="tab_project" lay-filter="tab_project" style="margin: 0;"></table>
|
||||
@ -31,8 +25,7 @@
|
||||
</script>
|
||||
<script type="text/html" id="status_templ">
|
||||
<div title="请到控制台中管理项目">
|
||||
<input type="checkbox" id="" disabled name="status" {{# if(d.status){ }}
|
||||
checked {{# } }}
|
||||
<input type="checkbox" id="" disabled name="status" {{# if(d.status){ }}checked{{# } }}
|
||||
lay-skin="switch"
|
||||
lay-text="运行中|未运行">
|
||||
</div>
|
||||
@ -51,9 +44,7 @@
|
||||
<select name="selectGroup" id="selectGroup" lay-verify="required" lay-filter="groupName"
|
||||
lay-search="">
|
||||
<option value="">请选择</option>
|
||||
#foreach($item in $groups)
|
||||
<option value="$item">$item</option>
|
||||
#end
|
||||
<option th:each="item : ${groups}" th:value="${item}" th:text="${item}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -99,7 +90,7 @@
|
||||
url: './getProjectInfo',
|
||||
toolbar: '#toolbarDemo',
|
||||
where: apiWhere,
|
||||
cols: [[{
|
||||
cols: [{
|
||||
field: 'name', title: '项目名称', width: '15%', sort: true, templet: function (d) {
|
||||
var title = '分组:' + d.group + ' 项目Id:' + d.id;
|
||||
title += ' lib状态:' + (d.runLibDesc || "") + " / " + (d.useLibDesc || "");
|
||||
@ -122,8 +113,7 @@
|
||||
sort: true,
|
||||
width: '8%'
|
||||
},
|
||||
{field: 'op', title: '操作', toolbar: '#bar_projects'}
|
||||
]],
|
||||
{field: 'op', title: '操作', toolbar: '#bar_projects'}],
|
||||
done: function (data) {
|
||||
var projects = data.data;
|
||||
var ids = [];
|
@ -1,13 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>项目管理系统</title>
|
||||
<th:block th:include="common/head::head"></th:block>
|
||||
<style>
|
||||
body {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.div-project {
|
||||
width: 100%;
|
||||
@ -25,50 +20,45 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
#if($user.isManage($node.id))
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>项目名称</th>
|
||||
<th>项目ID</th>
|
||||
<th>项目分组</th>
|
||||
<th>项目路径</th>
|
||||
<th>删除时间</th>
|
||||
<th>操作人</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
#foreach($item in $!array)
|
||||
#set($hashData=true)
|
||||
<tr>
|
||||
<td>$!velocityCount</td>
|
||||
<td>$!item.projectInfoModel.name</td>
|
||||
<td>$!item.projectInfoModel.id</td>
|
||||
<td>$!item.projectInfoModel.group</td>
|
||||
<td>$!item.projectInfoModel.lib</td>
|
||||
<td>$!item.delTime</td>
|
||||
<td>$!item.delUser</td>
|
||||
<td>
|
||||
<button name="delete" onclick="projectDetail(this)" data-name="$item.filename"
|
||||
index="$!velocityCount" data-id="$!item.id"
|
||||
class="layui-btn layui-btn-sm">详情
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
#end
|
||||
#if(!$hashData)
|
||||
<tr>
|
||||
<td colspan=8 style="text-align:center">无数据</td>
|
||||
</tr>
|
||||
#end
|
||||
</tbody>
|
||||
</table>
|
||||
#else
|
||||
<h1>你没有权限</h1>
|
||||
#end
|
||||
<table th:if="${session.user.isManage(node.id)}" class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>项目名称</th>
|
||||
<th>项目ID</th>
|
||||
<th>项目分组</th>
|
||||
<th>项目路径</th>
|
||||
<th>删除时间</th>
|
||||
<th>操作人</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr th:each="item,i: ${array}">
|
||||
<td th:text="${i.index}"></td>
|
||||
<td>$!item.projectInfoModel.name</td>
|
||||
<td>$!item.projectInfoModel.id</td>
|
||||
<td>$!item.projectInfoModel.group</td>
|
||||
<td>$!item.projectInfoModel.lib</td>
|
||||
<td>$!item.delTime</td>
|
||||
<td>$!item.delUser</td>
|
||||
<td>
|
||||
<button name="delete" onclick="projectDetail(this)"
|
||||
th:index="${i.index}" th:data-id="${item.id}"
|
||||
class="layui-btn layui-btn-sm">详情
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr th:if="${#lists.isEmpty(array)}">
|
||||
<td colspan=8 style="text-align:center">无数据</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h1 th:unless="${session.user.isManage(node.id)}">你没有权限</h1>
|
||||
|
||||
|
||||
<div class="layui-container div-project" id="div-project">
|
||||
<div class="layui-form-item">
|
@ -1,9 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>项目管理系统</title>
|
||||
<th:block th:include="common/head::head"></th:block>
|
||||
<style>
|
||||
body {
|
||||
position: absolute;
|
||||
@ -59,21 +58,18 @@
|
||||
|
||||
<body>
|
||||
<div class="console">
|
||||
<div th:if="${session.user.isManage(node.id)}" class="layui-row" id="optDiv">
|
||||
<!-- layui-elem-quote -->
|
||||
<a href="javascript:;" class="btn-op layui-btn layui-btn-sm" op="start">执行</a>
|
||||
<!-- <a href="javascript:;" class="btn-op layui-btn layui-btn-sm layui-btn-warm" op="restart">重启</a>-->
|
||||
<a href="javascript:;" style="display: none;" class="btn-op layui-btn layui-btn-sm layui-btn-danger"
|
||||
op="stop">停止</a>
|
||||
|
||||
#if($user.isManage($node.id))
|
||||
<div class="layui-row" id="optDiv">
|
||||
<!-- layui-elem-quote -->
|
||||
<a href="javascript:;" class="btn-op layui-btn layui-btn-sm" op="start">执行</a>
|
||||
## <a href="javascript:;" class="btn-op layui-btn layui-btn-sm layui-btn-warm" op="restart">重启</a>
|
||||
<a href="javascript:;" style="display: none;" class="btn-op layui-btn layui-btn-sm layui-btn-danger"
|
||||
op="stop">停止</a>
|
||||
|
||||
<div class="status">
|
||||
<div class="status-div"></div>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<div class="status-div"></div>
|
||||
<span></span>
|
||||
</div>
|
||||
#end
|
||||
</div>
|
||||
<div class="terminal"></div>
|
||||
</div>
|
||||
</body>
|
||||
@ -85,7 +81,7 @@
|
||||
const showLogDom = $('.console .terminal');
|
||||
|
||||
if ('WebSocket' in window) {
|
||||
var url = getSocketHost() + "/script_run?userId=$user.getUserMd5Key()&scriptId=" + scriptId + "&nodeId=$node.id&type=script";
|
||||
var url = getSocketHost() + "/script_run?userId=[[${session.user.getUserMd5Key()}]]&scriptId=" + scriptId + "&nodeId=[[${node.id}]]&type=script";
|
||||
const ws = new WebSocket(url);
|
||||
ws.onopen = function () {
|
||||
showLogDom.append('WebSocket连接成功!<br/>');
|
@ -1,14 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>oss</title>
|
||||
<style>
|
||||
body {
|
||||
padding-top: 20px;
|
||||
}
|
||||
</style>
|
||||
<head th:replace="common/head::head">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -18,35 +11,31 @@
|
||||
<label class="layui-form-label">模板ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="id" placeholder="请输入模板Id" required lay-verify="required"
|
||||
value="$!item.id" #if($item)readonly#end class="layui-input">
|
||||
<input type="hidden" name="type" value="$type">
|
||||
th:value="${item?.id}" th:readonly="${item}" class="layui-input">
|
||||
<input type="hidden" name="type" th:value="${type}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模板名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="name" placeholder="请输入模板名称" required lay-verify="required"
|
||||
value="$!item.name" class="layui-input">
|
||||
th:value="${item?.name}" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模板内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="context" style="height: 50vh;" placeholder="请输入模板内容"
|
||||
class="layui-textarea auto">$!item.context</textarea>
|
||||
class="layui-textarea auto" th:text="${item?.context}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
#if($user.isSystemUser())
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
|
||||
|
||||
#if($item)
|
||||
<a class="layui-btn layui-btn-warm" data-id="$item.id" id="delete">删除</a>
|
||||
#end
|
||||
</div>
|
||||
<div th:if="${session.user.isSystemUser()}" class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
|
||||
<a th:if="${item}" class="layui-btn layui-btn-warm" data-id="$item.id" id="delete">删除</a>
|
||||
</div>
|
||||
#end
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
@ -1,23 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>项目管理系统</title>
|
||||
<style>
|
||||
body {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
<head th:replace="common/head::head">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="layui-row">
|
||||
<button onclick="location.reload();" class="layui-btn layui-btn-sm">刷新表格</button>
|
||||
#if($user.isSystemUser())
|
||||
|
||||
<th:block th:if="${session.user.isSystemUser()}">
|
||||
<button onclick="editItem('');" class="layui-btn layui-btn-sm">添加模板</button>
|
||||
<button id="import" class="layui-btn layui-btn-sm">导入模板</button>
|
||||
#end
|
||||
</th:block>
|
||||
|
||||
</div>
|
||||
<div class="layui-form">
|
||||
@ -32,28 +26,24 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
#foreach($item in $array)
|
||||
<tr>
|
||||
<td>$item.id</td>
|
||||
<td>$item.name</td>
|
||||
<td>$item.modifyTime</td>
|
||||
<td>$item.lastRunUser</td>
|
||||
<td>
|
||||
<button onclick="runScript('$item.id')" class="layui-btn layui-btn-warm layui-btn-sm">执行
|
||||
</button>
|
||||
<tr th:each="item : ${array}">
|
||||
<td th:text="${item.id}"></td>
|
||||
<td th:text="${item.name}"></td>
|
||||
<td th:text="${item.modifyTime}"></td>
|
||||
<td th:text="${item.lastRunUser}"></td>
|
||||
<td>
|
||||
<button th:sId="${item.id}" onclick="runScript(this)" class="layui-btn layui-btn-warm layui-btn-sm">执行
|
||||
</button>
|
||||
<button th:sId="${item.id}" th:text="${session.user.isSystemUser()}?'修改':'预览'"
|
||||
onclick="editItem(this)"
|
||||
class="layui-btn layui-btn-sm">
|
||||
</button>
|
||||
|
||||
<button onclick="editItem('$item.id')" class="layui-btn layui-btn-sm">#if($user.isSystemUser())
|
||||
修改#else 预览#end
|
||||
</button>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
#end
|
||||
#if(!$array || $array.size()<=0)
|
||||
<tr>
|
||||
<td colspan="5">没有相关信息</td>
|
||||
</tr>
|
||||
#end
|
||||
</td>
|
||||
</tr>
|
||||
<tr th:if="${#lists.isEmpty(array)}">
|
||||
<td colspan="5">没有相关信息</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -86,7 +76,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
function editItem(id) {
|
||||
function editItem(t) {
|
||||
var id = $(t).attr("sId");
|
||||
layerOpen({
|
||||
type: 2,
|
||||
title: '管理脚本模板',
|
||||
@ -96,7 +87,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
function runScript(id) {
|
||||
function runScript(t) {
|
||||
var id = $(t).attr("sId");
|
||||
tabChange({
|
||||
id: "runScript-" + id,
|
||||
url: './script/console.html?id=' + id,
|
@ -1,13 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>证书管理</title>
|
||||
<th:block th:include="common/head::head"></th:block>
|
||||
<style>
|
||||
body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.layui-container {
|
||||
width: 80% !important;
|
||||
@ -54,9 +49,8 @@
|
||||
<select name="path" id="path" lay-filter="aihao" required
|
||||
lay-verify="required">
|
||||
<option value="">请选择证书存放的路径</option>
|
||||
#foreach($item in $certificate)
|
||||
<option id="path_$item" value="$item">$item</option>
|
||||
#end
|
||||
|
||||
<option th:each="item : ${certificate}" th:id="'path_'+${item}" th:value="${item}" th:text="${item}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -102,36 +96,37 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
var laytpl;
|
||||
var col = [
|
||||
{field: 'id', title: 'id', width: '10%', sort: true},
|
||||
{field: 'name', title: '名称', sort: true},
|
||||
{field: 'domain', title: '域名', sort: true},
|
||||
{
|
||||
field: 'effectiveTime',
|
||||
title: '生效时间',
|
||||
width: '14%',
|
||||
sort: true,
|
||||
templet: function (d) {
|
||||
return formateTime(d.effectiveTime);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'expirationTime',
|
||||
title: '到期时间',
|
||||
width: '14%',
|
||||
sort: true,
|
||||
templet: function (d) {
|
||||
return formateTime(d.expirationTime);
|
||||
}
|
||||
},
|
||||
{field: 'op', title: '操作', align: 'center', toolbar: '#bar_cert', fixed: 'right'}
|
||||
];
|
||||
|
||||
function loadSuccess() {
|
||||
tableRender({
|
||||
id: 'tab_certificate',
|
||||
elem: '#tab_certificate',
|
||||
url: './getCertList',
|
||||
cols: [[
|
||||
{field: 'id', title: 'id', width: '10%', sort: true},
|
||||
{field: 'name', title: '名称', sort: true},
|
||||
{field: 'domain', title: '域名', sort: true},
|
||||
{
|
||||
field: 'effectiveTime',
|
||||
title: '生效时间',
|
||||
width: '14%',
|
||||
sort: true,
|
||||
templet: function (d) {
|
||||
return formateTime(d.effectiveTime);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'expirationTime',
|
||||
title: '到期时间',
|
||||
width: '14%',
|
||||
sort: true,
|
||||
templet: function (d) {
|
||||
return formateTime(d.expirationTime);
|
||||
}
|
||||
},
|
||||
{field: 'op', title: '操作', align: 'center', toolbar: '#bar_cert', fixed: 'right'}
|
||||
]]
|
||||
cols: [col]
|
||||
});
|
||||
|
||||
var uploadConfig, hashSelectConfig, updateFormData;
|
@ -1,35 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>nginx管理</title>
|
||||
<style>
|
||||
body {
|
||||
padding: 10px 10px 0px 10px;
|
||||
}
|
||||
|
||||
.layui-container {
|
||||
width: 80% !important;
|
||||
}
|
||||
|
||||
.layui-inline {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.div_hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<head th:replace="common/head::head">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="layui-row">
|
||||
<button id="addNgx" class="layui-btn layui-btn-sm">新增nginx配置</button>
|
||||
<button onclick="reload();" class="layui-btn layui-btn-sm">刷新表格</button>
|
||||
## <button id="reload" class="layui-btn layui-btn-sm layui-btn-danger">重启nginx</button>
|
||||
|
||||
<button id="reload" class="layui-btn layui-btn-sm layui-btn-danger">重启nginx</button>
|
||||
</div>
|
||||
<table class="layui-table" id="tab_ngx" lay-filter="tab_ngx" style="margin: 0;"></table>
|
||||
|
||||
@ -78,21 +58,22 @@
|
||||
});
|
||||
}
|
||||
|
||||
var col = [
|
||||
{field: 'name', title: '文件名', sort: true},
|
||||
{field: 'serverCount', title: '数量', width: "5%", sort: true},
|
||||
{field: 'server_name', title: '域名', sort: true},
|
||||
{field: 'location', title: '根location', sort: true},
|
||||
{field: 'listen', title: '监听端口', width: "10%", sort: true},
|
||||
{field: 'time', title: '最后修改时间', sort: true},
|
||||
{
|
||||
field: 'op', title: '操作', align: 'center', toolbar: '#bar_ngx', fixed: 'right'
|
||||
}
|
||||
];
|
||||
tableRender({
|
||||
id: 'tab_ngx',
|
||||
elem: '#tab_ngx',
|
||||
url: './list_data.json',
|
||||
cols: [[
|
||||
{field: 'name', title: '文件名', sort: true},
|
||||
{field: 'serverCount', title: '数量', width: "5%", sort: true},
|
||||
{field: 'server_name', title: '域名', sort: true},
|
||||
{field: 'location', title: '根location', sort: true},
|
||||
{field: 'listen', title: '监听端口', width: "10%", sort: true},
|
||||
{field: 'time', title: '最后修改时间', sort: true},
|
||||
{
|
||||
field: 'op', title: '操作', align: 'center', toolbar: '#bar_ngx', fixed: 'right'
|
||||
}
|
||||
]]
|
||||
cols: [col]
|
||||
});
|
||||
|
||||
// 删除
|
@ -1,13 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>nginx管理</title>
|
||||
<th:block th:include="common/head::head"></th:block>
|
||||
<style>
|
||||
body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.context {
|
||||
height: 70vh;
|
||||
@ -22,22 +18,23 @@
|
||||
|
||||
<body>
|
||||
<form action="" class="layui-form" id="form_ngx">
|
||||
<input type="hidden" name="genre" value="$type">
|
||||
<input type="hidden" name="genre" th:value="${type}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">文件路径</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="whitePath" id="whitePath" required lay-verify="required"
|
||||
#if($type=="update")disabled #end>
|
||||
th:disabled="${type=='update'}">
|
||||
<option value="">请选择白名单路径</option>
|
||||
#foreach($item in $nginx)
|
||||
<option value="$item" #if($item==$data.whitePath) selected #end>$!item</option>
|
||||
#end
|
||||
|
||||
<option th:each="item : ${nginx}" th:value="${item}" th:selected="${item==data?.whitePath}"
|
||||
th:text="${item}">
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="layui-form-label">文件名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" placeholder='文件后缀必须为".conf"' class="layui-input" #if($type==
|
||||
"update") disabled #end value="$!data.name" required lay-verify="required">
|
||||
<input type="text" name="name" placeholder='文件后缀必须为".conf"' class="layui-input"
|
||||
th:disabled="${type=='update'}" th:value="${data?.name}" required lay-verify="required">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -45,7 +42,7 @@
|
||||
<label class="layui-form-label">配置内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="context" required lay-verify="required" placeholder="请填写nginx配置内容"
|
||||
class="layui-textarea context">$!data.context</textarea>
|
||||
class="layui-textarea context" th:text="${data?.context}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="padding-left: 20%">
|
||||
@ -53,7 +50,8 @@
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<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">
|
||||
|
@ -1,14 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
#parse("./common/head.vm")
|
||||
<title>白名单目录</title>
|
||||
<th:block th:include="common/head::head"></th:block>
|
||||
<style>
|
||||
body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.edit-div {
|
||||
width: 80%;
|
||||
height: 25vh;
|
||||
@ -24,7 +19,7 @@
|
||||
<label class="layui-form-label">项目路径</label>
|
||||
<div class="layui-input-block auto">
|
||||
<textarea name="project" placeholder="请输入项目存放路径白名单,回车支持输入多个路径,系统会自动过滤 ../ 路径、不允许输入根路径"
|
||||
class="layui-textarea auto">$!project</textarea>
|
||||
class="layui-textarea auto" th:text="${#strings.defaultString(project,'')}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -33,7 +28,7 @@
|
||||
<label class="layui-form-label">证书路径</label>
|
||||
<div class="layui-input-block auto">
|
||||
<textarea name="certificate" placeholder="请输入证书存放路径白名单,回车支持输入多个路径,系统会自动过滤 ../ 路径、不允许输入根路径"
|
||||
class="layui-textarea auto">$!certificate</textarea>
|
||||
class="layui-textarea auto" th:text="${#strings.defaultString(certificate,'')}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -42,7 +37,7 @@
|
||||
<label class="layui-form-label">nginx目录</label>
|
||||
<div class="layui-input-block auto">
|
||||
<textarea name="nginx" placeholder="请输入nginx存放路径白名单,回车支持输入多个路径,系统会自动过滤 ../ 路径、不允许输入根路径"
|
||||
class="layui-textarea auto">$!nginx</textarea>
|
||||
class="layui-textarea auto" th:text="${#strings.defaultString(nginx,'')}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -30,17 +30,17 @@
|
||||
<label class="layui-form-label"><span class="x-red">*</span>分发ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="id" placeholder="分发ID(设置后将不能修改)" required lay-verify="required"
|
||||
class="layui-input #if($item)layui-disabled#end" value="$!item.id"
|
||||
#if($item)readonly#end>
|
||||
<input type="hidden" name="reqId" value="$reqId">
|
||||
<input type="hidden" name="type" value="$type">
|
||||
th:class="${item}?'layui-input layui-disabled':'layui-input'" th:value="${item?.id}"
|
||||
th:readonly="${item}">
|
||||
<input type="hidden" name="reqId" th:value="${reqId}">
|
||||
<input type="hidden" name="type" value="${type}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label"><span class="x-red">*</span>分发名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="name" placeholder="分发名称" required lay-verify="required"
|
||||
class="layui-input" value="$!item.name">
|
||||
class="layui-input" th:value="${item?.name}">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -57,7 +57,7 @@
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="form_outgiving">提交
|
||||
</button>
|
||||
|
||||
<a th:if="${item}" class="layui-btn layui-btn-warm" data-id="$item.id" id="delete_outgiving">删除</a>
|
||||
<a th:if="${item}" class="layui-btn layui-btn-warm" th:data-id="${item?.id}" id="delete_outgiving">删除</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -69,9 +69,9 @@
|
||||
<div class="layui-input-block">
|
||||
<select name="nodeId" required lay-verify="required" lay-filter="selectNode">
|
||||
<option value="">请选择节点</option>
|
||||
#foreach($i in $nodeModels)
|
||||
<option value="$i.id" nodeName="$i.name">$i.name</option>
|
||||
#end
|
||||
|
||||
<option th:each="i : ${nodeModels}" th:value="${i.id}" th:nodeName="${i.name}"
|
||||
th:text="${i.name}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -87,21 +87,18 @@
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
#foreach($i in $nodeModels)
|
||||
<script type="text/html" id="node_project_$i.id">
|
||||
<div class="layui-form-item" nodeDiv="$i.id">
|
||||
|
||||
<script type="text/html" th:each="i : ${nodeModels}" th:id="'node_project_'+${i.id}">
|
||||
<div class="layui-form-item" th:nodeDiv="${i.id}">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label"><span class="x-red">*</span>{{ d.name }}</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="node_$i.id" required lay-verify="required">
|
||||
<select th:name="'node_'+${i.id}" required lay-verify="required">
|
||||
<option value="">选择选择项目</option>
|
||||
#foreach($ii in $i.groupProjects)
|
||||
<optgroup label="$ii.group">
|
||||
#foreach($iProject in $ii.projects)
|
||||
<option value="$iProject.id">$iProject.name</option>
|
||||
#end
|
||||
<optgroup th:each="ii : ${i.groupProjects}" th:label="${ii.group}">
|
||||
<option th:each="iProject : ${ii.projects}" th:value="${iProject.id}"
|
||||
th:text="${iProject.name}"></option>
|
||||
</optgroup>
|
||||
#end
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -112,7 +109,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
#end
|
||||
|
||||
<script type="text/javascript" th:inline="javascript" th:each="nodeP : ${item?.outGivingNodeProjectList}">
|
||||
asyncFn.push(function () {
|
||||
var nodeId = [[${nodeP.nodeId}]];
|
||||
var selectOption = $("select[name='nodeId'] option[value='" + nodeId + "']");
|
||||
addNode(nodeId, selectOption);
|
||||
// 选中
|
||||
$("select[name='node_" + nodeId + "']").val([[${nodeP.projectId}]]);
|
||||
form.render();
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var laytpl;
|
||||
@ -134,33 +143,7 @@
|
||||
});
|
||||
//
|
||||
});
|
||||
var selectOption;
|
||||
#foreach($nodeP in $item.outGivingNodeProjectList)
|
||||
selectOption = $("select[name='nodeId'] option[value='$nodeP.nodeId']");
|
||||
addNode("$nodeP.nodeId", selectOption)
|
||||
// 选中
|
||||
$("select[name='node_$nodeP.nodeId']").val("$nodeP.projectId");
|
||||
#end
|
||||
form.render();
|
||||
|
||||
function addNode(nodeId, selectOption) {
|
||||
var html = document.getElementById('node_project_' + nodeId);
|
||||
var nodeName = selectOption.attr("nodeName");
|
||||
laytpl(html.innerHTML).render({
|
||||
name: nodeName
|
||||
}, function (newHtml) {
|
||||
$("#appendNodeDiv").before(newHtml);
|
||||
layer.closeAll();
|
||||
// 改变已经选过的选项
|
||||
selectOption.attr("disabled", true);
|
||||
selectOption.attr("selected", false)
|
||||
form.render();
|
||||
// 检查按钮状态
|
||||
if ($("div[nodeDiv]").length >= $("select[name='nodeId']").find("option").length - 1) {
|
||||
$("#add_selectNode").hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
form.on('submit(form_outgiving)', function (data) {
|
||||
var len = $("div[nodeDiv]").length;
|
||||
@ -226,8 +209,24 @@
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
# 刷新列表
|
||||
function addNode(nodeId, selectOption) {
|
||||
var html = document.getElementById('node_project_' + nodeId);
|
||||
var nodeName = selectOption.attr("nodeName");
|
||||
laytpl(html.innerHTML).render({
|
||||
name: nodeName
|
||||
}, function (newHtml) {
|
||||
$("#appendNodeDiv").before(newHtml);
|
||||
layer.closeAll();
|
||||
// 改变已经选过的选项
|
||||
selectOption.attr("disabled", true);
|
||||
selectOption.attr("selected", false)
|
||||
form.render();
|
||||
// 检查按钮状态
|
||||
if ($("div[nodeDiv]").length >= $("select[name='nodeId']").find("option").length - 1) {
|
||||
$("#add_selectNode").hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function autoClose() {
|
||||
setTimeout(function () {
|
||||
|
@ -73,7 +73,8 @@
|
||||
<select name="whitelistDirectory" required lay-verify="required" lay-filter="whitelistDirectory">、
|
||||
<th:block th:unless="${#lists.isEmpty(whitelistDirectory)}">
|
||||
<option value="">请选择白名单</option>
|
||||
<option th:value="${itemPath}" th:each="itemPath : ${whitelistDirectory}"
|
||||
<option th:value="${itemPath}"
|
||||
th:each="itemPath : ${whitelistDirectory}"
|
||||
th:text="${itemPath}"></option>
|
||||
</th:block>
|
||||
<option value="" th:if="${#lists.isEmpty(whitelistDirectory)}">请配置白名单</option>
|
||||
@ -192,7 +193,7 @@
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" th:inline="javascript"
|
||||
th:each="nodeP,iterStat : ${item.outGivingNodeProjectList}">
|
||||
th:each="nodeP,iterStat : ${item?.outGivingNodeProjectList}">
|
||||
findFirst = false;
|
||||
asyncFn.push(function () {
|
||||
loadingAjax({
|
||||
@ -377,7 +378,6 @@
|
||||
|
||||
function checngeLib() {
|
||||
var wVal = whitelistDirectorySelect.val();
|
||||
console.log(wVal);
|
||||
if (wVal == "") {
|
||||
layer.msg("请选择白名单");
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user