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
c2d82c07
Commit
c2d82c07
authored
Oct 18, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Record and display release delivery time
parent
914aafa4
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
111 additions
and
31 deletions
+111
-31
InstanceConfigController.java
...llo/adminservice/controller/InstanceConfigController.java
+24
-2
InstanceConfigControllerTest.java
...adminservice/controller/InstanceConfigControllerTest.java
+22
-3
InstanceConfig.java
...com/ctrip/framework/apollo/biz/entity/InstanceConfig.java
+11
-0
InstanceService.java
...m/ctrip/framework/apollo/biz/service/InstanceService.java
+1
-0
InstanceConfigDTO.java
.../ctrip/framework/apollo/common/dto/InstanceConfigDTO.java
+9
-0
InstanceConfigAuditUtil.java
...rk/apollo/configservice/util/InstanceConfigAuditUtil.java
+15
-4
ConfigBaseInfoController.js
...tic/scripts/controller/config/ConfigBaseInfoController.js
+15
-12
namespace-panel-directive.js
...ces/static/scripts/directive/namespace-panel-directive.js
+1
-1
namespace-panel.html
...ain/resources/static/views/component/namespace-panel.html
+12
-8
pom.xml
pom.xml
+1
-1
No files found.
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/InstanceConfigController.java
View file @
c2d82c07
...
@@ -61,14 +61,35 @@ public class InstanceConfigController {
...
@@ -61,14 +61,35 @@ public class InstanceConfigController {
List
<
InstanceDTO
>
instanceDTOs
=
Collections
.
emptyList
();
List
<
InstanceDTO
>
instanceDTOs
=
Collections
.
emptyList
();
if
(
instanceConfigsPage
.
hasContent
())
{
if
(
instanceConfigsPage
.
hasContent
())
{
Set
<
Long
>
instanceIds
=
instanceConfigsPage
.
getContent
().
stream
().
map
Multimap
<
Long
,
InstanceConfig
>
instanceConfigMap
=
HashMultimap
.
create
();
(
InstanceConfig:
:
getInstanceId
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
otherReleaseKeys
=
Sets
.
newHashSet
();
for
(
InstanceConfig
instanceConfig
:
instanceConfigsPage
.
getContent
())
{
instanceConfigMap
.
put
(
instanceConfig
.
getInstanceId
(),
instanceConfig
);
otherReleaseKeys
.
add
(
instanceConfig
.
getReleaseKey
());
}
Set
<
Long
>
instanceIds
=
instanceConfigMap
.
keySet
();
List
<
Instance
>
instances
=
instanceService
.
findInstancesByIds
(
instanceIds
);
List
<
Instance
>
instances
=
instanceService
.
findInstancesByIds
(
instanceIds
);
if
(!
CollectionUtils
.
isEmpty
(
instances
))
{
if
(!
CollectionUtils
.
isEmpty
(
instances
))
{
instanceDTOs
=
BeanUtils
.
batchTransform
(
InstanceDTO
.
class
,
instances
);
instanceDTOs
=
BeanUtils
.
batchTransform
(
InstanceDTO
.
class
,
instances
);
}
}
for
(
InstanceDTO
instanceDTO
:
instanceDTOs
)
{
Collection
<
InstanceConfig
>
configs
=
instanceConfigMap
.
get
(
instanceDTO
.
getId
());
List
<
InstanceConfigDTO
>
configDTOs
=
configs
.
stream
().
map
(
instanceConfig
->
{
InstanceConfigDTO
instanceConfigDTO
=
new
InstanceConfigDTO
();
//to save some space
instanceConfigDTO
.
setRelease
(
null
);
instanceConfigDTO
.
setReleaseDeliveryTime
(
instanceConfig
.
getReleaseDeliveryTime
());
instanceConfigDTO
.
setDataChangeLastModifiedTime
(
instanceConfig
.
getDataChangeLastModifiedTime
());
return
instanceConfigDTO
;
}).
collect
(
Collectors
.
toList
());
instanceDTO
.
setConfigs
(
configDTOs
);
}
}
}
return
new
PageDTO
<>(
instanceDTOs
,
pageable
,
instanceConfigsPage
.
getTotalElements
());
return
new
PageDTO
<>(
instanceDTOs
,
pageable
,
instanceConfigsPage
.
getTotalElements
());
...
@@ -126,6 +147,7 @@ public class InstanceConfigController {
...
@@ -126,6 +147,7 @@ public class InstanceConfigController {
List
<
InstanceConfigDTO
>
configDTOs
=
configs
.
stream
().
map
(
instanceConfig
->
{
List
<
InstanceConfigDTO
>
configDTOs
=
configs
.
stream
().
map
(
instanceConfig
->
{
InstanceConfigDTO
instanceConfigDTO
=
new
InstanceConfigDTO
();
InstanceConfigDTO
instanceConfigDTO
=
new
InstanceConfigDTO
();
instanceConfigDTO
.
setRelease
(
releaseMap
.
get
(
instanceConfig
.
getReleaseKey
()));
instanceConfigDTO
.
setRelease
(
releaseMap
.
get
(
instanceConfig
.
getReleaseKey
()));
instanceConfigDTO
.
setReleaseDeliveryTime
(
instanceConfig
.
getReleaseDeliveryTime
());
instanceConfigDTO
.
setDataChangeLastModifiedTime
(
instanceConfig
instanceConfigDTO
.
setDataChangeLastModifiedTime
(
instanceConfig
.
getDataChangeLastModifiedTime
());
.
getDataChangeLastModifiedTime
());
return
instanceConfigDTO
;
return
instanceConfigDTO
;
...
...
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/InstanceConfigControllerTest.java
View file @
c2d82c07
...
@@ -72,13 +72,15 @@ public class InstanceConfigControllerTest {
...
@@ -72,13 +72,15 @@ public class InstanceConfigControllerTest {
String
someConfigAppId
=
"someConfigAppId"
;
String
someConfigAppId
=
"someConfigAppId"
;
String
someConfigNamespace
=
"someNamespace"
;
String
someConfigNamespace
=
"someNamespace"
;
String
someIp
=
"someIp"
;
String
someIp
=
"someIp"
;
Date
someReleaseDeliveryTime
=
new
Date
();
Date
anotherReleaseDeliveryTime
=
new
Date
();
when
(
releaseService
.
findOne
(
someReleaseId
)).
thenReturn
(
someRelease
);
when
(
releaseService
.
findOne
(
someReleaseId
)).
thenReturn
(
someRelease
);
InstanceConfig
someInstanceConfig
=
assembleInstanceConfig
(
someInstanceId
,
someConfigAppId
,
InstanceConfig
someInstanceConfig
=
assembleInstanceConfig
(
someInstanceId
,
someConfigAppId
,
someConfigNamespace
,
someReleaseKey
);
someConfigNamespace
,
someReleaseKey
,
someReleaseDeliveryTime
);
InstanceConfig
anotherInstanceConfig
=
assembleInstanceConfig
(
anotherInstanceId
,
InstanceConfig
anotherInstanceConfig
=
assembleInstanceConfig
(
anotherInstanceId
,
someConfigAppId
,
someConfigNamespace
,
someReleaseKey
);
someConfigAppId
,
someConfigNamespace
,
someReleaseKey
,
anotherReleaseDeliveryTime
);
List
<
InstanceConfig
>
instanceConfigs
=
Lists
.
newArrayList
(
someInstanceConfig
,
List
<
InstanceConfig
>
instanceConfigs
=
Lists
.
newArrayList
(
someInstanceConfig
,
anotherInstanceConfig
);
anotherInstanceConfig
);
Page
<
InstanceConfig
>
instanceConfigPage
=
new
PageImpl
<>(
instanceConfigs
,
pageable
,
Page
<
InstanceConfig
>
instanceConfigPage
=
new
PageImpl
<>(
instanceConfigs
,
pageable
,
...
@@ -113,6 +115,12 @@ public class InstanceConfigControllerTest {
...
@@ -113,6 +115,12 @@ public class InstanceConfigControllerTest {
verifyInstance
(
someInstance
,
someInstanceDto
);
verifyInstance
(
someInstance
,
someInstanceDto
);
verifyInstance
(
anotherInstance
,
anotherInstanceDto
);
verifyInstance
(
anotherInstance
,
anotherInstanceDto
);
assertEquals
(
1
,
someInstanceDto
.
getConfigs
().
size
());
assertEquals
(
someReleaseDeliveryTime
,
someInstanceDto
.
getConfigs
().
get
(
0
).
getReleaseDeliveryTime
());
assertEquals
(
1
,
anotherInstanceDto
.
getConfigs
().
size
());
assertEquals
(
anotherReleaseDeliveryTime
,
anotherInstanceDto
.
getConfigs
().
get
(
0
).
getReleaseDeliveryTime
());
}
}
@Test
(
expected
=
NotFoundException
.
class
)
@Test
(
expected
=
NotFoundException
.
class
)
...
@@ -133,6 +141,9 @@ public class InstanceConfigControllerTest {
...
@@ -133,6 +141,9 @@ public class InstanceConfigControllerTest {
long
anotherReleaseId
=
2
;
long
anotherReleaseId
=
2
;
String
releaseIds
=
Joiner
.
on
(
","
).
join
(
someReleaseId
,
anotherReleaseId
);
String
releaseIds
=
Joiner
.
on
(
","
).
join
(
someReleaseId
,
anotherReleaseId
);
Date
someReleaseDeliveryTime
=
new
Date
();
Date
anotherReleaseDeliveryTime
=
new
Date
();
Release
someRelease
=
mock
(
Release
.
class
);
Release
someRelease
=
mock
(
Release
.
class
);
Release
anotherRelease
=
mock
(
Release
.
class
);
Release
anotherRelease
=
mock
(
Release
.
class
);
String
someReleaseKey
=
"someReleaseKey"
;
String
someReleaseKey
=
"someReleaseKey"
;
...
@@ -153,6 +164,8 @@ public class InstanceConfigControllerTest {
...
@@ -153,6 +164,8 @@ public class InstanceConfigControllerTest {
when
(
anotherInstanceConfig
.
getInstanceId
()).
thenReturn
(
anotherInstanceId
);
when
(
anotherInstanceConfig
.
getInstanceId
()).
thenReturn
(
anotherInstanceId
);
when
(
someInstanceConfig
.
getReleaseKey
()).
thenReturn
(
someInstanceConfigReleaseKey
);
when
(
someInstanceConfig
.
getReleaseKey
()).
thenReturn
(
someInstanceConfigReleaseKey
);
when
(
anotherInstanceConfig
.
getReleaseKey
()).
thenReturn
(
anotherInstanceConfigReleaseKey
);
when
(
anotherInstanceConfig
.
getReleaseKey
()).
thenReturn
(
anotherInstanceConfigReleaseKey
);
when
(
someInstanceConfig
.
getReleaseDeliveryTime
()).
thenReturn
(
someReleaseDeliveryTime
);
when
(
anotherInstanceConfig
.
getReleaseDeliveryTime
()).
thenReturn
(
anotherReleaseDeliveryTime
);
when
(
instanceService
.
findInstanceConfigsByNamespaceWithReleaseKeysNotIn
(
someConfigAppId
,
when
(
instanceService
.
findInstanceConfigsByNamespaceWithReleaseKeysNotIn
(
someConfigAppId
,
someConfigClusterName
,
someConfigNamespaceName
,
Sets
.
newHashSet
(
someReleaseKey
,
someConfigClusterName
,
someConfigNamespaceName
,
Sets
.
newHashSet
(
someReleaseKey
,
anotherReleaseKey
))).
thenReturn
(
Lists
.
newArrayList
(
someInstanceConfig
,
anotherReleaseKey
))).
thenReturn
(
Lists
.
newArrayList
(
someInstanceConfig
,
...
@@ -203,6 +216,10 @@ public class InstanceConfigControllerTest {
...
@@ -203,6 +216,10 @@ public class InstanceConfigControllerTest {
assertEquals
(
anotherInstanceConfigReleaseKey
,
anotherInstanceDto
.
getConfigs
().
get
(
0
)
assertEquals
(
anotherInstanceConfigReleaseKey
,
anotherInstanceDto
.
getConfigs
().
get
(
0
)
.
getRelease
()
.
getRelease
()
.
getReleaseKey
());
.
getReleaseKey
());
assertEquals
(
someReleaseDeliveryTime
,
someInstanceDto
.
getConfigs
().
get
(
0
).
getReleaseDeliveryTime
());
assertEquals
(
anotherReleaseDeliveryTime
,
anotherInstanceDto
.
getConfigs
().
get
(
0
)
.
getReleaseDeliveryTime
());
}
}
@Test
@Test
...
@@ -284,13 +301,14 @@ public class InstanceConfigControllerTest {
...
@@ -284,13 +301,14 @@ public class InstanceConfigControllerTest {
}
}
private
InstanceConfig
assembleInstanceConfig
(
long
instanceId
,
String
configAppId
,
String
private
InstanceConfig
assembleInstanceConfig
(
long
instanceId
,
String
configAppId
,
String
configNamespaceName
,
String
releaseKey
)
{
configNamespaceName
,
String
releaseKey
,
Date
releaseDeliveryTime
)
{
InstanceConfig
instanceConfig
=
new
InstanceConfig
();
InstanceConfig
instanceConfig
=
new
InstanceConfig
();
instanceConfig
.
setInstanceId
(
instanceId
);
instanceConfig
.
setInstanceId
(
instanceId
);
instanceConfig
.
setConfigAppId
(
configAppId
);
instanceConfig
.
setConfigAppId
(
configAppId
);
instanceConfig
.
setConfigNamespaceName
(
configNamespaceName
);
instanceConfig
.
setConfigNamespaceName
(
configNamespaceName
);
instanceConfig
.
setReleaseKey
(
releaseKey
);
instanceConfig
.
setReleaseKey
(
releaseKey
);
instanceConfig
.
setDataChangeLastModifiedTime
(
new
Date
());
instanceConfig
.
setDataChangeLastModifiedTime
(
new
Date
());
instanceConfig
.
setReleaseDeliveryTime
(
releaseDeliveryTime
);
return
instanceConfig
;
return
instanceConfig
;
}
}
}
}
\ No newline at end of file
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/InstanceConfig.java
View file @
c2d82c07
...
@@ -38,6 +38,9 @@ public class InstanceConfig {
...
@@ -38,6 +38,9 @@ public class InstanceConfig {
@Column
(
name
=
"ReleaseKey"
,
nullable
=
false
)
@Column
(
name
=
"ReleaseKey"
,
nullable
=
false
)
private
String
releaseKey
;
private
String
releaseKey
;
@Column
(
name
=
"ReleaseDeliveryTime"
,
nullable
=
false
)
private
Date
releaseDeliveryTime
;
@Column
(
name
=
"DataChange_CreatedTime"
,
nullable
=
false
)
@Column
(
name
=
"DataChange_CreatedTime"
,
nullable
=
false
)
private
Date
dataChangeCreatedTime
;
private
Date
dataChangeCreatedTime
;
...
@@ -123,6 +126,14 @@ public class InstanceConfig {
...
@@ -123,6 +126,14 @@ public class InstanceConfig {
this
.
configClusterName
=
configClusterName
;
this
.
configClusterName
=
configClusterName
;
}
}
public
Date
getReleaseDeliveryTime
()
{
return
releaseDeliveryTime
;
}
public
void
setReleaseDeliveryTime
(
Date
releaseDeliveryTime
)
{
this
.
releaseDeliveryTime
=
releaseDeliveryTime
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
MoreObjects
.
toStringHelper
(
this
)
return
MoreObjects
.
toStringHelper
(
this
)
...
...
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/InstanceService.java
View file @
c2d82c07
...
@@ -127,6 +127,7 @@ public class InstanceService {
...
@@ -127,6 +127,7 @@ public class InstanceService {
"Instance config %d doesn't exist"
,
instanceConfig
.
getId
()));
"Instance config %d doesn't exist"
,
instanceConfig
.
getId
()));
existedInstanceConfig
.
setReleaseKey
(
instanceConfig
.
getReleaseKey
());
existedInstanceConfig
.
setReleaseKey
(
instanceConfig
.
getReleaseKey
());
existedInstanceConfig
.
setReleaseDeliveryTime
(
instanceConfig
.
getReleaseDeliveryTime
());
existedInstanceConfig
.
setDataChangeLastModifiedTime
(
instanceConfig
existedInstanceConfig
.
setDataChangeLastModifiedTime
(
instanceConfig
.
getDataChangeLastModifiedTime
());
.
getDataChangeLastModifiedTime
());
...
...
apollo-common/src/main/java/com/ctrip/framework/apollo/common/dto/InstanceConfigDTO.java
View file @
c2d82c07
...
@@ -7,6 +7,7 @@ import java.util.Date;
...
@@ -7,6 +7,7 @@ import java.util.Date;
*/
*/
public
class
InstanceConfigDTO
{
public
class
InstanceConfigDTO
{
private
ReleaseDTO
release
;
private
ReleaseDTO
release
;
private
Date
releaseDeliveryTime
;
private
Date
dataChangeLastModifiedTime
;
private
Date
dataChangeLastModifiedTime
;
public
ReleaseDTO
getRelease
()
{
public
ReleaseDTO
getRelease
()
{
...
@@ -24,4 +25,12 @@ public class InstanceConfigDTO {
...
@@ -24,4 +25,12 @@ public class InstanceConfigDTO {
public
void
setDataChangeLastModifiedTime
(
Date
dataChangeLastModifiedTime
)
{
public
void
setDataChangeLastModifiedTime
(
Date
dataChangeLastModifiedTime
)
{
this
.
dataChangeLastModifiedTime
=
dataChangeLastModifiedTime
;
this
.
dataChangeLastModifiedTime
=
dataChangeLastModifiedTime
;
}
}
public
Date
getReleaseDeliveryTime
()
{
return
releaseDeliveryTime
;
}
public
void
setReleaseDeliveryTime
(
Date
releaseDeliveryTime
)
{
this
.
releaseDeliveryTime
=
releaseDeliveryTime
;
}
}
}
apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/util/InstanceConfigAuditUtil.java
View file @
c2d82c07
...
@@ -88,11 +88,14 @@ public class InstanceConfigAuditUtil implements InitializingBean {
...
@@ -88,11 +88,14 @@ public class InstanceConfigAuditUtil implements InitializingBean {
InstanceConfig
instanceConfig
=
instanceService
.
findInstanceConfig
(
instanceId
,
auditModel
InstanceConfig
instanceConfig
=
instanceService
.
findInstanceConfig
(
instanceId
,
auditModel
.
getConfigAppId
(),
auditModel
.
getConfigClusterName
(),
auditModel
.
getConfigNamespace
());
.
getConfigAppId
(),
auditModel
.
getConfigClusterName
(),
auditModel
.
getConfigNamespace
());
//we need to update no matter the release key is the same or not, to ensure the
//last modified time is updated each day
if
(
instanceConfig
!=
null
)
{
if
(
instanceConfig
!=
null
)
{
instanceConfig
.
setReleaseKey
(
auditModel
.
getReleaseKey
());
if
(!
Objects
.
equals
(
instanceConfig
.
getReleaseKey
(),
auditModel
.
getReleaseKey
()))
{
instanceConfig
.
setDataChangeLastModifiedTime
(
new
Date
());
instanceConfig
.
setReleaseKey
(
auditModel
.
getReleaseKey
());
instanceConfig
.
setReleaseDeliveryTime
(
auditModel
.
getOfferTime
());
}
//we need to update no matter the release key is the same or not, to ensure the
//last modified time is updated each day
instanceConfig
.
setDataChangeLastModifiedTime
(
auditModel
.
getOfferTime
());
instanceService
.
updateInstanceConfig
(
instanceConfig
);
instanceService
.
updateInstanceConfig
(
instanceConfig
);
return
;
return
;
}
}
...
@@ -103,6 +106,8 @@ public class InstanceConfigAuditUtil implements InitializingBean {
...
@@ -103,6 +106,8 @@ public class InstanceConfigAuditUtil implements InitializingBean {
instanceConfig
.
setConfigClusterName
(
auditModel
.
getConfigClusterName
());
instanceConfig
.
setConfigClusterName
(
auditModel
.
getConfigClusterName
());
instanceConfig
.
setConfigNamespaceName
(
auditModel
.
getConfigNamespace
());
instanceConfig
.
setConfigNamespaceName
(
auditModel
.
getConfigNamespace
());
instanceConfig
.
setReleaseKey
(
auditModel
.
getReleaseKey
());
instanceConfig
.
setReleaseKey
(
auditModel
.
getReleaseKey
());
instanceConfig
.
setReleaseDeliveryTime
(
auditModel
.
getOfferTime
());
instanceConfig
.
setDataChangeCreatedTime
(
auditModel
.
getOfferTime
());
try
{
try
{
instanceService
.
createInstanceConfig
(
instanceConfig
);
instanceService
.
createInstanceConfig
(
instanceConfig
);
...
@@ -174,10 +179,12 @@ public class InstanceConfigAuditUtil implements InitializingBean {
...
@@ -174,10 +179,12 @@ public class InstanceConfigAuditUtil implements InitializingBean {
private
String
configClusterName
;
private
String
configClusterName
;
private
String
configNamespace
;
private
String
configNamespace
;
private
String
releaseKey
;
private
String
releaseKey
;
private
Date
offerTime
;
public
InstanceConfigAuditModel
(
String
appId
,
String
clusterName
,
String
dataCenter
,
String
public
InstanceConfigAuditModel
(
String
appId
,
String
clusterName
,
String
dataCenter
,
String
clientIp
,
String
configAppId
,
String
configClusterName
,
String
configNamespace
,
String
clientIp
,
String
configAppId
,
String
configClusterName
,
String
configNamespace
,
String
releaseKey
)
{
releaseKey
)
{
this
.
offerTime
=
new
Date
();
this
.
appId
=
appId
;
this
.
appId
=
appId
;
this
.
clusterName
=
clusterName
;
this
.
clusterName
=
clusterName
;
this
.
dataCenter
=
Strings
.
isNullOrEmpty
(
dataCenter
)
?
""
:
dataCenter
;
this
.
dataCenter
=
Strings
.
isNullOrEmpty
(
dataCenter
)
?
""
:
dataCenter
;
...
@@ -220,6 +227,10 @@ public class InstanceConfigAuditUtil implements InitializingBean {
...
@@ -220,6 +227,10 @@ public class InstanceConfigAuditUtil implements InitializingBean {
return
configClusterName
;
return
configClusterName
;
}
}
public
Date
getOfferTime
()
{
return
offerTime
;
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
this
==
o
)
return
true
;
...
...
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigBaseInfoController.js
View file @
c2d82c07
...
@@ -83,20 +83,23 @@ function ConfigBaseInfoController($rootScope, $scope, $location, toastr, UserSer
...
@@ -83,20 +83,23 @@ function ConfigBaseInfoController($rootScope, $scope, $location, toastr, UserSer
var
VISITED_APPS_STORAGE_KEY
=
"VisitedAppsV2"
;
var
VISITED_APPS_STORAGE_KEY
=
"VisitedAppsV2"
;
var
visitedAppsObject
=
JSON
.
parse
(
localStorage
.
getItem
(
VISITED_APPS_STORAGE_KEY
));
var
visitedAppsObject
=
JSON
.
parse
(
localStorage
.
getItem
(
VISITED_APPS_STORAGE_KEY
));
var
hasSaved
=
false
;
var
hasSaved
=
false
;
if
(
visitedAppsObject
)
{
var
visitedApps
=
visitedAppsObject
[
$rootScope
.
pageContext
.
userId
];
if
(
visitedApps
&&
visitedApps
.
length
>
0
)
{
visitedApps
.
forEach
(
function
(
app
)
{
if
(
app
==
appId
)
{
hasSaved
=
true
;
return
;
}
});
}
}
else
{
if
(
!
visitedAppsObject
)
{
visitedAppsObject
=
{};
visitedAppsObject
=
{};
visitedAppsObject
[
$rootScope
.
pageContext
.
userId
]
=
[];
}
if
(
!
visitedAppsObject
[
$rootScope
.
pageContext
.
userId
])
{
visitedAppsObject
[
$rootScope
.
pageContext
.
userId
]
=
[];
}
var
visitedApps
=
visitedAppsObject
[
$rootScope
.
pageContext
.
userId
];
if
(
visitedApps
&&
visitedApps
.
length
>
0
)
{
visitedApps
.
forEach
(
function
(
app
)
{
if
(
app
==
appId
)
{
hasSaved
=
true
;
return
;
}
});
}
}
var
currentUserVisitedApps
=
visitedAppsObject
[
$rootScope
.
pageContext
.
userId
];
var
currentUserVisitedApps
=
visitedAppsObject
[
$rootScope
.
pageContext
.
userId
];
...
...
apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js
View file @
c2d82c07
...
@@ -257,7 +257,7 @@ directive_module.directive('apollonspanel',
...
@@ -257,7 +257,7 @@ directive_module.directive('apollonspanel',
result
.
forEach
(
function
(
instance
)
{
result
.
forEach
(
function
(
instance
)
{
var
configs
=
instance
.
configs
;
var
configs
=
instance
.
configs
;
if
(
configs
.
length
>
0
)
{
if
(
configs
&&
configs
.
length
>
0
)
{
configs
.
forEach
(
function
(
instanceConfig
)
{
configs
.
forEach
(
function
(
instanceConfig
)
{
var
release
=
instanceConfig
.
release
;
var
release
=
instanceConfig
.
release
;
if
(
!
groupedInstances
[
release
.
id
])
{
if
(
!
groupedInstances
[
release
.
id
])
{
...
...
apollo-portal/src/main/resources/static/views/component/namespace-panel.html
View file @
c2d82c07
...
@@ -409,14 +409,16 @@
...
@@ -409,14 +409,16 @@
<td>
Cluster Name
</td>
<td>
Cluster Name
</td>
<td>
Data Center
</td>
<td>
Data Center
</td>
<td>
IP
</td>
<td>
IP
</td>
<td>
配置获取时间
</td>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
ng-repeat=
"instance in namespace.latestReleaseInstances.content"
>
<tr
ng-repeat=
"instance in namespace.latestReleaseInstances.content"
>
<td
width=
"25%"
ng-bind=
"instance.appId"
></td>
<td
width=
"20%"
ng-bind=
"instance.appId"
></td>
<td
width=
"25%"
ng-bind=
"instance.clusterName"
></td>
<td
width=
"20%"
ng-bind=
"instance.clusterName"
></td>
<td
width=
"25%"
ng-bind=
"instance.dataCenter"
></td>
<td
width=
"20%"
ng-bind=
"instance.dataCenter"
></td>
<td
width=
"25%"
ng-bind=
"instance.ip"
></td>
<td
width=
"20%"
ng-bind=
"instance.ip"
></td>
<td
width=
"20%"
>
{{instance.configs
&&
instance.configs.length ? (instance.configs[0].releaseDeliveryTime | date: 'yyyy-MM-dd HH:mm:ss') : ''}}
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
@@ -450,14 +452,16 @@
...
@@ -450,14 +452,16 @@
<td>
Cluster Name
</td>
<td>
Cluster Name
</td>
<td>
Data Center
</td>
<td>
Data Center
</td>
<td>
IP
</td>
<td>
IP
</td>
<td>
配置获取时间
</td>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
ng-repeat=
"instance in namespace.notLatestReleaseInstances[release.id]"
>
<tr
ng-repeat=
"instance in namespace.notLatestReleaseInstances[release.id]"
>
<td
width=
"25%"
ng-bind=
"instance.appId"
></td>
<td
width=
"20%"
ng-bind=
"instance.appId"
></td>
<td
width=
"25%"
ng-bind=
"instance.clusterName"
></td>
<td
width=
"20%"
ng-bind=
"instance.clusterName"
></td>
<td
width=
"25%"
ng-bind=
"instance.dataCenter"
></td>
<td
width=
"20%"
ng-bind=
"instance.dataCenter"
></td>
<td
width=
"25%"
ng-bind=
"instance.ip"
></td>
<td
width=
"20%"
ng-bind=
"instance.ip"
></td>
<td
width=
"20%"
>
{{instance.configs
&&
instance.configs.length ? (instance.configs[0].releaseDeliveryTime | date: 'yyyy-MM-dd HH:mm:ss') : ''}}
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
...
pom.xml
View file @
c2d82c07
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
<dependency>
<dependency>
<groupId>
com.ctrip.framework
</groupId>
<groupId>
com.ctrip.framework
</groupId>
<artifactId>
framework-foundation
</artifactId>
<artifactId>
framework-foundation
</artifactId>
<version>
1.2.
0
</version>
<version>
1.2.
1
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.dianping.cat
</groupId>
<groupId>
com.dianping.cat
</groupId>
...
...
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