diff --git a/mogan_ui/content/servers/tables.py b/mogan_ui/content/servers/tables.py index b6641e8..37d63f5 100644 --- a/mogan_ui/content/servers/tables.py +++ b/mogan_ui/content/servers/tables.py @@ -54,6 +54,17 @@ STATUS_DISPLAY_CHOICES = ( u"Maintenance")), ) +SERVER_FILTER_CHOICES = ( + ('name', _("Server Name"), True), + ('status', _("Status ="), True), + ('availability_zone', _("Availability Zone"), True), +) + + +class ServersFilterAction(tables.FilterAction): + filter_type = "server" + filter_choices = SERVER_FILTER_CHOICES + class ServersTable(tables.DataTable): STATUS_CHOICES = ( @@ -95,3 +106,4 @@ class ServersTable(tables.DataTable): verbose_name = _("Servers") status_columns = ["status"] row_class = UpdateRow + table_actions = (ServersFilterAction,)