Skip to content

Commit

Permalink
Improvements in the display and search of data
Browse files Browse the repository at this point in the history
  • Loading branch information
xbeaudouin committed Nov 2, 2022
1 parent 3831b20 commit 551847e
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions data-pick.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function update_source_step2(graphid)

function filterlist(previous)
{
var filterstring = $('input#filterstring').val();
var filterstring = $('input#filterstring').val().toUpperCase();

if(filterstring=='')
{
Expand Down Expand Up @@ -160,16 +160,16 @@ function filterignore()

$(document).ready( function() {
$('span.filter').keyup(function() {
var previous = $('input#filterstring').val();
var previous = $('input#filterstring').val().toUpperCase();
setTimeout(function () {filterlist(previous)}, 500);
}).show();
$('span.ignore').click(function() {
var previous = $('input#filterstring').val();
var previous = $('input#filterstring').val().toUpperCase();
setTimeout(function () {filterlist(previous)}, 500);
});
});

function update_source_step2(graphid,name,portid,ifAlias,ifDesc,ifIndex)
function update_source_step2(graphid,name,portid,ifAlias,ifDesc,ifIndex,ifSpeed)
{
var graph_url, hover_url;

Expand All @@ -184,11 +184,12 @@ function update_source_step2(graphid,name,portid,ifAlias,ifDesc,ifIndex)
opener.document.forms["frmMain"].node_label.value ='testing';
opener.document.forms["frmMain"].link_infourl.value = info_url;
opener.document.forms["frmMain"].link_hover.value = graph_url;
opener.document.forms["frmMain"].link_bandwith_in.value = ipSpeed;
}
self.close();
}

function update_source_step1(dataid,name,portid,ifAlias,ifDesc,ifIndex)
function update_source_step1(dataid,name,portid,ifAlias,ifDesc,ifIndex,ifSpeed)
{
// This must be the section that looks after link properties
var newlocation;
Expand All @@ -213,7 +214,7 @@ function update_source_step1(dataid,name,portid,ifAlias,ifDesc,ifIndex)
if(document.forms['mini'].overlib.checked)
{

window.onload = update_source_step2(dataid,name,portid,ifAlias,ifDesc,ifIndex);
window.onload = update_source_step2(dataid,name,portid,ifAlias,ifDesc,ifIndex,ifSpeed);

}
else
Expand Down Expand Up @@ -285,7 +286,7 @@ function applyDSFilterChange(objForm) {
}

// Link query
$hosts = \App\Models\Device::orderBy('hostname')->get(['device_id', 'hostname']);
$hosts = \App\Models\Device::orderBy('hostname')->get(['device_id', 'hostname', 'sysname']);
?>

<h3>Pick a data source:</h3>
Expand All @@ -301,7 +302,7 @@ function applyDSFilterChange(objForm) {
{
print '<option ';
if($host_id==$host['device_id']) print " SELECTED ";
print 'value="'.$host['device_id'].'">'.$host['hostname'].'</option>';
print 'value="'.$host['device_id'].'">'.$host['hostname'].'('.strtoupper($host['sysname']).')</option>';
}
print '</select><br />';
}
Expand Down Expand Up @@ -334,9 +335,9 @@ function applyDSFilterChange(objForm) {
if (!is_null($device->ports)) {
foreach ($device->ports as $port) {
echo "<li class=\"row" . ($i % 2) . "\">";
$key = $device->device_id . "','" . $device->hostname . "','" . $port->port_id . "','" . addslashes($port->ifAlias) . "','" . addslashes($port->ifDescr) . "','" . (int)$port->ifIndex;
$key = $device->device_id . "','" . $device->hostname . "','" . $port->port_id . "','" . addslashes($port->ifAlias) . "','" . addslashes($port->ifDescr) . "','" . (int)$port->ifIndex. "','" . $port->ifSpeed;

echo "<a href=\"#\" onclick=\"update_source_step1('$key')\">" . $device->displayName() . "/$port->ifDescr Desc: $port->ifAlias</a>";
echo "<a href=\"#\" onclick=\"update_source_step1('$key')\">" . $device->displayName() . "<br/>".strtoupper($port->ifDescr)." <br/>Desc: ".strtoupper($port->ifAlias)." <br/> Speed: $port->ifSpeed</a>";
echo "</li>\n";
}
$i++;
Expand Down Expand Up @@ -372,7 +373,7 @@ function applyDSFilterChange(objForm) {
$host_id = intval($_REQUEST['host_id']);
}

$hosts = \App\Models\Device::orderBy('hostname')->get(['device_id AS id', 'hostname AS name']);
$hosts = \App\Models\Device::orderBy('hostname')->get(['device_id AS id', 'hostname AS name', 'sysname AS sysname']);

?>
<html>
Expand All @@ -382,7 +383,7 @@ function applyDSFilterChange(objForm) {

function filterlist(previous)
{
var filterstring = $('input#filterstring').val();
var filterstring = $('input#filterstring').val().toUpperCase();

if(filterstring=='')
{
Expand All @@ -400,7 +401,7 @@ function filterlist(previous)

$(document).ready( function() {
$('span.filter').keyup(function() {
var previous = $('input#filterstring').val();
var previous = $('input#filterstring').val().toUpperCase();
setTimeout(function () {filterlist(previous)}, 500);
}).show();
});
Expand Down Expand Up @@ -481,7 +482,7 @@ function update_source_step1(graphid,name)
{
print '<option ';
if($host_id==$host['id']) print " SELECTED ";
print 'value="'.$host['id'].'">'.$host['name'].'</option>';
print 'value="'.$host['id'].'">'.$host['name'].'('.strtoupper($host['sysname']).')</option>';
}
print '</select><br />';
}
Expand Down

0 comments on commit 551847e

Please sign in to comment.