Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢捷峰
discovery
Commits
347fef54
Commit
347fef54
authored
Jul 20, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加图形化灰度发布功能
parent
1a2d2978
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
11 deletions
+60
-11
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/constant/ConsoleConstant.java
+21
-0
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/entity/InstanceEntity.java
+30
-2
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
+9
-9
No files found.
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/constant/ConsoleConstant.java
0 → 100644
View file @
347fef54
package
com
.
nepxion
.
discovery
.
console
.
desktop
.
constant
;
/**
* <p>Title: Nepxion Discovery</p>
* <p>Description: Nepxion Discovery</p>
* <p>Copyright: Copyright (c) 2017-2050</p>
* <p>Company: Nepxion</p>
* @author Haojun Ren
* @version 1.0
*/
public
class
ConsoleConstant
{
public
static
final
String
SPRING_APPLICATION_DISCOVERY_PLUGIN
=
"spring.application.discovery.plugin"
;
public
static
final
String
SPRING_APPLICATION_REGISTER_CONTROL_ENABLED
=
"spring.application.register.control.enabled"
;
public
static
final
String
SPRING_APPLICATION_DISCOVERY_CONTROL_ENABLED
=
"spring.application.discovery.control.enabled"
;
public
static
final
String
SPRING_APPLICATION_CONFIG_REST_CONTROL_ENABLED
=
"spring.application.config.rest.control.enabled"
;
public
static
final
String
FILTER
=
"filter"
;
public
static
final
String
PLUGIN
=
"plugin"
;
public
static
final
String
NO_FILTER_DESCRIPTION
=
"[No filter]"
;
}
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/entity/InstanceEntity.java
View file @
347fef54
...
...
@@ -18,6 +18,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.nepxion.discovery.console.desktop.constant.ConsoleConstant
;
import
com.nepxion.discovery.console.desktop.context.PropertiesContext
;
public
class
InstanceEntity
implements
Serializable
{
...
...
@@ -97,7 +98,7 @@ public class InstanceEntity implements Serializable {
}
public
String
getFilter
()
{
String
filterKey
=
PropertiesContext
.
getProperties
().
getString
(
"filter"
);
String
filterKey
=
PropertiesContext
.
getProperties
().
getString
(
ConsoleConstant
.
FILTER
);
if
(
StringUtils
.
isEmpty
(
filterKey
))
{
return
""
;
}
...
...
@@ -111,7 +112,7 @@ public class InstanceEntity implements Serializable {
}
public
String
getPlugin
()
{
String
plugin
=
metaData
.
get
(
"discovery.plugin"
);
String
plugin
=
metaData
.
get
(
ConsoleConstant
.
SPRING_APPLICATION_DISCOVERY_PLUGIN
);
if
(
plugin
==
null
)
{
return
""
;
}
...
...
@@ -119,6 +120,33 @@ public class InstanceEntity implements Serializable {
return
plugin
;
}
public
boolean
isRegisterControlEnabled
()
{
String
flag
=
metaData
.
get
(
ConsoleConstant
.
SPRING_APPLICATION_REGISTER_CONTROL_ENABLED
);
if
(
flag
==
null
)
{
return
true
;
}
return
Boolean
.
valueOf
(
flag
);
}
public
boolean
isDiscoveryControlEnabled
()
{
String
flag
=
metaData
.
get
(
ConsoleConstant
.
SPRING_APPLICATION_DISCOVERY_CONTROL_ENABLED
);
if
(
flag
==
null
)
{
return
true
;
}
return
Boolean
.
valueOf
(
flag
);
}
public
boolean
isConfigRestControlEnabled
()
{
String
flag
=
metaData
.
get
(
ConsoleConstant
.
SPRING_APPLICATION_CONFIG_REST_CONTROL_ENABLED
);
if
(
flag
==
null
)
{
return
true
;
}
return
Boolean
.
valueOf
(
flag
);
}
@Override
public
int
hashCode
()
{
return
HashCodeBuilder
.
reflectionHashCode
(
this
);
...
...
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
View file @
347fef54
...
...
@@ -44,6 +44,7 @@ import com.nepxion.cots.twaver.element.TGroupType;
import
com.nepxion.cots.twaver.element.TNode
;
import
com.nepxion.cots.twaver.graph.TGraphBackground
;
import
com.nepxion.cots.twaver.graph.TGraphManager
;
import
com.nepxion.discovery.console.desktop.constant.ConsoleConstant
;
import
com.nepxion.discovery.console.desktop.controller.ServiceController
;
import
com.nepxion.discovery.console.desktop.entity.InstanceEntity
;
import
com.nepxion.discovery.console.desktop.entity.ResultEntity
;
...
...
@@ -77,7 +78,6 @@ import com.nepxion.swing.textfield.number.JNumberTextField;
public
class
ServiceTopology
extends
AbstractTopology
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
String
NO_FILTER
=
"[No filter]"
;
private
LocationEntity
groupLocationEntity
=
new
LocationEntity
(
120
,
250
,
280
,
0
);
private
LocationEntity
nodeLocationEntity
=
new
LocationEntity
(
0
,
0
,
120
,
100
);
...
...
@@ -175,19 +175,19 @@ public class ServiceTopology extends AbstractTopology {
}
private
String
getFilter
(
TElement
element
)
{
return
element
.
getClientProperty
(
"filter"
).
toString
();
return
element
.
getClientProperty
(
ConsoleConstant
.
FILTER
).
toString
();
}
private
void
setFilter
(
TElement
element
,
String
filter
)
{
element
.
putClientProperty
(
"filter"
,
filter
);
element
.
putClientProperty
(
ConsoleConstant
.
FILTER
,
filter
);
}
private
String
getPlugin
(
TElement
element
)
{
return
element
.
getClientProperty
(
"plugin"
).
toString
();
return
element
.
getClientProperty
(
ConsoleConstant
.
PLUGIN
).
toString
();
}
private
void
setPlugin
(
TElement
element
,
String
plugin
)
{
element
.
putClientProperty
(
"plugin"
,
plugin
);
element
.
putClientProperty
(
ConsoleConstant
.
PLUGIN
,
plugin
);
}
private
boolean
isPlugin
(
TElement
element
)
{
...
...
@@ -208,7 +208,7 @@ public class ServiceTopology extends AbstractTopology {
String
filter
=
getValidFilter
(
instances
);
String
plugin
=
getValidPlugin
(
instances
);
if
(!
StringUtils
.
equals
(
filterId
,
NO_FILTER
)
&&
!
StringUtils
.
equals
(
filterId
,
filter
))
{
if
(!
StringUtils
.
equals
(
filterId
,
ConsoleConstant
.
NO_FILTER_DESCRIPTION
)
&&
!
StringUtils
.
equals
(
filterId
,
filter
))
{
return
;
}
...
...
@@ -288,7 +288,7 @@ public class ServiceTopology extends AbstractTopology {
if
(
filters
.
contains
(
""
))
{
filters
.
remove
(
""
);
}
filters
.
add
(
NO_FILTER
);
filters
.
add
(
ConsoleConstant
.
NO_FILTER_DESCRIPTION
);
return
filters
.
toArray
();
}
...
...
@@ -497,7 +497,7 @@ public class ServiceTopology extends AbstractTopology {
globalFilter
=
filterPanel
.
getFilter
();
String
title
=
ConsoleLocale
.
getString
(
"title_service_cluster_gray_release"
);
if
(!
StringUtils
.
equals
(
globalFilter
,
NO_FILTER
))
{
if
(!
StringUtils
.
equals
(
globalFilter
,
ConsoleConstant
.
NO_FILTER_DESCRIPTION
))
{
title
+=
" ["
+
globalFilter
+
"]"
;
}
background
.
setTitle
(
title
);
...
...
@@ -654,7 +654,7 @@ public class ServiceTopology extends AbstractTopology {
setLayout
(
new
FiledLayout
(
FiledLayout
.
COLUMN
,
FiledLayout
.
FULL
,
5
));
add
(
filterComboBox
);
add
(
new
JLabel
(
NO_FILTER
+
" - "
+
ConsoleLocale
.
getString
(
"no_service_cluster_filter"
)));
add
(
new
JLabel
(
ConsoleConstant
.
NO_FILTER_DESCRIPTION
+
" - "
+
ConsoleLocale
.
getString
(
"no_service_cluster_filter"
)));
}
@SuppressWarnings
(
"unchecked"
)
...
...
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