예제 #1
0
 def export_success(result):
     if result["success"]:
         socketio.emit("doFlash", {"alert_type": "alert-success", "message": "Data successfully exported"},
                       namespace='/main', room=data_dict["main_id"])
     user_obj = load_user(data_dict["user_id"])
     collection_manager.update_selector_list(user_obj=user_obj)
     return
예제 #2
0
 def build_resource_array(self):
     larray = [["Name", "Image", "Owner", "Status", "Id"]]
     all_containers = cli.containers(all=True)
     for cont in all_containers:
         if cont["Id"] in container_owners:
             owner_id = container_owners[cont["Id"]]
             if owner_id == "host":
                 owner_name = "host"
             else:
                 owner_name = load_user(owner_id).username
         else:
             owner_name = "system"
         larray.append([cont["Names"][0], cont["Image"], owner_name, cont["Status"], cont["Id"]])
     return larray