Skip to content

Commit afad056

Browse files
authored
feature:compare config (#4459)
1 parent 3440475 commit afad056

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ Apollo 2.1.0
1616
* [Optimize the UI experience of open platform authorization management](https://github.com/apolloconfig/apollo/pull/4436)
1717
* [Allow users to associate multiple public namespaces at a time](https://github.com/apolloconfig/apollo/pull/4437)
1818
* [Move apollo-demo, scripts/docker-quick-start and scripts/apollo-on-kubernetes out of main repository](https://github.com/apolloconfig/apollo/pull/4440)
19-
19+
* [Add search key when comparing Configuration items](https://github.com/apolloconfig/apollo/pull/4459)
2020
------------------
2121
All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/11?closed=1)

apollo-portal/src/main/resources/static/config/diff.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ <h4 class="modal-title">{{'Config.Diff.Title' | translate }}
9292
<div class="row" style="margin-top: 10px;">
9393
<div class="form-horizontal">
9494
<div class="col-sm-12">
95+
<label class="control-label">
96+
<input type="text" class="comment-toggle"
97+
ng-model="searchKey"
98+
placeholder="{{'Config.Diff.SearchKey' | translate }}">
99+
</label>
95100
<label class="control-label">
96101
<input type="checkbox" class="comment-toggle" ng-checked="showCommentDiff"
97102
ng-click="showCommentDiff=!showCommentDiff">
@@ -117,7 +122,7 @@ <h4 class="modal-title">{{'Config.Diff.Title' | translate }}
117122
</tr>
118123
</thead>
119124
<tbody>
120-
<tr ng-repeat="(key, itemsKeyedByCluster) in itemsKeyedByKey" ng-if="!onlyShowDiffKeys || (onlyShowDiffKeys && !allNamespaceValueEqualed[key])">
125+
<tr ng-repeat="(key, itemsKeyedByCluster) in itemsKeyedByKey" ng-if="(searchKey === '' || key.indexOf(searchKey) !== -1 ) && (!onlyShowDiffKeys || (onlyShowDiffKeys && !allNamespaceValueEqualed[key]))">
121126
<td width="15%" ng-bind="key"></td>
122127
<td ng-repeat="cluster in syncData.syncToNamespaces"
123128
ng-bind="(itemsKeyedByCluster[cluster.env + ':' + cluster.clusterName + ':' + cluster.namespaceName] || {}).value">

apollo-portal/src/main/resources/static/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@
701701
"Config.Diff.Tips": "By comparing configuration, you can see configuration differences between multiple environments and clusters",
702702
"Config.Diff.DiffCluster": "Clusters to be compared",
703703
"Config.Diff.HasDiffComment": "Whether to compare comments or not",
704+
"Config.Diff.SearchKey": "search configuration",
704705
"Config.Diff.OnlyShowDiffKeys": "Only display configuration items with different values",
705706
"Config.Diff.PleaseChooseTwoCluster": "Please select at least two clusters",
706707
"ConfigExport.Title": "Config Export/Import",

apollo-portal/src/main/resources/static/i18n/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@
701701
"Config.Diff.Tips": "通过比较配置功能,可以查看多个环境、集群间的配置差异",
702702
"Config.Diff.DiffCluster": "要比较的集群",
703703
"Config.Diff.HasDiffComment": "是否比较注释",
704+
"Config.Diff.SearchKey": "搜索配置项",
704705
"Config.Diff.OnlyShowDiffKeys": "是否只显示值不一样的配置项",
705706
"Config.Diff.PleaseChooseTwoCluster": "请至少选择两个集群",
706707
"ConfigExport.Title": "配置导出导入",

apollo-portal/src/main/resources/static/scripts/controller/config/DiffConfigController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ diff_item_module.controller("DiffItemController",
2828
var sourceItems = [];
2929

3030
$scope.diff = diff;
31+
$scope.searchKey = ''
3132
$scope.syncBtnDisabled = false;
3233
$scope.showCommentDiff = false;
3334
$scope.onlyShowDiffKeys = true;
34-
3535
$scope.collectSelectedClusters = collectSelectedClusters;
3636

3737
$scope.syncItemNextStep = syncItemNextStep;

0 commit comments

Comments
 (0)