summaryrefslogtreecommitdiffstats
path: root/net/8021q/Makefile
Commit message (Expand)AuthorAgeFilesLines
* vlan: uninline __vlan_hwaccel_rxPatrick McHardy2008-07-081-4/+5
* vlan: Add GVRP supportPatrick McHardy2008-07-061-6/+3Star
* [VLAN]: Use rtnl_link APIPatrick McHardy2007-07-111-1/+1
* Linux-2.6.12-rc2Linus Torvalds2005-04-171-0/+12
b6b5ff06bc6c'>346c60a8472d1baa8b8eef9567ffb6b5ff06bc6c (patch) tree46a01714755d76f3427ab73feb80955d3dbbbd9a /modules-available parent[statistics] Show current user in client list (diff)downloadslx-admin-346c60a8472d1baa8b8eef9567ffb6b5ff06bc6c.tar.gz
slx-admin-346c60a8472d1baa8b8eef9567ffb6b5ff06bc6c.tar.xz
slx-admin-346c60a8472d1baa8b8eef9567ffb6b5ff06bc6c.zip
[statistics] Make sort order in client list match the location tree
It's still not showing the actual tree, but sorting is the same as the location list now, but obviously skipping locations where no clients match the display filter.
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/statistics/pages/list.inc.php15
-rw-r--r--modules-available/statistics/templates/clientlist.html2
2 files changed, 15 insertions, 2 deletions
diff --git a/modules-available/statistics/pages/list.inc.php b/modules-available/statistics/pages/list.inc.php
index 97133aa2..4df60044 100644
--- a/modules-available/statistics/pages/list.inc.php
+++ b/modules-available/statistics/pages/list.inc.php
@@ -63,6 +63,7 @@ class SubPage
$execAllowedLocations = User::getAllowedLocations('.rebootcontrol.action.exec');
// Only make client clickable if user is allowed to view details page
$detailsAllowedLocations = User::getAllowedLocations("machine.view-details");
+ $location = self::buildLocationLookup();
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
if ($singleMachine === 'none') {
$singleMachine = $row['machineuuid'];
@@ -107,7 +108,9 @@ class SubPage
}
}
$row['state_' . $row['state']] = true;
- $row['locationname'] = Location::getName($row['locationid']);
+ if ($row['locationid'] > 0) {
+ $row['location'] = $location[$row['locationid']];
+ }
$rows[] = $row;
}
if ($singleMachine !== false && $singleMachine !== 'none') {
@@ -134,4 +137,14 @@ class SubPage
Render::addTemplate('clientlist', $data);
}
+ private static function buildLocationLookup()
+ {
+ $ret = [];
+ $i = 0;
+ foreach (Location::getLocationsAssoc() as $lid => $data) {
+ $ret[$lid] = ['sort' => ++$i, 'name' => $data['locationname']];
+ }
+ return $ret;
+ }
+
}
diff --git a/modules-available/statistics/templates/clientlist.html b/modules-available/statistics/templates/clientlist.html
index 6fee9f27..e9d0aeca 100644
--- a/modules-available/statistics/templates/clientlist.html
+++ b/modules-available/statistics/templates/clientlist.html
@@ -128,7 +128,7 @@
</div>{{/nohdd}}
</td>
<td data-sort-value="{{realcores}}">{{lang_realCores}}: {{realcores}}<div class="small">{{cpumodel}}</div></td>
- <td data-sort-value="{{locationname}}">{{locationname}}</td>
+ <td data-sort-value="{{location.sort}}">{{location.name}}</td>
</tr>
{{/rows}}
</tbody>