function renderFlatIP() { if (isset($_REQUEST['attr_id']) && isset($_REQUEST['attr_value'])) { $params = array('attr_id' => $_REQUEST['attr_id'], 'attr_value' => $_REQUEST['attr_value']); $av = $_REQUEST['attr_value']; if ($av === 'NULL') { $av = NULL; } $nets = fetchNetworksByAttr($_REQUEST['attr_id'], $av, TRUE); } else { $params = array(); $nets = array_merge(listCells('ipv4net'), listCells('ipv6net')); } $cf = getCellFilter(); $nets = filterCellList($nets, $cf['expression']); echo "<table border=0 class=objectview>\n"; echo "<tr><td class=pcleft>"; startPortlet(sprintf("Networks (%d)", count($nets))); echo '<ol>'; foreach ($nets as $network) { echo '<li>'; renderCell($network); echo '</li>'; } echo '</ol>'; finishPortlet(); echo '</td><td class=pcright>'; renderCellFilterPortlet($cf, 'ipv4net', $nets, $params); echo '</td></tr></table>'; }
function renderDeployQueue() { global $nextorder, $dqtitle; $order = 'odd'; $dqcode = getBypassValue(); $allq = get8021QDeployQueues(); foreach ($allq as $qcode => $data) { if ($dqcode == $qcode) { echo "<h2 align=center>Queue '" . $dqtitle[$qcode] . "' (" . count($data) . ")</h2>"; if (!count($data)) { continue; } echo '<table cellspacing=0 cellpadding=5 align=center class=widetable>'; echo '<tr><th>switch</th><th>changed</th><th>'; foreach ($data as $item) { echo "<tr class=row_{$order}><td>"; renderCell(spotEntity('object', $item['object_id'])); echo "</td><td>" . formatAge($item['last_change']) . "</td></tr>"; $order = $nextorder[$order]; } echo '</table>'; } } }
function renderDeployQueue() { global $nextorder, $dqtitle; $order = 'odd'; $dqcode = getBypassValue(); $allq = get8021QDeployQueues(); $en_key = $dqcode == 'disabled' ? 'disabled' : 'enabled'; foreach ($allq as $qcode => $data) { if ($dqcode == 'disabled' || $dqcode == $qcode) { if (!count($data[$en_key])) { continue; } if ($dqcode == 'disabled') { echo "<h2 align=center>Queue " . $dqtitle[$qcode] . " (" . count($data[$en_key]) . ")</h2>"; } echo '<table cellspacing=0 cellpadding=5 align=center class=widetable>'; echo '<tr><th>switch</th><th>age</th><th>'; foreach ($data[$en_key] as $item) { echo "<tr class=row_{$order}><td>"; renderCell(spotEntity('object', $item['object_id'])); echo "</td><td>{$item['last_change_age']}</td></tr>"; $order = $nextorder[$order]; } echo '</table>'; } } }