Stack resources table improvement
In spite of the fact that status of stack resource is "Create complete", the row color remains yellow instead of grey. This patch set keeps the column for detailed states and adds a new hidden column for correct states displaying. Closes-Bug: #1385244 Change-Id: I2a9e5a6f456378dcd1f96d96f69fdba1527e4f25
This commit is contained in:
parent
c158c56e7a
commit
6934660945
|
@ -336,9 +336,13 @@ class ResourcesUpdateRow(tables.Row):
|
|||
|
||||
|
||||
class ResourcesTable(tables.DataTable):
|
||||
class StatusColumn(tables.Column):
|
||||
def get_raw_data(self, datum):
|
||||
return datum.resource_status.partition("_")[2]
|
||||
|
||||
STATUS_CHOICES = (
|
||||
("Create Complete", True),
|
||||
("Create Failed", False),
|
||||
("Complete", True),
|
||||
("Failed", False),
|
||||
)
|
||||
|
||||
logical_resource = tables.Column('resource_name',
|
||||
|
@ -355,13 +359,16 @@ class ResourcesTable(tables.DataTable):
|
|||
filters.timesince_or_never))
|
||||
status = tables.Column("resource_status",
|
||||
filters=(title, filters.replace_underscores),
|
||||
verbose_name=_("Status"),
|
||||
status=True,
|
||||
status_choices=STATUS_CHOICES)
|
||||
verbose_name=_("Status"))
|
||||
|
||||
statusreason = tables.Column("resource_status_reason",
|
||||
verbose_name=_("Status Reason"),)
|
||||
|
||||
status_hidden = StatusColumn("status",
|
||||
hidden=True,
|
||||
status=True,
|
||||
status_choices=STATUS_CHOICES)
|
||||
|
||||
def __init__(self, request, data=None,
|
||||
needs_form_wrapper=None, **kwargs):
|
||||
super(ResourcesTable, self).__init__(
|
||||
|
@ -374,5 +381,5 @@ class ResourcesTable(tables.DataTable):
|
|||
class Meta(object):
|
||||
name = "resources"
|
||||
verbose_name = _("Stack Resources")
|
||||
status_columns = ["status", ]
|
||||
status_columns = ["status_hidden", ]
|
||||
row_class = ResourcesUpdateRow
|
||||
|
|
Loading…
Reference in New Issue