Changeset 808
- Timestamp:
- 03/08/16 13:16:44 (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r806 r808 1391 1391 sub getBreadCrumbs { 1392 1392 my $dbh = shift; 1393 my $parent = shift; 1393 my $parent = shift || 0; 1394 my $vrf = shift; # if we're not browsing into netblocks yet, caller can pass the VRF for breadcrumbs 1394 1395 my @result; 1395 1396 1396 my $sth = $dbh-> prepare("SELECT cidr,type,id,parent_id FROM allocations WHERE id=?");1397 my $sth = $dbh-> prepare("SELECT cidr,type,id,parent_id,vrf FROM allocations WHERE id=?"); 1397 1398 1398 1399 while ($parent != 0) { 1399 1400 $sth->execute($parent); 1400 my ($cidr,$type,$id,$pid) = $sth->fetchrow_array; 1401 push @result, {cidr => $cidr, link => $id, ispool => ($type =~ /^.[dp]$/ ? 1 : 0)}; 1401 my ($cidr,$type,$id,$pid,$bvrf) = $sth->fetchrow_array; 1402 $vrf = $bvrf; 1403 push @result, { cidr => $cidr, link => $id, ispool => ($type =~ /^.[dp]$/ ? 1 : 0) }; 1402 1404 $parent = $pid; 1403 1405 } 1404 1406 1407 push @result, { cidr => "vrf:$vrf", link => $vrf, isvrf => 1 } 1408 if $vrf; 1409 1405 1410 return \@result; 1406 } # end getBread ()1411 } # end getBreadCrumbs() 1407 1412 1408 1413 -
trunk/cgi-bin/main.cgi
r806 r808 108 108 if($webvar{action} eq 'index') { 109 109 showSummary(); 110 } elsif ($webvar{action} eq 'showvrf') { 111 showVRF(); 110 112 } elsif ($webvar{action} eq 'addmaster') { 111 113 if ($IPDBacl{$authuser} !~ /a/) { … … 269 271 270 272 273 # Show IP blocks in a VRF 274 sub showVRF { 275 my $masterlist = listSummary($ip_dbh, $webvar{vrf}); 276 $page->param(vrf => $webvar{vrf}); 277 $page->param(masterlist => $masterlist); 278 279 # we don't have a netblock; pass 0 for the block ID 280 # Tree navigation 281 my $crumbs = getBreadCrumbs($ip_dbh, 0, $webvar{vrf}); 282 my @rcrumbs = reverse (@$crumbs); 283 $utilbar->param(breadcrumb => \@rcrumbs); 284 285 $page->param(addmaster => ($IPDBacl{$authuser} =~ /s/) ); 286 } # showVRF 287 288 271 289 # Display blocks immediately within a given parent 272 290 sub showSubs { … … 306 324 #$page->param(editme => 1) unless $pinfo->{type} ne 'mm'; 307 325 308 my $crumbs = getBreadCrumbs($ip_dbh, $pinfo->{parent_id} );326 my $crumbs = getBreadCrumbs($ip_dbh, $pinfo->{parent_id}, $pinfo->{vrf}); 309 327 my @rcrumbs = reverse (@$crumbs); 310 328 $utilbar->param(breadcrumb => \@rcrumbs); -
trunk/templates/showvrf.tmpl
r802 r808 1 <div class="tbltitle">Master netblocks in <TMPL_VAR NAME=vrf></div> 2 1 3 <br> 2 4 <div class="center"> … … 5 7 <tr class="heading"> 6 8 <td>Master netblock</td> 7 <td>Primary VRF</td>8 9 <td>Aggregation/Containers</td> 9 10 <td>Allocated netblocks</td> … … 14 15 <tr> 15 16 <td><a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=showsubs&parent=<TMPL_VAR NAME=id>"><TMPL_VAR NAME=master></a></td> 16 <td><TMPL_VAR NAME=vrf></td>17 17 <td><TMPL_VAR NAME=routed></td> 18 18 <td><TMPL_VAR NAME=allocated></td> … … 31 31 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=addmaster">Add new master block</a> 32 32 </TMPL_IF> 33 <br><br>34 Note: Free blocks noted here include both routed and unrouted blocks.35 33 </div> 36 34
Note:
See TracChangeset
for help on using the changeset viewer.