diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java index b2fa7f78..ca3b5c2c 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveJobInfoRequest.java @@ -3,6 +3,7 @@ package com.github.kfcfans.powerjob.common.request.http; import com.github.kfcfans.powerjob.common.ExecuteType; import com.github.kfcfans.powerjob.common.ProcessorType; import com.github.kfcfans.powerjob.common.TimeExpressionType; +import com.github.kfcfans.powerjob.common.utils.CommonUtils; import lombok.Data; import java.util.List; @@ -76,4 +77,14 @@ public class SaveJobInfoRequest { // 报警用户ID列表 private List notifyUserIds; + + + public void valid() { + CommonUtils.requireNonNull(jobName, "jobName can't be empty"); + CommonUtils.requireNonNull(appId, "appId can't be empty"); + CommonUtils.requireNonNull(processorInfo, "processorInfo can't be empty"); + CommonUtils.requireNonNull(executeType, "executeType can't be empty"); + CommonUtils.requireNonNull(processorType, "processorType can't be empty"); + CommonUtils.requireNonNull(timeExpressionType, "timeExpressionType can't be empty"); + } } diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveWorkflowRequest.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveWorkflowRequest.java index ec06754a..3e0e03e1 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveWorkflowRequest.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/request/http/SaveWorkflowRequest.java @@ -2,6 +2,7 @@ package com.github.kfcfans.powerjob.common.request.http; import com.github.kfcfans.powerjob.common.TimeExpressionType; import com.github.kfcfans.powerjob.common.model.PEWorkflowDAG; +import com.github.kfcfans.powerjob.common.utils.CommonUtils; import com.google.common.collect.Lists; import lombok.Data; @@ -43,4 +44,11 @@ public class SaveWorkflowRequest { // 工作流整体失败的报警 private List notifyUserIds = Lists.newLinkedList(); + + public void valid() { + CommonUtils.requireNonNull(wfName, "workflow name can't be empty"); + CommonUtils.requireNonNull(appId, "appId can't be empty"); + CommonUtils.requireNonNull(pEWorkflowDAG, "dag can't be empty"); + CommonUtils.requireNonNull(timeExpressionType, "timeExpressionType can't be empty"); + } } diff --git a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/utils/CommonUtils.java b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/utils/CommonUtils.java index 8126dde8..52277188 100644 --- a/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/utils/CommonUtils.java +++ b/powerjob-common/src/main/java/com/github/kfcfans/powerjob/common/utils/CommonUtils.java @@ -1,8 +1,11 @@ package com.github.kfcfans.powerjob.common.utils; +import com.github.kfcfans.powerjob.common.OmsException; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import java.util.Collection; +import java.util.Objects; import java.util.function.Supplier; @@ -114,4 +117,16 @@ public class CommonUtils { return (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1; } + public static T requireNonNull(T obj, String msg) { + if (obj == null) { + throw new OmsException(msg); + } + if (obj instanceof String) { + if (StringUtils.isEmpty((String) obj)) { + throw new OmsException(msg); + } + } + return obj; + } + } diff --git a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/ContainerService.java b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/ContainerService.java index c6778cf2..0f10b0b4 100644 --- a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/ContainerService.java +++ b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/ContainerService.java @@ -86,6 +86,9 @@ public class ContainerService { * @param request 容器保存请求 */ public void save(SaveContainerInfoRequest request) { + + request.valid(); + ContainerInfoDO container; Long originId = request.getId(); if (originId != null) { diff --git a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/JobService.java b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/JobService.java index d9d9f840..b485edf2 100644 --- a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/JobService.java +++ b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/JobService.java @@ -52,6 +52,8 @@ public class JobService { */ public Long saveJob(SaveJobInfoRequest request) throws Exception { + request.valid(); + JobInfoDO jobInfoDO; if (request.getId() != null) { jobInfoDO = jobInfoRepository.findById(request.getId()).orElseThrow(() -> new IllegalArgumentException("can't find job by jobId: " + request.getId())); diff --git a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/workflow/WorkflowService.java b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/workflow/WorkflowService.java index c2884f65..63e224b5 100644 --- a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/workflow/WorkflowService.java +++ b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/service/workflow/WorkflowService.java @@ -39,6 +39,8 @@ public class WorkflowService { */ public Long saveWorkflow(SaveWorkflowRequest req) throws Exception { + req.valid(); + if (!WorkflowDAGUtils.valid(req.getPEWorkflowDAG())) { throw new OmsException("illegal DAG"); } diff --git a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/request/SaveContainerInfoRequest.java b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/request/SaveContainerInfoRequest.java index af219d21..b56837c1 100644 --- a/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/request/SaveContainerInfoRequest.java +++ b/powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/request/SaveContainerInfoRequest.java @@ -1,5 +1,6 @@ package com.github.kfcfans.powerjob.server.web.request; +import com.github.kfcfans.powerjob.common.utils.CommonUtils; import com.github.kfcfans.powerjob.server.common.constans.ContainerSourceType; import com.github.kfcfans.powerjob.server.common.constans.SwitchableStatus; import lombok.Data; @@ -29,4 +30,10 @@ public class SaveContainerInfoRequest { // 状态,枚举值为 ContainerStatus(ENABLE/DISABLE) private SwitchableStatus status; + + public void valid() { + CommonUtils.requireNonNull(containerName, "containerName can't be empty"); + CommonUtils.requireNonNull(appId, "appId can't be empty"); + CommonUtils.requireNonNull(sourceInfo, "sourceInfo can't be empty"); + } } diff --git a/powerjob-server/src/main/resources/static/js/2.js b/powerjob-server/src/main/resources/static/js/2.js index 2337571d..876f03dc 100644 --- a/powerjob-server/src/main/resources/static/js/2.js +++ b/powerjob-server/src/main/resources/static/js/2.js @@ -8,7 +8,7 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.includes */ \"./node_modules/core-js/modules/es.array.includes.js\");\n/* harmony import */ var core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.splice */ \"./node_modules/core-js/modules/es.array.splice.js\");\n/* harmony import */ var core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_string_includes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.includes */ \"./node_modules/core-js/modules/es.string.includes.js\");\n/* harmony import */ var core_js_modules_es_string_includes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_includes__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.replace */ \"./node_modules/core-js/modules/es.string.replace.js\");\n/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.split */ \"./node_modules/core-js/modules/es.string.split.js\");\n/* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _main__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../main */ \"./src/main.js\");\n\n\n\n\n\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nvar ws;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"ContainerManager\",\n data: function data() {\n return {\n form: {\n sourceType: 'Git',\n containerName: ''\n },\n gitForm: {\n repo: '',\n branch: '',\n username: '',\n password: ''\n },\n sourceInfo: '',\n id: '',\n appId: this.$store.state.appInfo.id,\n dialogVisible: false,\n arrangeTitle: '',\n arrangeVisible: false,\n containerList: [],\n logs: [],\n requestUrl: \"\",\n fileList: []\n };\n },\n methods: {\n onSubmit: function onSubmit() {\n var _this = this;\n\n // 接口参数\n var data = {\n appId: this.appId,\n containerName: this.form.containerName,\n status: \"ENABLE\",\n id: this.id,\n sourceType: this.form.sourceType\n };\n\n if (this.form.sourceType == 'Git') {\n data.sourceInfo = JSON.stringify(this.gitForm);\n } else {\n data.sourceInfo = this.sourceInfo;\n data.sourceType = 'FatJar';\n }\n\n this.flyio.post(\"container/save\", data).then(function (res) {\n if (res.data.success) {\n var appId = _this.$store.state.appInfo.id;\n\n _this.flyio.get(\"/container/list?appId=\" + appId).then(function (res) {\n if (res.data.success) {\n _this.$message.info(_this.$t('message.success')); // 恢复默认表单\n\n\n _this.dialogVisible = false;\n _this.form.containerName = '';\n _this.gitForm = {};\n _this.sourceInfo = '';\n _this.id = ''; // 刷新容器表单\n\n _this.containerList = res.data.data;\n }\n });\n } else {\n _this.$message.warning(_this.$t('message.failed'));\n }\n });\n },\n // 文件上传成功后 修改来源信息\n onSuccess: function onSuccess(response) {\n this.sourceInfo = response.data;\n },\n deleteItem: function deleteItem(item, index) {\n var _this2 = this;\n\n var appId = this.$store.state.appInfo.id;\n this.flyio.get(\"/container/delete?containerId=\" + item.id + '&appId=' + appId).then(function (res) {\n console.log(res);\n\n _this2.containerList.splice(index, 1);\n\n _this2.$message.info(_this2.$t('message.success'));\n });\n },\n editItem: function editItem(item) {\n if (item.sourceType == 'Git') {\n this.form.sourceType = 'Git';\n this.gitForm = JSON.parse(item.sourceInfo);\n } else {\n this.form.sourceType = 'FatJar';\n }\n\n this.form.containerName = item.containerName;\n this.id = item.id;\n this.dialogVisible = true;\n },\n arrangeItem: function arrangeItem(item) {\n var _this3 = this;\n\n var wsBase = this.requestUrl.replace(\"http\", \"ws\") + \"/container/deploy/\";\n var wsUrl = wsBase + item.id;\n ws = new WebSocket(wsUrl);\n\n ws.onopen = function () {\n _this3.arrangeTitle = _this3.$t('message.deploy');\n _this3.arrangeVisible = true;\n console.log(\"Connection open ...\");\n ws.send(\"Hello WebSockets!\");\n };\n\n ws.onmessage = function (evt) {\n _this3.logs.push(evt.data);\n };\n\n ws.onclose = function () {\n console.log(\"Connection closed.\");\n };\n },\n // 关闭部署页面时 关闭ws避免dialog内的信息有上台机器信息\n closeArrange: function closeArrange() {\n ws.close();\n this.logs = [];\n },\n closeEdit: function closeEdit() {\n this.sourceInfo = '';\n this.fileList = [];\n },\n listOfItem: function listOfItem(item) {\n var _this4 = this;\n\n var appId = this.$store.state.appInfo.id;\n this.flyio.get(\"/container/listDeployedWorker?containerId=\" + item.id + '&appId=' + appId).then(function (res) {\n if (res.data.data) {\n _this4.logs = res.data.data.split('\\n');\n _this4.arrangeTitle = _this4.$t('message.deployedWorkerList');\n _this4.arrangeVisible = true;\n } // this.containerList.splice(index,1);\n // this.$message(`容器${item.containerName}已删除`);\n\n });\n },\n // 兼容 java build in 模式下 baseURL 为 / 的情况(将当前url作为请求路径)\n calculateRequestUrl: function calculateRequestUrl() {\n if (_main__WEBPACK_IMPORTED_MODULE_6__[\"default\"] === undefined || !_main__WEBPACK_IMPORTED_MODULE_6__[\"default\"].includes(\"http\")) {\n var url = window.location.href;\n var urlSplit = url.split('//'); // str1[0]--协议头\n\n var ip = urlSplit[1].split('/')[0];\n this.requestUrl = urlSplit[0] + '//' + ip;\n console.log(\"calculateRequestUrl: \" + this.requestUrl);\n } else {\n this.requestUrl = _main__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n }\n }\n },\n mounted: function mounted() {\n var _this5 = this;\n\n this.calculateRequestUrl();\n var appId = this.$store.state.appInfo.id;\n this.flyio.get(\"/container/list?appId=\" + appId).then(function (res) {\n console.log(res);\n\n if (res.data.success) {\n _this5.containerList = res.data.data;\n }\n });\n }\n});\n\n//# sourceURL=webpack:///./src/components/views/ContainerManager.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.includes */ \"./node_modules/core-js/modules/es.array.includes.js\");\n/* harmony import */ var core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.splice */ \"./node_modules/core-js/modules/es.array.splice.js\");\n/* harmony import */ var core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_string_includes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.includes */ \"./node_modules/core-js/modules/es.string.includes.js\");\n/* harmony import */ var core_js_modules_es_string_includes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_includes__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.replace */ \"./node_modules/core-js/modules/es.string.replace.js\");\n/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.split */ \"./node_modules/core-js/modules/es.string.split.js\");\n/* harmony import */ var core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _main__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../main */ \"./src/main.js\");\n\n\n\n\n\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nvar ws;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"ContainerManager\",\n data: function data() {\n return {\n form: {\n sourceType: 'Git',\n containerName: ''\n },\n gitForm: {\n repo: '',\n branch: '',\n username: '',\n password: ''\n },\n sourceInfo: '',\n id: '',\n appId: this.$store.state.appInfo.id,\n dialogVisible: false,\n arrangeTitle: '',\n arrangeVisible: false,\n containerList: [],\n logs: [],\n requestUrl: \"\",\n fileList: []\n };\n },\n methods: {\n onSubmit: function onSubmit() {\n var _this = this;\n\n // 接口参数\n var data = {\n appId: this.appId,\n containerName: this.form.containerName,\n status: \"ENABLE\",\n id: this.id,\n sourceType: this.form.sourceType\n };\n\n if (this.form.sourceType == 'Git') {\n data.sourceInfo = JSON.stringify(this.gitForm);\n } else {\n data.sourceInfo = this.sourceInfo;\n data.sourceType = 'FatJar';\n }\n\n this.axios.post(\"container/save\", data).then(function () {\n var appId = _this.$store.state.appInfo.id;\n\n _this.axios.get(\"/container/list?appId=\" + appId).then(function (res) {\n _this.$message.info(_this.$t('message.success')); // 恢复默认表单\n\n\n _this.dialogVisible = false;\n _this.form.containerName = '';\n _this.gitForm = {};\n _this.sourceInfo = '';\n _this.id = ''; // 刷新容器表单\n\n _this.containerList = res;\n });\n });\n },\n // 文件上传成功后 修改来源信息\n onSuccess: function onSuccess(response) {\n this.sourceInfo = response.data;\n },\n deleteItem: function deleteItem(item, index) {\n var _this2 = this;\n\n var appId = this.$store.state.appInfo.id;\n this.flyio.get(\"/container/delete?containerId=\" + item.id + '&appId=' + appId).then(function (res) {\n console.log(res);\n\n _this2.containerList.splice(index, 1);\n\n _this2.$message.info(_this2.$t('message.success'));\n });\n },\n editItem: function editItem(item) {\n if (item.sourceType == 'Git') {\n this.form.sourceType = 'Git';\n this.gitForm = JSON.parse(item.sourceInfo);\n } else {\n this.form.sourceType = 'FatJar';\n }\n\n this.form.containerName = item.containerName;\n this.id = item.id;\n this.dialogVisible = true;\n },\n arrangeItem: function arrangeItem(item) {\n var _this3 = this;\n\n var wsBase = this.requestUrl.replace(\"http\", \"ws\") + \"/container/deploy/\";\n var wsUrl = wsBase + item.id;\n ws = new WebSocket(wsUrl);\n\n ws.onopen = function () {\n _this3.arrangeTitle = _this3.$t('message.deploy');\n _this3.arrangeVisible = true;\n console.log(\"Connection open ...\");\n ws.send(\"Hello WebSockets!\");\n };\n\n ws.onmessage = function (evt) {\n _this3.logs.push(evt.data);\n };\n\n ws.onclose = function () {\n console.log(\"Connection closed.\");\n };\n },\n // 关闭部署页面时 关闭ws避免dialog内的信息有上台机器信息\n closeArrange: function closeArrange() {\n ws.close();\n this.logs = [];\n },\n closeEdit: function closeEdit() {\n this.sourceInfo = '';\n this.fileList = [];\n },\n listOfItem: function listOfItem(item) {\n var _this4 = this;\n\n var appId = this.$store.state.appInfo.id;\n this.flyio.get(\"/container/listDeployedWorker?containerId=\" + item.id + '&appId=' + appId).then(function (res) {\n if (res.data.data) {\n _this4.logs = res.data.data.split('\\n');\n _this4.arrangeTitle = _this4.$t('message.deployedWorkerList');\n _this4.arrangeVisible = true;\n } // this.containerList.splice(index,1);\n // this.$message(`容器${item.containerName}已删除`);\n\n });\n },\n // 兼容 java build in 模式下 baseURL 为 / 的情况(将当前url作为请求路径)\n calculateRequestUrl: function calculateRequestUrl() {\n if (_main__WEBPACK_IMPORTED_MODULE_6__[\"default\"] === undefined || !_main__WEBPACK_IMPORTED_MODULE_6__[\"default\"].includes(\"http\")) {\n var url = window.location.href;\n var urlSplit = url.split('//'); // str1[0]--协议头\n\n var ip = urlSplit[1].split('/')[0];\n this.requestUrl = urlSplit[0] + '//' + ip;\n console.log(\"calculateRequestUrl: \" + this.requestUrl);\n } else {\n this.requestUrl = _main__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n }\n }\n },\n mounted: function mounted() {\n var _this5 = this;\n\n this.calculateRequestUrl();\n var appId = this.$store.state.appInfo.id;\n this.flyio.get(\"/container/list?appId=\" + appId).then(function (res) {\n console.log(res);\n\n if (res.data.success) {\n _this5.containerList = res.data.data;\n }\n });\n }\n});\n\n//# sourceURL=webpack:///./src/components/views/ContainerManager.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), diff --git a/powerjob-server/src/main/resources/static/js/app.js b/powerjob-server/src/main/resources/static/js/app.js index 64088f63..51bad83a 100644 --- a/powerjob-server/src/main/resources/static/js/app.js +++ b/powerjob-server/src/main/resources/static/js/app.js @@ -256,7 +256,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bar /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"Navbar\",\n data: function data() {\n return {\n changeAppInfoDialogVisible: false,\n appInfo: {\n id: this.$store.state.appInfo.id,\n appName: this.$store.state.appInfo.appName,\n password: undefined,\n password2: undefined\n }\n };\n },\n methods: {\n // 退出当前应用\n onClickCloseConsole: function onClickCloseConsole() {\n window.localStorage.removeItem('oms_auto_login');\n this.$router.push(\"/\");\n },\n // 处理系统设置的指令时间\n handleSettings: function handleSettings(cmd) {\n switch (cmd) {\n case \"logout\":\n this.onClickCloseConsole();\n break;\n\n case \"changeAppInfo\":\n this.changeAppInfoDialogVisible = true;\n break;\n }\n },\n // 更新应用信息\n saveNewAppInfo: function saveNewAppInfo() {\n var _this = this;\n\n if (this.appInfo.password === this.appInfo.password2) {\n var that = this;\n this.axios.post(\"/appInfo/save\", this.appInfo).then(function () {\n that.$message.success(_this.$t('message.success'));\n that.$router.push(\"/\");\n }, function (e) {\n return that.$message.error(e);\n });\n }\n }\n }\n});\n\n//# sourceURL=webpack:///./src/components/bar/Navbar.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"Navbar\",\n data: function data() {\n return {\n changeAppInfoDialogVisible: false,\n appInfo: {\n id: this.$store.state.appInfo.id,\n appName: this.$store.state.appInfo.appName,\n password: undefined,\n password2: undefined\n }\n };\n },\n methods: {\n // 退出当前应用\n onClickCloseConsole: function onClickCloseConsole() {\n window.localStorage.removeItem('oms_auto_login');\n this.$router.push(\"/\");\n },\n // 处理系统设置的指令时间\n handleSettings: function handleSettings(cmd) {\n switch (cmd) {\n case \"logout\":\n this.onClickCloseConsole();\n break;\n\n case \"changeAppInfo\":\n this.changeAppInfoDialogVisible = true;\n break;\n }\n },\n // 更新应用信息\n saveNewAppInfo: function saveNewAppInfo() {\n var _this = this;\n\n if (this.appInfo.password === this.appInfo.password2) {\n var that = this;\n this.axios.post(\"/appInfo/save\", this.appInfo).then(function () {\n that.$message.success(_this.$t('message.success'));\n that.$router.push(\"/\");\n }, function (e) {\n return that.$message.error(e);\n });\n } else {\n this.$message.error(\"the password doesn't match\");\n }\n }\n }\n});\n\n//# sourceURL=webpack:///./src/components/bar/Navbar.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), diff --git a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/container/OmsContainerFactory.java b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/container/OmsContainerFactory.java index 7661f7e7..2eb289c4 100644 --- a/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/container/OmsContainerFactory.java +++ b/powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/container/OmsContainerFactory.java @@ -148,7 +148,7 @@ public class OmsContainerFactory { public static void destroyContainer(Long containerId) { OmsContainer container = CARGO.remove(containerId); if (container == null) { - log.warn("[OmsContainer-{}] container not exists.", containerId); + log.info("[OmsContainer-{}] container not exists, so there is no need to destroy the container.", containerId); return; } try {