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
1a0b0ca1
Commit
1a0b0ca1
authored
Jul 18, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加图形化灰度发布功能
parent
0a61648a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
7 deletions
+45
-7
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
+45
-7
No files found.
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
View file @
1a0b0ca1
...
...
@@ -28,7 +28,6 @@ import javax.swing.BorderFactory;
import
javax.swing.Box
;
import
javax.swing.BoxLayout
;
import
javax.swing.JPanel
;
import
javax.swing.JPopupMenu
;
import
javax.swing.JToolBar
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -114,7 +113,6 @@ public class ServiceTopology extends AbstractTopology {
popupMenu
.
add
(
executeGrayReleaseMenuItem
,
0
);
popupMenu
.
add
(
executeGrayRouterMenuItem
,
1
);
popupMenu
.
add
(
refreshGrayStateMenuItem
,
2
);
popupMenu
.
add
(
new
JPopupMenu
.
Separator
(),
3
);
}
@Override
...
...
@@ -124,11 +122,11 @@ public class ServiceTopology extends AbstractTopology {
TNode
node
=
TElementManager
.
getSelectedNode
(
dataBox
);
pinSelectedNodeMenuItem
.
setVisible
(
node
!=
null
);
executeGrayRouterMenuItem
.
setVisible
(
node
!=
null
);
executeGrayRouterMenuItem
.
setVisible
(
node
!=
null
&&
StringUtils
.
isNotEmpty
(
node
.
getClientProperty
(
"plugin"
).
toString
())
);
TElement
element
=
TElementManager
.
getSelectedElement
(
dataBox
);
executeGrayReleaseMenuItem
.
setVisible
(
element
!=
null
);
refreshGrayStateMenuItem
.
setVisible
(
element
!=
null
);
executeGrayReleaseMenuItem
.
setVisible
(
element
!=
null
&&
StringUtils
.
isNotEmpty
(
element
.
getClientProperty
(
"plugin"
).
toString
())
);
refreshGrayStateMenuItem
.
setVisible
(
element
!=
null
&&
StringUtils
.
isNotEmpty
(
element
.
getClientProperty
(
"plugin"
).
toString
())
);
if
(
group
!=
null
||
node
!=
null
||
element
!=
null
)
{
return
popupMenu
;
...
...
@@ -199,11 +197,11 @@ public class ServiceTopology extends AbstractTopology {
TNode
node
=
null
;
if
(
StringUtils
.
isNotEmpty
(
plugin
))
{
node
=
createNode
(
nodeName
,
serviceNodeEntity
,
i
,
nodeStartX
,
nodeStartY
,
nodeHorizontalGap
,
nodeVerticalGap
);
node
.
putClientProperty
(
"plugin"
,
plugin
);
group
.
putClientProperty
(
"plugin"
,
plugin
);
}
else
{
node
=
createNode
(
nodeName
,
notServiceNodeEntity
,
i
,
nodeStartX
,
nodeStartY
,
nodeHorizontalGap
,
nodeVerticalGap
);
node
.
putClientProperty
(
"plugin"
,
""
);
group
.
putClientProperty
(
"plugin"
,
""
);
}
node
.
setUserObject
(
instance
);
...
...
@@ -404,6 +402,22 @@ public class ServiceTopology extends AbstractTopology {
return
;
}
if
(
group
!=
null
)
{
if
(
StringUtils
.
isEmpty
(
group
.
getClientProperty
(
"plugin"
).
toString
()))
{
JBasicOptionPane
.
showMessageDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
"该服务集群不能执行灰度发布"
,
SwingLocale
.
getString
(
"warning"
),
JBasicOptionPane
.
WARNING_MESSAGE
);
return
;
}
}
if
(
node
!=
null
)
{
if
(
StringUtils
.
isEmpty
(
node
.
getClientProperty
(
"plugin"
).
toString
()))
{
JBasicOptionPane
.
showMessageDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
"该服务不能执行灰度发布"
,
SwingLocale
.
getString
(
"warning"
),
JBasicOptionPane
.
WARNING_MESSAGE
);
return
;
}
}
boolean
hasException
=
false
;
if
(
group
!=
null
)
{
hasException
=
refreshGrayState
(
group
);
...
...
@@ -445,6 +459,14 @@ public class ServiceTopology extends AbstractTopology {
return
;
}
if
(
node
!=
null
)
{
if
(
StringUtils
.
isEmpty
(
node
.
getClientProperty
(
"plugin"
).
toString
()))
{
JBasicOptionPane
.
showMessageDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
"该服务不能执行执行灰度路由"
,
SwingLocale
.
getString
(
"warning"
),
JBasicOptionPane
.
WARNING_MESSAGE
);
return
;
}
}
InstanceEntity
instance
=
(
InstanceEntity
)
node
.
getUserObject
();
if
(
routerTopology
==
null
)
{
...
...
@@ -476,6 +498,22 @@ public class ServiceTopology extends AbstractTopology {
}
if
(
group
!=
null
)
{
if
(
StringUtils
.
isEmpty
(
group
.
getClientProperty
(
"plugin"
).
toString
()))
{
JBasicOptionPane
.
showMessageDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
"该服务集群不能刷新灰度状态"
,
SwingLocale
.
getString
(
"warning"
),
JBasicOptionPane
.
WARNING_MESSAGE
);
return
;
}
}
if
(
node
!=
null
)
{
if
(
StringUtils
.
isEmpty
(
node
.
getClientProperty
(
"plugin"
).
toString
()))
{
JBasicOptionPane
.
showMessageDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
"该服务不能刷新灰度状态"
,
SwingLocale
.
getString
(
"warning"
),
JBasicOptionPane
.
WARNING_MESSAGE
);
return
;
}
}
if
(
group
!=
null
)
{
refreshGrayState
(
group
);
}
else
if
(
node
!=
null
)
{
refreshGrayState
(
node
);
...
...
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