diff --git a/apollo-portal/src/main/resources/static/config/diff.html b/apollo-portal/src/main/resources/static/config/diff.html
index 0bd2adb8922..b2aac9c9a00 100644
--- a/apollo-portal/src/main/resources/static/config/diff.html
+++ b/apollo-portal/src/main/resources/static/config/diff.html
@@ -128,28 +128,26 @@
{{'Config.Diff.Title' | translate }}
-
+
- Key |
-
+ | Key |
+
Value ( {{'Common.Environment' | translate }} : , {{'Common.Cluster' | translate }} : )
-
- |
+
+ |
Comment ( {{'Common.Environment' | translate }} : , {{'Common.Cluster' | translate }} : )
-
+ |
|
|
-
-
-
-
+ |
+
|
{{'Config.Diff.Title' | translate }}
-
+
diff --git a/apollo-portal/src/main/resources/static/config/history.html b/apollo-portal/src/main/resources/static/config/history.html
index cf6d0420e0e..fb81125339d 100644
--- a/apollo-portal/src/main/resources/static/config/history.html
+++ b/apollo-portal/src/main/resources/static/config/history.html
@@ -188,14 +188,10 @@ {{'Config.History.ChangedItem' | translate }}
|
-
-
-
-
-
+ |
+
+
|
@@ -313,7 +309,7 @@
-
+
diff --git a/apollo-portal/src/main/resources/static/i18n/en.json b/apollo-portal/src/main/resources/static/i18n/en.json
index 69ae8e5e4cf..7cab764e0c6 100644
--- a/apollo-portal/src/main/resources/static/i18n/en.json
+++ b/apollo-portal/src/main/resources/static/i18n/en.json
@@ -297,6 +297,7 @@
"Component.Publish.NoPublishedValue": "Unreleased values",
"Component.Publish.ModifyUser": "Modifier",
"Component.Publish.ModifyTime": "Modified Time",
+ "Component.Publish.ModifyRecord": "Record",
"Component.Publish.NewAdded": "New",
"Component.Publish.NewAddedTips": "New Configuration",
"Component.Publish.Modified": "Modified",
diff --git a/apollo-portal/src/main/resources/static/i18n/zh-CN.json b/apollo-portal/src/main/resources/static/i18n/zh-CN.json
index f9f82e28dfe..8c00fee807f 100644
--- a/apollo-portal/src/main/resources/static/i18n/zh-CN.json
+++ b/apollo-portal/src/main/resources/static/i18n/zh-CN.json
@@ -297,6 +297,7 @@
"Component.Publish.NoPublishedValue": "待发布的值",
"Component.Publish.ModifyUser": "修改人",
"Component.Publish.ModifyTime": "修改时间",
+ "Component.Publish.ModifyRecord": "修改记录",
"Component.Publish.NewAdded": "新",
"Component.Publish.NewAddedTips": "新增的配置",
"Component.Publish.Modified": "改",
diff --git a/apollo-portal/src/main/resources/static/scripts/controller/config/DiffConfigController.js b/apollo-portal/src/main/resources/static/scripts/controller/config/DiffConfigController.js
index 7354ac670cb..8272ba7d28d 100644
--- a/apollo-portal/src/main/resources/static/scripts/controller/config/DiffConfigController.js
+++ b/apollo-portal/src/main/resources/static/scripts/controller/config/DiffConfigController.js
@@ -38,7 +38,7 @@ diff_item_module.controller("DiffItemController",
$scope.backToAppHomePage = backToAppHomePage;
$scope.switchSelect = switchSelect;
- $scope.showText = showText;
+ $scope.showTextDiff = showTextDiff;
$scope.itemsKeyedByKey = {};
$scope.allNamespaceValueEqualed = {};
@@ -195,8 +195,9 @@ diff_item_module.controller("DiffItemController",
o.checked = !o.checked;
}
- function showText(text) {
- $scope.text = text;
+ function showTextDiff(oldStr, newStr) {
+ $scope.oldStr = oldStr;
+ $scope.newStr = newStr;
AppUtil.showModal('#showTextModal');
}
}]);
diff --git a/apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js b/apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js
index 028cb554b04..45302596938 100644
--- a/apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js
+++ b/apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js
@@ -53,6 +53,7 @@ function releaseHistoryController($scope, $location, $translate, AppUtil, EventM
$scope.switchConfigViewType = switchConfigViewType;
$scope.findReleaseHistory = findReleaseHistory;
$scope.showText = showText;
+ $scope.showTextDiff = showTextDiff;
EventManager.subscribe(EventManager.EventType.REFRESH_RELEASE_HISTORY, function () {
location.reload(true);
@@ -207,8 +208,16 @@ function releaseHistoryController($scope, $location, $translate, AppUtil, EventM
}
function showText(text) {
+ $scope.enableTextDiff = false;
$scope.text = text;
AppUtil.showModal("#showTextModal");
}
+
+ function showTextDiff(oldStr, newStr) {
+ $scope.enableTextDiff = true;
+ $scope.oldStr = oldStr;
+ $scope.newStr = newStr;
+ AppUtil.showModal('#showTextModal');
+ }
}
diff --git a/apollo-portal/src/main/resources/static/scripts/directive/release-modal-directive.js b/apollo-portal/src/main/resources/static/scripts/directive/release-modal-directive.js
index 89d82a4e97b..9b285c9a8a2 100644
--- a/apollo-portal/src/main/resources/static/scripts/directive/release-modal-directive.js
+++ b/apollo-portal/src/main/resources/static/scripts/directive/release-modal-directive.js
@@ -34,6 +34,7 @@ function releaseModalDirective($translate, toastr, AppUtil, EventManager, Releas
scope.releaseBtnDisabled = false;
scope.releaseChangeViewType = 'compareWithPublishedValue';
+ scope.isComparePublished = true;
scope.releaseComment = '';
scope.isEmergencyPublish = false;
@@ -170,6 +171,9 @@ function releaseModalDirective($translate, toastr, AppUtil, EventManager, Releas
function switchReleaseChangeViewType(type) {
scope.releaseChangeViewType = type;
+ scope.isCompareMaster = type === 'compareWithMasterValue';
+ scope.isComparePublished = type === 'compareWithPublishedValue';
+ scope.isNoCompare = type === 'release';
}
}
}
diff --git a/apollo-portal/src/main/resources/static/scripts/directive/show-text-modal-directive.js b/apollo-portal/src/main/resources/static/scripts/directive/show-text-modal-directive.js
index ff55de3dc1c..f023a03ef07 100644
--- a/apollo-portal/src/main/resources/static/scripts/directive/show-text-modal-directive.js
+++ b/apollo-portal/src/main/resources/static/scripts/directive/show-text-modal-directive.js
@@ -74,7 +74,10 @@ function showTextModalDirective(AppUtil) {
transclude: true,
replace: true,
scope: {
- text: '='
+ text: '=',
+ oldStr: '=',
+ newStr: '=',
+ enableTextDiff: '='
},
link: function (scope) {
scope.$watch('text', init);
diff --git a/apollo-portal/src/main/resources/static/styles/common-style.css b/apollo-portal/src/main/resources/static/styles/common-style.css
index b396156c687..7d90f4b6fe9 100644
--- a/apollo-portal/src/main/resources/static/styles/common-style.css
+++ b/apollo-portal/src/main/resources/static/styles/common-style.css
@@ -95,7 +95,7 @@ p, td, span {
color: #797979;
}
-pre {
+pre .pre{
white-space: pre-wrap; /* Since CSS 2.1 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
@@ -103,10 +103,6 @@ pre {
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
-.pre {
- white-space: pre;
-}
-
.hover:hover {
background: #f5f5f5;
cursor: pointer
@@ -1185,4 +1181,8 @@ table th {
.table-fixed{
table-layout: fixed;
+}
+
+.block {
+ display: block;
}
\ No newline at end of file
diff --git a/apollo-portal/src/main/resources/static/views/component/diff.html b/apollo-portal/src/main/resources/static/views/component/diff.html
index 0caebc37bd7..938819c001a 100644
--- a/apollo-portal/src/main/resources/static/views/component/diff.html
+++ b/apollo-portal/src/main/resources/static/views/component/diff.html
@@ -1,4 +1,4 @@
-
+