Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
superrain51
apollo
提交
9c5d43e9
apollo
项目概览
superrain51
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9c5d43e9
编写于
12月 08, 2016
作者:
L
lepdou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bugfix: email's apollo link change release id to release history id
上级
3aae94de
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
26 addition
and
28 deletion
+26
-28
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/components/emailbuilder/ConfigPublishEmailBuilder.java
...al/components/emailbuilder/ConfigPublishEmailBuilder.java
+3
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/components/emailbuilder/GrayPublishEmailBuilder.java
...rtal/components/emailbuilder/GrayPublishEmailBuilder.java
+3
-3
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/util/RelativeDateFormat.java
...trip/framework/apollo/portal/util/RelativeDateFormat.java
+1
-1
apollo-portal/src/main/resources/static/scripts/PageCommon.js
...lo-portal/src/main/resources/static/scripts/PageCommon.js
+0
-1
apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js
...tic/scripts/controller/config/ReleaseHistoryController.js
+19
-15
apollo-portal/src/main/resources/static/styles/common-style.css
...-portal/src/main/resources/static/styles/common-style.css
+0
-6
未找到文件。
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/components/emailbuilder/ConfigPublishEmailBuilder.java
浏览文件 @
9c5d43e9
...
...
@@ -6,7 +6,6 @@ import com.google.common.collect.Lists;
import
com.ctrip.framework.apollo.common.constants.ReleaseOperation
;
import
com.ctrip.framework.apollo.common.dto.ReleaseDTO
;
import
com.ctrip.framework.apollo.common.entity.AppNamespace
;
import
com.ctrip.framework.apollo.common.utils.BeanUtils
;
import
com.ctrip.framework.apollo.core.enums.ConfigFileFormat
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.portal.constant.RoleType
;
...
...
@@ -24,7 +23,6 @@ import com.ctrip.framework.apollo.portal.util.RoleUtils;
import
org.apache.commons.lang.time.FastDateFormat
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
...
...
@@ -47,6 +45,7 @@ public abstract class ConfigPublishEmailBuilder {
private
static
final
String
EMAIL_CONTENT_FIELD_OPERATOR
=
"\\$\\{operator}"
;
private
static
final
String
EMAIL_CONTENT_FIELD_RELEASE_TIME
=
"\\$\\{releaseTime}"
;
private
static
final
String
EMAIL_CONTENT_FIELD_RELEASE_ID
=
"\\$\\{releaseId}"
;
private
static
final
String
EMAIL_CONTENT_FIELD_RELEASE_HISTORY_ID
=
"\\$\\{releaseHistoryId}"
;
private
static
final
String
EMAIL_CONTENT_FIELD_RELEASE_TITLE
=
"\\$\\{releaseTitle}"
;
private
static
final
String
EMAIL_CONTENT_FIELD_RELEASE_COMMENT
=
"\\$\\{releaseComment}"
;
private
static
final
String
EMAIL_CONTENT_FIELD_APOLLO_SERVER_ADDRESS
=
"\\$\\{apollo.portal.address}"
;
...
...
@@ -156,6 +155,8 @@ public abstract class ConfigPublishEmailBuilder {
renderResult
=
renderResult
.
replaceAll
(
EMAIL_CONTENT_FIELD_RELEASE_TITLE
,
Matcher
.
quoteReplacement
(
releaseHistory
.
getReleaseTitle
()));
renderResult
=
renderResult
.
replaceAll
(
EMAIL_CONTENT_FIELD_RELEASE_ID
,
String
.
valueOf
(
releaseHistory
.
getReleaseId
()));
renderResult
=
renderResult
.
replaceAll
(
EMAIL_CONTENT_FIELD_RELEASE_HISTORY_ID
,
String
.
valueOf
(
releaseHistory
.
getId
()));
renderResult
=
renderResult
.
replaceAll
(
EMAIL_CONTENT_FIELD_RELEASE_COMMENT
,
Matcher
.
quoteReplacement
(
releaseHistory
.
getReleaseComment
()));
renderResult
=
renderResult
.
replaceAll
(
EMAIL_CONTENT_FIELD_APOLLO_SERVER_ADDRESS
,
getApolloPortalAddress
());
return
renderResult
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/components/emailbuilder/GrayPublishEmailBuilder.java
浏览文件 @
9c5d43e9
package
com.ctrip.framework.apollo.portal.components.emailbuilder
;
import
com.google.common.base.Joiner
;
import
com.google.gson.Gson
;
import
com.ctrip.framework.apollo.common.constants.GsonType
;
...
...
@@ -21,6 +22,7 @@ public class GrayPublishEmailBuilder extends ConfigPublishEmailBuilder {
private
static
final
String
EMAIL_SUBJECT
=
"[Apollo] 灰度发布"
;
private
Gson
gson
=
new
Gson
();
private
Joiner
IP_JOINER
=
Joiner
.
on
(
", "
);
@Override
protected
String
subject
()
{
...
...
@@ -54,9 +56,7 @@ public class GrayPublishEmailBuilder extends ConfigPublishEmailBuilder {
.
append
(
clientAppId
)
.
append
(
" <b>IP: </b>"
);
for
(
String
ip
:
ips
)
{
rulesHtmlBuilder
.
append
(
ip
).
append
(
","
);
}
IP_JOINER
.
appendTo
(
rulesHtmlBuilder
,
ips
);
}
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/util/RelativeDateFormat.java
浏览文件 @
9c5d43e9
...
...
@@ -6,7 +6,7 @@ import java.util.Date;
public
class
RelativeDateFormat
{
private
static
final
FastDateFormat
TIMESTAMP_FORMAT
=
FastDateFormat
.
getInstance
(
"yyyy
MMddHHmmss
"
);
private
static
final
FastDateFormat
TIMESTAMP_FORMAT
=
FastDateFormat
.
getInstance
(
"yyyy
-MM-dd
"
);
private
static
final
long
ONE_MINUTE
=
60000L
;
private
static
final
long
ONE_HOUR
=
3600000L
;
private
static
final
long
ONE_DAY
=
86400000L
;
...
...
apollo-portal/src/main/resources/static/scripts/PageCommon.js
浏览文件 @
9c5d43e9
...
...
@@ -23,7 +23,6 @@ $(document).ready(function () {
$
(
"
textarea
"
).
niceScroll
({
cursoropacitymax
:
0
});
$
(
"
pre
"
).
niceScroll
({
cursoropacitymax
:
0
});
$
(
"
.release-history-list
"
).
niceScroll
({
cursoropacitymax
:
0
});
$
(
"
.release-info .config
"
).
niceScroll
({
cursoropacitymax
:
0
});
},
2500
);
});
...
...
apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js
浏览文件 @
9c5d43e9
...
...
@@ -12,7 +12,8 @@ function releaseHistoryController($scope, $location, AppUtil,
env
:
params
.
env
,
clusterName
:
params
.
clusterName
,
namespaceName
:
params
.
namespaceName
,
releaseId
:
params
.
releaseId
releaseId
:
params
.
releaseId
,
releaseHistoryId
:
params
.
releaseHistoryId
};
var
PAGE_SIZE
=
10
;
var
CONFIG_VIEW_TYPE
=
{
...
...
@@ -50,7 +51,7 @@ function releaseHistoryController($scope, $location, AppUtil,
$scope
.
pageContext
.
namespaceName
,
$scope
.
page
,
PAGE_SIZE
)
.
then
(
function
(
result
)
{
if
(
$scope
.
page
==
0
){
if
(
$scope
.
page
==
0
)
{
$
(
"
.release-history
"
).
removeClass
(
'
hidden
'
);
}
...
...
@@ -66,13 +67,14 @@ function releaseHistoryController($scope, $location, AppUtil,
if
(
$scope
.
page
==
0
)
{
var
defaultToShowReleaseHistory
=
result
[
0
];
if
(
$scope
.
pageContext
.
releaseId
){
$scope
.
releaseHistories
.
forEach
(
function
(
history
)
{
if
(
$scope
.
pageContext
.
releaseId
==
history
.
releaseId
){
defaultToShowReleaseHistory
=
history
;
}
})
}
$scope
.
releaseHistories
.
forEach
(
function
(
history
)
{
if
(
$scope
.
pageContext
.
releaseHistoryId
==
history
.
id
)
{
defaultToShowReleaseHistory
=
history
;
}
else
if
(
$scope
.
pageContext
.
releaseId
==
history
.
releaseId
)
{
history
.
viewType
=
CONFIG_VIEW_TYPE
.
ALL
;
defaultToShowReleaseHistory
=
history
;
}
});
showReleaseHistoryDetail
(
defaultToShowReleaseHistory
);
}
...
...
@@ -98,26 +100,28 @@ function releaseHistoryController($scope, $location, AppUtil,
$scope
.
history
=
history
;
$scope
.
selectedReleaseHistory
=
history
.
id
;
history
.
viewType
=
CONFIG_VIEW_TYPE
.
DIFF
;
showReleaseDiffConfiguration
(
history
);
if
(
!
history
.
viewType
)
{
//default view type
history
.
viewType
=
CONFIG_VIEW_TYPE
.
DIFF
;
getReleaseDiffConfiguration
(
history
);
}
}
function
switchConfigViewType
(
history
,
viewType
)
{
history
.
viewType
=
viewType
;
if
(
viewType
==
CONFIG_VIEW_TYPE
.
DIFF
)
{
show
ReleaseDiffConfiguration
(
history
);
get
ReleaseDiffConfiguration
(
history
);
}
}
function
showReleaseDiffConfiguration
(
history
)
{
history
.
viewType
=
CONFIG_VIEW_TYPE
.
DIFF
;
function
getReleaseDiffConfiguration
(
history
)
{
if
(
!
history
.
changes
)
{
//Set previous release id to master latest release id when branch first gray release.
if
(
history
.
operation
==
2
&&
history
.
previousReleaseId
==
0
){
if
(
history
.
operation
==
2
&&
history
.
previousReleaseId
==
0
)
{
history
.
previousReleaseId
=
history
.
operationContext
.
baseReleaseId
;
}
...
...
apollo-portal/src/main/resources/static/styles/common-style.css
浏览文件 @
9c5d43e9
...
...
@@ -612,12 +612,6 @@ table th {
padding
:
15px
;
}
.release-history
.panel-body
{
max-height
:
750px
;
padding
:
0
;
overflow
:
scroll
;
}
.release-history
.empty-container
{
padding
:
15px
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录