From e0111635aa63523374af976bd2242548d1b88e18 Mon Sep 17 00:00:00 2001 From: lepdou Date: Tue, 22 Nov 2016 16:27:14 +0800 Subject: [PATCH] bugfix: modify item dont need select cluster --- .../static/scripts/directive/item-modal-directive.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js b/apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js index 25fa27038..4f4858474 100644 --- a/apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js +++ b/apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js @@ -26,11 +26,6 @@ function itemModalDirective(toastr, AppUtil, EventManager, ConfigService) { function doItem() { - if (selectedClusters.length == 0) { - toastr.error("请选择集群"); - return; - } - if (!scope.item.value) { scope.item.value = ""; } @@ -68,6 +63,11 @@ function itemModalDirective(toastr, AppUtil, EventManager, ConfigService) { toastr.error(AppUtil.errorMsg(result), "添加失败"); }); } else { + if (selectedClusters.length == 0) { + toastr.error("请选择集群"); + return; + } + selectedClusters.forEach(function (cluster) { ConfigService.create_item(scope.appId, cluster.env, @@ -113,8 +113,6 @@ function itemModalDirective(toastr, AppUtil, EventManager, ConfigService) { AppUtil.hideModal('#itemModal'); toastr.success("更新成功, 如需生效请发布"); - - }, function (result) { toastr.error(AppUtil.errorMsg(result), "更新失败"); }); -- GitLab