Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
9c5d43e9
Commit
9c5d43e9
authored
Dec 08, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: email's apollo link change release id to release history id
parent
3aae94de
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
24 deletions
+22
-24
ConfigPublishEmailBuilder.java
...al/components/emailbuilder/ConfigPublishEmailBuilder.java
+3
-2
GrayPublishEmailBuilder.java
...rtal/components/emailbuilder/GrayPublishEmailBuilder.java
+3
-3
RelativeDateFormat.java
...trip/framework/apollo/portal/util/RelativeDateFormat.java
+1
-1
PageCommon.js
...lo-portal/src/main/resources/static/scripts/PageCommon.js
+0
-1
ReleaseHistoryController.js
...tic/scripts/controller/config/ReleaseHistoryController.js
+15
-11
common-style.css
...-portal/src/main/resources/static/styles/common-style.css
+0
-6
No files found.
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/components/emailbuilder/ConfigPublishEmailBuilder.java
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
){
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
;
if
(
!
history
.
viewType
)
{
//default view type
history
.
viewType
=
CONFIG_VIEW_TYPE
.
DIFF
;
showReleaseDiffConfiguration
(
history
);
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
View file @
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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment