Beispiel #1
0
 def get(self, *args, **kwargs):
     node_ip = self.get_argument('node_ip', None)
     get_all_node = self.get_argument('get_all_node', None)
     if node_ip is None and get_all_node is None:
         self.write("Something Wrong")
         return
     elif get_all_node:
         """
         直接点击Director中的Container查看所有容器管理时
         """
         node_list = NodeInfo.get_all_node(
         )  # ((127.0.0.1, ), (192.168.180.128, ))
         myswarm = Myswarm()
         con_data_list = list()
         ip_list = list()
         for ip in node_list:
             node_ip = ip[0]
             ip_list.append(node_ip)
             node_port = NodeInfo.get_node_port(node_ip)[0][0]
             con_data_list.append(
                 [ip[0], myswarm.container_list(node_ip, node_port)])
         self.render('node/cont_list.html',
                     con_data=con_data_list,
                     node_ip=ip_list)
     else:
         node_port = NodeInfo.get_node_port(node_ip)[0][0]
         myswarm = Myswarm()
         con_data = myswarm.container_list(node_ip, node_port)
         self.render('node/node_add.html',
                     con_data=con_data,
                     node_ip=node_ip)
Beispiel #2
0
 def get(self, *args, **kwargs):
     node_ip = self.get_argument('node_ip', None)
     print(node_ip)
     if node_ip is None:
         self.write("Something Wrong")
         return
     else:
         node_port = NodeInfo.get_node_port(node_ip)[0][0]
         myswarm = Myswarm()
         con_data = myswarm.container_list(node_ip, node_port)
         self.render('node/rightnode.html',
                     con_data=con_data,
                     node_ip=node_ip)