Commit d49b38d5 by Őry Máté

dashboard: show node status in list

parent 1eef65b6
...@@ -19,8 +19,7 @@ from __future__ import absolute_import ...@@ -19,8 +19,7 @@ from __future__ import absolute_import
from django.contrib.auth.models import Group, User from django.contrib.auth.models import Group, User
from django_tables2 import Table, A from django_tables2 import Table, A
from django_tables2.columns import (TemplateColumn, Column, BooleanColumn, from django_tables2.columns import TemplateColumn, Column, LinkColumn
LinkColumn)
from vm.models import Node, InstanceTemplate, Lease from vm.models import Node, InstanceTemplate, Lease
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
...@@ -40,8 +39,10 @@ class NodeListTable(Table): ...@@ -40,8 +39,10 @@ class NodeListTable(Table):
attrs={'th': {'class': 'node-list-table-thin'}}, attrs={'th': {'class': 'node-list-table-thin'}},
) )
enabled = BooleanColumn( get_status_display = Column(
verbose_name=_("Status"),
attrs={'th': {'class': 'node-list-table-thin'}}, attrs={'th': {'class': 'node-list-table-thin'}},
order_by=("enabled", "schedule_enabled"),
) )
name = TemplateColumn( name = TemplateColumn(
...@@ -70,8 +71,8 @@ class NodeListTable(Table): ...@@ -70,8 +71,8 @@ class NodeListTable(Table):
model = Node model = Node
attrs = {'class': ('table table-bordered table-striped table-hover ' attrs = {'class': ('table table-bordered table-striped table-hover '
'node-list-table')} 'node-list-table')}
fields = ('pk', 'name', 'host', 'enabled', 'priority', 'overcommit', fields = ('pk', 'name', 'host', 'get_status_display', 'priority',
'number_of_VMs', ) 'overcommit', 'number_of_VMs', )
class GroupListTable(Table): class GroupListTable(Table):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment