mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix sorting
This commit is contained in:
@@ -5,7 +5,7 @@ $common_output[] = '
|
|||||||
<table id="stp-ports" class="table table-condensed table-hover">
|
<table id="stp-ports" class="table table-condensed table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-column-id="port">Port</th>
|
<th data-column-id="port_id">Port</th>
|
||||||
<th data-column-id="priority">Priority</th>
|
<th data-column-id="priority">Priority</th>
|
||||||
<th data-column-id="state">State</th>
|
<th data-column-id="state">State</th>
|
||||||
<th data-column-id="enable">Enable</th>
|
<th data-column-id="enable">Enable</th>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
logfile(print_r($_POST, true));
|
||||||
$device_id = mres($_POST['device_id']);
|
$device_id = mres($_POST['device_id']);
|
||||||
|
|
||||||
$param[] = $device_id;
|
$param[] = $device_id;
|
||||||
@@ -13,10 +14,10 @@ if (empty($total)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($sort) || empty($sort)) {
|
if (!isset($sort) || empty($sort)) {
|
||||||
$sort = 'ps.port_id DESC';
|
$sort = 'port_id DESC';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= " ORDER BY $sort";
|
$sql .= " ORDER BY ps.$sort";
|
||||||
|
|
||||||
if (isset($current)) {
|
if (isset($current)) {
|
||||||
$limit_low = (($current * $rowCount) - ($rowCount));
|
$limit_low = (($current * $rowCount) - ($rowCount));
|
||||||
@@ -36,7 +37,7 @@ foreach (dbFetchRows($sql, array($device_id)) as $stp_ports_db) {
|
|||||||
$root_device = dbFetchRow("SELECT `devices`.*, `stp`.`device_id`, `stp`.`bridgeAddress` FROM `devices` JOIN `stp` ON `devices`.`device_id`=`stp`.`device_id` WHERE `stp`.`bridgeAddress` = ?", array($stp_ports_db['designatedRoot']));
|
$root_device = dbFetchRow("SELECT `devices`.*, `stp`.`device_id`, `stp`.`bridgeAddress` FROM `devices` JOIN `stp` ON `devices`.`device_id`=`stp`.`device_id` WHERE `stp`.`bridgeAddress` = ?", array($stp_ports_db['designatedRoot']));
|
||||||
|
|
||||||
$response[] = array (
|
$response[] = array (
|
||||||
'port' => generate_port_link($stp_ports_db, $stp_ports_db['ifName'])."<br>".$stp_ports_db['ifAlias'],
|
'port_id' => generate_port_link($stp_ports_db, $stp_ports_db['ifName'])."<br>".$stp_ports_db['ifAlias'],
|
||||||
'priority' => $stp_ports_db['priority'],
|
'priority' => $stp_ports_db['priority'],
|
||||||
'state' => $stp_ports_db['state'],
|
'state' => $stp_ports_db['state'],
|
||||||
'enable' => $stp_ports_db['enable'],
|
'enable' => $stp_ports_db['enable'],
|
||||||
|
|||||||
Reference in New Issue
Block a user