本文整理汇总了PHP中formatCiscoHardware函数的典型用法代码示例。如果您正苦于以下问题:PHP formatCiscoHardware函数的具体用法?PHP formatCiscoHardware怎么用?PHP formatCiscoHardware使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了formatCiscoHardware函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: generate_device_popup_header
function generate_device_popup_header($device, $vars = array())
{
global $config;
humanize_device($device);
if ($device['os'] == "ios") {
formatCiscoHardware($device, TRUE);
}
// FIXME or generic function for more than just IOS? [and/or do this at poll time]
$contents = '
<table class="table table-striped table-bordered table-rounded table-condensed">
<tr class="' . $device['html_row_class'] . '" style="font-size: 10pt;">
<td class="state-marker"></td>
<td width="40" style="padding: 10px; text-align: center; vertical-align: middle;">' . get_device_icon($device) . '</td>
<td width="200"><a href="#" class="' . $class . '" style="font-size: 15px; font-weight: bold;">' . escape_html($device['hostname']) . '</a><br />' . escape_html(truncate($device['location'], 64, '')) . '</td>
<td>' . escape_html($device['hardware']) . ' <br /> ' . $device['os_text'] . ' ' . escape_html($device['version']) . '</td>
<td>' . deviceUptime($device, 'short') . '<br />' . escape_html($device['sysName']) . '
</tr>
</table>
';
return $contents;
}
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:21,代码来源:device.inc.php
示例2: strtolower
$class = 'bg-danger';
} else {
$class = 'bg-primary';
}
if ($device['ignore'] == '1') {
$class = 'bg-warning';
if ($device['status'] == '1') {
$class = 'bg-success';
}
}
if ($device['disabled'] == '1') {
$class = 'bg-info';
}
$type = strtolower($device['os']);
if ($device['os'] == 'ios') {
formatCiscoHardware($device, true);
}
$device['os_text'] = $config['os'][$device['os']]['text'];
echo ' <tr>
<td class="' . $class . ' "></td>
<td>' . $image . '</td>
<td><span style="font-size: 15px;">' . generate_device_link($device) . '</span></td>';
echo '<td>';
if ($port_count) {
echo ' <img src="images/icons/port.png" align=absmiddle /> ' . $port_count;
}
echo '<br />';
if ($sensor_count) {
echo ' <img src="images/icons/sensors.png" align=absmiddle /> ' . $sensor_count;
}
echo '</td>';
开发者ID:sfromm,项目名称:librenms,代码行数:31,代码来源:hostbox-public.inc.php
示例3: formatCiscoHardware
* @package observium
* @subpackage webui
* @author Adam Armstrong <[email protected]>
* @copyright (C) 2006-2014 Adam Armstrong
*
*/
?>
<div class="well info_box">
<div class="title"><i class="oicon-server"></i> Device Information</div>
<div class="content">
<?php
if ($config['overview_show_sysDescr']) {
echo '<div style="font-family: courier, serif; margin: 3px"><strong>' . $device['sysDescr'] . "</strong></div>";
}
if ($device['os'] == "ios") {
formatCiscoHardware($device);
}
// FIXME or do this in a general function for all OS types with a switch($device['os']) ?
echo '<table class="table table-condensed-more table-striped table-bordered">';
if ($device['purpose']) {
echo '<tr>
<td class="entity">Description</td>
<td>' . htmlspecialchars($device['purpose']) . '</td>
</tr>';
}
if ($device['hardware']) {
echo '<tr>
<td class="entity">Hardware</td>
<td>' . htmlspecialchars($device['hardware']) . '</td>
</tr>';
}
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:information.inc.php
示例4: generate_device_link_header
function generate_device_link_header($device, $vars = array())
{
global $config;
if (isset($device['humanized_device']) == FALSE) {
humanize_device($device);
}
if ($device['os'] == "ios") {
formatCiscoHardware($device, true);
}
# print_r($device);
$contents = '
<table class="table table-striped table-bordered table-rounded table-condensed">
<tr class="' . $device['html_row_class'] . '" style="font-size: 10pt;">
<td style="width: 10px; background-color: ' . $device['html_tab_colour'] . '; margin: 0px; padding: 0px"></td>
<td width="40" style="padding: 10px; text-align: center; vertical-align: middle;">' . getImage($device) . '</td>
<td width="200"><a href="#" class="' . $class . '" style="font-size: 15px; font-weight: bold;">' . $device['hostname'] . '</a><br />' . truncate($device['location'], 64, '') . '</td>
<td>' . $device['hardware'] . ' <br /> ' . $device['os_text'] . ' ' . $device['version'] . '</td>
<td>' . deviceUptime($device, 'short') . '<br />' . $device['sysName'] . '
</tr>
</table>
';
return $contents;
}
开发者ID:RomanBogachev,项目名称:observium,代码行数:23,代码来源:functions.inc.php
示例5: print_device_hostbox
function print_device_hostbox($device, $mode = 'basic')
{
global $config;
if (!is_array($device)) {
print_error("Invalid device passed to print_device_hostbox()!");
}
if ($device['os'] == "ios") {
formatCiscoHardware($device, TRUE);
}
humanize_device($device);
$hostbox_tags = array('html_row_class' => $device['html_row_class'], 'device_id' => $device['device_id'], 'device_link' => generate_device_link($device), 'hardware' => escape_html($device['hardware']), 'features' => escape_html($device['features']), 'os_text' => $device['os_text'], 'version' => escape_html($device['version']), 'sysName' => escape_html($device['sysName']), 'device_uptime' => deviceUptime($device, 'short'), 'location' => escape_html(truncate($device['location'], 32, '')));
switch ($mode) {
case 'detail':
case 'details':
$hostbox_tags['device_image'] = get_device_icon($device);
$hostbox_tags['ports_count'] = dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE `device_id` = ?;", array($device['device_id']));
$hostbox_tags['sensors_count'] = dbFetchCell("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = ?;", array($device['device_id']));
$hostbox = '
<tr class="' . $hostbox_tags['html_row_class'] . '" onclick="location.href=\'device/device=' . $hostbox_tags['device_id'] . '/\'" style="cursor: pointer;">
<td class="state-marker"></td>
<td style="width: 64px; text-align: center; vertical-align: middle;">' . $hostbox_tags['device_image'] . '</td>
<td style="width: 300px;"><span class="entity-title">' . $hostbox_tags['device_link'] . '</span><br />' . $hostbox_tags['location'] . '</td>
<td style="width: 55px;">';
if ($hostbox_tags['ports_count']) {
$hostbox .= '<i class="oicon-network-ethernet"></i> ' . $hostbox_tags['ports_count'];
}
$hostbox .= '<br />';
if ($hostbox_tags['sensors_count']) {
$hostbox .= '<i class="oicon-dashboard"></i> ' . $hostbox_tags['sensors_count'];
}
$hostbox .= '</td>
<td>' . $hostbox_tags['hardware'] . '<br />' . $hostbox_tags['features'] . '</td>
<td>' . $hostbox_tags['os_text'] . '<br />' . $hostbox_tags['version'] . '</td>
<td>' . $hostbox_tags['device_uptime'] . '<br />' . $hostbox_tags['sysName'] . '</td>
</tr>';
break;
case 'status':
$hostbox_tags['device_image'] = get_device_icon($device);
// Graphs
$graph_array = array();
$graph_array['height'] = "100";
$graph_array['width'] = "310";
$graph_array['to'] = $config['time']['now'];
$graph_array['device'] = $device['device_id'];
$graph_array['type'] = "device_bits";
$graph_array['from'] = $config['time']['day'];
$graph_array['legend'] = "no";
$graph_array['height'] = "45";
$graph_array['width'] = "175";
$graph_array['bg'] = "FFFFFF00";
if (isset($config['os'][$device['os']]['over'])) {
$graphs = $config['os'][$device['os']]['over'];
} else {
if (isset($device['os_group']) && isset($config['os'][$device['os_group']]['over'])) {
$graphs = $config['os'][$device['os_group']]['over'];
} else {
$graphs = $config['os']['default']['over'];
}
}
// Preprocess device graphs array
foreach ($GLOBALS['device_graphs'][$device['device_id']] as $graph) {
$graphs_enabled[] = $graph['graph'];
}
foreach ($graphs as $entry) {
if ($entry['graph'] && in_array(str_replace('device_', '', $entry['graph']), $graphs_enabled)) {
$graph_array['type'] = $entry['graph'];
$graph_array['popup_title'] = $entry['text'];
$hostbox_tags['graphs'][] = generate_graph_popup($graph_array);
}
}
$hostbox = '
<tr class="' . $hostbox_tags['html_row_class'] . '" onclick="location.href=\'device/device=' . $hostbox_tags['device_id'] . '/\'" style="cursor: pointer;">
<td class="state-marker"></td>
<td style="width: 64px; text-align: center; vertical-align: middle;">' . $hostbox_tags['device_image'] . '</td>
<td style="width: 300px;"><span class="entity-title">' . $hostbox_tags['device_link'] . '</span><br />' . $hostbox_tags['location'] . '</td>
<td>';
if ($hostbox_tags['graphs']) {
$hostbox .= '<div class="pull-right" style="height: 50px; padding: 2px; margin: 0;">' . implode($hostbox_tags['graphs']) . '</div>';
}
$hostbox .= '</td>
</tr>';
break;
default:
// basic
$hostbox = '
<tr class="' . $hostbox_tags['html_row_class'] . '" onclick="location.href=\'device/device=' . $hostbox_tags['device_id'] . '/\'" style="cursor: pointer;">
<td style="width: 300;"><span class="entity-title">' . $hostbox_tags['device_link'] . '</span><br />' . $hostbox_tags['location'] . '</td>
<td>' . $hostbox_tags['hardware'] . ' ' . $hostbox_tags['features'] . '</td>
<td>' . $hostbox_tags['os_text'] . ' ' . $hostbox_tags['version'] . '</td>
<td>' . $hostbox_tags['device_uptime'] . '</td>
</tr>';
}
echo $hostbox;
}
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:94,代码来源:device.inc.php
注:本文中的formatCiscoHardware函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论