Skip to content

Commit

Permalink
feat: support gray scale diff
Browse files Browse the repository at this point in the history
  • Loading branch information
WTIFS committed Nov 18, 2024
1 parent 2abd7aa commit d231d3f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
6 changes: 3 additions & 3 deletions apollo-portal/src/main/resources/static/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
"Component.Publish.CompareWithMasterValue": "与主版本对比",
"Component.Publish.CompareWithPublishedValue": "与已发布对比",
"Component.Publish.PublishedValue": "已发布的值",
"Component.Publish.Changes": "Changes",
"Component.Publish.Changes": "改动",
"Component.Publish.Key": "Key",
"Component.Publish.NoPublishedValue": "待发布的值",
"Component.Publish.ModifyUser": "修改人",
Expand All @@ -310,8 +310,8 @@
"Component.Publish.ItemNoChange": "配置没有变化",
"Component.Publish.GrayItemNoChange": "灰度配置没有变化",
"Component.Publish.NoGrayItems": "没有灰度的配置项",
"Component.Publish.Release": "Release Name",
"Component.Publish.ReleaseComment": "Comment",
"Component.Publish.Release": "版本名称",
"Component.Publish.ReleaseComment": "说明",
"Component.Publish.OpPublish": "发布",
"Component.Rollback.To": "回滚到",
"Component.Rollback.Tips": "此操作将会回滚到上一个发布版本,且当前版本作废,但不影响正在修改的配置。可在发布历史页面查看当前生效的版本",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ directive_module.directive('apollodiff',
part.removed ? 'red' : 'grey';
span = document.createElement('span');
span.style.color = color;
span.style.display = 'block'
pre = part.added ? '+' :
part.removed ? '-' : '';
span.appendChild(document.createTextNode(pre + part.value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ <h4 class="modal-title" ng-show="toReleaseNamespace.isBranch && toReleaseNamespa
<div class="release modal-body">

<div class="form-group pre-scrollable">
<div class="col-sm-2 control-label" ng-if="!toReleaseNamespace.isPropertiesFormat">
<div class="btn-group-vertical">
<div class="col-sm-2 control-label">
<div class="btn-group-vertical" ng-if="!toReleaseNamespace.isPropertiesFormat || (toReleaseNamespace.isBranch && !toReleaseNamespace.mergeAndPublish)">
<div class="btn-group btn-group-xs" role="group">
<button type="button" class="btn btn-default" ng-if="toReleaseNamespace.isBranch"
ng-class="{active:releaseChangeViewType=='compareWithMasterValue'}"
Expand All @@ -56,9 +56,8 @@ <h4 class="modal-title" ng-show="toReleaseNamespace.isBranch && toReleaseNamespa
</button>
</div>
</div>
<label ng-if="toReleaseNamespace.isPropertiesFormat" style="display: block">{{'Component.Publish.Changes' | translate }}</label>
</div>
<label class="col-sm-2 control-label"
ng-if="toReleaseNamespace.isPropertiesFormat">{{'Component.Publish.Changes' | translate }}</label>

<div class="col-sm-10"
ng-if="(!toReleaseNamespace.isBranch && toReleaseNamespace.itemModifiedCnt)
Expand Down Expand Up @@ -123,11 +122,11 @@ <h4 class="modal-title" ng-show="toReleaseNamespace.isBranch && toReleaseNamespa

<!--branch gray release-->
<!--灰度发布-->
<table class="table table-bordered table-striped text-center table-hover" ng-if="toReleaseNamespace.isPropertiesFormat &&
<table class="table table-bordered table-striped text-center table-hover table-fixed" ng-if="toReleaseNamespace.isPropertiesFormat &&
toReleaseNamespace.isBranch && !toReleaseNamespace.mergeAndPublish">
<thead>
<tr>
<th>
<th width="12%">
{{'Component.Publish.Key' | translate }}
</th>
<th>
Expand All @@ -139,10 +138,10 @@ <h4 class="modal-title" ng-show="toReleaseNamespace.isBranch && toReleaseNamespa
<th>
{{'Component.Publish.GrayNoPublishedValue' | translate }}
</th>
<th>
<th width="10%">
{{'Component.Publish.ModifyUser' | translate }}
</th>
<th>
<th width="12%">
{{'Component.Publish.ModifyTime' | translate }}
</th>
</tr>
Expand All @@ -161,8 +160,14 @@ <h4 class="modal-title" ng-show="toReleaseNamespace.isBranch && toReleaseNamespa
<td width="20%" title="{{config.oldValue}}">
<span ng-bind="config.oldValue"></span>
</td>
<td width="20%" title="{{config.newValue}}">
<span ng-bind="config.newValue"></span>
<td width="20%" title="{{config.newValue}}" class="left-overflow">
<span ng-if="releaseChangeViewType=='compareWithMasterValue'">
<apollodiff old-str="config.masterReleaseValue" new-str="config.newValue" apollo-id="'grayDiffMaster:' + config.item.key"></apollodiff>
</span>
<span ng-if="releaseChangeViewType=='compareWithPublishedValue'">
<apollodiff old-str="config.oldValue" new-str="config.newValue" apollo-id="'grayDiffPublished:' + config.item.key"></apollodiff>
</span>
<span ng-if="releaseChangeViewType=='release'" ng-bind="config.newValue"></span>
</td>
<td width="10%" ng-bind="config.item.dataChangeLastModifiedBy">
</td>
Expand Down Expand Up @@ -211,7 +216,7 @@ <h4 class="modal-title" ng-show="toReleaseNamespace.isBranch && toReleaseNamespa
<span ng-bind="config.masterReleaseValue"></span>
</td>
<td width="25%" title="{{config.item.value}}" class="left-overflow">
<apollodiff old-str="config.masterReleaseValue" new-str="config.item.value" apollo-id="'grayDiffMaster:' + config.item.key"></apollodiff>
<apollodiff old-str="config.masterReleaseValue" new-str="config.item.value" apollo-id="'grayDiffMasterReleased:' + config.item.key"></apollodiff>
</td>
<td width="15%" ng-bind="config.item.dataChangeLastModifiedBy">
</td>
Expand Down

0 comments on commit d231d3f

Please sign in to comment.