Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements in the display and search of data. #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_bandwidth_in.value = ifSpeed;
}
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 @@ -210,7 +211,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 @@ -282,7 +283,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 @@ -298,7 +299,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 @@ -331,9 +332,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 @@ -369,7 +370,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 @@ -379,7 +380,7 @@ function applyDSFilterChange(objForm) {

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

if(filterstring=='')
{
Expand All @@ -397,7 +398,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 @@ -478,7 +479,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