diff --git a/CHANGELOG.md b/CHANGELOG.md index b824868bb..d782a98dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ 5. 【Server】构建历史支持配置单个构建最多保存多少个历史 6. 【Server】解决节点分组筛选bug(感谢gitee@I17XEH) 7. 【Server】角色权限动态数据,单个节点异常不影响所有节点配置(感谢@£天空之城~龙) +8. 【Server】关联节点分发项目支持修改发布后操作 ----------------------------------------------------------- diff --git a/modules/server/src/main/java/io/jpom/common/forward/NodeForward.java b/modules/server/src/main/java/io/jpom/common/forward/NodeForward.java index cffe2597a..d4cb8b3f2 100644 --- a/modules/server/src/main/java/io/jpom/common/forward/NodeForward.java +++ b/modules/server/src/main/java/io/jpom/common/forward/NodeForward.java @@ -56,7 +56,7 @@ public class NodeForward { * @param userModel user * @return JSON */ - public static JsonMessage request(NodeModel nodeModel, NodeUrl nodeUrl, UserModel userModel, JSONObject jsonObject) { + public static JsonMessage request(NodeModel nodeModel, NodeUrl nodeUrl, UserModel userModel, JSONObject jsonObject) { return request(nodeModel, null, nodeUrl, true, userModel, jsonObject, null, null); } @@ -70,7 +70,7 @@ public class NodeForward { * @param val 其他参数 * @return JSON */ - public static JsonMessage requestBySys(NodeModel nodeModel, NodeUrl nodeUrl, String pName, Object pVal, Object... val) { + public static JsonMessage requestBySys(NodeModel nodeModel, NodeUrl nodeUrl, String pName, Object pVal, Object... val) { return request(nodeModel, null, nodeUrl, false, null, null, pName, pVal, val); } diff --git a/modules/server/src/main/java/io/jpom/controller/outgiving/OutGivingController.java b/modules/server/src/main/java/io/jpom/controller/outgiving/OutGivingController.java index 8b69150ee..544576c4b 100644 --- a/modules/server/src/main/java/io/jpom/controller/outgiving/OutGivingController.java +++ b/modules/server/src/main/java/io/jpom/controller/outgiving/OutGivingController.java @@ -1,5 +1,6 @@ package io.jpom.controller.outgiving; +import cn.hutool.core.convert.Convert; import cn.hutool.core.util.StrUtil; import cn.jiangzeyin.common.JsonMessage; import com.alibaba.fastjson.JSONArray; @@ -8,6 +9,7 @@ import io.jpom.common.BaseServerController; import io.jpom.common.forward.NodeForward; import io.jpom.common.forward.NodeUrl; import io.jpom.common.interceptor.OptLog; +import io.jpom.model.BaseEnum; import io.jpom.model.data.NodeModel; import io.jpom.model.data.OutGivingModel; import io.jpom.model.data.OutGivingNodeProject; @@ -77,6 +79,8 @@ public class OutGivingController extends BaseServerController { String reqId = nodeService.cacheNodeList(nodeModels); setAttribute("reqId", reqId); + JSONArray afterOpt = BaseEnum.toJSONArray(OutGivingModel.AfterOpt.class); + setAttribute("afterOpt", afterOpt); return "outgiving/edit"; } @@ -124,7 +128,7 @@ public class OutGivingController extends BaseServerController { return error; } - private String doData(OutGivingModel outGivingModel) throws IOException { + private String doData(OutGivingModel outGivingModel) { outGivingModel.setName(getParameter("name")); if (StrUtil.isEmpty(outGivingModel.getName())) { return JsonMessage.getString(405, "分发名称不能为空"); @@ -179,6 +183,13 @@ public class OutGivingController extends BaseServerController { return JsonMessage.getString(405, "至少选择2个节点项目"); } outGivingModel.setOutGivingNodeProjectList(outGivingNodeProjects); + // + String afterOpt = getParameter("afterOpt"); + OutGivingModel.AfterOpt afterOpt1 = BaseEnum.getEnum(OutGivingModel.AfterOpt.class, Convert.toInt(afterOpt, 0)); + if (afterOpt1 == null) { + return JsonMessage.getString(400, "请选择分发后的操作"); + } + outGivingModel.setAfterOpt(afterOpt1.getCode()); return null; } diff --git a/modules/server/src/main/java/io/jpom/monitor/Monitor.java b/modules/server/src/main/java/io/jpom/monitor/Monitor.java index 9e652a094..11dc138af 100644 --- a/modules/server/src/main/java/io/jpom/monitor/Monitor.java +++ b/modules/server/src/main/java/io/jpom/monitor/Monitor.java @@ -144,7 +144,7 @@ public class Monitor implements Task { if (monitorModel.isAutoRestart()) { // 执行重启 try { - JsonMessage reJson = NodeForward.requestBySys(nodeModel, NodeUrl.Manage_Restart, "id", id); + JsonMessage reJson = NodeForward.requestBySys(nodeModel, NodeUrl.Manage_Restart, "id", id); if (reJson.getCode() == HttpStatus.HTTP_OK) { // 重启成功 runStatus = true; diff --git a/modules/server/src/main/java/io/jpom/outgiving/OutGivingRun.java b/modules/server/src/main/java/io/jpom/outgiving/OutGivingRun.java index 82c336504..e2507f974 100644 --- a/modules/server/src/main/java/io/jpom/outgiving/OutGivingRun.java +++ b/modules/server/src/main/java/io/jpom/outgiving/OutGivingRun.java @@ -128,7 +128,7 @@ public class OutGivingRun implements Callable { updateStatus(this.logId, this.outGivingId, this.outGivingNodeProject, OutGivingNodeProject.Status.Ing, "开始分发"); // - JsonMessage jsonMessage = fileUpload(file, + JsonMessage jsonMessage = fileUpload(file, this.outGivingNodeProject.getProjectId(), unzip, afterOpt != OutGivingModel.AfterOpt.No, @@ -162,10 +162,10 @@ public class OutGivingRun implements Callable { * @param userModel 操作用户 * @return json */ - public static JsonMessage fileUpload(File file, String projectId, - boolean unzip, boolean restart, - NodeModel nodeModel, UserModel userModel, - boolean clearOld) { + public static JsonMessage fileUpload(File file, String projectId, + boolean unzip, boolean restart, + NodeModel nodeModel, UserModel userModel, + boolean clearOld) { JSONObject data = new JSONObject(); data.put("file", file); data.put("id", projectId); diff --git a/modules/server/src/main/resources/templates/outgiving/edit.html b/modules/server/src/main/resources/templates/outgiving/edit.html index 671458281..d356ba222 100644 --- a/modules/server/src/main/resources/templates/outgiving/edit.html +++ b/modules/server/src/main/resources/templates/outgiving/edit.html @@ -52,6 +52,20 @@ +
+
+ +
+ +
+
+
+