Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
apollo
Commits
7e7a7959
Commit
7e7a7959
authored
Jun 12, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
diff show deleted item & clogging
parent
76bd56d9
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
635 additions
and
501 deletions
+635
-501
apollo-adminservice/src/main/resources/logback.xml
apollo-adminservice/src/main/resources/logback.xml
+1
-1
apollo-assembly/src/main/resources/logback.xml
apollo-assembly/src/main/resources/logback.xml
+1
-1
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/customize/BizLoggingCustomizer.java
.../framework/apollo/biz/customize/BizLoggingCustomizer.java
+38
-0
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/customize/package-info.java
...om/ctrip/framework/apollo/biz/customize/package-info.java
+4
-0
apollo-common/src/main/java/com/ctrip/framework/apollo/common/customize/LoggingCustomizer.java
.../framework/apollo/common/customize/LoggingCustomizer.java
+18
-23
apollo-common/src/main/java/com/ctrip/framework/apollo/common/customize/TomcatContainerCustomizer.java
...rk/apollo/common/customize/TomcatContainerCustomizer.java
+1
-1
apollo-common/src/main/java/com/ctrip/framework/apollo/common/customize/package-info.java
...ctrip/framework/apollo/common/customize/package-info.java
+4
-0
apollo-common/src/main/java/com/ctrip/framework/apollo/common/datasource/package-info.java
...trip/framework/apollo/common/datasource/package-info.java
+4
-0
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/api/AdminServiceAPI.java
...om/ctrip/framework/apollo/portal/api/AdminServiceAPI.java
+7
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/cumsomize/BizLoggingCustomizer.java
...amework/apollo/portal/cumsomize/BizLoggingCustomizer.java
+38
-0
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/cumsomize/package-info.java
...ctrip/framework/apollo/portal/cumsomize/package-info.java
+4
-0
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalConfigService.java
.../framework/apollo/portal/service/PortalConfigService.java
+13
-2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalNamespaceService.java
...amework/apollo/portal/service/PortalNamespaceService.java
+32
-0
apollo-portal/src/main/resources/static/config.html
apollo-portal/src/main/resources/static/config.html
+466
-471
apollo-portal/src/main/resources/static/server_config.html
apollo-portal/src/main/resources/static/server_config.html
+1
-0
apollo-portal/src/main/resources/static/views/common/nav.html
...lo-portal/src/main/resources/static/views/common/nav.html
+3
-0
No files found.
apollo-adminservice/src/main/resources/logback.xml
View file @
7e7a7959
...
@@ -7,4 +7,4 @@
...
@@ -7,4 +7,4 @@
<root
level=
"INFO"
>
<root
level=
"INFO"
>
<appender-ref
ref=
"FILE"
/>
<appender-ref
ref=
"FILE"
/>
</root>
</root>
</configuration>
</configuration>
\ No newline at end of file
apollo-assembly/src/main/resources/logback.xml
View file @
7e7a7959
...
@@ -7,4 +7,4 @@
...
@@ -7,4 +7,4 @@
<root
level=
"INFO"
>
<root
level=
"INFO"
>
<appender-ref
ref=
"FILE"
/>
<appender-ref
ref=
"FILE"
/>
</root>
</root>
</configuration>
</configuration>
\ No newline at end of file
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/customize/BizLoggingCustomizer.java
0 → 100644
View file @
7e7a7959
package
com
.
ctrip
.
framework
.
apollo
.
biz
.
customize
;
import
com.ctrip.framework.apollo.biz.repository.ServerConfigRepository
;
import
com.ctrip.framework.apollo.common.customize.LoggingCustomizer
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.stereotype.Component
;
@Component
@Profile
(
"ctrip"
)
public
class
BizLoggingCustomizer
extends
LoggingCustomizer
{
private
static
final
String
CLOGGING_SERVER_URL_KEY
=
"clogging.server.url"
;
private
static
final
String
CLOGGING_SERVER_PORT_KEY
=
"clogging.server.port"
;
@Autowired
private
ServerConfigRepository
serverConfigRepository
;
private
String
cloggingUrl
;
private
String
cloggingPort
;
@Override
protected
String
cloggingUrl
()
{
if
(
cloggingUrl
==
null
){
cloggingUrl
=
serverConfigRepository
.
findByKey
(
CLOGGING_SERVER_URL_KEY
).
getValue
();
}
return
cloggingUrl
;
}
@Override
protected
String
cloggingPort
()
{
if
(
cloggingPort
==
null
){
cloggingPort
=
serverConfigRepository
.
findByKey
(
CLOGGING_SERVER_PORT_KEY
).
getValue
();
}
return
cloggingPort
;
}
}
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/customize/package-info.java
0 → 100644
View file @
7e7a7959
/**
* 携程内部的日志系统,第三方公司可删除
*/
package
com
.
ctrip
.
framework
.
apollo
.
biz
.
customize
;
apollo-
biz/src/main/java/com/ctrip/framework/apollo/biz
/customize/LoggingCustomizer.java
→
apollo-
common/src/main/java/com/ctrip/framework/apollo/common
/customize/LoggingCustomizer.java
View file @
7e7a7959
package
com
.
ctrip
.
framework
.
apollo
.
biz
.
customize
;
package
com
.
ctrip
.
framework
.
apollo
.
common
.
customize
;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
com.ctrip.framework.apollo.biz.entity.ServerConfig
;
import
com.ctrip.framework.apollo.biz.repository.ServerConfigRepository
;
import
com.ctrip.framework.foundation.Foundation
;
import
com.ctrip.framework.foundation.Foundation
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.Cat
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ClassUtils
;
import
org.springframework.util.ClassUtils
;
import
org.springframework.util.ReflectionUtils
;
import
org.springframework.util.ReflectionUtils
;
import
java.util.Objects
;
import
ch.qos.logback.classic.LoggerContext
;
import
ch.qos.logback.classic.LoggerContext
;
import
ch.qos.logback.core.Appender
;
import
ch.qos.logback.core.Appender
;
/**
/**
* clogging config.only used in ctrip
* @author Jason Song(song_s@ctrip.com)
* @author Jason Song(song_s@ctrip.com)
*/
*/
@Component
public
abstract
class
LoggingCustomizer
implements
InitializingBean
{
public
class
LoggingCustomizer
implements
InitializingBean
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
LoggingCustomizer
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
LoggingCustomizer
.
class
);
private
static
final
String
cLoggingAppenderClass
=
private
static
final
String
cLoggingAppenderClass
=
"com.ctrip.framework.clogging.agent.appender.CLoggingAppender"
;
"com.ctrip.framework.clogging.agent.appender.CLoggingAppender"
;
private
static
boolean
cLoggingAppenderPresent
=
private
static
boolean
cLoggingAppenderPresent
=
ClassUtils
.
isPresent
(
cLoggingAppenderClass
,
LoggingCustomizer
.
class
.
getClassLoader
());
ClassUtils
.
isPresent
(
cLoggingAppenderClass
,
LoggingCustomizer
.
class
.
getClassLoader
());
private
static
final
String
CLOGGING_SERVER_URL_KEY
=
"clogging.server.url"
;
private
static
final
String
CLOGGING_SERVER_PORT_KEY
=
"clogging.server.port"
;
@Autowired
private
ServerConfigRepository
serverConfigRepository
;
@Override
@Override
public
void
afterPropertiesSet
()
{
public
void
afterPropertiesSet
()
{
if
(!
cLoggingAppenderPresent
)
{
if
(!
cLoggingAppenderPresent
)
{
...
@@ -59,13 +48,6 @@ public class LoggingCustomizer implements InitializingBean {
...
@@ -59,13 +48,6 @@ public class LoggingCustomizer implements InitializingBean {
return
;
return
;
}
}
ServerConfig
cloggingUrl
=
serverConfigRepository
.
findByKey
(
CLOGGING_SERVER_URL_KEY
);
ServerConfig
cloggingPort
=
serverConfigRepository
.
findByKey
(
CLOGGING_SERVER_PORT_KEY
);
if
(
Objects
.
isNull
(
cloggingUrl
)
||
Objects
.
isNull
(
cloggingPort
))
{
logger
.
warn
(
"CLogging config is not set!"
);
return
;
}
LoggerContext
loggerContext
=
(
LoggerContext
)
LoggerFactory
.
getILoggerFactory
();
LoggerContext
loggerContext
=
(
LoggerContext
)
LoggerFactory
.
getILoggerFactory
();
Class
clazz
=
Class
.
forName
(
cLoggingAppenderClass
);
Class
clazz
=
Class
.
forName
(
cLoggingAppenderClass
);
...
@@ -73,9 +55,9 @@ public class LoggingCustomizer implements InitializingBean {
...
@@ -73,9 +55,9 @@ public class LoggingCustomizer implements InitializingBean {
ReflectionUtils
.
findMethod
(
clazz
,
"setAppId"
,
String
.
class
).
invoke
(
cLoggingAppender
,
appId
);
ReflectionUtils
.
findMethod
(
clazz
,
"setAppId"
,
String
.
class
).
invoke
(
cLoggingAppender
,
appId
);
ReflectionUtils
.
findMethod
(
clazz
,
"setServerIp"
,
String
.
class
)
ReflectionUtils
.
findMethod
(
clazz
,
"setServerIp"
,
String
.
class
)
.
invoke
(
cLoggingAppender
,
cloggingUrl
.
getValue
());
.
invoke
(
cLoggingAppender
,
cloggingUrl
());
ReflectionUtils
.
findMethod
(
clazz
,
"setServerPort"
,
int
.
class
)
ReflectionUtils
.
findMethod
(
clazz
,
"setServerPort"
,
int
.
class
)
.
invoke
(
cLoggingAppender
,
Integer
.
parseInt
(
cloggingPort
.
getValue
()));
.
invoke
(
cLoggingAppender
,
Integer
.
parseInt
(
cloggingPort
()));
cLoggingAppender
.
setName
(
"CentralLogging"
);
cLoggingAppender
.
setName
(
"CentralLogging"
);
cLoggingAppender
.
setContext
(
loggerContext
);
cLoggingAppender
.
setContext
(
loggerContext
);
...
@@ -87,4 +69,17 @@ public class LoggingCustomizer implements InitializingBean {
...
@@ -87,4 +69,17 @@ public class LoggingCustomizer implements InitializingBean {
}
}
/**
* clogging server url
* @return
*/
protected
abstract
String
cloggingUrl
();
/**
* clogging server port
* @return
*/
protected
abstract
String
cloggingPort
();
}
}
apollo-
biz/src/main/java/com/ctrip/framework/apollo/biz
/customize/TomcatContainerCustomizer.java
→
apollo-
common/src/main/java/com/ctrip/framework/apollo/common
/customize/TomcatContainerCustomizer.java
View file @
7e7a7959
package
com
.
ctrip
.
framework
.
apollo
.
biz
.
customize
;
package
com
.
ctrip
.
framework
.
apollo
.
common
.
customize
;
import
org.apache.catalina.connector.Connector
;
import
org.apache.catalina.connector.Connector
;
import
org.apache.coyote.ProtocolHandler
;
import
org.apache.coyote.ProtocolHandler
;
...
...
apollo-common/src/main/java/com/ctrip/framework/apollo/common/customize/package-info.java
0 → 100644
View file @
7e7a7959
/**
* 携程内部的日志系统,第三方公司可删除
*/
package
com
.
ctrip
.
framework
.
apollo
.
common
.
customize
;
apollo-common/src/main/java/com/ctrip/framework/apollo/common/datasource/package-info.java
0 → 100644
View file @
7e7a7959
/**
* 携程内部的dal,第三方公司可替换实现
*/
package
com
.
ctrip
.
framework
.
apollo
.
common
.
datasource
;
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/api/AdminServiceAPI.java
View file @
7e7a7959
...
@@ -95,15 +95,20 @@ public class AdminServiceAPI {
...
@@ -95,15 +95,20 @@ public class AdminServiceAPI {
@Service
@Service
public
static
class
ItemAPI
extends
API
{
public
static
class
ItemAPI
extends
API
{
public
List
<
ItemDTO
>
findItems
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespace
)
{
public
List
<
ItemDTO
>
findItems
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespace
Name
)
{
ItemDTO
[]
itemDTOs
=
ItemDTO
[]
itemDTOs
=
restTemplate
restTemplate
.
getForObject
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items"
,
.
getForObject
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items"
,
ItemDTO
[].
class
,
ItemDTO
[].
class
,
getAdminServiceHost
(
env
),
appId
,
clusterName
,
namespace
);
getAdminServiceHost
(
env
),
appId
,
clusterName
,
namespace
Name
);
return
Arrays
.
asList
(
itemDTOs
);
return
Arrays
.
asList
(
itemDTOs
);
}
}
public
ItemDTO
loadItem
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespaceName
,
String
key
){
return
restTemplate
.
getForObject
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key}"
,
ItemDTO
.
class
,
getAdminServiceHost
(
env
),
appId
,
clusterName
,
namespaceName
,
key
);
}
public
void
updateItems
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespace
,
public
void
updateItems
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespace
,
ItemChangeSets
changeSets
)
{
ItemChangeSets
changeSets
)
{
restTemplate
.
postForEntity
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/itemset"
,
restTemplate
.
postForEntity
(
"{host}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/itemset"
,
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/cumsomize/BizLoggingCustomizer.java
0 → 100644
View file @
7e7a7959
package
com
.
ctrip
.
framework
.
apollo
.
portal
.
cumsomize
;
import
com.ctrip.framework.apollo.common.customize.LoggingCustomizer
;
import
com.ctrip.framework.apollo.portal.repository.ServerConfigRepository
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Profile
;
import
org.springframework.stereotype.Component
;
@Component
@Profile
(
"ctrip"
)
public
class
BizLoggingCustomizer
extends
LoggingCustomizer
{
private
static
final
String
CLOGGING_SERVER_URL_KEY
=
"clogging.server.url"
;
private
static
final
String
CLOGGING_SERVER_PORT_KEY
=
"clogging.server.port"
;
@Autowired
private
ServerConfigRepository
serverConfigRepository
;
private
String
cloggingUrl
;
private
String
cloggingPort
;
@Override
protected
String
cloggingUrl
()
{
if
(
cloggingUrl
==
null
){
cloggingUrl
=
serverConfigRepository
.
findByKey
(
CLOGGING_SERVER_URL_KEY
).
getValue
();
}
return
cloggingUrl
;
}
@Override
protected
String
cloggingPort
()
{
if
(
cloggingPort
==
null
){
cloggingPort
=
serverConfigRepository
.
findByKey
(
CLOGGING_SERVER_PORT_KEY
).
getValue
();
}
return
cloggingPort
;
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/cumsomize/package-info.java
0 → 100644
View file @
7e7a7959
/**
* 携程内部的日志系统,第三方公司可删除
*/
package
com
.
ctrip
.
framework
.
apollo
.
portal
.
cumsomize
;
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalConfigService.java
View file @
7e7a7959
...
@@ -168,13 +168,14 @@ public class PortalConfigService {
...
@@ -168,13 +168,14 @@ public class PortalConfigService {
namespace
.
getClusterName
(),
namespace
.
getNamespaceName
());
namespace
.
getClusterName
(),
namespace
.
getNamespaceName
());
long
namespaceId
=
getNamespaceId
(
namespace
);
long
namespaceId
=
getNamespaceId
(
namespace
);
if
(
CollectionUtils
.
isEmpty
(
targetItems
))
{
//all source items is added
if
(
CollectionUtils
.
isEmpty
(
targetItems
))
{
//all source items is added
int
lineNum
=
1
;
int
lineNum
=
1
;
for
(
ItemDTO
sourceItem
:
sourceItems
)
{
for
(
ItemDTO
sourceItem
:
sourceItems
)
{
changeSets
.
addCreateItem
(
buildItem
(
namespaceId
,
lineNum
++,
sourceItem
));
changeSets
.
addCreateItem
(
buildItem
(
namespaceId
,
lineNum
++,
sourceItem
));
}
}
}
else
{
}
else
{
Map
<
String
,
ItemDTO
>
keyMapItem
=
BeanUtils
.
mapByKey
(
"key"
,
targetItems
);
Map
<
String
,
ItemDTO
>
targetItemMap
=
BeanUtils
.
mapByKey
(
"key"
,
targetItems
);
String
key
,
sourceValue
,
sourceComment
;
String
key
,
sourceValue
,
sourceComment
;
ItemDTO
targetItem
=
null
;
ItemDTO
targetItem
=
null
;
int
maxLineNum
=
targetItems
.
size
();
//append to last
int
maxLineNum
=
targetItems
.
size
();
//append to last
...
@@ -182,7 +183,7 @@ public class PortalConfigService {
...
@@ -182,7 +183,7 @@ public class PortalConfigService {
key
=
sourceItem
.
getKey
();
key
=
sourceItem
.
getKey
();
sourceValue
=
sourceItem
.
getValue
();
sourceValue
=
sourceItem
.
getValue
();
sourceComment
=
sourceItem
.
getComment
();
sourceComment
=
sourceItem
.
getComment
();
targetItem
=
keyMapItem
.
get
(
key
);
targetItem
=
targetItemMap
.
get
(
key
);
if
(
targetItem
==
null
)
{
//added items
if
(
targetItem
==
null
)
{
//added items
...
@@ -196,6 +197,16 @@ public class PortalConfigService {
...
@@ -196,6 +197,16 @@ public class PortalConfigService {
}
}
}
}
//parse deleted items
List
<
ItemDTO
>
deletedItems
=
new
LinkedList
<>();
Map
<
String
,
ItemDTO
>
sourceItemMap
=
BeanUtils
.
mapByKey
(
"key"
,
sourceItems
);
for
(
ItemDTO
targetItem:
targetItems
){
if
(
sourceItemMap
.
get
(
targetItem
.
getKey
())
==
null
){
deletedItems
.
add
(
targetItem
);
}
}
changeSets
.
setDeleteItems
(
deletedItems
);
return
changeSets
;
return
changeSets
;
}
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalNamespaceService.java
View file @
7e7a7959
...
@@ -2,6 +2,7 @@ package com.ctrip.framework.apollo.portal.service;
...
@@ -2,6 +2,7 @@ package com.ctrip.framework.apollo.portal.service;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.ctrip.framework.apollo.common.utils.BeanUtils
;
import
com.ctrip.framework.apollo.common.utils.ExceptionUtils
;
import
com.ctrip.framework.apollo.common.utils.ExceptionUtils
;
import
com.ctrip.framework.apollo.core.dto.AppNamespaceDTO
;
import
com.ctrip.framework.apollo.core.dto.AppNamespaceDTO
;
import
com.ctrip.framework.apollo.core.dto.ItemDTO
;
import
com.ctrip.framework.apollo.core.dto.ItemDTO
;
...
@@ -139,17 +140,48 @@ public class PortalNamespaceService {
...
@@ -139,17 +140,48 @@ public class PortalNamespaceService {
itemVos
.
add
(
itemVO
);
itemVos
.
add
(
itemVO
);
}
}
//count deleted item num
List
<
NamespaceVO
.
ItemVO
>
deletedItems
=
countDeletedItemNum
(
items
,
releaseItems
);
itemVos
.
addAll
(
deletedItems
);
modifiedItemCnt
+=
deletedItems
.
size
();
namespaceVO
.
setItemModifiedCnt
(
modifiedItemCnt
);
namespaceVO
.
setItemModifiedCnt
(
modifiedItemCnt
);
return
namespaceVO
;
return
namespaceVO
;
}
}
private
List
<
NamespaceVO
.
ItemVO
>
countDeletedItemNum
(
List
<
ItemDTO
>
newItems
,
Map
<
String
,
String
>
releaseItems
)
{
Map
<
String
,
ItemDTO
>
newItemMap
=
BeanUtils
.
mapByKey
(
"key"
,
newItems
);
List
<
NamespaceVO
.
ItemVO
>
deletedItems
=
new
LinkedList
<>();
for
(
Map
.
Entry
<
String
,
String
>
entry:
releaseItems
.
entrySet
()){
String
key
=
entry
.
getKey
();
if
(
newItemMap
.
get
(
key
)
==
null
){
NamespaceVO
.
ItemVO
deletedItem
=
new
NamespaceVO
.
ItemVO
();
ItemDTO
deletedItemDto
=
new
ItemDTO
();
deletedItemDto
.
setKey
(
key
);
String
oldValue
=
entry
.
getValue
();
deletedItem
.
setItem
(
deletedItemDto
);
deletedItemDto
.
setValue
(
oldValue
);
deletedItem
.
setModified
(
true
);
deletedItem
.
setOldValue
(
oldValue
);
deletedItem
.
setNewValue
(
""
);
deletedItems
.
add
(
deletedItem
);
}
}
return
deletedItems
;
}
private
NamespaceVO
.
ItemVO
parseItemVO
(
ItemDTO
itemDTO
,
Map
<
String
,
String
>
releaseItems
)
{
private
NamespaceVO
.
ItemVO
parseItemVO
(
ItemDTO
itemDTO
,
Map
<
String
,
String
>
releaseItems
)
{
String
key
=
itemDTO
.
getKey
();
String
key
=
itemDTO
.
getKey
();
NamespaceVO
.
ItemVO
itemVO
=
new
NamespaceVO
.
ItemVO
();
NamespaceVO
.
ItemVO
itemVO
=
new
NamespaceVO
.
ItemVO
();
itemVO
.
setItem
(
itemDTO
);
itemVO
.
setItem
(
itemDTO
);
String
newValue
=
itemDTO
.
getValue
();
String
newValue
=
itemDTO
.
getValue
();
String
oldValue
=
releaseItems
.
get
(
key
);
String
oldValue
=
releaseItems
.
get
(
key
);
//new item or modified
if
(!
StringUtils
.
isEmpty
(
key
)
&&
(
oldValue
==
null
||
!
newValue
.
equals
(
oldValue
)))
{
if
(!
StringUtils
.
isEmpty
(
key
)
&&
(
oldValue
==
null
||
!
newValue
.
equals
(
oldValue
)))
{
itemVO
.
setModified
(
true
);
itemVO
.
setModified
(
true
);
itemVO
.
setOldValue
(
oldValue
==
null
?
""
:
oldValue
);
itemVO
.
setOldValue
(
oldValue
==
null
?
""
:
oldValue
);
...
...
apollo-portal/src/main/resources/static/config.html
View file @
7e7a7959
...
@@ -14,568 +14,563 @@
...
@@ -14,568 +14,563 @@
<apollonav></apollonav>
<apollonav></apollonav>
<div
class=
"container-fluid apollo-container"
>
<div
class=
"container-fluid apollo-container app"
id=
"config-info"
>
<div
class=
"app"
>
<!--具体配置信息-->
<!--配置信息-->
<div
class=
"row config-info-container"
>
<div
id=
"config-info"
>
<!--tag导航-->
<!--具体配置信息-->
<div
class=
"col-md-3"
ng-controller=
"ConfigBaseInfoController"
>
<div
class=
"row config-info-container"
>
<div
id=
"treeview"
></div>
<!--app info-->
<!--tag导航-->
<section
class=
"panel"
>
<div
class=
"col-md-3"
ng-controller=
"ConfigBaseInfoController"
>
<header
class=
"panel-heading"
>
<div
id=
"treeview"
></div>
<img
src=
"img/info.png"
class=
"i-25-20"
/>
应用信息
<!--app info-->
<section
class=
"panel"
>
<header
class=
"panel-heading"
>
<img
src=
"img/info.png"
class=
"i-25-20"
/>
应用信息
<span
class=
"tools pull-right"
>
<span
class=
"tools pull-right"
>
<a
href=
"javascript:;"
class=
"icon-chevron-down"
></a>
<a
href=
"javascript:;"
class=
"icon-chevron-down"
></a>
</span>
</span>
</header>
</header>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<table
class=
"project-info"
>
<table
class=
"project-info"
>
<tbody>
<tbody>
<tr>
<tr>
<th>
应用ID:
</th>
<th>
应用ID:
</th>
<td
ng-bind=
"appBaseInfo.appId"
></td>
<td
ng-bind=
"appBaseInfo.appId"
></td>
</tr>
</tr>
<tr>
<tr>
<th>
应用名:
</th>
<th>
应用名:
</th>
<td
ng-bind=
"appBaseInfo.name"
></td>
<td
ng-bind=
"appBaseInfo.name"
></td>
</tr>
</tr>
<tr>
<tr>
<th>
Owner:
</th>
<th>
Owner:
</th>
<td
ng-bind=
"appBaseInfo.ownerName"
></td>
<td
ng-bind=
"appBaseInfo.ownerName"
></td>
</tr>
</tr>
<tr>
<tr>
<th>
Owner Email:
</th>
<th>
Owner Email:
</th>
<td
ng-bind=
"appBaseInfo.ownerEmail"
></td>
<td
ng-bind=
"appBaseInfo.ownerEmail"
></td>
</tr>
</tr>
<tr
ng-show=
"missEnvs.length > 0"
>
<tr
ng-show=
"missEnvs.length > 0"
>
<th>
缺失的环境:
</th>
<th>
缺失的环境:
</th>
<td>
<td>
<span
ng-repeat=
"env in missEnvs"
ng-bind=
"env"
>
<span
ng-repeat=
"env in missEnvs"
ng-bind=
"env"
>
</span>
</span>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
</div>
</div>
</section>
</section>
<a
class=
"list-group-item"
data-toggle=
"modal"
data-target=
"#createEnvModal"
<a
class=
"list-group-item"
data-toggle=
"modal"
data-target=
"#createEnvModal"
ng-show=
"missEnvs.length > 0"
>
ng-show=
"missEnvs.length > 0"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-2"
><img
src=
"img/plus.png"
class=
"i-20"
></div>
<div
class=
"col-md-2"
><img
src=
"img/plus.png"
class=
"i-20"
></div>
<div
class=
"col-md-7 hidden-xs"
>
<div
class=
"col-md-7 hidden-xs"
>
<p
class=
"btn-title"
>
添加环境
</p>
<p
class=
"btn-title"
>
添加环境
</p>
</div>
</div>
</div>
</div>
</a>
</a>
<!--<a class="list-group-item" target="_blank" href="/views/config.html?#/appid={{app.appId}}">-->
<a
class=
"list-group-item"
href=
"#"
disabled=
"disabled"
ng-show=
"false"
>
<!--<div class="row">-->
<div
class=
"row"
>
<!--<div class="col-md-2"><img src="../img/plus.png" class="i-20"></div>-->
<div
class=
"col-md-2"
><img
src=
"../img/plus.png"
class=
"i-20"
></div>
<!--<div class="col-md-7 hidden-xs">-->
<div
class=
"col-md-7 hidden-xs"
>
<!--<p class="apps-description">添加集群</p>-->
<p
class=
"btn-title"
>
添加集群
</p>
<!--</div>-->
</div>
<!--</div>-->
<!--</a>-->
<a
class=
"list-group-item"
href=
"namespace.html?#/appid={{pageContext.appId}}&type=link"
>
<div
class=
"row"
>
<div
class=
"col-md-2"
><img
src=
"img/plus.png"
class=
"i-20"
></div>
<div
class=
"col-md-7 hidden-xs"
>
<p
class=
"btn-title"
>
添加Namespace
</p>
</div>
</div>
</a>
</section>
<!--create env modal-->
<div
class=
"modal fade"
id=
"createEnvModal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header panel-primary"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
>
添加环境
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"form-group"
>
<label>
请选择环境:
</label>
<div
class=
"checkbox"
ng-repeat=
"env in missEnvs"
>
<label>
<input
type=
"checkbox"
name=
"selectedEnvs[]"
value=
"{{env}}"
ng-checked=
"selectedEnvs.indexOf(env) > -1"
ng-click=
"toggleSelection(env)"
><span
ng-bind=
"env"
></span>
</label>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
</a>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<a
class=
"list-group-item"
href=
"namespace.html?#/appid={{pageContext.appId}}&type=link"
>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
<div
class=
"row"
>
ng-click=
"createEnvs()"
>
添加
<div
class=
"col-md-2"
><img
src=
"img/plus.png"
class=
"i-20"
></div>
</button>
<div
class=
"col-md-7 hidden-xs"
>
<p
class=
"btn-title"
>
添加Namespace
</p>
</div>
</div>
</a>
</section>
<!--create env modal-->
<div
class=
"modal fade"
id=
"createEnvModal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header panel-primary"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
>
添加环境
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"form-group"
>
<label>
请选择环境:
</label>
<div
class=
"checkbox"
ng-repeat=
"env in missEnvs"
>
<label>
<input
type=
"checkbox"
name=
"selectedEnvs[]"
value=
"{{env}}"
ng-checked=
"selectedEnvs.indexOf(env) > -1"
ng-click=
"toggleSelection(env)"
><span
ng-bind=
"env"
></span>
</label>
</div>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
ng-click=
"createEnvs()"
>
添加
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--namespaces-->
<!--namespaces-->
<div
class=
"col-md-9 config-item-container hide"
ng-controller=
"ConfigNamespaceController"
>
<div
class=
"col-md-9 config-item-container hide"
ng-controller=
"ConfigNamespaceController"
>
<div
ng-repeat=
"namespace in namespaces"
>
<div
ng-repeat=
"namespace in namespaces"
>
<div
class=
"panel"
>
<div
class=
"panel"
>
<header
class=
"panel-heading"
>
<header
class=
"panel-heading"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<b
ng-bind=
"namespace.namespace.namespaceName"
></b>
<b
ng-bind=
"namespace.namespace.namespaceName"
></b>
<span
class=
"label label-primary"
<span
class=
"label label-primary"
ng-show=
"namespace.itemModifiedCnt > 0"
>
有修改
ng-show=
"namespace.itemModifiedCnt > 0"
>
有修改
<span
class=
"badge"
ng-bind=
"namespace.itemModifiedCnt"
></span></span>
<span
class=
"badge"
ng-bind=
"namespace.itemModifiedCnt"
></span></span>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<div
class=
"btn-toolbar"
role=
"toolbar"
aria-label=
"..."
>
<div
class=
"btn-toolbar"
role=
"toolbar"
aria-label=
"..."
>
<div
class=
"btn-group"
role=
"group"
aria-label=
"..."
>
<div
class=
"btn-group"
role=
"group"
aria-label=
"..."
>
<button
type=
"button"
data-toggle=
"modal"
data-target=
"#releaseModal"
<button
type=
"button"
data-toggle=
"modal"
data-target=
"#releaseModal"
class=
"btn btn-default btn-sm J_tableview_btn"
class=
"btn btn-default btn-sm J_tableview_btn"
ng-disabled=
"namespace.isTextEditing"
ng-disabled=
"namespace.isTextEditing"
ng-click=
"prepareReleaseNamespace(namespace)"
>
发布
ng-click=
"prepareReleaseNamespace(namespace)"
>
发布
</button>
</button>
<button
type=
"button"
<button
type=
"button"
class=
"btn btn-default btn-sm J_tableview_btn"
>
回滚
class=
"btn btn-default btn-sm J_tableview_btn"
disabled
>
回滚
</button>
</button>
<button
type=
"button"
<button
type=
"button"
class=
"btn btn-default btn-sm J_historyview_btn"
>
class=
"btn btn-default btn-sm J_historyview_btn"
disabled
>
查看历史版本
查看历史版本
</button>
</button>
<button
type=
"button"
<button
type=
"button"
class=
"btn btn-default btn-sm J_tableview_btn"
disabled
>
授权
class=
"btn btn-default btn-sm J_tableview_btn"
>
授权
</button>
</button>
<a
type=
"button"
<a
type=
"button"
href=
"config/sync.html?#/appid={{pageContext.appId}}&env={{pageContext.env}}&clusterName={{pageContext.clusterName}}&namespaceName={{namespace.namespace.namespaceName}}"
href=
"config/sync.html?#/appid={{pageContext.appId}}&env={{pageContext.env}}&clusterName={{pageContext.clusterName}}&namespaceName={{namespace.namespace.namespaceName}}"
class=
"btn btn-default btn-sm J_tableview_btn"
>
同步
class=
"btn btn-default btn-sm J_tableview_btn"
>
同步
</a>
</div>
</div>
</div>
<div
class=
"col-md-3"
>
<div
class=
"btn-toolbar"
role=
"toolbar"
aria-label=
"..."
>
<div
class=
"btn-group"
role=
"group"
aria-label=
"..."
>
<button
type=
"button"
class=
"btn btn-default btn-sm J_tableview_btn"
ng-click=
"switchView(namespace, 'text')"
>
文本
</button>
<button
type=
"button"
class=
"btn btn-default btn-sm J_tableview_btn"
ng-click=
"switchView(namespace, 'table')"
>
表格
</button>
<button
type=
"button"
class=
"btn btn-default btn-sm J_historyview_btn"
ng-click=
"switchView(namespace, 'history')"
>
更改历史
</button>
</div>
</div>
</div>
<div
class=
"col-md-1 text-right"
>
<a
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"取消修改"
ng-show=
"namespace.isTextEditing && namespace.viewType == 'text'"
ng-click=
"toggleTextEditStatus(namespace)"
>
<span
class=
"glyphicon glyphicon-remove"
aria-hidden=
"true"
></span>
</a>
<a
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"修改配置"
ng-show=
"!namespace.isTextEditing && namespace.viewType == 'text'"
ng-click=
"toggleTextEditStatus(namespace)"
>
<span
class=
"glyphicon glyphicon-pencil"
aria-hidden=
"true"
></span>
</a>
<a
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"提交修改"
data-toggle=
"modal"
data-target=
"#commitModal"
ng-show=
"namespace.isTextEditing && namespace.viewType == 'text'"
ng-click=
"setCommitNamespace(namespace)"
>
<span
class=
"glyphicon glyphicon-ok"
aria-hidden=
"true"
></span>
</a>
</a>
</div>
</div>
</div>
<a
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"添加配置"
<div
class=
"col-md-3"
>
ng-show=
"namespace.viewType == 'table'"
<div
class=
"btn-toolbar"
role=
"toolbar"
aria-label=
"..."
>
data-toggle=
"modal"
data-target=
"#itemModal"
<div
class=
"btn-group"
role=
"group"
aria-label=
"..."
>
ng-click=
"createItem(namespace)"
>
<button
type=
"button"
<span
class=
"glyphicon glyphicon-plus"
aria-hidden=
"true"
></span>
class=
"btn btn-default btn-sm J_tableview_btn"
</a>
ng-click=
"switchView(namespace, 'text')"
>
文本
</button>
<button
type=
"button"
class=
"btn btn-default btn-sm J_tableview_btn"
ng-click=
"switchView(namespace, 'table')"
>
表格
</button>
<button
type=
"button"
class=
"btn btn-default btn-sm J_historyview_btn"
ng-click=
"switchView(namespace, 'history')"
disabled
>
更改历史
</button>
</div>
</div>
</div>
</div>
</header>
</div>
<div
class=
"col-md-1 text-right"
>
<a
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"取消修改"
ng-show=
"namespace.isTextEditing && namespace.viewType == 'text'"
ng-click=
"toggleTextEditStatus(namespace)"
>
<span
class=
"glyphicon glyphicon-remove"
aria-hidden=
"true"
></span>
</a>
<a
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"修改配置"
ng-show=
"!namespace.isTextEditing && namespace.viewType == 'text'"
ng-click=
"toggleTextEditStatus(namespace)"
>
<span
class=
"glyphicon glyphicon-pencil"
aria-hidden=
"true"
></span>
</a>
<a
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"提交修改"
data-toggle=
"modal"
data-target=
"#commitModal"
ng-show=
"namespace.isTextEditing && namespace.viewType == 'text'"
ng-click=
"setCommitNamespace(namespace)"
>
<span
class=
"glyphicon glyphicon-ok"
aria-hidden=
"true"
></span>
</a>
<a
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"添加配置"
ng-show=
"namespace.viewType == 'table'"
data-toggle=
"modal"
data-target=
"#itemModal"
ng-click=
"createItem(namespace)"
>
<span
class=
"glyphicon glyphicon-plus"
aria-hidden=
"true"
></span>
</a>
</div>
</div>
</header>
<!--text view-->
<!--text view-->
<!--只读模式下的文本内容,不替换换行符-->
<!--只读模式下的文本内容,不替换换行符-->
<textarea
class=
"form-control"
rows=
"{{namespace.itemCnt}}"
style=
"border-radius: 0px"
<textarea
class=
"form-control"
rows=
"{{namespace.itemCnt}}"
style=
"border-radius: 0px"
ng-show=
"namespace.viewType == 'text' && !namespace.isTextEditing"
ng-show=
"namespace.viewType == 'text' && !namespace.isTextEditing"
ng-disabled=
"!namespace.isTextEditing"
ng-model=
"namespace.text"
ng-disabled=
"!namespace.isTextEditing"
ng-model=
"namespace.text"
ng-bind=
"namespace.text"
>
ng-bind=
"namespace.text"
>
</textarea>
</textarea>
<!--编辑状态下的文本内容,会过滤掉换行符-->
<!--编辑状态下的文本内容,会过滤掉换行符-->
<textarea
class=
"form-control"
rows=
"{{namespace.itemCnt}}"
style=
"border-radius: 0px"
<textarea
class=
"form-control"
rows=
"{{namespace.itemCnt}}"
style=
"border-radius: 0px"
ng-show=
"namespace.viewType == 'text' && namespace.isTextEditing"
ng-show=
"namespace.viewType == 'text' && namespace.isTextEditing"
ng-disabled=
"!namespace.isTextEditing"
ng-model=
"namespace.editText"
ng-disabled=
"!namespace.isTextEditing"
ng-model=
"namespace.editText"
ng-bind=
"namespace.editText"
>
ng-bind=
"namespace.editText"
>
</textarea>
</textarea>
<!--table view-->
<!--table view-->
<div
class=
"namespace-view-table"
>
<div
class=
"namespace-view-table"
>
<table
class=
"table table-bordered table-striped text-center table-hover"
<table
class=
"table table-bordered table-striped text-center table-hover"
ng-show=
"namespace.viewType == 'table' && namespace.items.length > 0"
>
ng-show=
"namespace.viewType == 'table' && namespace.items.length > 0"
>
<thead>
<thead>
<tr>
<tr>
<th>
<th>
Key
Key
</th>
</th>
<th>
<th>
value
value
</th>
</th>
<th>
<th>
备注
备注
</th>
</th>
<th>
<th>
最后修改人
最后修改人
</th>
</th>
<th>
<th>
最后修改时间
最后修改时间
</th>
</th>
<th>
<th>
操作
操作
</th>
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
ng-repeat=
"config in namespace.items"
ng-class=
"{warning:config.isModified}"
<tr
ng-repeat=
"config in namespace.items"
ng-class=
"{warning:config.isModified}"
ng-if=
"config.item.ke
y"
>
ng-if=
"config.item.key && config.item.lastModifiedB
y"
>
<td
width=
"20%"
title=
"{{config.item.key}}"
>
<td
width=
"20%"
title=
"{{config.item.key}}"
>
<span
ng-bind=
"config.item.key | limitTo: 250"
></span>
<span
ng-bind=
"config.item.key | limitTo: 250"
></span>
<span
ng-bind=
"config.item.key.length > 250 ? '...' :''"
></span>
<span
ng-bind=
"config.item.key.length > 250 ? '...' :''"
></span>
</td>
</td>
<td
width=
"25%"
title=
"{{config.item.value}}"
>
<td
width=
"25%"
title=
"{{config.item.value}}"
>
<span
ng-bind=
"config.item.value | limitTo: 250"
></span>
<span
ng-bind=
"config.item.value | limitTo: 250"
></span>
<span
ng-bind=
"config.item.value.length > 250 ? '...': ''"
></span>
<span
ng-bind=
"config.item.value.length > 250 ? '...': ''"
></span>
</td>
</td>
<td
width=
"20%"
title=
"{{config.item.comment}}"
>
<td
width=
"20%"
title=
"{{config.item.comment}}"
>
<span
ng-bind=
"config.item.comment | limitTo: 250"
></span>
<span
ng-bind=
"config.item.comment | limitTo: 250"
></span>
<span
ng-bind=
"config.item.comment.length > 250 ?'...' : ''"
></span>
<span
ng-bind=
"config.item.comment.length > 250 ?'...' : ''"
></span>
</td>
</td>
<td
width=
"10%"
ng-bind=
"config.item.lastModifiedBy"
>
<td
width=
"10%"
ng-bind=
"config.item.lastModifiedBy"
>
</td>
</td>
<td
width=
"15%"
<td
width=
"15%"
ng-bind=
"config.item.lastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'"
>
ng-bind=
"config.item.lastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'"
>
</td>
</td>
<td
width=
"10%"
>
<td
width=
"10%"
>
<span
class=
"glyphicon glyphicon-eye-open"
aria-hidden=
"true"
<span
class=
"glyphicon glyphicon-eye-open"
aria-hidden=
"true"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"查看"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"查看"
data-toggle=
"modal"
data-target=
"#itemModal"
data-toggle=
"modal"
data-target=
"#itemModal"
ng-click=
"retrieveItem(namespace, config.item, config.oldValue)"
>
ng-click=
"retrieveItem(namespace, config.item, config.oldValue)"
>
</span>
</span>
<span
class=
"glyphicon glyphicon-edit"
aria-hidden=
"true"
<span
class=
"glyphicon glyphicon-edit"
aria-hidden=
"true"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"修改"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"修改"
data-toggle=
"modal"
data-target=
"#itemModal"
data-toggle=
"modal"
data-target=
"#itemModal"
ng-click=
"editItem(namespace, config.item)"
>
ng-click=
"editItem(namespace, config.item)"
>
</span>
</span>
<span
class=
"glyphicon glyphicon-remove"
aria-hidden=
"true"
<span
class=
"glyphicon glyphicon-remove"
aria-hidden=
"true"
data-toggle=
"modal"
data-target=
"#deleteModal"
data-toggle=
"modal"
data-target=
"#deleteModal"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"删除"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"删除"
ng-click=
"preDeleteItem(config.item.id)"
>
ng-click=
"preDeleteItem(config.item.id)"
>
</span>
</span>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
</div>
</div>
<!--历史修改视图-->
<!--历史修改视图-->
<div
class=
"J_historyview history-view"
<div
class=
"J_historyview history-view"
ng-show=
"namespace.viewType == 'history'"
>
ng-show=
"namespace.viewType == 'history'"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-11 col-md-offset-1 list"
style=
""
>
<div
class=
"col-md-11 col-md-offset-1 list"
style=
""
>
<div
class=
"media"
>
<div
class=
"media"
>
<img
src=
"img/history.png"
/>
<img
src=
"img/history.png"
/>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-10"
><h5
class=
"media-heading"
>
2016-02-23
<div
class=
"col-md-10"
><h5
class=
"media-heading"
>
2016-02-23
12:23
12:23
王玉
</h5>
王玉
</h5>
<p>
<p>
修改comment
修改comment
</p></div>
</p></div>
<div
class=
"col-md-2 text-right"
>
<div
class=
"col-md-2 text-right"
>
<button
class=
"btn btn-default"
type=
"submit"
>
查看修改内容
<button
class=
"btn btn-default"
type=
"submit"
>
查看修改内容
</button>
</button>
</div>
</div>
<hr>
</div>
</div>
<div
class=
"media"
>
</div>
<img
src=
"img/history.png"
/>
<hr>
</div>
<div
class=
"row"
>
<div
class=
"media"
>
<div
class=
"col-md-10"
><h5
class=
"media-heading"
>
2016-02-23
<img
src=
"img/history.png"
/>
12:23
王玉
</h5>
<div
class=
"row"
>
<div
class=
"col-md-10"
><h5
class=
"media-heading"
>
2016-02-23
<p>
12:23
修改comment
王玉
</h5>
</p></div>
<div
class=
"col-md-2 text-right"
>
<p>
<button
class=
"btn btn-default"
type=
"submit"
>
查看修改内容
修改comment
</button>
</p></div>
</div>
<div
class=
"col-md-2 text-right"
>
</div>
<button
class=
"btn btn-default"
type=
"submit"
>
查看修改内容
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- commit modify config modal-->
<!-- commit modify config modal-->
<div
class=
"modal fade"
id=
"commitModal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal fade"
id=
"commitModal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header panel-primary"
>
<div
class=
"modal-header panel-primary"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
>
Commit changes
</h4>
<h4
class=
"modal-title"
>
Commit changes
</h4>
</div>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<textarea
rows=
"4"
class=
"form-control"
style=
"width:570px;"
<textarea
rows=
"4"
class=
"form-control"
style=
"width:570px;"
placeholder=
"Add an optional extended description..."
placeholder=
"Add an optional extended description..."
ng-model=
"commitComment"
></textarea>
ng-model=
"commitComment"
></textarea>
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
<button
type=
"button"
class=
"btn btn-primary"
data-dismiss=
"modal"
ng-click=
"commitChange()"
>
ng-click=
"commitChange()"
>
提交
提交
</button>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- delete modal-->
<!-- delete modal-->
<div
class=
"modal fade"
id=
"deleteModal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal fade"
id=
"deleteModal"
tabindex=
"-1"
role=
"dialog"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header panel-primary"
>
<div
class=
"modal-header panel-primary"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
>
删除配置
</h4>
<h4
class=
"modal-title"
>
删除配置
</h4>
</div>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
确定要删除配置吗?
确定要删除配置吗?
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
取消
</button>
<button
type=
"button"
class=
"btn btn-danger"
data-dismiss=
"modal"
<button
type=
"button"
class=
"btn btn-danger"
data-dismiss=
"modal"
ng-click=
"deleteItem()"
>
ng-click=
"deleteItem()"
>
确定
确定
</button>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--create release modal-->
<!--create release modal-->
<form
class=
"modal fade form-horizontal"
id=
"releaseModal"
tabindex=
"-1"
role=
"dialog"
<form
class=
"modal fade form-horizontal"
id=
"releaseModal"
tabindex=
"-1"
role=
"dialog"
ng-submit=
"release()"
>
ng-submit=
"release()"
>
<div
class=
"modal-dialog"
role=
"document"
style=
"width: 960px"
>
<div
class=
"modal-dialog"
role=
"document"
style=
"width: 960px"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header panel-primary"
>
<div
class=
"modal-header panel-primary"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
>
发布
</h4>
<h4
class=
"modal-title"
>
发布
</h4>
</div>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
<label
class=
"col-sm-2 control-label"
>
Changes:
</label>
Changes:
</label>
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<table
class=
"table table-bordered table-striped text-center table-hover"
<table
class=
"table table-bordered table-striped text-center table-hover"
ng-show=
"toReleaseNamespace.itemModifiedCnt"
>
ng-show=
"toReleaseNamespace.itemModifiedCnt"
>
<thead>
<thead>
<tr>
<tr>
<th>
<th>
Key
Key
</th>
</th>
<th>
<th>
Old Value
Old Value
</th>
</th>
<th>
<th>
New Value
New Value
</th>
</th>
<th>
<th>
最后修改人
最后修改人
</th>
</th>
<th>
<th>
最后修改时间
最后修改时间
</th>
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
ng-repeat=
"config in toReleaseNamespace.items"
<tr
ng-repeat=
"config in toReleaseNamespace.items"
ng-if=
"config.item.key && config.isModified"
>
ng-if=
"config.item.key && config.isModified"
>
<td
width=
"20%"
title=
"{{config.item.key}}"
>
<td
width=
"20%"
title=
"{{config.item.key}}"
>
<span
ng-bind=
"config.item.key | limitTo: 250"
></span>
<span
class=
"label label-danger"
<span
ng-bind=
"config.item.key.length > 250 ? '...' :''"
></span>
ng-show=
"!config.newValue"
>
deleted
</span>
</td>
<span
ng-bind=
"config.item.key | limitTo: 250"
></span>
<td
width=
"25%"
title=
"{{config.oldValue}}"
>
<span
ng-bind=
"config.item.key.length > 250 ? '...' :''"
></span>
<span
ng-bind=
"config.oldValue | limitTo: 250"
></span>
</td>
<span
ng-bind=
"config.oldValue.length > 250 ? '...': ''"
></span>
<td
width=
"25%"
title=
"{{config.oldValue}}"
>
</td>
<span
ng-bind=
"config.oldValue | limitTo: 250"
></span>
<td
width=
"25%"
title=
"{{config.item.value}}"
>
<span
ng-bind=
"config.oldValue.length > 250 ? '...': ''"
></span>
<span
ng-bind=
"config.item.value | limitTo: 250"
></span>
</td>
<span
ng-bind=
"config.item.value.length > 250 ? '...': ''"
></span>
<td
width=
"25%"
title=
"{{config.newValue}}"
>
</td>
<span
ng-bind=
"config.newValue | limitTo: 250"
></span>
<td
width=
"15%"
ng-bind=
"config.item.lastModifiedBy"
>
<span
ng-bind=
"config.newValue.length > 250 ? '...': ''"
></span>
</td>
</td>
<td
width=
"15%"
<td
width=
"15%"
ng-bind=
"config.item.lastModifiedBy"
>
ng-bind=
"config.item.lastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'"
>
</td>
</td>
<td
width=
"15%"
</tr>
ng-bind=
"config.item.lastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'"
>
</tbody>
</td>
</table>
</tr>
</tbody>
</table>
<span
ng-show=
"!toReleaseNamespace.itemModifiedCnt"
>
<span
ng-show=
"!toReleaseNamespace.itemModifiedCnt"
>
配置没有变化
配置没有变化
</span>
</span>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
<label
class=
"col-sm-2 control-label"
>
<apollorequiredfiled></apollorequiredfiled>
<apollorequiredfiled></apollorequiredfiled>
Release Name:
</label>
Release Name:
</label>
<div
class=
"col-sm-5"
>
<div
class=
"col-sm-5"
>
<input
type=
"text"
class=
"form-control"
placeholder=
"input release title"
<input
type=
"text"
class=
"form-control"
placeholder=
"input release title"
ng-model=
"releaseTitle"
ng-required=
"true"
>
ng-model=
"releaseTitle"
ng-required=
"true"
>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
Comment:
</label>
<label
class=
"col-sm-2 control-label"
>
Comment:
</label>
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<textarea
rows=
"4"
class=
"form-control"
style=
"margin-top: 15px;"
<textarea
rows=
"4"
class=
"form-control"
style=
"margin-top: 15px;"
ng-model=
"releaseComment"
ng-model=
"releaseComment"
placeholder=
"Add an optional extended description..."
></textarea>
placeholder=
"Add an optional extended description..."
></textarea>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"submit"
class=
"btn btn-primary"
>
发布
</button>
</div>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"submit"
class=
"btn btn-primary"
>
发布
</button>
</div>
</div>
</form>
</div>
</div>
<!--table mode item modal-->
</form>
<form
class=
"modal fade form-horizontal"
id=
"itemModal"
role=
"dialog"
ng-submit=
"doItem()"
>
<div
class=
"modal-dialog"
role=
"document"
>
<!--table mode item modal-->
<div
class=
"modal-content"
>
<form
class=
"modal fade form-horizontal"
id=
"itemModal"
role=
"dialog"
ng-submit=
"doItem()"
>
<div
class=
"modal-header panel-primary"
>
<div
class=
"modal-dialog"
role=
"document"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
<div
class=
"modal-content"
>
aria-hidden=
"true"
>
×
</span></button>
<div
class=
"modal-header panel-primary"
>
<h4
class=
"modal-title"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
<span
ng-show=
"tableViewOperType == 'create'"
>
添加配置项
</span>
aria-hidden=
"true"
>
×
</span></button>
<span
ng-show=
"tableViewOperType == 'retrieve'"
>
查看配置项
</span>
<h4
class=
"modal-title"
>
<span
ng-show=
"tableViewOperType == 'update'"
>
修改配置项
</span>
<span
ng-show=
"tableViewOperType == 'create'"
>
添加配置项
</span>
</h4>
<span
ng-show=
"tableViewOperType == 'retrieve'"
>
查看配置项
</span>
<span
ng-show=
"tableViewOperType == 'update'"
>
修改配置项
</span>
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
<apollorequiredfiled
ng-show=
"tableViewOperType != 'retrieve'"
></apollorequiredfiled>
Key
</label>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"form-control"
ng-model=
"item.key"
ng-required=
"true"
ng-disabled=
"tableViewOperType != 'create'"
>
</div>
</div>
<div
class=
"modal-body"
>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
<label
class=
"col-sm-2 control-label"
>
<apollorequiredfiled
<apollorequiredfiled
ng-show=
"tableViewOperType != 'retrieve'"
></apollorequiredfiled>
ng-show=
"tableViewOperType != 'retrieve'"
></apollorequiredfiled>
Key
Value
</label>
</label>
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"form-control"
ng-model=
"item.key"
ng-required=
"true"
ng-disabled=
"tableViewOperType != 'create'"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
<apollorequiredfiled
ng-show=
"tableViewOperType != 'retrieve'"
></apollorequiredfiled>
Value
</label>
<div
class=
"col-sm-10"
>
<textarea
type=
"text"
class=
"form-control"
rows=
"6"
ng-model=
"item.value"
<textarea
type=
"text"
class=
"form-control"
rows=
"6"
ng-model=
"item.value"
ng-required=
"true"
ng-show=
"tableViewOperType != 'retrieve'"
>
ng-required=
"true"
ng-show=
"tableViewOperType != 'retrieve'"
>
</textarea>
</textarea>
<p
ng-bind=
"item.value"
ng-show=
"tableViewOperType == 'retrieve'"
></p>
<p
ng-bind=
"item.value"
ng-show=
"tableViewOperType == 'retrieve'"
></p>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
ng-show=
"tableViewOperType == 'retrieve'"
>
<div
class=
"form-group"
ng-show=
"tableViewOperType == 'retrieve'"
>
<label
class=
"col-sm-2 control-label"
>
Released Value
</label>
<label
class=
"col-sm-2 control-label"
>
Released Value
</label>
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<p
ng-show=
"!item.oldValue"
>
这是新增的配置
</p>
<p
ng-show=
"!item.oldValue"
>
这是新增的配置
</p>
<p
ng-show=
"item.oldValue"
ng-bind=
"item.oldValue"
></p>
<p
ng-show=
"item.oldValue"
ng-bind=
"item.oldValue"
></p>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
Comment
</label>
<label
class=
"col-sm-2 control-label"
>
Comment
</label>
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<textarea
class=
"form-control"
ng-model=
"item.comment"
rows=
"2"
<textarea
class=
"form-control"
ng-model=
"item.comment"
rows=
"2"
ng-disabled=
"tableViewOperType == 'retrieve'"
>
ng-disabled=
"tableViewOperType == 'retrieve'"
>
</textarea>
</textarea>
</div>
</div>
<div
class=
"form-group"
ng-show=
"tableViewOperType != 'retrieve'"
>
<label
class=
"col-sm-2 control-label"
>
<apollorequiredfiled></apollorequiredfiled>
选择集群
</label>
<div
class=
"col-sm-10"
>
<apolloclusterselector
apollo-app-id=
"pageContext.appId"
apollo-default-all-checked=
"false"
apollo-default-checked-env=
"pageContext.env"
apollo-default-checked-cluster=
"pageContext.clusterName"
apollo-select=
"collectSelectedClusters"
>
</apolloclusterselector>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
</div>
<button
type=
"button"
class=
"btn btn-default"
ng-click=
"switchToEdit()"
<div
class=
"form-group"
ng-show=
"tableViewOperType != 'retrieve'"
>
ng-show=
"tableViewOperType == 'retrieve'"
>
修改
<label
class=
"col-sm-2 control-label"
>
</button>
<apollorequiredfiled></apollorequiredfiled>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
选择集群
</label>
</button>
<div
class=
"col-sm-10"
>
<button
type=
"submit"
class=
"btn btn-primary"
<apolloclusterselector
apollo-app-id=
"pageContext.appId"
ng-show=
"tableViewOperType != 'retrieve'"
>
提交
apollo-default-all-checked=
"false"
</button>
apollo-default-checked-env=
"pageContext.env"
apollo-default-checked-cluster=
"pageContext.clusterName"
apollo-select=
"collectSelectedClusters"
>
</apolloclusterselector>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
ng-click=
"switchToEdit()"
ng-show=
"tableViewOperType == 'retrieve'"
>
修改
</button>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"submit"
class=
"btn btn-primary"
ng-show=
"tableViewOperType != 'retrieve'"
>
提交
</button>
</div>
</div>
</div>
</div>
</
div
>
</
form
>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
apollo-portal/src/main/resources/static/server_config.html
View file @
7e7a7959
...
@@ -83,6 +83,7 @@
...
@@ -83,6 +83,7 @@
<script
type=
"application/javascript"
src=
"scripts/services/AppService.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/services/AppService.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/services/EnvService.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/services/EnvService.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/services/UserService.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/services/ServerConfigService.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/services/ServerConfigService.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/controller/ServerConfigController.js"
></script>
<script
type=
"application/javascript"
src=
"scripts/controller/ServerConfigController.js"
></script>
...
...
apollo-portal/src/main/resources/static/views/common/nav.html
View file @
7e7a7959
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
<div
class=
"collapse navbar-collapse"
id=
"bs-example-navbar-collapse-1"
>
<div
class=
"collapse navbar-collapse"
id=
"bs-example-navbar-collapse-1"
>
<ul
class=
"nav navbar-nav navbar-right"
>
<ul
class=
"nav navbar-nav navbar-right"
>
<li><a
href=
"http://conf.ctripcorp.com/pages/viewpage.action?pageId=98435462"
target=
"_blank"
>
help
</span>
</a></li>
<li
class=
"dropdown"
>
<li
class=
"dropdown"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
role=
"button"
aria-haspopup=
"true"
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
role=
"button"
aria-haspopup=
"true"
aria-expanded=
"false"
>
{{userName}}
<span
class=
"caret"
></span></a>
aria-expanded=
"false"
>
{{userName}}
<span
class=
"caret"
></span></a>
...
...
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