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
ff0364c1
Commit
ff0364c1
authored
Mar 28, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构portal api
parent
babb3c6a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
191 additions
and
86 deletions
+191
-86
AdminConfigServiceImpl.java
...ctrip/apollo/biz/service/impl/AdminConfigServiceImpl.java
+3
-0
import.sql
apollo-biz/src/main/resources/import.sql
+5
-5
RestUtils.java
...rtal/src/main/java/com/ctrip/apollo/portal/RestUtils.java
+0
-17
API.java
...portal/src/main/java/com/ctrip/apollo/portal/api/API.java
+21
-0
AdminServiceAPI.java
...ain/java/com/ctrip/apollo/portal/api/AdminServiceAPI.java
+80
-0
ConfigService.java
...n/java/com/ctrip/apollo/portal/service/ConfigService.java
+28
-26
ServiceLocator.java
.../java/com/ctrip/apollo/portal/service/ServiceLocator.java
+0
-2
VersionService.java
.../java/com/ctrip/apollo/portal/service/VersionService.java
+11
-5
application.yml
apollo-portal/src/main/resources/application.yml
+1
-1
common-style.css
...-portal/src/main/resources/static/styles/common-style.css
+4
-0
config.html
...lo-portal/src/main/resources/static/views/app/config.html
+23
-23
ConfigServiceTest.java
...va/com/ctrip/apollo/portal/service/ConfigServiceTest.java
+0
-0
application.yml
apollo-portal/src/test/resources/application.yml
+15
-7
No files found.
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/impl/AdminConfigServiceImpl.java
View file @
ff0364c1
...
...
@@ -77,6 +77,9 @@ public class AdminConfigServiceImpl implements AdminConfigService {
return
null
;
}
Version
version
=
versionRepository
.
findById
(
versionId
);
if
(
version
==
null
){
return
null
;
}
return
version
.
toDTO
();
}
...
...
apollo-biz/src/main/resources/import.sql
View file @
ff0364c1
...
...
@@ -15,12 +15,12 @@ INSERT INTO RELEASESNAPSHOT (ClusterName, IsDeleted, ReleaseId, Configurations)
INSERT
INTO
RELEASESNAPSHOT
(
ClusterName
,
IsDeleted
,
ReleaseId
,
Configurations
)
VALUES
(
'cluster2'
,
0
,
11111
,
'{"6666.bar":"bar2222"}'
);
INSERT
INTO
RELEASESNAPSHOT
(
ClusterName
,
IsDeleted
,
ReleaseId
,
Configurations
)
VALUES
(
'default'
,
0
,
11112
,
'{"6666.foo":"verson2.0", "6666.bar":"verson2.0","3333.foo":"1008","4444.bar":"99901"}'
);
INSERT
INTO
ConfigItem
(
ClusterId
,
ClusterName
,
AppId
,
Key
,
Value
,
comment
,
DataChange_CreatedBy
,
DataChange_CreatedTime
,
DataChange_LastModifiedBy
,
DataChange_Last
Modified
Time
,
IsDeleted
)
VALUES
(
100
,
'default'
,
6666
,
'6666.k1'
,
'6666.v1'
,
'comment1'
,
'lepdou'
,
'2016-03-23 12:00:00'
,
'王五'
,
NOW
(),
0
);
INSERT
INTO
ConfigItem
(
ClusterId
,
ClusterName
,
AppId
,
Key
,
Value
,
comment
,
DataChange_CreatedBy
,
DataChange_CreatedTime
,
DataChange_LastModifiedBy
,
DataChange_LastTime
,
IsDeleted
)
VALUES
(
100
,
'default'
,
6666
,
'6666.k1'
,
'6666.v1'
,
'comment1'
,
'lepdou'
,
'2016-03-23 12:00:00'
,
'王五'
,
NOW
(),
0
);
INSERT
INTO
ConfigItem
(
ClusterId
,
ClusterName
,
AppId
,
Key
,
Value
,
comment
,
DataChange_CreatedBy
,
DataChange_CreatedTime
,
DataChange_LastModifiedBy
,
DataChange_Last
Modified
Time
,
IsDeleted
)
VALUES
(
100
,
'default'
,
6666
,
'6666.k2'
,
'6666.v2'
,
'xxxx'
,
'lepdou'
,
'2016-03-23 12:00:00'
,
'王五1'
,
NOW
(),
0
);
INSERT
INTO
ConfigItem
(
ClusterId
,
ClusterName
,
AppId
,
Key
,
Value
,
comment
,
DataChange_CreatedBy
,
DataChange_CreatedTime
,
DataChange_LastModifiedBy
,
DataChange_LastTime
,
IsDeleted
)
VALUES
(
100
,
'default'
,
6666
,
'6666.k2'
,
'6666.v2'
,
'xxxx'
,
'lepdou'
,
'2016-03-23 12:00:00'
,
'王五1'
,
NOW
(),
0
);
INSERT
INTO
ConfigItem
(
ClusterId
,
ClusterName
,
AppId
,
Key
,
Value
,
comment
,
DataChange_CreatedBy
,
DataChange_CreatedTime
,
DataChange_LastModifiedBy
,
DataChange_Last
Modified
Time
,
IsDeleted
)
VALUES
(
100
,
'default'
,
6666
,
'6666.k3'
,
'6666.v3'
,
'yyyy'
,
'lepdou'
,
'2016-03-23 12:00:00'
,
'王五2'
,
NOW
(),
0
);
INSERT
INTO
ConfigItem
(
ClusterId
,
ClusterName
,
AppId
,
Key
,
Value
,
comment
,
DataChange_CreatedBy
,
DataChange_CreatedTime
,
DataChange_LastModifiedBy
,
DataChange_LastTime
,
IsDeleted
)
VALUES
(
100
,
'default'
,
6666
,
'6666.k3'
,
'6666.v3'
,
'yyyy'
,
'lepdou'
,
'2016-03-23 12:00:00'
,
'王五2'
,
NOW
(),
0
);
INSERT
INTO
ConfigItem
(
ClusterId
,
ClusterName
,
AppId
,
Key
,
Value
,
comment
,
DataChange_CreatedBy
,
DataChange_CreatedTime
,
DataChange_LastModifiedBy
,
DataChange_Last
Modified
Time
,
IsDeleted
)
VALUES
(
100
,
'default'
,
5555
,
'5555.k1'
,
'5555.v11'
,
'zzzz'
,
'lepdou'
,
'2016-03-23 12:00:00'
,
'王五3'
,
NOW
(),
0
);
INSERT
INTO
ConfigItem
(
ClusterId
,
ClusterName
,
AppId
,
Key
,
Value
,
comment
,
DataChange_CreatedBy
,
DataChange_CreatedTime
,
DataChange_LastModifiedBy
,
DataChange_LastTime
,
IsDeleted
)
VALUES
(
100
,
'default'
,
5555
,
'5555.k1'
,
'5555.v11'
,
'zzzz'
,
'lepdou'
,
'2016-03-23 12:00:00'
,
'王五3'
,
NOW
(),
0
);
INSERT
INTO
ConfigItem
(
ClusterId
,
ClusterName
,
AppId
,
Key
,
Value
,
comment
,
DataChange_CreatedBy
,
DataChange_CreatedTime
,
DataChange_LastModifiedBy
,
DataChange_Last
Modified
Time
,
IsDeleted
)
VALUES
(
101
,
'cluster1'
,
6666
,
'6666.k1'
,
'6666.v122'
,
'qqqqq'
,
'lepdou'
,
'2016-03-23 12:00:00'
,
'王五4'
,
NOW
(),
0
);
INSERT
INTO
ConfigItem
(
ClusterId
,
ClusterName
,
AppId
,
Key
,
Value
,
comment
,
DataChange_CreatedBy
,
DataChange_CreatedTime
,
DataChange_LastModifiedBy
,
DataChange_LastTime
,
IsDeleted
)
VALUES
(
101
,
'cluster1'
,
6666
,
'6666.k1'
,
'6666.v122'
,
'qqqqq'
,
'lepdou'
,
'2016-03-23 12:00:00'
,
'王五4'
,
NOW
(),
0
);
apollo-portal/src/main/java/com/ctrip/apollo/portal/RestUtils.java
deleted
100644 → 0
View file @
babb3c6a
package
com
.
ctrip
.
apollo
.
portal
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.client.RestTemplate
;
public
class
RestUtils
{
private
static
RestTemplate
restTemplate
=
new
RestTemplate
();
public
static
<
T
>
T
exchangeInGET
(
String
url
,
Class
<
T
>
responseType
)
{
ResponseEntity
<
T
>
response
=
restTemplate
.
exchange
(
url
,
HttpMethod
.
GET
,
new
HttpEntity
<
Void
>((
Void
)
null
),
responseType
);
return
response
.
getBody
();
}
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/api/API.java
0 → 100644
View file @
ff0364c1
package
com
.
ctrip
.
apollo
.
portal
.
api
;
import
com.ctrip.apollo.Apollo
;
import
com.ctrip.apollo.portal.service.ServiceLocator
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.client.RestTemplate
;
public
class
API
{
@Autowired
protected
ServiceLocator
serviceLocator
;
protected
RestTemplate
restTemplate
=
new
RestTemplate
();
public
String
getAdminServiceHost
(
Apollo
.
Env
env
){
//本地测试用
// return "http://localhost:8090";
return
serviceLocator
.
getAdminService
(
env
);
}
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/api/AdminServiceAPI.java
0 → 100644
View file @
ff0364c1
package
com
.
ctrip
.
apollo
.
portal
.
api
;
import
com.ctrip.apollo.Apollo
;
import
com.ctrip.apollo.core.dto.ClusterDTO
;
import
com.ctrip.apollo.core.dto.ConfigItemDTO
;
import
com.ctrip.apollo.core.dto.ReleaseSnapshotDTO
;
import
com.ctrip.apollo.core.dto.VersionDTO
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
AdminServiceAPI
{
@Service
public
static
class
ConfigAPI
extends
API
{
public
static
String
CONFIG_RELEASE_API
=
"/configs/release/"
;
public
ReleaseSnapshotDTO
[]
getConfigByReleaseId
(
Apollo
.
Env
env
,
long
releaseId
)
{
if
(
releaseId
<=
0
)
{
return
null
;
}
return
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
CONFIG_RELEASE_API
+
releaseId
,
ReleaseSnapshotDTO
[].
class
);
}
public
ConfigItemDTO
[]
getLatestConfigItemsByClusters
(
Apollo
.
Env
env
,
List
<
Long
>
clusterIds
)
{
if
(
clusterIds
==
null
||
clusterIds
.
size
()
==
0
)
{
return
null
;
}
StringBuilder
sb
=
new
StringBuilder
();
for
(
long
clusterId
:
clusterIds
)
{
sb
.
append
(
clusterId
).
append
(
","
);
}
return
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
"/configs/latest?clusterIds="
+
sb
.
substring
(
0
,
sb
.
length
()
-
1
),
ConfigItemDTO
[].
class
);
}
}
@Service
public
static
class
ClusterAPI
extends
API
{
public
static
String
CLUSTER_APP_API
=
"/cluster/app/"
;
public
ClusterDTO
[]
getClustersByApp
(
Apollo
.
Env
env
,
long
appId
)
{
if
(
appId
<=
0
)
{
return
null
;
}
return
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
CLUSTER_APP_API
+
appId
,
ClusterDTO
[].
class
);
}
}
@Service
public
static
class
VersionAPI
extends
API
{
public
static
String
VERSION_API
=
"/version/"
;
public
static
String
VERSION_APP_API
=
"/version/app/"
;
public
VersionDTO
getVersionById
(
Apollo
.
Env
env
,
long
versionId
){
if
(
versionId
<=
0
){
return
null
;
}
return
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
VERSION_API
+
versionId
,
VersionDTO
.
class
);
}
public
VersionDTO
[]
getVersionsByApp
(
Apollo
.
Env
env
,
long
appId
){
if
(
appId
<=
0
){
return
null
;
}
return
restTemplate
.
getForObject
(
getAdminServiceHost
(
env
)
+
VERSION_APP_API
+
appId
,
VersionDTO
[].
class
);
}
}
}
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/ConfigService.java
View file @
ff0364c1
package
com
.
ctrip
.
apollo
.
portal
.
service
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -16,33 +19,38 @@ import com.ctrip.apollo.core.dto.ClusterDTO;
import
com.ctrip.apollo.core.dto.ConfigItemDTO
;
import
com.ctrip.apollo.core.dto.ReleaseSnapshotDTO
;
import
com.ctrip.apollo.core.dto.VersionDTO
;
import
com.ctrip.apollo.core.serivce.ApolloService
;
import
com.ctrip.apollo.portal.RestUtils
;
import
com.ctrip.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.apollo.portal.constants.PortalConstants
;
import
com.ctrip.apollo.portal.entity.AppConfigVO
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.collect.Maps
;
@Service
public
class
ConfigService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ConfigService
.
class
);
@Autowired
private
AdminServiceAPI
.
ConfigAPI
configAPI
;
@Autowired
private
AdminServiceAPI
.
ClusterAPI
clusterAPI
;
@Autowired
private
ServiceLocator
serviceLocator
;
private
AdminServiceAPI
.
VersionAPI
versionAPI
;
private
ObjectMapper
objectMapper
=
new
ObjectMapper
();
public
AppConfigVO
loadReleaseConfig
(
Env
env
,
long
appId
,
long
versionId
)
{
if
(
appId
<=
0
||
versionId
<=
0
)
{
return
null
;
}
long
releaseId
=
getReleaseIdFromVersionId
(
env
,
versionId
);
if
(
releaseId
==
-
1
)
{
return
null
;
}
String
serviceHost
=
serviceLocator
.
getAdminService
(
env
);
ReleaseSnapshotDTO
[]
releaseSnapShots
=
RestUtils
.
exchangeInGET
(
serviceHost
+
"/configs/release/"
+
releaseId
,
ReleaseSnapshotDTO
[].
class
);
ReleaseSnapshotDTO
[]
releaseSnapShots
=
configAPI
.
getConfigByReleaseId
(
Env
.
DEV
,
releaseId
);
if
(
releaseSnapShots
==
null
||
releaseSnapShots
.
length
==
0
)
{
return
null
;
}
...
...
@@ -63,9 +71,7 @@ public class ConfigService {
}
private
long
getReleaseIdFromVersionId
(
Env
env
,
long
versionId
)
{
String
serviceHost
=
serviceLocator
.
getAdminService
(
env
);
VersionDTO
version
=
RestUtils
.
exchangeInGET
(
serviceHost
+
"/version/"
+
versionId
,
VersionDTO
.
class
);
VersionDTO
version
=
versionAPI
.
getVersionById
(
env
,
versionId
);
if
(
version
==
null
)
{
return
-
1
;
}
...
...
@@ -73,7 +79,7 @@ public class ConfigService {
}
private
void
collectDefaultClusterConfigs
(
long
appId
,
ReleaseSnapshotDTO
snapShot
,
AppConfigVO
appConfigVO
)
{
AppConfigVO
appConfigVO
)
{
Map
<
Long
,
List
<
ConfigItemDTO
>>
groupedConfigs
=
groupConfigsByApp
(
snapShot
.
getConfigurations
());
...
...
@@ -136,7 +142,7 @@ public class ConfigService {
}
private
void
collectSpecialClusterConfigs
(
long
appId
,
ReleaseSnapshotDTO
snapShot
,
AppConfigVO
appConfigVO
)
{
AppConfigVO
appConfigVO
)
{
List
<
AppConfigVO
.
OverrideClusterConfig
>
overrideClusterConfigs
=
appConfigVO
.
getOverrideClusterConfigs
();
AppConfigVO
.
OverrideClusterConfig
overrideClusterConfig
=
...
...
@@ -152,21 +158,17 @@ public class ConfigService {
return
null
;
}
String
serviceHost
=
serviceLocator
.
getAdminService
(
env
);
ClusterDTO
[]
clusters
=
RestUtils
.
exchangeInGET
(
serviceHost
+
"/cluster/app/"
+
appId
,
ClusterDTO
[].
class
);
ClusterDTO
[]
clusters
=
clusterAPI
.
getClustersByApp
(
env
,
appId
);
if
(
clusters
==
null
||
clusters
.
length
==
0
)
{
return
null
;
}
StringBuilder
sb
=
new
StringBuilder
(
);
List
<
Long
>
clusterIds
=
new
ArrayList
<>(
clusters
.
length
);
for
(
ClusterDTO
cluster
:
clusters
)
{
sb
.
append
(
cluster
.
getId
()).
append
(
","
);
clusterIds
.
add
(
cluster
.
getId
()
);
}
ConfigItemDTO
[]
configItems
=
RestUtils
.
exchangeInGET
(
serviceHost
+
"/configs/latest?clusterIds="
+
sb
.
substring
(
0
,
sb
.
length
()
-
1
),
ConfigItemDTO
[].
class
);
ConfigItemDTO
[]
configItems
=
configAPI
.
getLatestConfigItemsByClusters
(
env
,
clusterIds
);
return
buildAPPConfigVO
(
appId
,
Arrays
.
asList
(
configItems
));
}
...
...
@@ -203,7 +205,7 @@ public class ConfigService {
}
private
void
groupConfigByAppAndEnrichDTO
(
Map
<
String
,
List
<
ConfigItemDTO
>>
groupedClusterConfigs
,
AppConfigVO
appConfigVO
)
{
AppConfigVO
appConfigVO
)
{
long
appId
=
appConfigVO
.
getAppId
();
List
<
ConfigItemDTO
>
defaultClusterConfigs
=
appConfigVO
.
getDefaultClusterConfigs
();
...
...
@@ -222,7 +224,7 @@ public class ConfigService {
if
(
Constants
.
DEFAULT_CLUSTER_NAME
.
equals
(
clusterName
))
{
// default cluster configs
collectDefaultClusterConfigs
(
appId
,
clusterConfigs
,
defaultClusterConfigs
,
overrideAppConfigs
);
overrideAppConfigs
);
}
else
{
// override cluster configs
collectSpecialClusterConfigs
(
clusterName
,
clusterConfigs
,
overrideClusterConfigs
);
...
...
@@ -231,8 +233,8 @@ public class ConfigService {
}
private
void
collectDefaultClusterConfigs
(
long
appId
,
List
<
ConfigItemDTO
>
clusterConfigs
,
List
<
ConfigItemDTO
>
defaultClusterConfigs
,
List
<
AppConfigVO
.
OverrideAppConfig
>
overrideAppConfigs
)
{
List
<
ConfigItemDTO
>
defaultClusterConfigs
,
List
<
AppConfigVO
.
OverrideAppConfig
>
overrideAppConfigs
)
{
Map
<
Long
,
AppConfigVO
.
OverrideAppConfig
>
appIdMapOverrideAppConfig
=
null
;
...
...
@@ -261,7 +263,7 @@ public class ConfigService {
}
private
void
collectSpecialClusterConfigs
(
String
clusterName
,
List
<
ConfigItemDTO
>
clusterConfigs
,
List
<
AppConfigVO
.
OverrideClusterConfig
>
overrideClusterConfigs
)
{
List
<
AppConfigVO
.
OverrideClusterConfig
>
overrideClusterConfigs
)
{
AppConfigVO
.
OverrideClusterConfig
overrideClusterConfig
=
new
AppConfigVO
.
OverrideClusterConfig
();
overrideClusterConfig
.
setClusterName
(
clusterName
);
...
...
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/ServiceLocator.java
View file @
ff0364c1
...
...
@@ -30,8 +30,6 @@ public class ServiceLocator {
}
public
String
getAdminService
(
Env
env
)
{
//本地测试用
// return "http://localhost:8090";
List
<
ApolloService
>
services
=
getAdminServices
(
env
);
if
(
services
.
size
()
==
0
)
{
throw
new
RuntimeException
(
"No available admin service"
);
...
...
apollo-portal/src/main/java/com/ctrip/apollo/portal/service/VersionService.java
View file @
ff0364c1
...
...
@@ -2,22 +2,28 @@ package com.ctrip.apollo.portal.service;
import
com.ctrip.apollo.Apollo
;
import
com.ctrip.apollo.core.dto.VersionDTO
;
import
com.ctrip.apollo.portal.
RestUtils
;
import
com.ctrip.apollo.portal.
api.AdminServiceAPI
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
@Service
public
class
VersionService
{
@Autowired
private
ServiceLocator
serviceLocator
;
private
AdminServiceAPI
.
VersionAPI
versionAPI
;
public
List
<
VersionDTO
>
findVersionsByApp
(
Apollo
.
Env
env
,
long
appId
)
{
return
RestUtils
.
exchangeInGET
(
serviceLocator
.
getAdminService
(
env
)
+
"/version/app/"
+
appId
,
List
.
class
);
VersionDTO
[]
versions
=
versionAPI
.
getVersionsByApp
(
env
,
appId
);
if
(
versions
==
null
||
versions
.
length
==
0
){
return
Collections
.
EMPTY_LIST
;
}
return
Arrays
.
asList
(
versions
);
}
}
apollo-portal/src/main/resources/application.yml
View file @
ff0364c1
...
...
@@ -13,7 +13,7 @@ spring:
logging
:
level
:
org.springframework.cloud
:
'
DEBUG'
file
:
/opt/logs/${ctrip.appid}/apollo-
adminservice
.log
file
:
/opt/logs/${ctrip.appid}/apollo-
portal
.log
ctrip
:
appid
:
100003173
apollo-portal/src/main/resources/static/styles/common-style.css
View file @
ff0364c1
...
...
@@ -7,6 +7,10 @@ body {
padding-bottom
:
50px
;
}
a
{
cursor
:
pointer
;
}
.container
{
width
:
100%
;
min-height
:
550px
;
...
...
apollo-portal/src/main/resources/static/views/app/config.html
View file @
ff0364c1
...
...
@@ -3,7 +3,7 @@
<!--环境nav-->
<ul
class=
"nav nav-pills nav-justified"
>
<li
ng-repeat=
"env in envs"
ng-class=
"{active:configLocation.env == env}"
>
<a
href=
"#"
ng-click=
"switchEnv(env)"
>
{{env}}
</a>
<a
ng-click=
"switchEnv(env)"
>
{{env}}
</a>
</li>
</ul>
...
...
@@ -14,12 +14,12 @@
<ul
class=
"nav nav-pills nav-stacked"
>
<li
class=
"dropdown-header"
>
未发布
</li>
<li
role=
"presentation"
ng-class=
"{active:configLocation.versionId == -1}"
ng-click=
"switchVersion(-1)"
><a
href=
"#"
>
latest
</a></li>
ng-click=
"switchVersion(-1)"
><a>
latest
</a></li>
<li
role=
"separator"
class=
"divider"
></li>
<li
class=
"dropdown-header"
>
已发布
</li>
<li
ng-repeat=
"version in releaseVersions"
ng-class=
"{active:configLocation.versionId == version.id}"
>
<a
href=
"#"
ng-click=
"switchVersion(version.id)"
>
{{version.name}}
</a>
<a
ng-click=
"switchVersion(version.id)"
>
{{version.name}}
</a>
</li>
</ul>
</div>
...
...
@@ -31,13 +31,13 @@
<div
class=
"col-md-6"
>
项目的基本配置
</div>
<div
class=
"col-md-6"
ng-show=
"!currentVersionIsRelease"
>
<p
class=
"text-right"
>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"下载配置"
>
<span
class=
"glyphicon glyphicon-save"
aria-hidden=
"true"
></span>
</a>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"添加配置"
>
<span
class=
"glyphicon glyphicon-plus"
aria-hidden=
"true"
></span>
...
...
@@ -93,12 +93,12 @@
</td>
<td
ng-show=
"!currentVersionIsRelease"
>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"修改"
>
<span
class=
"glyphicon glyphicon-edit"
aria-hidden=
"true"
></span>
</a>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"删除"
>
<span
class=
"glyphicon glyphicon-remove"
aria-hidden=
"true"
></span>
...
...
@@ -110,17 +110,17 @@
<nav
class=
"text-right"
>
<ul
class=
"pagination"
>
<li>
<a
href=
"#"
aria-label=
"Previous"
>
<a
aria-label=
"Previous"
>
<span
aria-hidden=
"true"
>
«
</span>
</a>
</li>
<li><a
href=
"#"
>
1
</a></li>
<li><a
href=
"#"
>
2
</a></li>
<li><a
href=
"#"
>
3
</a></li>
<li><a
href=
"#"
>
4
</a></li>
<li><a
href=
"#"
>
5
</a></li>
<li><a
>
1
</a></li>
<li><a
>
2
</a></li>
<li><a
>
3
</a></li>
<li><a
>
4
</a></li>
<li><a
>
5
</a></li>
<li>
<a
href=
"#"
aria-label=
"Next"
>
<a
aria-label=
"Next"
>
<span
aria-hidden=
"true"
>
»
</span>
</a>
</li>
...
...
@@ -135,18 +135,18 @@
<header
class=
"panel-heading"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
重写
<a
href=
"#"
>
{{overrideAppConfig.appId}}
</a>
的配置
>
{{overrideAppConfig.appId}}
</a>
的配置
</div>
<div
class=
"col-md-6"
ng-show=
"!currentVersionIsRelease"
>
<p
class=
"text-right"
>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"下载配置"
>
<span
class=
"glyphicon glyphicon-save"
aria-hidden=
"true"
></span>
</a>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"添加配置"
>
<span
class=
"glyphicon glyphicon-plus"
...
...
@@ -202,13 +202,13 @@
</td>
<td
ng-show=
"!currentVersionIsRelease"
>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"修改"
>
<span
class=
"glyphicon glyphicon-edit"
aria-hidden=
"true"
></span>
</a>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"删除"
>
<span
class=
"glyphicon glyphicon-remove"
...
...
@@ -247,13 +247,13 @@
</div>
<div
class=
"col-md-6"
ng-show=
"!currentVersionIsRelease"
>
<p
class=
"text-right"
>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"下载配置"
>
<span
class=
"glyphicon glyphicon-save"
aria-hidden=
"true"
></span>
</a>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"添加配置"
>
<span
class=
"glyphicon glyphicon-plus"
aria-hidden=
"true"
></span>
...
...
@@ -308,13 +308,13 @@
</td>
<td
ng-show=
"!currentVersionIsRelease"
>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"修改"
>
<span
class=
"glyphicon glyphicon-edit"
aria-hidden=
"true"
></span>
</a>
<a
href=
"#"
data-toggle=
"tooltip"
<a
data-toggle=
"tooltip"
data-placement=
"top"
title=
"删除"
>
<span
class=
"glyphicon glyphicon-remove"
...
...
apollo-portal/src/test/java/com/ctrip/apollo/portal/service/ConfigServiceTest.java
View file @
ff0364c1
This diff is collapsed.
Click to expand it.
apollo-portal/src/test/resources/application.yml
View file @
ff0364c1
server
:
port
:
80
8
0
port
:
80
7
0
spring
:
spring
:
application
:
name
:
apollo-portal
datasource
:
url
:
jdbc:h2:file:~/fxapolloportaldb
username
:
sa
password
:
sa
url
:
jdbc:h2:mem:~/fxapolloportaldb
jpa
:
show-sql
:
true
hibernate
:
naming_strategy
:
org.hibernate.cfg.EJB3NamingStrategy
logging
:
level
:
org.springframework.cloud
:
'
DEBUG'
file
:
/opt/logs/${ctrip.appid}/apollo-portal.log
ctrip
:
appid
:
100003173
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