From 1deb136c2c40eeb581c43863ee786b8bd0c754f1 Mon Sep 17 00:00:00 2001 From: ywy <1758863328@qq.com> Date: Sat, 23 Sep 2023 00:08:01 +0800 Subject: [PATCH] fix button value and diff code (#4981) --- apollo-portal/src/main/resources/static/i18n/en.json | 2 +- apollo-portal/src/main/resources/static/i18n/zh-CN.json | 2 +- .../main/resources/static/scripts/directive/diff-directive.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apollo-portal/src/main/resources/static/i18n/en.json b/apollo-portal/src/main/resources/static/i18n/en.json index 56ac0f11862..c20959c323c 100644 --- a/apollo-portal/src/main/resources/static/i18n/en.json +++ b/apollo-portal/src/main/resources/static/i18n/en.json @@ -289,7 +289,7 @@ "Component.Publish.AllPublishTips": "(Full release configurations are applied to all instances)", "Component.Publish.ToSeeChange": "View changes", "Component.Publish.CompareWithMasterValue": "Compare with master", - "Component.Publish.CompareWithPublishedValue": "Compare with grayscale", + "Component.Publish.CompareWithPublishedValue": "Compare with published", "Component.Publish.PublishedValue": "Released values", "Component.Publish.Changes": "Changes", "Component.Publish.Key": "Key", 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 72047982c9b..da9c856b4e6 100644 --- a/apollo-portal/src/main/resources/static/i18n/zh-CN.json +++ b/apollo-portal/src/main/resources/static/i18n/zh-CN.json @@ -289,7 +289,7 @@ "Component.Publish.AllPublishTips": "(全量发布的配置会作用于全部的实例)", "Component.Publish.ToSeeChange": "查看变更", "Component.Publish.CompareWithMasterValue": "与主版本对比", - "Component.Publish.CompareWithPublishedValue": "与灰度版本对比", + "Component.Publish.CompareWithPublishedValue": "与已发布对比", "Component.Publish.PublishedValue": "待发布的值", "Component.Publish.Changes": "Changes", "Component.Publish.Key": "Key", diff --git a/apollo-portal/src/main/resources/static/scripts/directive/diff-directive.js b/apollo-portal/src/main/resources/static/scripts/directive/diff-directive.js index 3bf0036092e..1c6c1f4505b 100644 --- a/apollo-portal/src/main/resources/static/scripts/directive/diff-directive.js +++ b/apollo-portal/src/main/resources/static/scripts/directive/diff-directive.js @@ -49,7 +49,8 @@ directive_module.directive('apollodiff', var newStr = scope.newStr == undefined ? '' : scope.newStr; var oldStrRes = oldStr.replace(/\r/g, ""); - var diff = JsDiff.diffLines(oldStrRes, newStr), + var newStrRes = newStr.replace(/\r/g, ""); + var diff = JsDiff.diffLines(oldStrRes, newStrRes), fragment = document.createDocumentFragment(); diff.forEach(function (part) {