interface.php.patch (4,573 bytes)
Index: interface.php
===================================================================
--- interface.php (revision 5010)
+++ interface.php (working copy)
@@ -2519,8 +2519,14 @@
}
// pager
- $maxperpage = getConfigVar ('IPV4_ADDRS_PER_PAGE');
- $address_count = $endip - $startip + 1;
+ $maxperpage = getConfigVar ('IPV4_ADDRS_PER_PAGE');
+ $reservedips = 0;
+ for ($ip = $startip; $ip <= $endip; $ip++) :
+ $addr = $range['addrlist'][$ip];
+ if ( $addr['reserved'] == 'yes')
+ $reservedips++;
+ endfor;
+ $address_count = $endip - $startip - $reservedips + 1;
$page = 0;
$rendered_pager = '';
if ($address_count > $maxperpage && $maxperpage > 0)
@@ -2553,51 +2559,54 @@
continue;
}
$addr = $range['addrlist'][$ip];
- // render IP change history
- $title = '';
- $history_class = '';
- if (isset ($addr['last_log']))
- {
- $title = ' title="' . htmlspecialchars ($addr['last_log']['user'] . ', ' . formatAge ($addr['last_log']['time']) , ENT_QUOTES) . '"';
- $history_class = 'hover-history underline';
+ if ($addr['reserved'] != 'yes')
+ {
+ // render IP change history
+ $title = '';
+ $history_class = '';
+ if (isset ($addr['last_log']))
+ {
+ $title = ' title="' . htmlspecialchars ($addr['last_log']['user'] . ', ' . formatAge ($addr['last_log']['time']) , ENT_QUOTES) . '"';
+ $history_class = 'hover-history underline';
+ }
+ echo "<tr class='${addr['class']}'>";
+ echo "<td class=tdleft><a class='ancor $history_class' $title name='ip-$dottedquad' href='".makeHref(array('page'=>'ipaddress', 'ip'=>$addr['ip']))."'>${addr['ip']}</a></td>";
+ echo "<td class='${secondstyle} " .
+ (empty ($addr['allocs']) || !empty ($addr['name']) ? 'rsv-port' : '') .
+ "'><span class='rsvtext'>${addr['name']}</span></td><td class='${secondstyle}'>";
+ $delim = '';
+ if ( $addr['reserved'] == 'yes')
+ {
+ echo "<strong>RESERVED</strong> ";
+ $delim = '; ';
+ }
+ foreach ($addr['allocs'] as $ref)
+ {
+ echo $delim . $aac2[$ref['type']];
+ echo "<a href='".makeHref(array('page'=>'object', 'object_id'=>$ref['object_id'], 'tab' => 'default', 'hl_ipv4_addr'=>$addr['ip']))."'>";
+ echo $ref['name'] . (!strlen ($ref['name']) ? '' : '@');
+ echo "${ref['object_name']}</a>";
+ $delim = '; ';
+ }
+ if ($delim != '')
+ $delim = '<br>';
+ foreach ($addr['vslist'] as $vs_id)
+ {
+ $vs = spotEntity ('ipv4vs', $vs_id);
+ echo "${delim}<a href='".makeHref(array('page'=>'ipv4vs', 'vs_id'=>$vs['id']))."'>";
+ echo "${vs['name']}:${vs['vport']}/${vs['proto']}</a>→";
+ $delim = '<br>';
+ }
+ foreach ($addr['rsplist'] as $rsp_id)
+ {
+ $rsp = spotEntity ('ipv4rspool', $rsp_id);
+ echo "${delim}→<a href='".makeHref(array('page'=>'ipv4rspool', 'pool_id'=>$rsp['id']))."'>";
+ echo "${rsp['name']}</a>";
+ $delim = '<br>';
+ }
}
- echo "<tr class='${addr['class']}'>";
- echo "<td class=tdleft><a class='ancor $history_class' $title name='ip-$dottedquad' href='".makeHref(array('page'=>'ipaddress', 'ip'=>$addr['ip']))."'>${addr['ip']}</a></td>";
- echo "<td class='${secondstyle} " .
- (empty ($addr['allocs']) || !empty ($addr['name']) ? 'rsv-port' : '') .
- "'><span class='rsvtext'>${addr['name']}</span></td><td class='${secondstyle}'>";
- $delim = '';
- if ( $addr['reserved'] == 'yes')
- {
- echo "<strong>RESERVED</strong> ";
- $delim = '; ';
- }
- foreach ($addr['allocs'] as $ref)
- {
- echo $delim . $aac2[$ref['type']];
- echo "<a href='".makeHref(array('page'=>'object', 'object_id'=>$ref['object_id'], 'tab' => 'default', 'hl_ipv4_addr'=>$addr['ip']))."'>";
- echo $ref['name'] . (!strlen ($ref['name']) ? '' : '@');
- echo "${ref['object_name']}</a>";
- $delim = '; ';
- }
- if ($delim != '')
- $delim = '<br>';
- foreach ($addr['vslist'] as $vs_id)
- {
- $vs = spotEntity ('ipv4vs', $vs_id);
- echo "${delim}<a href='".makeHref(array('page'=>'ipv4vs', 'vs_id'=>$vs['id']))."'>";
- echo "${vs['name']}:${vs['vport']}/${vs['proto']}</a>→";
- $delim = '<br>';
- }
- foreach ($addr['rsplist'] as $rsp_id)
- {
- $rsp = spotEntity ('ipv4rspool', $rsp_id);
- echo "${delim}→<a href='".makeHref(array('page'=>'ipv4rspool', 'pool_id'=>$rsp['id']))."'>";
- echo "${rsp['name']}</a>";
- $delim = '<br>';
- }
echo "</td></tr>\n";
- endfor;
+ endfor;
// end of iteration
if (permitted (NULL, NULL, 'set_reserve_comment'))
addJS ('js/inplace-edit.js');