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
94b9ba8f
Commit
94b9ba8f
authored
Jul 20, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加图形化灰度发布功能
parent
0ac19dbe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
9 deletions
+32
-9
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
+30
-9
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale.properties
+1
-0
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale_zh_CN.properties
+1
-0
No files found.
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
View file @
94b9ba8f
...
@@ -91,7 +91,7 @@ public class ServiceTopology extends AbstractTopology {
...
@@ -91,7 +91,7 @@ public class ServiceTopology extends AbstractTopology {
private
JBasicMenuItem
refreshGrayStateMenuItem
;
private
JBasicMenuItem
refreshGrayStateMenuItem
;
private
JBasicMenuItem
executeGrayRouterMenuItem
;
private
JBasicMenuItem
executeGrayRouterMenuItem
;
private
TGraphBackground
background
;
private
TGraphBackground
background
;
private
JBasicComboBox
filterComboBox
;
private
FilterPanel
filterPanel
;
private
GrayPanel
grayPanel
;
private
GrayPanel
grayPanel
;
private
JBasicTextArea
resultTextArea
;
private
JBasicTextArea
resultTextArea
;
private
RouterTopology
routerTopology
;
private
RouterTopology
routerTopology
;
...
@@ -471,7 +471,6 @@ public class ServiceTopology extends AbstractTopology {
...
@@ -471,7 +471,6 @@ public class ServiceTopology extends AbstractTopology {
JSecurityAction
action
=
new
JSecurityAction
(
ConsoleLocale
.
getString
(
"show_topology"
),
ConsoleIconFactory
.
getSwingIcon
(
"component/ui_16.png"
),
ConsoleLocale
.
getString
(
"show_topology"
))
{
JSecurityAction
action
=
new
JSecurityAction
(
ConsoleLocale
.
getString
(
"show_topology"
),
ConsoleIconFactory
.
getSwingIcon
(
"component/ui_16.png"
),
ConsoleLocale
.
getString
(
"show_topology"
))
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@SuppressWarnings
(
"unchecked"
)
public
void
execute
(
ActionEvent
e
)
{
public
void
execute
(
ActionEvent
e
)
{
Map
<
String
,
List
<
InstanceEntity
>>
instanceMap
=
null
;
Map
<
String
,
List
<
InstanceEntity
>>
instanceMap
=
null
;
try
{
try
{
...
@@ -483,20 +482,19 @@ public class ServiceTopology extends AbstractTopology {
...
@@ -483,20 +482,19 @@ public class ServiceTopology extends AbstractTopology {
}
}
Object
[]
filters
=
filter
(
instanceMap
);
Object
[]
filters
=
filter
(
instanceMap
);
if
(
filter
ComboBox
==
null
)
{
if
(
filter
Panel
==
null
)
{
filter
ComboBox
=
new
JBasicComboBox
();
filter
Panel
=
new
FilterPanel
();
filter
ComboBox
.
setPreferredSize
(
new
Dimension
(
300
,
filterComboBox
.
getPreferredSize
().
height
));
filter
Panel
.
setPreferredSize
(
new
Dimension
(
320
,
60
));
}
}
filterPanel
.
setFilters
(
filters
);
filterComboBox
.
setModel
(
new
DefaultComboBoxModel
<>(
filters
));
int
selectedValue
=
JBasicOptionPane
.
showOptionDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
filterPanel
,
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
);
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
)
{
if
(
selectedValue
!=
0
)
{
return
;
return
;
}
}
globalInstanceMap
=
instanceMap
;
globalInstanceMap
=
instanceMap
;
globalFilter
=
filter
ComboBox
.
getSelectedItem
().
toString
();
globalFilter
=
filter
Panel
.
getFilter
();
String
title
=
ConsoleLocale
.
getString
(
"title_service_cluster_gray_release"
);
String
title
=
ConsoleLocale
.
getString
(
"title_service_cluster_gray_release"
);
if
(!
StringUtils
.
equals
(
globalFilter
,
NO_FILTER
))
{
if
(!
StringUtils
.
equals
(
globalFilter
,
NO_FILTER
))
{
...
@@ -646,6 +644,29 @@ public class ServiceTopology extends AbstractTopology {
...
@@ -646,6 +644,29 @@ public class ServiceTopology extends AbstractTopology {
return
action
;
return
action
;
}
}
private
class
FilterPanel
extends
JPanel
{
private
static
final
long
serialVersionUID
=
1L
;
private
JBasicComboBox
filterComboBox
;
public
FilterPanel
()
{
filterComboBox
=
new
JBasicComboBox
();
setLayout
(
new
FiledLayout
(
FiledLayout
.
COLUMN
,
FiledLayout
.
FULL
,
5
));
add
(
filterComboBox
);
add
(
new
JLabel
(
NO_FILTER
+
" - "
+
ConsoleLocale
.
getString
(
"no_service_cluster_filter"
)));
}
@SuppressWarnings
(
"unchecked"
)
public
void
setFilters
(
Object
[]
filters
)
{
filterComboBox
.
setModel
(
new
DefaultComboBoxModel
<>(
filters
));
}
public
String
getFilter
()
{
return
filterComboBox
.
getSelectedItem
().
toString
();
}
}
private
class
GrayPanel
extends
JPanel
{
private
class
GrayPanel
extends
JPanel
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale.properties
View file @
94b9ba8f
...
@@ -12,6 +12,7 @@ refresh_gray_state=刷新灰度状态
...
@@ -12,6 +12,7 @@ refresh_gray_state=刷新灰度状态
title_service_cluster_gray_release
=
服务集群灰度发布
title_service_cluster_gray_release
=
服务集群灰度发布
service_cluster_filter
=
服务集群过滤
service_cluster_filter
=
服务集群过滤
no_service_cluster_filter
=
表示不过滤,执行跨服务集群灰度发布
title_service_gray_router
=
服务灰度路由
title_service_gray_router
=
服务灰度路由
service_list
=
服务列表
service_list
=
服务列表
...
...
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale_zh_CN.properties
View file @
94b9ba8f
...
@@ -12,6 +12,7 @@ refresh_gray_state=\u5237\u65b0\u7070\u5ea6\u72b6\u6001
...
@@ -12,6 +12,7 @@ refresh_gray_state=\u5237\u65b0\u7070\u5ea6\u72b6\u6001
title_service_cluster_gray_release
=
\u
670d
\u
52a1
\u
96c6
\u
7fa4
\u7070\u
5ea6
\u
53d1
\u
5e03
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_cluster_filter
=
\u
670d
\u
52a1
\u
96c6
\u
7fa4
\u
8fc7
\u
6ee4
no_service_cluster_filter
=
\u8868\u
793a
\u
4e0d
\u
8fc7
\u
6ee4
\u
ff0c
\u6267\u
884c
\u
8de8
\u
670d
\u
52a1
\u
96c6
\u
7fa4
\u7070\u
5ea6
\u
53d1
\u
5e03
title_service_gray_router
=
\u
670d
\u
52a1
\u7070\u
5ea6
\u
8def
\u7531
title_service_gray_router
=
\u
670d
\u
52a1
\u7070\u
5ea6
\u
8def
\u7531
service_list
=
\u
670d
\u
52a1
\u5217\u8868
service_list
=
\u
670d
\u
52a1
\u5217\u8868
...
...
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