diff --git a/src/main/java/cn/jiangzeyin/controller/manage/ManageControl.java b/src/main/java/cn/jiangzeyin/controller/manage/ManageControl.java index ff210bee5..384acf350 100644 --- a/src/main/java/cn/jiangzeyin/controller/manage/ManageControl.java +++ b/src/main/java/cn/jiangzeyin/controller/manage/ManageControl.java @@ -16,6 +16,8 @@ import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import java.util.Set; /** @@ -53,17 +55,26 @@ public class ManageControl extends BaseController { // 查询数据 JSONObject json = manageService.getAllProjectInfo(); // 转换为数据 - JSONArray array = new JSONArray(); + List array = new ArrayList<>(); Set setKey = json.keySet(); for (String asetKey : setKey) { ProjectInfoModel projectInfoModel = manageService.getProjectInfo(asetKey); String result = commandService.execCommand(CommandService.CommandOp.status, projectInfoModel); JSONObject jsonObject = json.getJSONObject(asetKey); boolean status = result.contains(CommandService.RUNING_TAG); - jsonObject.put("status", status); - array.add(jsonObject); + projectInfoModel.setStatus(status); +// jsonObject.put("status", status); + array.add(projectInfoModel); } - return PageUtil.getPaginate(200, "查询成功!", array); + array.sort((o1, o2) -> { + String group1 = o1.getGroup(); + String group2 = o2.getGroup(); + if (group1 == null || group2 == null) { + return 0; + } + return group1.compareTo(group2); + }); + return PageUtil.getPaginate(200, "查询成功!", (JSONArray) JSONArray.toJSON(array)); } catch (IOException e) { DefaultSystemLog.ERROR().error(e.getMessage(), e); return JsonMessage.getString(500, e.getMessage()); diff --git a/src/main/java/cn/jiangzeyin/model/ProjectInfoModel.java b/src/main/java/cn/jiangzeyin/model/ProjectInfoModel.java index 8fa1ddc50..1760b8bb6 100644 --- a/src/main/java/cn/jiangzeyin/model/ProjectInfoModel.java +++ b/src/main/java/cn/jiangzeyin/model/ProjectInfoModel.java @@ -10,11 +10,13 @@ import com.alibaba.fastjson.JSONObject; public class ProjectInfoModel { private String id; private String name; + private String group; private String mainClass; private String lib; private String log; private String jvm; private String token; + private boolean status; private String createTime; private String modifyTime; private String args; @@ -28,6 +30,14 @@ public class ProjectInfoModel { */ private String runLibDesc; + public boolean isStatus() { + return status; + } + + public void setStatus(boolean status) { + this.status = status; + } + public String getRunLibDesc() { return runLibDesc; } @@ -84,6 +94,14 @@ public class ProjectInfoModel { this.name = name; } + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + public String getMainClass() { return mainClass; } diff --git a/src/main/resources/vm/manage/editProject.vm b/src/main/resources/vm/manage/editProject.vm index f5fa2a604..a195605da 100644 --- a/src/main/resources/vm/manage/editProject.vm +++ b/src/main/resources/vm/manage/editProject.vm @@ -25,18 +25,26 @@
+ class="layui-input" value="#if($item)#if($item.name)$!item.name#else$!item.id#end#end">
- +
- +
+
+ +
+ +
+
@@ -44,6 +52,9 @@ lay-verify="required" class="layui-input" value="#if($item)$!item.mainClass#end">
+ +
+
@@ -51,8 +62,6 @@ class="layui-input" value="#if($item)$!item.lib#end">
-
-
@@ -60,13 +69,7 @@ class="layui-input" value="#if($item)$!item.log#end">
-
- -
- -
-
+
@@ -85,6 +88,13 @@
+
+ +
+ +
+
diff --git a/src/main/resources/vm/manage/projectInfo.vm b/src/main/resources/vm/manage/projectInfo.vm index 740caa753..fdc325b93 100644 --- a/src/main/resources/vm/manage/projectInfo.vm +++ b/src/main/resources/vm/manage/projectInfo.vm @@ -35,8 +35,68 @@ lay-text="运行中|未运行"> + +