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
1c6575c4
Commit
1c6575c4
authored
Jul 20, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加图形化灰度发布功能
parent
7ee6cac6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
6 deletions
+21
-6
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
+17
-6
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale.properties
+2
-0
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale_zh_CN.properties
+2
-0
No files found.
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
View file @
1c6575c4
...
...
@@ -42,6 +42,7 @@ import com.nepxion.cots.twaver.element.TElementManager;
import
com.nepxion.cots.twaver.element.TGroup
;
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.controller.ServiceController
;
import
com.nepxion.discovery.console.desktop.entity.InstanceEntity
;
...
...
@@ -79,22 +80,24 @@ public class ServiceTopology extends AbstractTopology {
private
static
final
String
NO_FILTER
=
"[No filter]"
;
private
LocationEntity
groupLocationEntity
=
new
LocationEntity
(
120
,
2
0
0
,
280
,
0
);
private
LocationEntity
groupLocationEntity
=
new
LocationEntity
(
120
,
2
5
0
,
280
,
0
);
private
LocationEntity
nodeLocationEntity
=
new
LocationEntity
(
0
,
0
,
120
,
100
);
private
TopologyEntity
serviceGroupEntity
=
new
TopologyEntity
(
TopologyEntityType
.
SERVICE
,
true
,
true
);
private
TopologyEntity
notServiceGroupEntity
=
new
TopologyEntity
(
TopologyEntityType
.
MQ
,
true
,
true
);
private
TopologyEntity
serviceNodeEntity
=
new
TopologyEntity
(
TopologyEntityType
.
SERVICE
,
true
,
false
);
private
TopologyEntity
notServiceNodeEntity
=
new
TopologyEntity
(
TopologyEntityType
.
MQ
,
true
,
false
);
private
Map
<
String
,
List
<
InstanceEntity
>>
globalInstanceMap
;
private
String
globalFilter
;
private
Map
<
String
,
Point
>
groupLocationMap
=
new
HashMap
<
String
,
Point
>();
private
JBasicMenuItem
executeGrayReleaseMenuItem
;
private
JBasicMenuItem
refreshGrayStateMenuItem
;
private
JBasicMenuItem
executeGrayRouterMenuItem
;
private
Map
<
String
,
List
<
InstanceEntity
>>
globalInstanceMap
;
private
String
globalFilter
;
private
TGraphBackground
background
;
private
JBasicComboBox
filterComboBox
;
private
GrayPanel
grayPanel
;
private
JBasicTextArea
resultTextArea
;
...
...
@@ -154,6 +157,8 @@ public class ServiceTopology extends AbstractTopology {
}
private
void
initializeTopology
()
{
background
=
graph
.
getGraphBackground
();
background
.
setTitle
(
ConsoleLocale
.
getString
(
"title_service_cluster_gray_release"
));
graph
.
setBlinkingRule
(
new
BlinkingRule
()
{
public
boolean
isBodyBlinking
(
Element
element
)
{
return
element
.
getAlarmState
().
getHighestNativeAlarmSeverity
()
!=
null
||
element
.
getClientProperty
(
TWaverConst
.
PROPERTYNAME_RENDER_COLOR
)
!=
null
;
...
...
@@ -194,7 +199,7 @@ public class ServiceTopology extends AbstractTopology {
int
count
=
groupLocationMap
.
size
();
String
groupName
=
getGroupName
(
serviceId
,
instances
.
size
(),
filter
);
TGroup
group
=
createGroup
(
groupName
,
s
erviceGroupEntity
,
groupLocationEntity
,
count
);
TGroup
group
=
createGroup
(
groupName
,
StringUtils
.
isNotEmpty
(
plugin
)
?
serviceGroupEntity
:
notS
erviceGroupEntity
,
groupLocationEntity
,
count
);
group
.
setGroupType
(
TGroupType
.
ELLIPSE_GROUP_TYPE
.
getType
());
group
.
setUserObject
(
serviceId
);
setFilter
(
group
,
filter
);
...
...
@@ -466,7 +471,7 @@ public class ServiceTopology extends AbstractTopology {
filterComboBox
.
setModel
(
new
DefaultComboBoxModel
<>(
filters
));
int
selectedValue
=
JBasicOptionPane
.
showOptionDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
filterComboBox
,
"服务集群过滤"
,
JBasicOptionPane
.
DEFAULT_OPTION
,
JBasicOptionPane
.
PLAIN_MESSAGE
,
ConsoleIconFactory
.
getSwingIcon
(
"banner/query.png"
),
new
Object
[]
{
SwingLocale
.
getString
(
"yes"
),
SwingLocale
.
getString
(
"no"
)
},
null
,
true
);
int
selectedValue
=
JBasicOptionPane
.
showOptionDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
filterComboBox
,
ConsoleLocale
.
getString
(
"service_cluster_filter"
)
,
JBasicOptionPane
.
DEFAULT_OPTION
,
JBasicOptionPane
.
PLAIN_MESSAGE
,
ConsoleIconFactory
.
getSwingIcon
(
"banner/query.png"
),
new
Object
[]
{
SwingLocale
.
getString
(
"yes"
),
SwingLocale
.
getString
(
"no"
)
},
null
,
true
);
if
(
selectedValue
!=
0
)
{
return
;
}
...
...
@@ -474,6 +479,12 @@ public class ServiceTopology extends AbstractTopology {
globalInstanceMap
=
instanceMap
;
globalFilter
=
filterComboBox
.
getSelectedItem
().
toString
();
String
title
=
ConsoleLocale
.
getString
(
"title_service_cluster_gray_release"
);
if
(!
StringUtils
.
equals
(
globalFilter
,
NO_FILTER
))
{
title
+=
" ["
+
globalFilter
+
"]"
;
}
background
.
setTitle
(
title
);
showTopology
();
}
};
...
...
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale.properties
View file @
1c6575c4
...
...
@@ -10,6 +10,8 @@ execute_gray_release=执行灰度发布
execute_gray_router
=
执行灰度路由
refresh_gray_state
=
刷新灰度状态
title_service_cluster_gray_release
=
服务集群灰度发布
service_cluster_filter
=
服务集群过滤
service_list
=
服务列表
add_service
=
添加一个服务
delete_service
=
删除一个服务
...
...
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale_zh_CN.properties
View file @
1c6575c4
...
...
@@ -10,6 +10,8 @@ execute_gray_release=\u6267\u884c\u7070\u5ea6\u53d1\u5e03
execute_gray_router
=
\u6267\u
884c
\u7070\u
5ea6
\u
8def
\u7531
refresh_gray_state
=
\u5237\u
65b0
\u7070\u
5ea6
\u
72b6
\u6001
title_service_cluster_gray_release
=
\u
670d
\u
52a1
\u
96c6
\u
7fa4
\u7070\u
5ea6
\u
53d1
\u
5e03
service_cluster_filter
=
\u
670d
\u
52a1
\u
96c6
\u
7fa4
\u
8fc7
\u
6ee4
service_list
=
\u
670d
\u
52a1
\u5217\u8868
add_service
=
\u
6dfb
\u
52a0
\u
4e00
\u
4e2a
\u
670d
\u
52a1
delete_service
=
\u5220\u9664\u
4e00
\u
4e2a
\u
670d
\u
52a1
...
...
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