Commit d39f55cc by Nepxion

增加图形化灰度发布功能

parent f16621b0
...@@ -90,6 +90,7 @@ public class RouterTopology extends AbstractTopology { ...@@ -90,6 +90,7 @@ public class RouterTopology extends AbstractTopology {
toolBar.add(Box.createHorizontalStrut(5)); toolBar.add(Box.createHorizontalStrut(5));
toolBar.add(comboBox); toolBar.add(comboBox);
toolBar.add(new JClassicButton(createAddServiceAction())); toolBar.add(new JClassicButton(createAddServiceAction()));
toolBar.add(new JClassicButton(createDeleteServiceAction()));
toolBar.add(textField); toolBar.add(textField);
toolBar.add(new JClassicButton(createExecuteRouterAction())); toolBar.add(new JClassicButton(createExecuteRouterAction()));
toolBar.add(new JClassicButton(createClearRouterAction())); toolBar.add(new JClassicButton(createClearRouterAction()));
...@@ -144,6 +145,8 @@ public class RouterTopology extends AbstractTopology { ...@@ -144,6 +145,8 @@ public class RouterTopology extends AbstractTopology {
graph.getLayoutInternalFrame().setLocation(3000, 3000); graph.getLayoutInternalFrame().setLocation(3000, 3000);
// graph.adjustComponentPosition(graph.getLayoutInternalFrame()); // graph.adjustComponentPosition(graph.getLayoutInternalFrame());
RouterTopology.this.setPreferredSize(new Dimension(RouterTopology.this.getPreferredSize().width - 82, 900));
removeHierarchyListener(this); removeHierarchyListener(this);
} }
}); });
...@@ -225,7 +228,26 @@ public class RouterTopology extends AbstractTopology { ...@@ -225,7 +228,26 @@ public class RouterTopology extends AbstractTopology {
} }
private JSecurityAction createAddServiceAction() { private JSecurityAction createAddServiceAction() {
JSecurityAction action = new JSecurityAction(ConsoleIconFactory.getSwingIcon("direction_east.png"), ConsoleLocale.getString("add_service")) { JSecurityAction action = new JSecurityAction(ConsoleIconFactory.getSwingIcon("add.png"), ConsoleLocale.getString("add_service")) {
private static final long serialVersionUID = 1L;
public void execute(ActionEvent e) {
String routerPath = textField.getText();
String serviceId = comboBox.getSelectedItem().toString();
if (StringUtils.isNotEmpty(routerPath)) {
routerPath = routerPath + ";" + serviceId;
} else {
routerPath = serviceId;
}
textField.setText(routerPath);
}
};
return action;
}
private JSecurityAction createDeleteServiceAction() {
JSecurityAction action = new JSecurityAction(ConsoleIconFactory.getSwingIcon("delete.png"), ConsoleLocale.getString("delete_service")) {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public void execute(ActionEvent e) { public void execute(ActionEvent e) {
......
...@@ -505,7 +505,7 @@ public class ServiceTopology extends AbstractTopology { ...@@ -505,7 +505,7 @@ public class ServiceTopology extends AbstractTopology {
if (routerTopology == null) { if (routerTopology == null) {
routerTopology = new RouterTopology(); routerTopology = new RouterTopology();
routerTopology.setPreferredSize(new Dimension(1280, 900)); // routerTopology.setPreferredSize(new Dimension(1280, 900));
} }
Object[] filterServices = filterServices(node); Object[] filterServices = filterServices(node);
......
...@@ -12,6 +12,7 @@ refresh_gray_state=刷新灰度状态 ...@@ -12,6 +12,7 @@ refresh_gray_state=刷新灰度状态
service_list=服务列表 service_list=服务列表
add_service=添加服务 add_service=添加服务
delete_service=添加服务
execute_router=执行路由 execute_router=执行路由
clear_router=清除路由 clear_router=清除路由
router_path_invalid=路由路径不能为空 router_path_invalid=路由路径不能为空
......
...@@ -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
service_list=\u670d\u52a1\u5217\u8868 service_list=\u670d\u52a1\u5217\u8868
add_service=\u6dfb\u52a0\u670d\u52a1 add_service=\u6dfb\u52a0\u670d\u52a1
delete_service=\u6dfb\u52a0\u670d\u52a1
execute_router=\u6267\u884c\u8def\u7531 execute_router=\u6267\u884c\u8def\u7531
clear_router=\u6e05\u9664\u8def\u7531 clear_router=\u6e05\u9664\u8def\u7531
router_path_invalid=\u8def\u7531\u8def\u5f84\u4e0d\u80fd\u4e3a\u7a7a router_path_invalid=\u8def\u7531\u8def\u5f84\u4e0d\u80fd\u4e3a\u7a7a
......
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