diff --git a/CHANGELOG-BETA.md b/CHANGELOG-BETA.md index 6b5c3a2b2..6c35fe9dc 100644 --- a/CHANGELOG-BETA.md +++ b/CHANGELOG-BETA.md @@ -5,6 +5,7 @@ ### 🐞 解决BUG、优化功能 1. 【server】优化 逻辑节点节目取消全局 loading(感谢@小菜鸡) +2. 【server】优化 新增个性化配置全屏打开日志弹窗(构建、SSH、脚本、Docker等日志)(感谢@张飞鸿) ------ diff --git a/modules/server/src/main/java/org/dromara/jpom/controller/build/BuildInfoManageController.java b/modules/server/src/main/java/org/dromara/jpom/controller/build/BuildInfoManageController.java index 848741dab..a3a7c95c7 100644 --- a/modules/server/src/main/java/org/dromara/jpom/controller/build/BuildInfoManageController.java +++ b/modules/server/src/main/java/org/dromara/jpom/controller/build/BuildInfoManageController.java @@ -208,6 +208,9 @@ public class BuildInfoManageController extends BaseServerController { // 运行中 Integer status = queryByBean.getStatus(); data.put("run", buildExecuteService.checkStatus(item) != null); + data.put("logId", queryByBean.getId()); + data.put("status", status); + data.put("statusMsg", queryByBean.getStatusMsg()); // 构建中 //data.put("buildRun", status == BuildStatus.Ing.getCode()); return JsonMessage.success("ok", data); diff --git a/modules/server/src/main/java/org/dromara/jpom/controller/node/manage/ProjectManageControl.java b/modules/server/src/main/java/org/dromara/jpom/controller/node/manage/ProjectManageControl.java index fcc9a2e5a..c7a14733d 100644 --- a/modules/server/src/main/java/org/dromara/jpom/controller/node/manage/ProjectManageControl.java +++ b/modules/server/src/main/java/org/dromara/jpom/controller/node/manage/ProjectManageControl.java @@ -109,8 +109,8 @@ public class ProjectManageControl extends BaseServerController { */ @RequestMapping(value = "project_copy_list", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Feature(method = MethodFeature.LIST) - public IJsonMessage projectCopyList() { - return NodeForward.request(getNode(), getRequest(), NodeUrl.Manage_ProjectCopyList); + public IJsonMessage projectCopyList(HttpServletRequest request) { + return NodeForward.request(getNode(), request, NodeUrl.Manage_ProjectCopyList); } /** @@ -119,8 +119,8 @@ public class ProjectManageControl extends BaseServerController { * @return json */ @RequestMapping(value = "getProjectPort", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) - public IJsonMessage getProjectPort() { - return NodeForward.request(getNode(), getRequest(), NodeUrl.Manage_GetProjectPort); + public IJsonMessage getProjectPort(HttpServletRequest request) { + return NodeForward.request(getNode(), request, NodeUrl.Manage_GetProjectPort); } /** @@ -129,8 +129,8 @@ public class ProjectManageControl extends BaseServerController { * @return json */ @RequestMapping(value = "getProjectCopyPort", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) - public IJsonMessage getProjectCopyPort() { - return NodeForward.request(getNode(), getRequest(), NodeUrl.Manage_GetProjectCopyPort); + public IJsonMessage getProjectCopyPort(HttpServletRequest request) { + return NodeForward.request(getNode(), request, NodeUrl.Manage_GetProjectCopyPort); } @@ -141,9 +141,8 @@ public class ProjectManageControl extends BaseServerController { */ @PostMapping(value = "get_project_info", produces = MediaType.APPLICATION_JSON_VALUE) @Feature(method = MethodFeature.LIST) - public IJsonMessage> getProjectInfo() { - PageResultDto modelPageResultDto = projectInfoCacheService.listPage(getRequest()); -// JSONArray jsonArray = projectInfoService.listAll(nodeModel, getRequest()); + public IJsonMessage> getProjectInfo(HttpServletRequest request) { + PageResultDto modelPageResultDto = projectInfoCacheService.listPage(request); return JsonMessage.success("", modelPageResultDto); } @@ -155,33 +154,31 @@ public class ProjectManageControl extends BaseServerController { */ @PostMapping(value = "deleteProject", produces = MediaType.APPLICATION_JSON_VALUE) @Feature(method = MethodFeature.DEL) - public IJsonMessage deleteProject(@ValidatorItem(value = ValidatorRule.NOT_BLANK) String id, String copyId) { + public IJsonMessage deleteProject(@ValidatorItem(value = ValidatorRule.NOT_BLANK) String id, + String copyId, + HttpServletRequest request) { NodeModel nodeModel = getNode(); - HttpServletRequest servletRequest = getRequest(); if (StrUtil.isEmpty(copyId)) { // 检查节点分发 - outGivingServer.checkNodeProject(nodeModel.getId(), id, servletRequest); + outGivingServer.checkNodeProject(nodeModel.getId(), id, request); // 检查日志阅读 - logReadServer.checkNodeProject(nodeModel.getId(), id, servletRequest); - // - List monitorModels = monitorService.listByWorkspace(servletRequest); + logReadServer.checkNodeProject(nodeModel.getId(), id, request); + // 项目监控 + List monitorModels = monitorService.listByWorkspace(request); if (monitorModels != null) { boolean match = monitorModels.stream().anyMatch(monitorModel -> monitorModel.checkNodeProject(nodeModel.getId(), id)); -// if (monitorService.checkProject(nodeModel.getId(), id)) { -// return JsonMessage.getString(405, ); -// } Assert.state(!match, "当前项目存在监控项,不能直接删除"); } - - boolean releaseMethod = buildService.checkReleaseMethod(nodeModel.getId() + StrUtil.COLON + id, servletRequest, BuildReleaseMethod.Project); + // 构建 + boolean releaseMethod = buildService.checkReleaseMethod(nodeModel.getId() + StrUtil.COLON + id, request, BuildReleaseMethod.Project); Assert.state(!releaseMethod, "当前项目存在构建项,不能直接删除"); } - JsonMessage request = NodeForward.request(nodeModel, servletRequest, NodeUrl.Manage_DeleteProject); - if (request.success()) { + JsonMessage jsonMessage = NodeForward.request(nodeModel, request, NodeUrl.Manage_DeleteProject); + if (jsonMessage.success()) { // projectInfoCacheService.syncExecuteNode(nodeModel); } - return request; + return jsonMessage; } /** @@ -193,9 +190,9 @@ public class ProjectManageControl extends BaseServerController { */ @RequestMapping(value = "restart", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Feature(method = MethodFeature.EXECUTE) - public IJsonMessage restart() { + public IJsonMessage restart(HttpServletRequest request) { NodeModel nodeModel = getNode(); - return NodeForward.request(nodeModel, getRequest(), NodeUrl.Manage_Restart); + return NodeForward.request(nodeModel, request, NodeUrl.Manage_Restart); } @@ -208,9 +205,9 @@ public class ProjectManageControl extends BaseServerController { */ @RequestMapping(value = "start", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Feature(method = MethodFeature.EXECUTE) - public IJsonMessage start() { + public IJsonMessage start(HttpServletRequest request) { NodeModel nodeModel = getNode(); - return NodeForward.request(nodeModel, getRequest(), NodeUrl.Manage_Start); + return NodeForward.request(nodeModel, request, NodeUrl.Manage_Start); } @@ -223,9 +220,9 @@ public class ProjectManageControl extends BaseServerController { */ @RequestMapping(value = "stop", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Feature(method = MethodFeature.EXECUTE) - public IJsonMessage stop() { + public IJsonMessage stop(HttpServletRequest request) { NodeModel nodeModel = getNode(); - return NodeForward.request(nodeModel, getRequest(), NodeUrl.Manage_Stop); + return NodeForward.request(nodeModel, request, NodeUrl.Manage_Stop); } @@ -240,12 +237,12 @@ public class ProjectManageControl extends BaseServerController { // CsvWriter writer = CsvUtil.getWriter(response.getWriter()); writer.writeLine("id", "name", "groupName", "whitelistDirectory", "path", "logPath", "runMode", - "mainClass", - "jvm", "args", - "javaExtDirsCp", - "dslContent", - "webHooks", - "autoStart"); + "mainClass", + "jvm", "args", + "javaExtDirsCp", + "dslContent", + "webHooks", + "autoStart"); writer.flush(); } @@ -264,11 +261,11 @@ public class ProjectManageControl extends BaseServerController { CsvWriter writer = CsvUtil.getWriter(response.getWriter(), csvWriteConfig); int pageInt = 0; writer.writeLine("id", "name", "groupName", "whitelistDirectory", "path", "logPath", "runMode", - "mainClass", - "jvm", "args", "javaExtDirsCp", - "dslContent", - "webHooks", - "autoStart", "outGivingProject"); + "mainClass", + "jvm", "args", "javaExtDirsCp", + "dslContent", + "webHooks", + "autoStart", "outGivingProject"); while (true) { Map paramMap = ServletUtil.getParamMap(request); // 下一页 @@ -278,26 +275,26 @@ public class ProjectManageControl extends BaseServerController { break; } listPage.getResult() - .stream() - .map((Function>) projectInfoCacheModel -> CollUtil.newArrayList( - projectInfoCacheModel.getProjectId(), - projectInfoCacheModel.getName(), - projectInfoCacheModel.getGroup(), - projectInfoCacheModel.getWhitelistDirectory(), - projectInfoCacheModel.getLib(), - projectInfoCacheModel.getLogPath(), - projectInfoCacheModel.getRunMode(), - projectInfoCacheModel.getMainClass(), - encodeCsv(projectInfoCacheModel.getJvm()), - encodeCsv(projectInfoCacheModel.getArgs()), - encodeCsv(projectInfoCacheModel.getJavaExtDirsCp()), - encodeCsv(projectInfoCacheModel.getDslContent()), - projectInfoCacheModel.getToken(), - projectInfoCacheModel.getAutoStart(), - projectInfoCacheModel.getOutGivingProject() - )) - .map(objects -> objects.stream().map(StrUtil::toStringOrNull).toArray(String[]::new)) - .forEach(writer::writeLine); + .stream() + .map((Function>) projectInfoCacheModel -> CollUtil.newArrayList( + projectInfoCacheModel.getProjectId(), + projectInfoCacheModel.getName(), + projectInfoCacheModel.getGroup(), + projectInfoCacheModel.getWhitelistDirectory(), + projectInfoCacheModel.getLib(), + projectInfoCacheModel.getLogPath(), + projectInfoCacheModel.getRunMode(), + projectInfoCacheModel.getMainClass(), + encodeCsv(projectInfoCacheModel.getJvm()), + encodeCsv(projectInfoCacheModel.getArgs()), + encodeCsv(projectInfoCacheModel.getJavaExtDirsCp()), + encodeCsv(projectInfoCacheModel.getDslContent()), + projectInfoCacheModel.getToken(), + projectInfoCacheModel.getAutoStart(), + projectInfoCacheModel.getOutGivingProject() + )) + .map(objects -> objects.stream().map(StrUtil::toStringOrNull).toArray(String[]::new)) + .forEach(writer::writeLine); if (ObjectUtil.equal(listPage.getPage(), listPage.getTotalPage())) { // 最后一页 break; diff --git a/web-vue/src/components/logView/index.vue b/web-vue/src/components/logView/index.vue index 07e0e23c2..2b260c239 100644 --- a/web-vue/src/components/logView/index.vue +++ b/web-vue/src/components/logView/index.vue @@ -1,24 +1,35 @@ @@ -113,4 +139,8 @@ export default { display: flex; align-items: center; } + +/deep/ .ant-page-header { + padding: 0; +} diff --git a/web-vue/src/components/logView/index2.vue b/web-vue/src/components/logView/index2.vue new file mode 100644 index 000000000..07e0e23c2 --- /dev/null +++ b/web-vue/src/components/logView/index2.vue @@ -0,0 +1,116 @@ + + + + + diff --git a/web-vue/src/components/logView/view-pre.vue b/web-vue/src/components/logView/view-pre.vue index 3b0d055e5..31d66df45 100644 --- a/web-vue/src/components/logView/view-pre.vue +++ b/web-vue/src/components/logView/view-pre.vue @@ -217,6 +217,9 @@ export default { id: item.id, }; }); + if (!tempArray.length) { + return; + } this.dataArray = [...this.dataArray, ...tempArray]; // console.log(this.dataArray.length, this.showList.length); if (this.config.logScroll) { diff --git a/web-vue/src/pages/build/details.vue b/web-vue/src/pages/build/details.vue index c081a40fa..4af7de961 100644 --- a/web-vue/src/pages/build/details.vue +++ b/web-vue/src/pages/build/details.vue @@ -123,9 +123,17 @@ - - - + @@ -134,6 +142,7 @@ import { getBuildGet, releaseMethodMap, statusMap, geteBuildHistory, statusColor import { parseTime, PAGE_DEFAULT_LIST_QUERY, PAGE_DEFAULT_SIZW_OPTIONS, PAGE_DEFAULT_SHOW_TOTAL, renderSize, formatDuration } from "@/utils/const"; import { getRepositoryInfo } from "@/api/repository"; import BuildLog from "./log"; + export default { props: { id: { @@ -154,9 +163,10 @@ export default { listQuery: Object.assign({ buildDataId: this.id }, PAGE_DEFAULT_LIST_QUERY), historyList: [], tempRepository: null, - buildLogVisible: false, + buildLogVisible: 0, }; }, + computed: {}, created() { this.refresh(); }, @@ -215,7 +225,7 @@ export default { id: record.buildDataId, buildId: record.buildNumberId, }; - this.buildLogVisible = true; + this.buildLogVisible = new Date() * Math.random(); }, // 回滚 handleRollback(record) { @@ -237,14 +247,12 @@ export default { id: record.buildDataId, buildId: res.data, }; - this.buildLogVisible = true; + this.buildLogVisible = new Date() * Math.random(); } }); }, }); }, - // 关闭日志对话框 - closeBuildLogModel() {}, }, }; diff --git a/web-vue/src/pages/build/history.vue b/web-vue/src/pages/build/history.vue index 8143c0859..12cf0c0a3 100644 --- a/web-vue/src/pages/build/history.vue +++ b/web-vue/src/pages/build/history.vue @@ -90,9 +90,17 @@ - - - + diff --git a/web-vue/src/pages/docker/container.vue b/web-vue/src/pages/docker/container.vue index 66bda9276..892b45cf9 100644 --- a/web-vue/src/pages/docker/container.vue +++ b/web-vue/src/pages/docker/container.vue @@ -411,9 +411,22 @@ - - - + + + - - - + +