Exemplo n.º 1
0
function generate_entity_popup_header($entity, $vars)
{
    $translate = entity_type_translate_array($vars['entity_type']);
    $vars['popup'] = TRUE;
    $vars['entity_icon'] = TRUE;
    switch ($vars['entity_type']) {
        case "sensor":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_sensor_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        case "toner":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_toner_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        case "bgp_peer":
            if ($entity['peer_device_id']) {
                $peer_dev = device_by_id_cache($entity['peer_device_id']);
                $peer_name = '<br /><a class="entity" style="font-weight: bold;">' . $peer_dev['hostname'] . '</a>';
            } else {
                if ($entity['reverse_dns']) {
                    $peer_name = '<br /><span style="font-weight: bold;">' . $entity['reverse_dns'] . '</span>';
                }
            }
            $astext = '<span>AS' . $entity['bgpPeerRemoteAs'];
            if ($entity['astext']) {
                $astext .= '<br />' . $entity['astext'] . '</span>';
            }
            $astext .= '</span>';
            $contents .= generate_box_open();
            $contents .= '
      <table class="' . OBS_CLASS_TABLE . '">
        <tr class="' . $entity['row_class'] . ' vertical-align" style="font-size: 10pt;">
          <td class="state-marker"></td>
          <td style="width: 10px;"></td>
          <td style="width: 10px;"><i class="' . $translate['icon'] . '"></i></td>
          <td><a class="entity-popup" style="font-size: 15px; font-weight: bold;">' . $entity['entity_shortname'] . '</a>' . $peer_name . '</td>
          <td class="text-nowrap" style="width: 20%;">' . $astext . '</td>
          <td></td>
        </tr>
      </table>';
            $contents .= generate_box_close();
            break;
        case "sla":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_sla_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        case "processor":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_processor_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        case "mempool":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_mempool_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        case "p2pradio":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_p2pradio_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        case "status":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_status_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        case "storage":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_storage_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        case "netscalervsvr":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_netscalervsvr_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        case "netscalersvc":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_netscalersvc_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        case "netscalersvcgrpmem":
            $contents .= generate_box_open();
            $contents .= '<table class="' . OBS_CLASS_TABLE . '">';
            $contents .= generate_netscalersvcmem_row($entity, $vars);
            $contents .= '</table>';
            $contents .= generate_box_close();
            break;
        default:
            entity_rewrite($vars['entity_type'], $entity);
            $contents = generate_box_open() . '
      <table class="' . OBS_CLASS_TABLE_STRIPED . '">
        <tr class="' . $entity['row_class'] . '" style="font-size: 10pt;">
          <td class="state-marker"></td>
          <td style="width: 10px;"></td>
          <td width="400"><i class="' . $translate['icon'] . '" style="margin-right: 10px;"></i> <a class="entity-popup" style="font-size: 15px; font-weight: bold;">' . $entity['entity_name'] . '</a></td>
          <td width="100"></td>
          <td></td>
        </tr>
      </table>' . generate_box_close();
    }
    return $contents;
}
Exemplo n.º 2
0
function print_storage_row($storage, $vars)
{
    echo generate_storage_row($storage, $vars);
}