diff --git a/apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ReleaseService.java b/apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ReleaseService.java index a910eba35dc44a7f225e3e0b3b230ecc72305bae..e4432d6c6cc92f9c5d4e8f19d18c338772aef826 100644 --- a/apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ReleaseService.java +++ b/apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ReleaseService.java @@ -67,6 +67,7 @@ public class ReleaseService { release.setReleaseKey(ReleaseKeyGenerator.generateReleaseKey(namespace)); release.setDataChangeCreatedTime(new Date()); release.setDataChangeCreatedBy(owner); + release.setDataChangeLastModifiedBy(owner); release.setName(name); release.setComment(comment); release.setAppId(namespace.getAppId()); diff --git a/apollo-portal/src/main/java/com/ctrip/apollo/portal/entity/form/NamespaceTextModel.java b/apollo-portal/src/main/java/com/ctrip/apollo/portal/entity/form/NamespaceTextModel.java index ef0204b180a63c04dec6c370ac31c176c146a30a..ba467e73f1498a91b2778c5b2e1266696c0b03e3 100644 --- a/apollo-portal/src/main/java/com/ctrip/apollo/portal/entity/form/NamespaceTextModel.java +++ b/apollo-portal/src/main/java/com/ctrip/apollo/portal/entity/form/NamespaceTextModel.java @@ -12,12 +12,11 @@ public class NamespaceTextModel implements Verifiable { private String namespaceName; private int namespaceId; private String configText; - private String modifyBy; private String comment; @Override public boolean isInvalid(){ - return StringUtils.isContainEmpty(appId, env, clusterName, namespaceName, configText, modifyBy) || namespaceId <= 0; + return StringUtils.isContainEmpty(appId, env, clusterName, namespaceName, configText) || namespaceId <= 0; } public String getAppId() { return appId; @@ -67,14 +66,6 @@ public class NamespaceTextModel implements Verifiable { this.configText = configText; } - public String getModifyBy() { - return modifyBy; - } - - public void setModifyBy(String modifyBy) { - this.modifyBy = modifyBy; - } - public String getComment() { return comment; } diff --git a/apollo-portal/src/main/resources/static/scripts/controller/app/AppConfigController.js b/apollo-portal/src/main/resources/static/scripts/controller/app/AppConfigController.js index a19066cae0dddce18a6d69b091d60f41a043a2da..10421484c12754d5a692d879659ecc40db2a027f 100644 --- a/apollo-portal/src/main/resources/static/scripts/controller/app/AppConfigController.js +++ b/apollo-portal/src/main/resources/static/scripts/controller/app/AppConfigController.js @@ -159,7 +159,7 @@ application_module.controller("AppConfigController", $scope.commitChange = function () { ConfigService.modify_items($scope.pageContext.appId, $scope.pageContext.env, $scope.pageContext.clusterName, $scope.draft.namespace.namespaceName, $scope.draft.text, - $scope.draft.namespace.id, $scope.commitComment, currentUser).then( + $scope.draft.namespace.id, $scope.commitComment).then( function (result) { toastr.success("更新成功"); //refresh all namespace items @@ -205,10 +205,11 @@ application_module.controller("AppConfigController", releaseNamespace = namespace; }; $scope.releaseComment = ''; + $scope.releaseTitle = ''; $scope.release = function () { ConfigService.release($scope.pageContext.appId, $scope.pageContext.env, $scope.pageContext.clusterName, - releaseNamespace.namespace.namespaceName, currentUser, + releaseNamespace.namespace.namespaceName, $scope.releaseTitle, $scope.releaseComment).then( function (result) { toastr.success("发布成功"); diff --git a/apollo-portal/src/main/resources/static/scripts/controller/app/SyncConfigController.js b/apollo-portal/src/main/resources/static/scripts/controller/app/SyncConfigController.js index a4c4490f695de7f458efa304ece71283ff9fe205..85fd57077d87b552c8b3f730bc9249dbe2b9e4d5 100644 --- a/apollo-portal/src/main/resources/static/scripts/controller/app/SyncConfigController.js +++ b/apollo-portal/src/main/resources/static/scripts/controller/app/SyncConfigController.js @@ -72,7 +72,9 @@ sync_item_module.controller("SyncItemController", $scope.syncItems = function () { ConfigService.sync_items($scope.pageContext.namespaceName, parseSyncSourceData()).then(function (result) { $scope.syncItemStep += 1; + $scope.syncSuccess = true; }, function (result) { + $scope.syncSuccess = false; toastr.error(AppUtil.errorMsg(result)); }); }; diff --git a/apollo-portal/src/main/resources/static/scripts/services/ConfigService.js b/apollo-portal/src/main/resources/static/scripts/services/ConfigService.js index 07bd715371df9d81269c7a9e54af1a53011bb5e4..926661edb2e86cb6061fae3ecec6eb751ecf93ad 100644 --- a/apollo-portal/src/main/resources/static/scripts/services/ConfigService.js +++ b/apollo-portal/src/main/resources/static/scripts/services/ConfigService.js @@ -59,7 +59,7 @@ appService.service("ConfigService", ['$resource', '$q', function ($resource, $q) return d.promise; }, - modify_items: function (appId, env, clusterName, namespaceName, configText, namespaceId, comment, modifyBy) { + modify_items: function (appId, env, clusterName, namespaceName, configText, namespaceId, comment) { var d = $q.defer(); config_source.modify_items({ appId: appId, @@ -70,8 +70,7 @@ appService.service("ConfigService", ['$resource', '$q', function ($resource, $q) { configText: configText, namespaceId: namespaceId, - comment:comment, - modifyBy: modifyBy + comment:comment }, function (result) { d.resolve(result); diff --git a/apollo-portal/src/main/resources/static/views/app.html b/apollo-portal/src/main/resources/static/views/app.html index d9bc6218b11180129923c0f8e97f3bc3c6a0fd5c..94b50d6c01a3b95941cc5cd8e353e55bb3ca65b7 100644 --- a/apollo-portal/src/main/resources/static/views/app.html +++ b/apollo-portal/src/main/resources/static/views/app.html @@ -334,12 +334,13 @@ diff --git a/apollo-portal/src/main/resources/static/views/sync.html b/apollo-portal/src/main/resources/static/views/sync.html index ea083498a087eec9c5be6dcce5fc40f43afb3077..dc88a2471d4a2b6a9fba209bc147dc61634e431c 100644 --- a/apollo-portal/src/main/resources/static/views/sync.html +++ b/apollo-portal/src/main/resources/static/views/sync.html @@ -162,9 +162,13 @@ -
+
-

同步成功!

+

同步成功!

+
+
+ +

同步失败!

diff --git a/apollo-portal/src/test/java/com/ctrip/apollo/portal/ConfigServiceTest.java b/apollo-portal/src/test/java/com/ctrip/apollo/portal/ConfigServiceTest.java index ed373d55913783acf12772cadf6a7040c0ee3279..a4018a9180c7985819d06921e9392bf5d0268879 100644 --- a/apollo-portal/src/test/java/com/ctrip/apollo/portal/ConfigServiceTest.java +++ b/apollo-portal/src/test/java/com/ctrip/apollo/portal/ConfigServiceTest.java @@ -100,7 +100,6 @@ public class ConfigServiceTest { NamespaceTextModel model = new NamespaceTextModel(); model.setEnv("DEV"); - model.setModifyBy("ll"); model.setNamespaceName(namespaceName); model.setClusterName(clusterName); model.setAppId(appId);