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
278b6cde
Commit
278b6cde
authored
Jul 20, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加图形化灰度发布功能
parent
dc22753a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
+15
-5
No files found.
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
View file @
278b6cde
...
@@ -119,11 +119,11 @@ public class ServiceTopology extends AbstractTopology {
...
@@ -119,11 +119,11 @@ public class ServiceTopology extends AbstractTopology {
TGroup
group
=
TElementManager
.
getSelectedGroup
(
dataBox
);
TGroup
group
=
TElementManager
.
getSelectedGroup
(
dataBox
);
TNode
node
=
TElementManager
.
getSelectedNode
(
dataBox
);
TNode
node
=
TElementManager
.
getSelectedNode
(
dataBox
);
executeGrayRouterMenuItem
.
setVisible
(
node
!=
null
&&
StringUtils
.
isNotEmpty
(
node
.
getClientProperty
(
"plugin"
).
toString
()
));
executeGrayRouterMenuItem
.
setVisible
(
node
!=
null
&&
hasPlugin
(
node
));
TElement
element
=
TElementManager
.
getSelectedElement
(
dataBox
);
TElement
element
=
TElementManager
.
getSelectedElement
(
dataBox
);
executeGrayReleaseMenuItem
.
setVisible
(
element
!=
null
&&
StringUtils
.
isNotEmpty
(
element
.
getClientProperty
(
"plugin"
).
toString
()
));
executeGrayReleaseMenuItem
.
setVisible
(
element
!=
null
&&
hasPlugin
(
element
));
refreshGrayStateMenuItem
.
setVisible
(
element
!=
null
&&
StringUtils
.
isNotEmpty
(
element
.
getClientProperty
(
"plugin"
).
toString
()
));
refreshGrayStateMenuItem
.
setVisible
(
element
!=
null
&&
hasPlugin
(
element
));
if
(
group
!=
null
||
node
!=
null
||
element
!=
null
)
{
if
(
group
!=
null
||
node
!=
null
||
element
!=
null
)
{
return
popupMenu
;
return
popupMenu
;
...
@@ -215,6 +215,16 @@ public class ServiceTopology extends AbstractTopology {
...
@@ -215,6 +215,16 @@ public class ServiceTopology extends AbstractTopology {
TElementManager
.
addGroupChildren
(
dataBox
,
group
);
TElementManager
.
addGroupChildren
(
dataBox
,
group
);
}
}
private
boolean
hasPlugin
(
TElement
element
)
{
String
plugin
=
getPlugin
(
element
);
return
StringUtils
.
isNotEmpty
(
plugin
);
}
private
String
getPlugin
(
TElement
element
)
{
return
element
.
getClientProperty
(
"plugin"
).
toString
();
}
private
Object
[]
filterServices
(
TNode
node
)
{
private
Object
[]
filterServices
(
TNode
node
)
{
Object
[]
services
=
instanceMap
.
keySet
().
toArray
();
Object
[]
services
=
instanceMap
.
keySet
().
toArray
();
List
<
Object
>
filterServices
=
new
ArrayList
<
Object
>();
List
<
Object
>
filterServices
=
new
ArrayList
<
Object
>();
...
@@ -222,7 +232,7 @@ public class ServiceTopology extends AbstractTopology {
...
@@ -222,7 +232,7 @@ public class ServiceTopology extends AbstractTopology {
for
(
Object
service
:
services
)
{
for
(
Object
service
:
services
)
{
TGroup
group
=
getGroup
(
service
.
toString
());
TGroup
group
=
getGroup
(
service
.
toString
());
// node.getParent() != group 表示自己不能路由自己,暂时不禁止
// node.getParent() != group 表示自己不能路由自己,暂时不禁止
if
(
group
!=
null
&&
StringUtils
.
isNotEmpty
(
group
.
getClientProperty
(
"plugin"
).
toString
()
))
{
if
(
group
!=
null
&&
hasPlugin
(
group
))
{
filterServices
.
add
(
service
);
filterServices
.
add
(
service
);
}
}
}
}
...
@@ -249,7 +259,7 @@ public class ServiceTopology extends AbstractTopology {
...
@@ -249,7 +259,7 @@ public class ServiceTopology extends AbstractTopology {
}
}
private
void
updateGroup
(
TGroup
group
)
{
private
void
updateGroup
(
TGroup
group
)
{
String
name
=
getGroupName
(
group
.
getUserObject
().
toString
(),
group
.
childrenSize
(),
g
roup
.
getClientProperty
(
"plugin"
).
toString
(
));
String
name
=
getGroupName
(
group
.
getUserObject
().
toString
(),
group
.
childrenSize
(),
g
etPlugin
(
group
));
group
.
setName
(
name
);
group
.
setName
(
name
);
}
}
...
...
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