Commit 31672cea by Nepxion

增加图形化灰度发布功能

parent a0a1bac3
...@@ -32,6 +32,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -32,6 +32,7 @@ import org.apache.commons.lang3.StringUtils;
import com.nepxion.cots.twaver.element.TElementManager; import com.nepxion.cots.twaver.element.TElementManager;
import com.nepxion.cots.twaver.element.TLink; import com.nepxion.cots.twaver.element.TLink;
import com.nepxion.cots.twaver.element.TNode; import com.nepxion.cots.twaver.element.TNode;
import com.nepxion.cots.twaver.graph.TGraphBackground;
import com.nepxion.cots.twaver.graph.TGraphControlBar; import com.nepxion.cots.twaver.graph.TGraphControlBar;
import com.nepxion.cots.twaver.graph.TGraphManager; import com.nepxion.cots.twaver.graph.TGraphManager;
import com.nepxion.cots.twaver.graph.TLayoutPanel; import com.nepxion.cots.twaver.graph.TLayoutPanel;
...@@ -61,13 +62,12 @@ import com.nepxion.swing.textfield.JBasicTextField; ...@@ -61,13 +62,12 @@ import com.nepxion.swing.textfield.JBasicTextField;
public class RouterTopology extends AbstractTopology { public class RouterTopology extends AbstractTopology {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private LocationEntity nodeLocationEntity = new LocationEntity(100, 150, 200, 0); private LocationEntity nodeLocationEntity = new LocationEntity(100, 200, 200, 0);
private TopologyEntity serviceNodeEntity = new TopologyEntity(TopologyEntityType.SERVICE, true, true); private TopologyEntity serviceNodeEntity = new TopologyEntity(TopologyEntityType.SERVICE, true, true);
private TGraphBackground background;
private JBasicTextField textField = new JBasicTextField(); private JBasicTextField textField = new JBasicTextField();
private JBasicComboBox comboBox = new JBasicComboBox(); private JBasicComboBox comboBox = new JBasicComboBox();
private ActionListener layoutActionListener; private ActionListener layoutActionListener;
private InstanceEntity instance; private InstanceEntity instance;
...@@ -98,6 +98,8 @@ public class RouterTopology extends AbstractTopology { ...@@ -98,6 +98,8 @@ public class RouterTopology extends AbstractTopology {
} }
private void initializeTopology() { private void initializeTopology() {
background = graph.getGraphBackground();
background.setTitle(ConsoleLocale.getString("title_service_gray_router"));
graph.setElementStateOutlineColorGenerator(new Generator() { graph.setElementStateOutlineColorGenerator(new Generator() {
public Object generate(Object object) { public Object generate(Object object) {
return null; return null;
......
...@@ -77,26 +77,19 @@ import com.nepxion.swing.textfield.number.JNumberTextField; ...@@ -77,26 +77,19 @@ import com.nepxion.swing.textfield.number.JNumberTextField;
public class ServiceTopology extends AbstractTopology { public class ServiceTopology extends AbstractTopology {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final String NO_FILTER = "[No filter]"; private static final String NO_FILTER = "[No filter]";
private LocationEntity groupLocationEntity = new LocationEntity(120, 250, 280, 0); private LocationEntity groupLocationEntity = new LocationEntity(120, 250, 280, 0);
private LocationEntity nodeLocationEntity = new LocationEntity(0, 0, 120, 100); private LocationEntity nodeLocationEntity = new LocationEntity(0, 0, 120, 100);
private TopologyEntity serviceGroupEntity = new TopologyEntity(TopologyEntityType.SERVICE, true, true); private TopologyEntity serviceGroupEntity = new TopologyEntity(TopologyEntityType.SERVICE, true, true);
private TopologyEntity notServiceGroupEntity = new TopologyEntity(TopologyEntityType.MQ, true, true); private TopologyEntity notServiceGroupEntity = new TopologyEntity(TopologyEntityType.MQ, true, true);
private TopologyEntity serviceNodeEntity = new TopologyEntity(TopologyEntityType.SERVICE, true, false); private TopologyEntity serviceNodeEntity = new TopologyEntity(TopologyEntityType.SERVICE, true, false);
private TopologyEntity notServiceNodeEntity = new TopologyEntity(TopologyEntityType.MQ, 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 Map<String, Point> groupLocationMap = new HashMap<String, Point>();
private JBasicMenuItem executeGrayReleaseMenuItem; private JBasicMenuItem executeGrayReleaseMenuItem;
private JBasicMenuItem refreshGrayStateMenuItem; private JBasicMenuItem refreshGrayStateMenuItem;
private JBasicMenuItem executeGrayRouterMenuItem; private JBasicMenuItem executeGrayRouterMenuItem;
private TGraphBackground background; private TGraphBackground background;
private JBasicComboBox filterComboBox; private JBasicComboBox filterComboBox;
private GrayPanel grayPanel; private GrayPanel grayPanel;
...@@ -104,6 +97,9 @@ public class ServiceTopology extends AbstractTopology { ...@@ -104,6 +97,9 @@ public class ServiceTopology extends AbstractTopology {
private RouterTopology routerTopology; private RouterTopology routerTopology;
private LayoutDialog layoutDialog; private LayoutDialog layoutDialog;
private Map<String, List<InstanceEntity>> globalInstanceMap;
private String globalFilter;
public ServiceTopology() { public ServiceTopology() {
initializeToolBar(); initializeToolBar();
initializeTopology(); initializeTopology();
...@@ -281,8 +277,8 @@ public class ServiceTopology extends AbstractTopology { ...@@ -281,8 +277,8 @@ public class ServiceTopology extends AbstractTopology {
for (String service : services) { for (String service : services) {
TGroup group = getGroup(service); TGroup group = getGroup(service);
// node.getParent() != group 表示自己不能路由自己,暂时不禁止 // node.getParent() != group 表示自己不能路由自己
if (group != null && isPlugin(group)) { if (group != null && isPlugin(group) && node.getParent() != group) {
filterServices.add(service); filterServices.add(service);
} }
} }
......
...@@ -12,6 +12,8 @@ refresh_gray_state=刷新灰度状态 ...@@ -12,6 +12,8 @@ refresh_gray_state=刷新灰度状态
title_service_cluster_gray_release=服务集群灰度发布 title_service_cluster_gray_release=服务集群灰度发布
service_cluster_filter=服务集群过滤 service_cluster_filter=服务集群过滤
title_service_gray_router=服务灰度路由
service_list=服务列表 service_list=服务列表
add_service=添加一个服务 add_service=添加一个服务
delete_service=删除一个服务 delete_service=删除一个服务
......
...@@ -12,6 +12,8 @@ refresh_gray_state=\u5237\u65b0\u7070\u5ea6\u72b6\u6001 ...@@ -12,6 +12,8 @@ refresh_gray_state=\u5237\u65b0\u7070\u5ea6\u72b6\u6001
title_service_cluster_gray_release=\u670d\u52a1\u96c6\u7fa4\u7070\u5ea6\u53d1\u5e03 title_service_cluster_gray_release=\u670d\u52a1\u96c6\u7fa4\u7070\u5ea6\u53d1\u5e03
service_cluster_filter=\u670d\u52a1\u96c6\u7fa4\u8fc7\u6ee4 service_cluster_filter=\u670d\u52a1\u96c6\u7fa4\u8fc7\u6ee4
title_service_gray_router=\u670d\u52a1\u7070\u5ea6\u8def\u7531
service_list=\u670d\u52a1\u5217\u8868 service_list=\u670d\u52a1\u5217\u8868
add_service=\u6dfb\u52a0\u4e00\u4e2a\u670d\u52a1 add_service=\u6dfb\u52a0\u4e00\u4e2a\u670d\u52a1
delete_service=\u5220\u9664\u4e00\u4e2a\u670d\u52a1 delete_service=\u5220\u9664\u4e00\u4e2a\u670d\u52a1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment