예제 #1
0
function generate_ap_link($args, $text = null, $type = null)
{
    global $config;
    $args = ifNameDescr($args);
    if (!$text) {
        $text = fixIfName($args['label']);
    }
    if ($type) {
        $args['graph_type'] = $type;
    }
    if (!isset($args['graph_type'])) {
        $args['graph_type'] = 'port_bits';
    }
    if (!isset($args['hostname'])) {
        $args = array_merge($args, device_by_id_cache($args['device_id']));
    }
    $content = '<div class=list-large>' . $args['text'] . ' - ' . fixifName($args['label']) . '</div>';
    if ($args['ifAlias']) {
        $content .= $args['ifAlias'] . '<br />';
    }
    $content .= "<div style=\\'width: 850px\\'>";
    $graph_array = array();
    $graph_array['type'] = $args['graph_type'];
    $graph_array['legend'] = 'yes';
    $graph_array['height'] = '100';
    $graph_array['width'] = '340';
    $graph_array['to'] = $config['time']['now'];
    $graph_array['from'] = $config['time']['day'];
    $graph_array['id'] = $args['accesspoint_id'];
    $content .= generate_graph_tag($graph_array);
    $graph_array['from'] = $config['time']['week'];
    $content .= generate_graph_tag($graph_array);
    $graph_array['from'] = $config['time']['month'];
    $content .= generate_graph_tag($graph_array);
    $graph_array['from'] = $config['time']['year'];
    $content .= generate_graph_tag($graph_array);
    $content .= '</div>';
    $url = generate_ap_url($args);
    if (port_permitted($args['interface_id'], $args['device_id'])) {
        return overlib_link($url, $text, $content, null);
    } else {
        return fixifName($text);
    }
}
예제 #2
0
function generate_ap_link($args, $text = NULL, $type = NULL, $escape = FALSE)
{
    global $config;
    humanize_port($args);
    if (!$text) {
        $text = rewrite_ifname($args['port_label'], !$escape);
    }
    // Negative escape flag for exclude double escape
    if ($type) {
        $args['graph_type'] = $type;
    }
    if (!isset($args['graph_type'])) {
        $args['graph_type'] = 'port_bits';
    }
    if (!isset($args['hostname'])) {
        $args = array_merge($args, device_by_id_cache($args['device_id']));
    }
    $content = "<div class=entity-title>" . $args['text'] . " - " . rewrite_ifname($args['port_label'], !$escape) . "</div>";
    if ($args['ifAlias']) {
        $content .= $args['ifAlias'] . "<br />";
    }
    $content .= "<div style=\\'width: 850px\\'>";
    $graph_array['type'] = $args['graph_type'];
    $graph_array['legend'] = "yes";
    $graph_array['height'] = "100";
    $graph_array['width'] = "340";
    $graph_array['to'] = $config['time']['now'];
    $graph_array['from'] = $config['time']['day'];
    $graph_array['id'] = $args['accesspoint_id'];
    $content .= generate_graph_tag($graph_array);
    $graph_array['from'] = $config['time']['week'];
    $content .= generate_graph_tag($graph_array);
    $graph_array['from'] = $config['time']['month'];
    $content .= generate_graph_tag($graph_array);
    $graph_array['from'] = $config['time']['year'];
    $content .= generate_graph_tag($graph_array);
    $content .= "</div>";
    $url = generate_ap_url($args);
    if (port_permitted($args['interface_id'], $args['device_id'])) {
        return overlib_link($url, $text, $content, $class, $escape);
    } else {
        return rewrite_ifname($text);
    }
}
예제 #3
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage webui
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
$ap['text'] = $ap['name'] . " " . $ap['type'];
echo "<tr onclick=\"openLink('" . generate_ap_url($ap) . "/')\" style='cursor: pointer;'>\n         <td valign=top width=350>";
echo "        <span class=entity-title> " . generate_ap_link($ap, " " . $ap['text'] . " </span><br />");
echo "<span class=small>";
echo "{$break}" . $ap['mac_addr'] . "<br>" . $ap['type'] . " - channel " . $ap['channel'];
echo "<br />txpow " . $ap['txpow'];
echo "</span>";
echo "</td><td width=100>";
echo "</td><td width=150>";
$ap['graph_type'] = "accesspoints_numasoclients";
echo generate_ap_link($ap, "<img src='graph.php?type=" . $ap['graph_type'] . "&amp;id=" . $ap['accesspoint_id'] . "&amp;from=" . $config['time']['day'] . "&amp;to=" . $config['time']['now'] . "&amp;width=100&amp;height=20&amp;legend=no&amp;bg=" . str_replace("#", "", $row_colour) . "'>");
echo "<br>\n";
$ap['graph_type'] = "accesspoints_radioutil";
echo generate_ap_link($ap, "<img src='graph.php?type=" . $ap['graph_type'] . "&amp;id=" . $ap['accesspoint_id'] . "&amp;from=" . $config['time']['day'] . "&amp;to=" . $config['time']['now'] . "&amp;width=100&amp;height=20&amp;legend=no&amp;bg=" . str_replace("#", "", $row_colour) . "'>");
echo "<br>\n";
$ap['graph_type'] = "accesspoints_interference";
echo generate_ap_link($ap, "<img src='graph.php?type=" . $ap['graph_type'] . "&amp;id=" . $ap['accesspoint_id'] . "&amp;from=" . $config['time']['day'] . "&amp;to=" . $config['time']['now'] . "&amp;width=100&amp;height=20&amp;legend=no&amp;bg=" . str_replace("#", "", $row_colour) . "'>");
echo "<br>\n";
echo "</td><td width=120>";
<?php

if ($int_colour) {
    $row_colour = $int_colour;
} else {
    if (!is_integer($i / 2)) {
        $row_colour = $list_colour_a;
    } else {
        $row_colour = $list_colour_b;
    }
}
$text = $ap['name'] . " " . $ap['type'];
$ap['text'] = $text;
echo "<tr style=\"background-color: {$row_colour};\" valign=top onmouseover=\"this.style.backgroundColor='{$list_highlight}';\" onmouseout=\"this.style.backgroundColor='{$row_colour}';\" onclick=\"location.href='" . generate_ap_url($ap) . "/'\" style='cursor: pointer;'>\n         <td valign=top width=350>";
echo "        <span class=entity-title> " . generate_ap_link($ap, " {$text} </span><br />");
echo "<span class=interface-desc>";
echo "{$break}" . $ap['mac_addr'] . "<br>" . $ap['type'] . " - channel " . $ap['channel'];
echo "<br />txpow {$ap['txpow']}";
echo "</span>";
echo "</td><td width=100>";
echo "</td><td width=150>";
$ap['graph_type'] = "accesspoints_numasoclients";
echo generate_ap_link($ap, "<img src='graph.php?type={$ap['graph_type']}&amp;id=" . $ap['accesspoint_id'] . "&amp;from=" . $config['time']['day'] . "&amp;to=" . $config['time']['now'] . "&amp;width=100&amp;height=20&amp;legend=no&amp;bg=" . str_replace("#", "", $row_colour) . "'>");
echo "<br>\n";
$ap['graph_type'] = "accesspoints_radioutil";
echo generate_ap_link($ap, "<img src='graph.php?type={$ap['graph_type']}&amp;id=" . $ap['accesspoint_id'] . "&amp;from=" . $config['time']['day'] . "&amp;to=" . $config['time']['now'] . "&amp;width=100&amp;height=20&amp;legend=no&amp;bg=" . str_replace("#", "", $row_colour) . "'>");
echo "<br>\n";
$ap['graph_type'] = "accesspoints_interference";
echo generate_ap_link($ap, "<img src='graph.php?type={$ap['graph_type']}&amp;id=" . $ap['accesspoint_id'] . "&amp;from=" . $config['time']['day'] . "&amp;to=" . $config['time']['now'] . "&amp;width=100&amp;height=20&amp;legend=no&amp;bg=" . str_replace("#", "", $row_colour) . "'>");
echo "<br>\n";
echo "</td><td width=120>";
예제 #5
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage webui
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
$ap['text'] = $ap['name'] . " " . $ap['type'];
echo "<tr onclick=\"location.href='" . generate_ap_url($ap) . "/'\" style='cursor: pointer;'>\n         <td valign=top width=350>";
echo "        <span class=entity-title> " . generate_ap_link($ap, " " . $ap['text'] . " </span><br />");
echo "<span class=small>";
echo "{$break}" . $ap['mac_addr'] . "<br>" . $ap['type'] . " - channel " . $ap['channel'];
echo "<br />txpow " . $ap['txpow'];
echo "</span>";
echo "</td><td width=100>";
echo "</td><td width=150>";
$ap['graph_type'] = "accesspoints_numasoclients";
echo generate_ap_link($ap, "<img src='graph.php?type=" . $ap['graph_type'] . "&amp;id=" . $ap['accesspoint_id'] . "&amp;from=" . $config['time']['day'] . "&amp;to=" . $config['time']['now'] . "&amp;width=100&amp;height=20&amp;legend=no&amp;bg=" . str_replace("#", "", $row_colour) . "'>");
echo "<br>\n";
$ap['graph_type'] = "accesspoints_radioutil";
echo generate_ap_link($ap, "<img src='graph.php?type=" . $ap['graph_type'] . "&amp;id=" . $ap['accesspoint_id'] . "&amp;from=" . $config['time']['day'] . "&amp;to=" . $config['time']['now'] . "&amp;width=100&amp;height=20&amp;legend=no&amp;bg=" . str_replace("#", "", $row_colour) . "'>");
echo "<br>\n";
$ap['graph_type'] = "accesspoints_interference";
echo generate_ap_link($ap, "<img src='graph.php?type=" . $ap['graph_type'] . "&amp;id=" . $ap['accesspoint_id'] . "&amp;from=" . $config['time']['day'] . "&amp;to=" . $config['time']['now'] . "&amp;width=100&amp;height=20&amp;legend=no&amp;bg=" . str_replace("#", "", $row_colour) . "'>");
echo "<br>\n";
echo "</td><td width=120>";