diff --git a/masakaridashboard/api/api.py b/masakaridashboard/api/api.py index c000f78..f596bd7 100644 --- a/masakaridashboard/api/api.py +++ b/masakaridashboard/api/api.py @@ -183,6 +183,11 @@ def notification_list(request, filters=None, marker='', paginate=False): return entities, has_more_data, has_prev_data +def get_notification_list(request): + """return notifications list """ + return list(openstack_connection(request).notifications()) + + def get_notification(request, notification_id): """return single notifications""" return openstack_connection(request).get_notification(notification_id) diff --git a/masakaridashboard/notifications/tabs.py b/masakaridashboard/notifications/tabs.py index 37b0d14..99b1f8d 100644 --- a/masakaridashboard/notifications/tabs.py +++ b/masakaridashboard/notifications/tabs.py @@ -75,14 +75,13 @@ class VMoveTab(tabs.TableTab): preload = False def get_vmove_data(self): - vmove_list = [] - notification_type = self.tab_group.kwargs['type'] - if notification_type != "COMPUTE_HOST": - return vmove_list + notification = self.tab_group.kwargs['notification'] + if notification.type != "COMPUTE_HOST": + return [] - notification_id = self.tab_group.kwargs['notification_uuid'] + vmove_list = [] vmove_gen = api.get_vmoves_list( - self.request, notification_id, filters={}) + self.request, notification.notification_uuid, filters={}) for item in vmove_gen: vmove_list.append(item) diff --git a/masakaridashboard/notifications/views.py b/masakaridashboard/notifications/views.py index b6cb4c8..3ff3983 100644 --- a/masakaridashboard/notifications/views.py +++ b/masakaridashboard/notifications/views.py @@ -97,7 +97,11 @@ class DetailView(tabs.TabbedTableView): @memoized.memoized_method def get_data(self): try: - notification_id = self.kwargs['notification_id'] + notification_data = self.kwargs['notification_id'] + if len(notification_data.split(',')) > 1: + notification_id = notification_data.split(',')[0] + else: + notification_id = notification_data notification = api.get_notification(self.request, notification_id) except Exception: msg = _('Unable to get notification "%s".') % notification_id diff --git a/masakaridashboard/vmoves/tables.py b/masakaridashboard/vmoves/tables.py index 473b63c..c1cf718 100644 --- a/masakaridashboard/vmoves/tables.py +++ b/masakaridashboard/vmoves/tables.py @@ -18,7 +18,7 @@ from horizon import tables VMOVE_FILTER_CHOICES = ( - ('notification_id', _("Notification UUId ="), True), + ('notification_uuid', _("Notification UUId ="), True), ('type', _("Type ="), True), ('status', _("Status ="), True), ) @@ -53,7 +53,7 @@ class VMoveTable(tables.DataTable): 'status', verbose_name=_("Status")) def get_object_id(self, datum): - return datum.uuid + ',' + datum.notification_id + return datum.notification_id + ',' + datum.uuid class Meta(object): name = "vmove" diff --git a/masakaridashboard/vmoves/templates/vmoves/_detail_overview.html b/masakaridashboard/vmoves/templates/vmoves/_detail_overview.html index 5a8c3fe..968898f 100644 --- a/masakaridashboard/vmoves/templates/vmoves/_detail_overview.html +++ b/masakaridashboard/vmoves/templates/vmoves/_detail_overview.html @@ -21,5 +21,7 @@