本文整理汇总了PHP中generate_graph_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP generate_graph_tag函数的具体用法?PHP generate_graph_tag怎么用?PHP generate_graph_tag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generate_graph_tag函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: print_graph_row
function print_graph_row($graph_array)
{
global $config;
if ($_SESSION['widescreen']) {
if ($_SESSION['big_graphs']) {
if (!$graph_array['height']) {
$graph_array['height'] = "110";
}
if (!$graph_array['width']) {
$graph_array['width'] = "353";
}
$periods = array('sixhour', 'week', 'month', 'year');
} else {
if (!$graph_array['height']) {
$graph_array['height'] = "110";
}
if (!$graph_array['width']) {
$graph_array['width'] = "215";
}
$periods = array('sixhour', 'day', 'week', 'month', 'year', 'twoyear');
}
} else {
if ($_SESSION['big_graphs']) {
if (!$graph_array['height']) {
$graph_array['height'] = "100";
}
if (!$graph_array['width']) {
$graph_array['width'] = "323";
}
$periods = array('day', 'week', 'month');
} else {
if (!$graph_array['height']) {
$graph_array['height'] = "100";
}
if (!$graph_array['width']) {
$graph_array['width'] = "228";
}
$periods = array('day', 'week', 'month', 'year');
}
}
if ($graph_array['shrink']) {
$graph_array['width'] = $graph_array['width'] - $graph_array['shrink'];
}
$graph_array['to'] = $config['time']['now'];
foreach ($periods as $period) {
$graph_array['from'] = $config['time'][$period];
$graph_array_zoom = $graph_array;
$graph_array_zoom['height'] = "175";
$graph_array_zoom['width'] = "600";
$link_array = $graph_array;
$link_array['page'] = "graphs";
unset($link_array['height'], $link_array['width']);
$link = generate_url($link_array);
echo overlib_link($link, generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
}
}
开发者ID:skive,项目名称:observium,代码行数:56,代码来源:rows.inc.php
示例2: generate_port_popup
function generate_port_popup($port, $text = NULL, $type = NULL)
{
global $config;
if (!isset($port['os'])) {
$port = array_merge($port, device_by_id_cache($port['device_id']));
}
humanize_port($port);
if (!$text) {
$text = rewrite_ifname($port['label']);
}
if ($type) {
$port['graph_type'] = $type;
}
if (!isset($port['graph_type'])) {
$port['graph_type'] = 'port_bits';
}
$class = ifclass($port['ifOperStatus'], $port['ifAdminStatus']);
if (!isset($port['os'])) {
$port = array_merge($port, device_by_id_cache($port['device_id']));
}
$content = generate_device_popup_header($port);
$content .= generate_port_popup_header($port);
$content .= '<div style="width: 700px">';
$graph_array['type'] = $port['graph_type'];
$graph_array['legend'] = "yes";
$graph_array['height'] = "100";
$graph_array['width'] = "275";
$graph_array['to'] = $config['time']['now'];
$graph_array['from'] = $config['time']['day'];
$graph_array['id'] = $port['port_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>";
return $content;
}
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:40,代码来源:port.inc.php
示例3: generate_entity_popup_graphs
function generate_entity_popup_graphs($entity, $vars)
{
global $config;
$entity_type = $vars['entity_type'];
if (is_array($config['entities'][$entity_type]['graph'])) {
if (isset($config['entities'][$entity_type]['graph']['type'])) {
$graphs[] = $config['entities'][$entity_type]['graph'];
} else {
$graphs = $config['entities'][$entity_type]['graph'];
}
foreach ($graphs as $graph_array) {
//$graph_array = $config['entities'][$entity_type]['graph'];
// We can draw a graph for this type/metric pair!
foreach ($graph_array as $key => $val) {
// Check to see if we need to do any substitution
if (substr($val, 0, 1) == "@") {
$nval = substr($val, 1);
$graph_array[$key] = $entity[$nval];
}
}
$graph_array['height'] = "100";
$graph_array['width'] = "323";
$content = '<div style="white-space: nowrap;">';
$content .= "<div class=entity-title><h4>" . nicecase(str_replace("_", " ", $graph_array['type'])) . "</h4></div>";
/*
$content = generate_box_open(array('title' => nicecase(str_replace("_", " ", $graph_array['type'])),
'body-style' => 'white-space: nowrap;'));
*/
foreach (array('day', 'month') as $period) {
$graph_array['from'] = $config['time'][$period];
$content .= generate_graph_tag($graph_array);
}
$content .= "</div>";
//$content .= generate_box_close();
}
//r($content);
return $content;
}
}
开发者ID:Natolumin,项目名称:observium,代码行数:39,代码来源:generic.inc.php
示例4: foreach
$sql = "SELECT * {$sql}";
foreach (dbFetchRows($sql, $param) as $processor) {
$perc = round($processor['processor_usage'], 0);
$graph_array['type'] = $graph_type;
$graph_array['id'] = $processor['processor_id'];
$graph_array['from'] = $config['time']['day'];
$graph_array['to'] = $config['time']['now'];
$graph_array['height'] = '20';
$graph_array['width'] = '80';
$graph_array_zoom = $graph_array;
$graph_array_zoom['height'] = '150';
$graph_array_zoom['width'] = '400';
$link = 'graphs/id=' . $graph_array['id'] . '/type=' . $graph_array['type'] . '/from=' . $graph_array['from'] . '/to=' . $graph_array['to'] . '/';
$mini_graph = overlib_link($link, generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), null);
$background = get_percentage_colours($perc);
$bar_link = overlib_link($link, print_percentage_bar(400, 20, $perc, $perc . '%', 'ffffff', $background['left'], 100 - $perc . '%', 'ffffff', $background['right']), generate_graph_tag($graph_array_zoom), null);
$response[] = array('hostname' => generate_device_link($processor), 'processor_descr' => $processor['processor_descr'], 'graph' => $mini_graph, 'processor_usage' => $bar_link);
if ($_POST['view'] == 'graphs') {
$graph_array['height'] = '100';
$graph_array['width'] = '216';
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $processor['processor_id'];
$graph_array['type'] = $graph_type;
$return_data = true;
include 'includes/print-graphrow.inc.php';
unset($return_data);
$response[] = array('hostname' => $graph_data[0], 'processor_descr' => $graph_data[1], 'graph' => $graph_data[2], 'processor_usage' => $graph_data[3]);
}
//end if
}
//end foreach
开发者ID:awlx,项目名称:librenms,代码行数:31,代码来源:processor.inc.php
示例5: generate_ap_link
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);
}
}
开发者ID:RobsanInc,项目名称:librenms,代码行数:44,代码来源:functions.inc.php
示例6: round
}
//end if
if ($_SESSION['screen_width']) {
if ($_SESSION['screen_width'] < 1024 && $_SESSION['screen_width'] > 700) {
$graph_array['width'] = round(($_SESSION['screen_width'] - 90) / 2, 0);
} else {
if ($_SESSION['screen_width'] > 1024) {
$graph_array['width'] = round(($_SESSION['screen_width'] - 90) / count($periods) + 1, 0);
} else {
$graph_array['width'] = $_SESSION['screen_width'] - 70;
}
}
}
$graph_array['height'] = round($graph_array['width'] / 2.15);
$graph_array['to'] = $config['time']['now'];
$graph_data = array();
foreach ($periods as $period) {
$graph_array['from'] = $config['time'][$period];
$graph_array_zoom = $graph_array;
$graph_array_zoom['height'] = '150';
$graph_array_zoom['width'] = '400';
$link_array = $graph_array;
$link_array['page'] = 'graphs';
unset($link_array['height'], $link_array['width']);
$link = generate_url($link_array);
if ($return_data === true) {
$graph_data[] = overlib_link($link, generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
} else {
echo overlib_link($link, generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
}
}
开发者ID:sfromm,项目名称:librenms,代码行数:31,代码来源:print-graphrow.inc.php
示例7: generate_url
} else {
if ($vars[$option] == "yes") {
$navbar[$side][$option]['url'] = generate_url($vars, array('page' => "graphs", $option => NULL));
$navbar[$side][$option]['class'] .= " active";
} else {
$navbar[$side][$option]['url'] = generate_url($vars, array('page' => "graphs", $option => 'yes'));
}
}
}
}
print_navbar($navbar);
unset($navbar);
/// End options navbar
echo generate_graph_js_state($graph_array);
echo '<div style="width: ' . $graph_array['width'] . '; margin: auto;">';
echo generate_graph_tag($graph_array);
echo "</div>";
if (isset($graph_return['descr'])) {
print_optionbar_start();
echo '<div style="float: left; width: 30px;">
<div style="margin: auto auto;">
<img valign=absmiddle src="images/16/information.png" />
</div>
</div>';
echo $graph_return['descr'];
print_optionbar_end();
}
#print_r($graph_return);
if (isset($vars['showcommand'])) {
?>
开发者ID:RomanBogachev,项目名称:observium,代码行数:30,代码来源:graphs.inc.php
示例8: generate_ap_link
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);
}
}
开发者ID:Natolumin,项目名称:observium,代码行数:44,代码来源:functions.inc.php
示例9: round
}
$perc = round($drive['storage_perc'], 0);
$total = formatStorage($drive['storage_size']);
$free = formatStorage($drive['storage_free']);
$used = formatStorage($drive['storage_used']);
$graph_array['type'] = $graph_type;
$graph_array['id'] = $drive['storage_id'];
$graph_array['from'] = $config['time']['day'];
$graph_array['to'] = $config['time']['now'];
$graph_array['height'] = "20";
$graph_array['width'] = "80";
$graph_array_zoom = $graph_array;
$graph_array_zoom['height'] = "150";
$graph_array_zoom['width'] = "400";
$link = "graphs/id=" . $graph_array['id'] . "/type=" . $graph_array['type'] . "/from=" . $graph_array['from'] . "/to=" . $graph_array['to'] . "/";
$mini_graph = overlib_link($link, generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
$background = get_percentage_colours($perc);
echo "<tr class='health'><td>" . generate_device_link($drive) . "</td><td class=tablehead>" . $drive['storage_descr'] . "</td>\n <td>{$mini_graph}</td>\n <td>\n <a href='#' {$store_popup}>" . print_percentage_bar(400, 20, $perc, "{$used} / {$total}", "ffffff", $background['left'], $free, "ffffff", $background['right']) . "</a>\n </td><td>{$perc}" . "%</td></tr>";
if ($vars['view'] == "graphs") {
echo "<tr></tr><tr class='health'><td colspan=5>";
$graph_array['height'] = "100";
$graph_array['width'] = "216";
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $drive['storage_id'];
$graph_array['type'] = $graph_type;
include "includes/print-graphrow.inc.php";
echo "</td></tr>";
}
# endif graphs
}
}
开发者ID:CumulusNetworks,项目名称:cldemo-archive,代码行数:31,代码来源:storage.inc.php
示例10: overlib_link
$graph_array_new['type'] = $graph_type;
$graph_array_new['device'] = $device['device_id'];
$graph_array_new['height'] = '110';
$graph_array_new['width'] = $width;
$graph_array_new['legend'] = 'no';
$graph_array_new['title'] = 'yes';
$graph_array_new['from'] = $graph_array['from'];
$graph_array_new['to'] = $graph_array['to'];
$graph_array_zoom = $graph_array_new;
$graph_array_zoom['height'] = '150';
$graph_array_zoom['width'] = '400';
$graph_array_zoom['legend'] = 'yes';
$overlib_link = "device/device=" . $device['device_id'] . "/";
echo '<div class="devices-overlib-box" style="min-width:' . ($width + 90) . '; max-width: ' . ($width + 90) . '">';
echo '<div class="panel panel-default">';
echo overlib_link($overlib_link, generate_lazy_graph_tag($graph_array_new), generate_graph_tag($graph_array_zoom), null);
echo "</div></div>\n\n";
}
}
}
} else {
if (is_admin() === true || is_read() === true) {
$os = "SELECT `os` FROM `devices` AS D WHERE 1 GROUP BY `os` ORDER BY `os`";
$ver = "SELECT `version` FROM `devices` AS D WHERE 1 GROUP BY `version` ORDER BY `version`";
$platform = "SELECT `hardware` FROM `devices` AS D WHERE 1 GROUP BY `hardware` ORDER BY `hardware`";
$features = "SELECT `features` FROM `devices` AS D WHERE 1 GROUP BY `features` ORDER BY `features`";
$types = "SELECT `type` FROM `devices` AS D WHERE 1 GROUP BY `type` ORDER BY `type`";
} else {
$os = "SELECT `os` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `os` ORDER BY `os`";
$ver = "SELECT `version` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `version` ORDER BY `version`";
$platform = "SELECT `hardware` FROM `devices` AS `D`, `devices_perms` AS `P` WHERE `P`.`user_id` = ? AND `P`.`device_id` = `D`.`device_id` GROUP BY `hardware` ORDER BY `hardware`";
开发者ID:awlx,项目名称:librenms,代码行数:31,代码来源:devices.inc.php
示例11: generate_graph_tag
$graph_array['to'] = $now;
$graph_array['device'] = $device['device_id'];
$graph_array['type'] = "device_bits";
$graph_array['from'] = $day;
$graph = generate_graph_tag($graph_array);
$content = "<div class=list-large>" . $device['hostname'] . " - Device Traffic</div>";
$content .= "<div style=\\'width: 850px\\'>";
$graph_array['width'] = "340";
$graph_array['from'] = $day;
$content .= generate_graph_tag($graph_array);
$graph_array['from'] = $week;
$content .= generate_graph_tag($graph_array);
$graph_array['from'] = $month;
$content .= generate_graph_tag($graph_array);
$graph_array['from'] = $year;
$content .= generate_graph_tag($graph_array);
$content .= "</div>";
echo overlib_link($_SERVER['REQUEST_URI'], $graph, $content, NULL);
echo ' <div style="height: 5px;"></div>';
echo ' <table class="tablehead" cellpadding="2" cellspacing="0" width="100%">
<tr bgcolor="' . $ports_colour . '" align="center"><td></td>
<td width="25%"><img src="images/16/connect.png" align="absmiddle"> ' . $ports['total'] . '</td>
<td width="25%" class="green"><img src="images/16/if-connect.png" align="absmiddle"> ' . $ports['up'] . '</td>
<td width="25%" class="red"><img src="images/16/if-disconnect.png" align="absmiddle"> ' . $ports['down'] . '</td>
<td width="25%" class="grey"><img src="images/16/if-disable.png" align="absmiddle"> ' . $ports['disabled'] . '</td>
</tr>
</table>';
echo ' <div style="margin: 8px; font-size: 11px; font-weight: bold;">';
$sql = "SELECT * FROM ports WHERE `device_id` = '" . $device['device_id'] . "' AND deleted != '1'";
$query = mysql_query($sql);
$ifsep = "";
开发者ID:kyrisu,项目名称:observernms,代码行数:31,代码来源:ports.inc.php
示例12: foreach
$graph_type = 'atmvp_bits';
}
echo '<table cellspacing="0" cellpadding="5" border="0">';
foreach (dbFetchRows('SELECT * FROM juniAtmVp WHERE port_id = ?', array($interface['port_id'])) as $vp) {
if (is_integer($row / 2)) {
$row_colour = $list_colour_a;
} else {
$row_colour = $list_colour_b;
}
echo '<tr bgcolor="' . $row_colour . '">';
echo '<td><span class=list-bold>' . $row . '. VP' . $vp['vp_id'] . ' ' . $vp['vp_descr'] . '</span></td>';
echo '</tr>';
$graph_array['height'] = '100';
$graph_array['width'] = '214';
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $vp['juniAtmVp_id'];
$graph_array['type'] = $graph_type;
$periods = array('day', 'week', 'month', 'year');
echo '<tr bgcolor="' . $row_colour . '"><td>';
foreach ($periods as $period) {
$graph_array['from'] = ${$period};
$graph_array_zoom = $graph_array;
$graph_array_zoom['height'] = '150';
$graph_array_zoom['width'] = '400';
echo overlib_link('#', generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), null);
}
echo '</td></tr>';
$row++;
}
//end foreach
echo '</table>';
开发者ID:job,项目名称:librenms,代码行数:31,代码来源:junose-atm-vp.inc.php
示例13: generate_storage_row
function generate_storage_row($storage, $vars)
{
global $config;
$table_cols = 8;
if ($vars['page'] != "device" && $vars['popup'] != TRUE) {
$table_cols++;
}
// Add a column for device.
$graph_array = array();
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $storage['storage_id'];
$graph_array['type'] = 'storage_usage';
$graph_array['legend'] = "no";
$link_array = $graph_array;
$link_array['page'] = "graphs";
unset($link_array['height'], $link_array['width'], $link_array['legend']);
$link_graph = generate_url($link_array);
$link = generate_url(array("page" => "device", "device" => $storage['device_id'], "tab" => "health", "metric" => 'storage'));
$overlib_content = generate_overlib_content($graph_array, $storage['hostname'] . ' - ' . $storage['storage_descr']);
$graph_array['width'] = 80;
$graph_array['height'] = 20;
$graph_array['bg'] = 'ffffff00';
$graph_array['from'] = $config['time']['day'];
$mini_graph = generate_graph_tag($graph_array);
$total = formatStorage($storage['storage_size']);
$used = formatStorage($storage['storage_used']);
$free = formatStorage($storage['storage_free']);
$background = get_percentage_colours($storage['storage_perc']);
if ($storage['storage_ignore']) {
$storage['row_class'] = 'suppressed';
} else {
$storage['row_class'] = $background['class'];
}
$row .= '<tr class="ports ' . $storage['row_class'] . '">
<td class="state-marker"></td>';
if ($vars['page'] != "device" && $vars['popup'] != TRUE) {
$row .= '<td class="entity">' . generate_device_link($storage) . '</td>';
}
$row .= ' <td class="entity">' . generate_entity_link('storage', $storage) . '</td>
<td>' . $total . '</td>
<td>' . $used . '</td>
<td>' . $free . '</td>
<td>' . overlib_link($link_graph, $mini_graph, $overlib_content) . '</td>
<td><a href="' . $link_graph . '">
' . print_percentage_bar(400, 20, $storage['storage_perc'], $storage['storage_perc'] . '%', "ffffff", $background['left'], 100 - $storage['storage_perc'] . "%", "ffffff", $background['right']) . '
</a>
</td>
</tr>
';
if ($vars['view'] == "graphs") {
$vars['graph'] = "usage";
}
if ($vars['graph']) {
echo '<tr class="' . $storage['row_class'] . '">';
echo '<td class="state-marker"></td>';
echo '<td colspan="' . $table_cols . '">';
unset($graph_array['height'], $graph_array['width'], $graph_array['legend']);
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $storage['storage_id'];
$graph_array['type'] = 'storage_' . $vars['graph'];
print_graph_row($graph_array, TRUE);
$row .= '</td></tr>';
}
# endif graphs
return $row;
}
开发者ID:Natolumin,项目名称:observium,代码行数:66,代码来源:storage.inc.php
示例14: generate_device_popup
function generate_device_popup($device, $vars = array(), $start = NULL, $end = NULL)
{
global $config;
if (!$start) {
$start = $config['time']['day'];
}
if (!$end) {
$end = $config['time']['now'];
}
$content = generate_device_popup_header($device, $vars = array());
if (isset($config['os'][$device['os']]['graphs'])) {
$graphs = $config['os'][$device['os']]['graphs'];
} elseif (isset($device['os_group']) && isset($config['os'][$device['os_group']]['graphs'])) {
$graphs = $config['os'][$device['os_group']]['graphs'];
} else {
$graphs = $config['os']['default']['graphs'];
}
// Preprocess device graphs array
foreach ($device['graphs'] as $graph) {
if ($graph['enabled'] != '0') {
$graphs_enabled[] = $graph['graph'];
}
}
foreach ($graphs as $entry) {
$graph = $entry;
if ($graph && in_array(str_replace('device_', '', $graph), $graphs_enabled) !== FALSE) {
// No text provided for the minigraph, fetch from array
preg_match('/^(?P<type>[a-z0-9A-Z-]+)_(?P<subtype>[a-z0-9A-Z-_]+)/', $graph, $graphtype);
if (isset($graphtype['type']) && isset($graphtype['subtype'])) {
$type = $graphtype['type'];
$subtype = $graphtype['subtype'];
$text = $config['graph_types'][$type][$subtype]['descr'];
} else {
$text = nicecase($subtype);
// Fallback to the type itself as a string, should not happen!
}
// FIXME -- function!
$graph_array = array();
$graph_array['height'] = "100";
$graph_array['width'] = "290";
$graph_array['to'] = $config['time']['now'];
$graph_array['device'] = $device['device_id'];
$graph_array['type'] = $graph;
$graph_array['from'] = $config['time']['day'];
$graph_array['legend'] = "no";
$graph_array['bg'] = "FFFFFF";
$content .= '<div style="width: 730px; white-space: nowrap;">';
$content .= "<div class=entity-title><h4>" . $text . "</h4></div>";
/*
$content .= generate_box_open(array('title' => $text,
'body-style' => 'white-space: nowrap;'));
*/
$content .= generate_graph_tag($graph_array);
$graph_array['from'] = $config['time']['week'];
$content .= generate_graph_tag($graph_array);
$content .= '</div>';
//$content .= generate_box_close();
}
}
//r($content);
return $content;
}
开发者ID:Natolumin,项目名称:observium,代码行数:62,代码来源:device.inc.php
示例15: overlib_link
$graph_array['from'] = $config['time']['day'];
$graph_array['height'] = '110';
$graph_array['width'] = $width;
// Peer Address
$graph_array_zoom = $graph_array;
$graph_array_zoom['height'] = '150';
$graph_array_zoom['width'] = '500';
$overlib_link = "device/device=" . $peer['device_id'] . "/tab=routing/proto=bgp/";
$peeraddresslink = "<span class=list-large>" . overlib_link($overlib_link, $peer_ident, generate_graph_tag($graph_array_zoom), NULL) . "</span>";
// Local Address
$graph_array['afi'] = 'ipv4';
$graph_array['safi'] = 'unicast';
$graph_array_zoom['afi'] = 'ipv4';
$graph_array_zoom['safi'] = 'unicast';
$overlib_link = "device/device=" . $peer['device_id'] . "/tab=routing/proto=bgp/";
$localaddresslink = "<span class=list-large>" . overlib_link($overlib_link, $peer_ip, generate_graph_tag($graph_array_zoom), NULL) . "</span>";
echo '<tr class="bgp"' . ($peer['alert'] ? ' bordercolor="#cc0000"' : '') . ($peer['disabled'] ? ' bordercolor="#cccccc"' : '') . '>';
unset($sep);
foreach (dbFetchRows('SELECT * FROM `bgpPeers_cbgp` WHERE `device_id` = ? AND bgpPeerIdentifier = ?', array($peer['device_id'], $peer['bgpPeerIdentifier'])) as $afisafi) {
$afi = $afisafi['afi'];
$safi = $afisafi['safi'];
$this_afisafi = $afi . $safi;
$peer['afi'] .= $sep . $afi . '.' . $safi;
$sep = '<br />';
$peer['afisafi'][$this_afisafi] = 1;
// Build a list of valid AFI/SAFI for this peer
}
unset($sep);
echo ' <td></td>
<td width=150>' . $localaddresslink . '<br />' . generate_device_link($peer, shorthost($peer['hostname']), array('tab' => 'routing', 'proto' => 'bgp')) . '</td>
<td width=30><b>»</b></td>
开发者ID:greggcz,项目名称:librenms,代码行数:31,代码来源:bgp.inc.php
示例16: foreach
foreach ($app_list as $app) {
echo '<div style="clear: both;">';
echo '<h2>' . generate_link(nicecase($app['app_type']), array('page' => 'apps', 'app' => $app['app_type'])) . '</h2>';
$app_devices = dbFetchRows("SELECT * FROM `devices` AS D, `applications` AS A WHERE D.device_id = A.device_id AND A.app_type = ?", array($app['app_type']));
foreach ($app_devices as $app_device) {
$graph_type = $graphs[$app['app_type']][0];
$graph_array['type'] = "application_" . $app['app_type'] . "_" . $graph_type;
$graph_array['id'] = $app_device['app_id'];
$graph_array_zoom['type'] = "application_" . $app['app_type'] . "_" . $graph_type;
$graph_array_zoom['id'] = $app_device['app_id'];
$link_array = $graph_array;
$link_array['page'] = "device";
$link_array['device'] = $app_device['device_id'];
$link_array['tab'] = "apps";
$link_array['app'] = $app['app_type'];
unset($link_array['height'], $link_array['width']);
$overlib_url = generate_url($link_array);
$overlib_link = '<span style="float:left; margin-left: 10px; font-weight: bold;">' . shorthost($app_device['hostname']) . "</span>";
if (!empty($app_device['app_instance'])) {
$overlib_link .= '<span style="float:right; margin-right: 10px; font-weight: bold;">' . $app_device['app_instance'] . "</span>";
$app_device['content_add'] = '(' . $app_device['app_instance'] . ')';
}
$overlib_link .= "<br/>";
$overlib_link .= generate_graph_tag($graph_array);
$overlib_content = generate_overlib_content($graph_array, $app_device['hostname'] . " - " . $app_device['app_type'] . $app_device['content_add']);
echo "<div style='display: block; padding: 1px; padding-top: 3px; margin: 2px; min-width: " . $width_div . "px; max-width:" . $width_div . "px; min-height:165px; max-height:165px;\n text-align: center; float: left; background-color: #f5f5f5;'>";
echo overlib_link($overlib_url, $overlib_link, $overlib_content);
echo "</div>";
}
echo '</div>';
}
开发者ID:REAP720801,项目名称:librenms,代码行数:31,代码来源:overview.inc.php
示例17: unset
$graph_array['height'] = '100';
$graph_array['width'] = '210';
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $sensor['sensor_id'];
$graph_array['type'] = $graph_type;
$graph_array['from'] = $config['time']['day'];
$graph_array['legend'] = 'no';
$link_array = $graph_array;
$link_array['page'] = 'graphs';
unset($link_array['height'], $link_array['width'], $link_array['legend']);
$link_graph = generate_url($link_array);
$link = generate_url(array('page' => 'device', 'device' => $sensor['device_id'], 'tab' => 'health', 'metric' => $sensor['sensor_class']));
$overlib_content = '<div style="width: 580px;"><h2>' . $device['hostname'] . ' - ' . $sensor['sensor_descr'] . '</h1>';
foreach (array('day', 'week', 'month', 'year') as $period) {
$graph_array['from'] = $config['time'][$period];
$overlib_content .= str_replace('"', "\\'", generate_graph_tag($graph_array));
}
$overlib_content .= '</div>';
$graph_array['width'] = 80;
$graph_array['height'] = 20;
$graph_array['bg'] = 'ffffff00';
// the 00 at the end makes the area transparent.
$graph_array['from'] = $config['time']['day'];
$sensor_minigraph = generate_lazy_graph_tag($graph_array);
$sensor['sensor_descr'] = truncate($sensor['sensor_descr'], 48, '');
echo '<tr class="health">
<td class=list-bold>' . generate_device_link($sensor) . '</td>
<td>' . overlib_link($link, $sensor['sensor_descr'], $overlib_content) . '</td>
<td >' . overlib_link($link_graph, $sensor_minigraph, $overlib_content) . '</td>
<td >' . $alert . '</td>
<td class="text-center"><strong>' . $sensor['sensor_current'] . $unit . '</strong></td>
开发者ID:rkojedzinszky,项目名称:librenms,代码行数:31,代码来源:sensors.inc.php
示例18: generate_status_row
function generate_status_row($status, $vars)
{
global $config;
$table_cols = 7;
humanize_status($status);
$alert = $status['state_event'] == 'alert' ? 'oicon-exclamation-red' : '';
// FIXME - make this "four graphs in popup" a function/include and "small graph" a function.
// FIXME - DUPLICATED IN device/overview/status
$graph_array = array();
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $status['status_id'];
$graph_array['type'] = "status_graph";
$graph_array['legend'] = "no";
$graph_array['width'] = 80;
$graph_array['height'] = 20;
$graph_array['bg'] = 'ffffff00';
$graph_array['from'] = $config['time']['day'];
$status_misc = '<span class="label">' . $status['entPhysicalClass'] . '</span>';
$row .= '<tr class="' . $status['row_class'] . '">
<td class="state-marker"></td>';
if ($vars['page'] != "device" && $vars['popup'] != TRUE) {
$row .= '<td class="entity">' . generate_device_link($status) . '</td>';
$table_cols++;
}
if ($status['status_event'] && $status['status_name']) {
$mini_graph = generate_graph_tag($graph_array);
} else {
// Do not show "Draw Error" minigraph
$mini_graph = '';
}
$row .= '<td class="entity">' . generate_entity_link('status', $status) . '</td>';
if ($vars['tab'] != "overview") {
$row .= '<td><span class="label">' . $status['entPhysicalClass'] . '</span></td>';
$table_cols++;
}
$row .= '<td style="width: 90px; text-align: right;">' . generate_entity_link('status', $status, $mini_graph, NULL, FALSE) . '</td>';
if ($vars['tab'] != "overview") {
$row .= '<td style="white-space: nowrap">' . generate_tooltip_link(NULL, formatUptime($config['time']['now'] - $status['status_last_change'], 'short-2') . ' ago', format_unixtime($status['status_last_change'])) . '</td>
<td style="text-align: right;"><strong><span class="' . $status['state_class'] . '">' . $status['status_event'] . '</span></strong></td>';
$table_cols++;
$table_cols++;
}
$row .= '<td style="width: 80px; text-align: right;"><strong><span class="' . $status['state_class'] . '">' . $status['status_name'] . '</span></strong></td>
</tr>' . PHP_EOL;
if ($vars['view'] == "graphs") {
$vars['graph'] = "status";
}
if ($vars['graph'] || $vars['id'] == $status['status_id']) {
// If id set in vars, display only specific graphs
$row .= '<tr class="' . $status['row_class'] . '">
<td class="state-marker"></td>
<td colspan="' . $table_cols . '">';
unset($graph_array['height'], $graph_array['width'], $graph_array['legend']);
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $status['status_id'];
$graph_array['type'] = "status_graph";
$row .= generate_graph_row($graph_array, TRUE);
$row .= '</td></tr>';
}
# endif graphs
return $row;
}
开发者ID:Natolumin,项目名称:observium,代码行数:62,代码来源:status.inc.php
示例19: generate_sla_row
function generate_sla_row($sla, $vars)
{
global $config;
humanize_sla($sla);
$table_cols = "8";
$graph_array = array();
$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $sla['sla_id'];
$graph_array['type'] = $sla['graph_type'];
$graph_array['legend'] = "no";
$graph_array['width'] = 80;
$graph_array['height'] = 20;
$graph_array['bg'] = 'ffffff00';
$graph_array['from'] = $config['time']['day'];
if ($sla['rtt_event'] && $sla['rtt_sense']) {
$mini_graph = generate_graph_tag($graph_array);
} else {
// Do not show "Draw Error" minigraph
$mini_graph = '';
}
$out = '<tr class="' . $sla['row_class'] . '"><td class="state-marker"></td>'
|
请发表评论