Merge "Fixes sorting on IP Address columns in tables."

This commit is contained in:
Jenkins 2013-04-24 13:13:16 +00:00 committed by Gerrit Code Review
commit 4aeb8fc72a
5 changed files with 15 additions and 4 deletions

View File

@ -252,6 +252,10 @@ $(parent).find("table.datatable").each(function () {
// set as [i-1] as there is one more <th> in <thead>
// than <td>'s in <tbody>
header_options[i-1] = {sorter: 'sizeSorter'};
} else if ($th.data('type') == 'ip'){
// set as [i-1] as there is one more <th> in <thead>
// than <td>'s in <tbody>
header_options[i-1] = {sorter: 'ipAddress'};
}
});
$table.tablesorter({

View File

@ -97,7 +97,9 @@ class AdminInstancesTable(tables.DataTable):
name = tables.Column("name",
link=("horizon:admin:instances:detail"),
verbose_name=_("Name"))
ip = tables.Column(get_ips, verbose_name=_("IP Address"))
ip = tables.Column(get_ips,
verbose_name=_("IP Address"),
attrs={'data-type': "ip"})
size = tables.Column(get_size,
verbose_name=_("Size"),
classes=('nowrap-col',),

View File

@ -111,7 +111,9 @@ def get_instance_link(datum):
class FloatingIPsTable(tables.DataTable):
ip = tables.Column("ip", verbose_name=_("IP Address"))
ip = tables.Column("ip",
verbose_name=_("IP Address"),
attrs={'data-type': "ip"})
instance = tables.Column(get_instance_info,
link=get_instance_link,
verbose_name=_("Instance"),

View File

@ -462,7 +462,9 @@ class InstancesTable(tables.DataTable):
name = tables.Column("name",
link=("horizon:project:instances:detail"),
verbose_name=_("Instance Name"))
ip = tables.Column(get_ips, verbose_name=_("IP Address"))
ip = tables.Column(get_ips,
verbose_name=_("IP Address"),
attrs={'data-type': "ip"})
size = tables.Column(get_size,
verbose_name=_("Size"),
attrs={'data-type': 'size'})

View File

@ -136,7 +136,8 @@ def get_member_link(member):
class MembersTable(tables.DataTable):
address = tables.Column('address',
verbose_name=_("IP Address"),
link=get_member_link)
link=get_member_link,
attrs={'data-type': "ip"})
protocol_port = tables.Column('protocol_port',
verbose_name=_("Protocol Port"))
pool_name = tables.Column("pool_name",