mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
get rid of base_url, part 1 of ...
git-svn-id: http://www.observium.org/svn/observer/trunk@2132 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -22,7 +22,7 @@ function generate_device_link($device, $text=0, $linksuffix="", $start=0, $end=0
|
||||
$graphs = $config['os']['default']['over'];
|
||||
}
|
||||
|
||||
$url = $config['base_url']."/device/" . $device['device_id'] . "/" . $linksuffix;
|
||||
$url = "device/" . $device['device_id'] . "/" . $linksuffix;
|
||||
$contents = "<div class=list-large>".$device['hostname'];
|
||||
if ($device['hardware']) { $contents .= " - ".$device['hardware']; }
|
||||
$contents .= "</div>";
|
||||
@ -41,8 +41,8 @@ function generate_device_link($device, $text=0, $linksuffix="", $start=0, $end=0
|
||||
$graphhead = $entry['text'];
|
||||
$contents .= '<div style="width: 708px">';
|
||||
$contents .= '<span style="margin-left: 5px; font-size: 12px; font-weight: bold;">'.$graphhead.'</span><br />';
|
||||
$contents .= '<img src="' . $config['base_url'] . "/graph.php?id=" . $device['device_id'] . "&from=$start&to=$end&width=275&height=100&type=$graph&legend=no" . '" style="margin: 2px;">';
|
||||
$contents .= '<img src="' . $config['base_url'] . "/graph.php?id=" . $device['device_id'] . "&from=".$config['week']."&to=$end&width=275&height=100&type=$graph&legend=no" . '" style="margin: 2px;">';
|
||||
$contents .= "<img src=\"graph.php?id=" . $device['device_id'] . "&from=$start&to=$end&width=275&height=100&type=$graph&legend=no" . '" style="margin: 2px;">';
|
||||
$contents .= "<img src=\"graph.php?id=" . $device['device_id'] . "&from=".$config['week']."&to=$end&width=275&height=100&type=$graph&legend=no" . '" style="margin: 2px;">';
|
||||
$contents .= '</div>';
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ function generate_graph_tag ($args)
|
||||
global $config;
|
||||
|
||||
$sep = "?";
|
||||
$url = $config['base_url'] . "/graph.php";
|
||||
$url = "graph.php";
|
||||
foreach ($args as $key => $arg)
|
||||
{
|
||||
$url .= $sep.$key."=".$arg;
|
||||
@ -260,7 +260,7 @@ function generate_port_link($args, $text = NULL, $type = NULL)
|
||||
$content .= generate_graph_tag($graph_array);
|
||||
$content .= "</div>";
|
||||
|
||||
$url = $config['base_url']."/device/".$args['device_id']."/port/" . $args['interface_id'] . "/";
|
||||
$url = "device/".$args['device_id']."/port/" . $args['interface_id'] . "/";
|
||||
|
||||
if (port_permitted($args['interface_id'])) {
|
||||
return overlib_link($url, $text, $content, $class);
|
||||
|
@ -1,4 +1,4 @@
|
||||
<script type="text/javascript" src="<?php echo($config['base_url']); ?>/js/tw-sack.js"></script>
|
||||
<script type="text/javascript" src="js/tw-sack.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var ajax = new Array();
|
||||
|
@ -16,7 +16,7 @@ foreach ($periods as $period)
|
||||
$graph_array_zoom['height'] = "150";
|
||||
$graph_array_zoom['width'] = "400";
|
||||
|
||||
$link = $config['base_url'] . "/graphs/" . $graph_array['id'] . "/" . $graph_array['type'] . "/" . $graph_array['from'] . "/" . $config['now'] . "/";
|
||||
$link = "graphs/" . $graph_array['id'] . "/" . $graph_array['type'] . "/" . $graph_array['from'] . "/" . $config['now'] . "/";
|
||||
|
||||
echo(overlib_link($link, generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL));
|
||||
}
|
||||
|
@ -23,10 +23,10 @@ if ($service['service_checked'])
|
||||
$checked = formatUptime($checked);
|
||||
} else { $checked = "Never"; }
|
||||
|
||||
$mini_url = $config['base_url'] . "/graph.php?id=".$service['service_id']."&type=service_availability&from=".$day."&to=".$now."&width=80&height=20&bg=efefef";
|
||||
$mini_url = "graph.php?id=".$service['service_id']."&type=service_availability&from=".$day."&to=".$now."&width=80&height=20&bg=efefef";
|
||||
|
||||
$popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$service['service_type'];
|
||||
$popup .= "</div><img src=\'".$config['base_url']."/graph.php?id=" . $service['service_id'] . "&type=service_availability&from=$day&to=$now&width=400&height=125\'>";
|
||||
$popup .= "</div><img src=\'graph.php?id=" . $service['service_id'] . "&type=service_availability&from=$day&to=$now&width=400&height=125\'>";
|
||||
$popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
|
||||
echo("
|
||||
|
@ -164,13 +164,13 @@ if ($_GET['opta'] == "add")
|
||||
echo("
|
||||
<tr bgcolor='$row_colour'>
|
||||
<td width='7'></td>
|
||||
<td width='250'><a href='".$config['base_url']."/bill/".$bill['bill_id']."/'><span style='font-weight: bold;' class=interface>".$bill['bill_name']."</span></a></td>
|
||||
<td width='250'><a href='bill/".$bill['bill_id']."/'><span style='font-weight: bold;' class=interface>".$bill['bill_name']."</span></a></td>
|
||||
<td>$notes</td>
|
||||
<td>$type</td>
|
||||
<td>$allowed</td>
|
||||
<td>$used</td>
|
||||
<td width=370>".print_percentage_bar (350, 20, $perc, NULL, "ffffff", $left_background, $percent . "%", "ffffff", $right_background)."</td>
|
||||
<td width=60><a href='".$config['base_url']."/bill/".$bill['bill_id']."/edit/'><img src='images/16/wrench.png' align=absmiddle alt='Edit'> Edit</a></td>
|
||||
<td width=60><a href='bill/".$bill['bill_id']."/edit/'><img src='images/16/wrench.png' align=absmiddle alt='Edit'> Edit</a></td>
|
||||
</tr>
|
||||
");
|
||||
$i++;
|
||||
|
@ -63,10 +63,10 @@ while ($customer = mysql_fetch_assoc($cust_query))
|
||||
}
|
||||
|
||||
echo("<tr bgcolor='$bg_colour'><td></td><td colspan=6>
|
||||
<img src='".$config['base_url']."/graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$day&to=$now&width=215&height=100'>
|
||||
<img src='".$config['base_url']."/graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$week&to=$now&width=215&height=100'>
|
||||
<img src='".$config['base_url']."/graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$month&to=$now&width=215&height=100'>
|
||||
<img src='".$config['base_url']."/graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$year&to=$now&width=215&height=100'>
|
||||
<img src='graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$day&to=$now&width=215&height=100'>
|
||||
<img src='graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$week&to=$now&width=215&height=100'>
|
||||
<img src='graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$month&to=$now&width=215&height=100'>
|
||||
<img src='graph.php?id=".rawurlencode($customer['port_descr_descr'])."&type=customer_bits&from=$year&to=$now&width=215&height=100'>
|
||||
</td></tr>");
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ if (device_permitted($_GET['id']) || $check_device == $_GET['id'])
|
||||
if(isset($bgp_menu) || isset($ospf_menu) || isset($isis_menu) || isset($eigrp_menu) || isset($bgp_menu))
|
||||
{
|
||||
echo('<li class="' . $select['routing'] . '">
|
||||
<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/routing/">
|
||||
<a href="device/' . $device['device_id'] . '/routing/">
|
||||
<img src="images/16/arrow_branch.png" align="absmiddle" border="0" /> Routing
|
||||
</a>
|
||||
</li>');
|
||||
|
@ -19,7 +19,7 @@ while ($app = mysql_fetch_assoc($query))
|
||||
} else {
|
||||
#echo('<img src="images/icons/greyscale/'.$app['app_type'].'.png" class="optionicon" />');
|
||||
}
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/apps/" . $app['app_type'] . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $app['app_type'] ."</a>");
|
||||
echo("<a href='device/".$device['device_id']."/apps/" . $app['app_type'] . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $app['app_type'] ."</a>");
|
||||
if ($_GET['opta'] == $app['app_type']) { echo("</span>"); }
|
||||
$sep = " | ";
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ while ($data = mysql_fetch_assoc($query))
|
||||
if (!$_GET['opta']) { $_GET['opta'] = $type; }
|
||||
echo($sep);
|
||||
if ($_GET['opta'] == $type) { echo("<strong>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ciscosensors/" . $type . "/'>" . htmlspecialchars($type) ."</a>\n");
|
||||
echo("<a href='device/" . $device['device_id'] . "/ciscosensors/" . $type . "/'>" . htmlspecialchars($type) ."</a>\n");
|
||||
if ($_GET['opta'] == $type) { echo("</strong>"); }
|
||||
$sep = ' | ';
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ print_optionbar_start();
|
||||
if (!$_GET['opta']) { $_GET['opta'] = $plugin; }
|
||||
echo($sep);
|
||||
if ($_GET['opta'] == $plugin) { echo("<span class='pagemenu-selected'>"); }
|
||||
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/collectd/" . $plugin . "/'>" . htmlspecialchars($plugin) ."</a>");
|
||||
echo("<a href='device/" . $device['device_id'] . "/collectd/" . $plugin . "/'>" . htmlspecialchars($plugin) ."</a>");
|
||||
if ($_GET['opta'] == $plugin) { echo("</span>"); }
|
||||
$sep = ' | ';
|
||||
}
|
||||
@ -88,24 +88,24 @@ print_optionbar_end();
|
||||
}
|
||||
echo("</div>");
|
||||
|
||||
$daily_traffic = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$day&to=$now&width=215&height=100";
|
||||
$daily_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$day&to=$now&width=215&height=100";
|
||||
$daily_traffic .= $args;
|
||||
$daily_url = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$day&to=$now&width=400&height=150";
|
||||
$daily_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$day&to=$now&width=400&height=150";
|
||||
$daily_url .= $args;
|
||||
|
||||
$weekly_traffic = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$week&to=$now&width=215&height=100";
|
||||
$weekly_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$week&to=$now&width=215&height=100";
|
||||
$weekly_traffic .= $args;
|
||||
$weekly_url = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$week&to=$now&width=400&height=150";
|
||||
$weekly_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$week&to=$now&width=400&height=150";
|
||||
$weekly_url .= $args;
|
||||
|
||||
$monthly_traffic = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$month&to=$now&width=215&height=100";
|
||||
$monthly_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$month&to=$now&width=215&height=100";
|
||||
$monthly_traffic .= $args;
|
||||
$monthly_url = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$month&to=$now&width=400&height=150";
|
||||
$monthly_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$month&to=$now&width=400&height=150";
|
||||
$monthly_url .= $args;
|
||||
|
||||
$yearly_traffic = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$year&to=$now&width=215&height=100";
|
||||
$yearly_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$year&to=$now&width=215&height=100";
|
||||
$yearly_traffic .= $args;
|
||||
$yearly_url = $config['base_url'] . "/collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$year&to=$now&width=400&height=150";
|
||||
$yearly_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$year&to=$now&width=400&height=150";
|
||||
$yearly_url .= $args;
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@ if ($_SESSION['userlevel'] < '7')
|
||||
#echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
|
||||
}
|
||||
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/edit/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $text ."</a>");
|
||||
echo("<a href='device/".$device['device_id']."/edit/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $text ."</a>");
|
||||
if ($_GET['opta'] == $type) { echo("</span>"); }
|
||||
$sep = " | ";
|
||||
}
|
||||
|
@ -17,7 +17,8 @@ function printEntPhysical($ent, $level, $class)
|
||||
if ($ent['entPhysicalClass'] == "sensor")
|
||||
{
|
||||
echo("<img src='images/16/contrast.png' style='vertical-align:middle'/> ");
|
||||
$link = " href='".$config['base_url'] . "/device/".$device['device_id']."/ciscosensors/".$ent['entSensorType']."/' onmouseover=\"return overlib('<img src=\'graph.php?host=49&type=cisco_entity_sensor&from=-2d&to=now&width=400&height=150&a=".$ent['entPhysical_id']."\'><img src=\'graph.php?host=49&type=cisco_entity_sensor&from=-2w&to=now&width=400&height=150&a=".$ent['entPhysical_id']."\'>', LEFT,FGCOLOR,'#e5e5e5', BGCOLOR, '#c0c0c0', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#050505');\" onmouseout=\"return nd();\"";
|
||||
# FIXME /ciscosensors? doesn't exist anymore methinks? or does it?
|
||||
$link = " href='device/".$device['device_id']."/ciscosensors/".$ent['entSensorType']."/' onmouseover=\"return overlib('<img src=\'graph.php?host=49&type=cisco_entity_sensor&from=-2d&to=now&width=400&height=150&a=".$ent['entPhysical_id']."\'><img src=\'graph.php?host=49&type=cisco_entity_sensor&from=-2w&to=now&width=400&height=150&a=".$ent['entPhysical_id']."\'>', LEFT,FGCOLOR,'#e5e5e5', BGCOLOR, '#c0c0c0', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#050505');\" onmouseout=\"return nd();\"";
|
||||
} else { unset ($link); }
|
||||
|
||||
if ($ent['entPhysicalClass'] == "backplane") { echo("<img src='images/16/brick.png' style='vertical-align:middle'/> "); }
|
||||
|
@ -30,7 +30,7 @@ foreach ($config['graph_sections'] as $section)
|
||||
echo('<span class="pagemenu-selected">');
|
||||
}
|
||||
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/graphs/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . ucfirst($type) ."</a>");
|
||||
echo("<a href='device/".$device['device_id']."/graphs/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . ucfirst($type) ."</a>");
|
||||
if ($_GET['opta'] == $type)
|
||||
{
|
||||
echo("</span>");
|
||||
|
@ -13,7 +13,7 @@ while ($hrdevice = mysql_fetch_assoc($hrdevices))
|
||||
$proc_id = mysql_result(mysql_query("SELECT processor_id FROM processors WHERE device_id = '".$device['device_id']."' AND hrDeviceIndex = '".$hrdevice['hrDeviceIndex']."'"),0);
|
||||
$proc_url = "device/".$device['device_id']."/health/processor/";
|
||||
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$hrdevice['hrDeviceDescr'];
|
||||
$proc_popup .= "</div><img src=\'".$config['base_url']."/graph.php?id=" . $proc_id . "&type=processor_usage&from=$month&to=$now&width=400&height=125\'>";
|
||||
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc_id . "&type=processor_usage&from=$month&to=$now&width=400&height=125\'>";
|
||||
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
echo("<td><a href='$proc_url' $proc_popup>".$hrdevice['hrDeviceDescr']."</a></td>");
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<center>
|
||||
<object data="<?php echo($config['base_url']); ?>/map.php?device=<?php echo($device['device_id']); ?>&format=svg" type="image/svg+xml" style="width: 100%; height:1000px;">
|
||||
<object data="map.php?device=<?php echo($device['device_id']); ?>&format=svg" type="image/svg+xml" style="width: 100%; height:1000px;">
|
||||
</object>
|
||||
</center>
|
||||
|
Reference in New Issue
Block a user