- Timestamp:
- 03/07/16 18:05:24 (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r799 r806 29 29 &initIPDBGlobals &connectDB &finish &checkDBSanity 30 30 &addMaster &touchMaster 31 &list Summary &listSubs &listContainers &listAllocations &listForMerge &listFree &listPool31 &listVRF &listSummary &listSubs &listContainers &listAllocations &listForMerge &listFree &listPool 32 32 &getMasterList &getTypeList &getPoolSelect &findAllocateFrom 33 33 &ipParent &subParent &blockParent &getBreadCrumbs &getRoutedCity … … 45 45 &initIPDBGlobals &connectDB &finish &checkDBSanity 46 46 &addMaster &touchMaster 47 &list Summary &listSubs &listContainers &listAllocations &listForMerge &listFree &listPool47 &listVRF &listSummary &listSubs &listContainers &listAllocations &listForMerge &listFree &listPool 48 48 &getMasterList &getTypeList &getPoolSelect &findAllocateFrom 49 49 &ipParent &subParent &blockParent &getBreadCrumbs &getRoutedCity … … 843 843 return ('OK','OK'); 844 844 } # end touchMaster() 845 846 847 ## IPDB::listVRF() 848 # Get summary list of all VRFs 849 # Returns an arrayref to a list of hashrefs with the VRF name, comment 850 sub listVRF { 851 my $dbh = shift; 852 my $vrflist = $dbh->selectall_arrayref("SELECT vrf,comment FROM vrfs ORDER BY vrf", { Slice => {} }); 853 return $vrflist; 854 } # end listVRF() 845 855 846 856 -
trunk/cgi-bin/main.cgi
r800 r806 259 259 260 260 261 # Initial display: Show master blocks with total allocated subnets, total free subnets261 # Initial display: Show list of VRFs 262 262 sub showSummary { 263 my $masterlist = listSummary($ip_dbh); 264 $page->param(masterlist => $masterlist); 265 266 $page->param(addmaster => ($IPDBacl{$authuser} =~ /a/) ); 263 my $vrflist = listVRF($ip_dbh); 264 $page->param(vrflist => $vrflist); 265 266 # Only systems/network should be allowed to add VRFs - or maybe higher? 267 $page->param(addvrf => ($IPDBacl{$authuser} =~ /s/) ); 267 268 } # showSummary 268 269 -
trunk/templates/index.tmpl
r687 r806 2 2 <div class="center"> 3 3 <table class="center altrows" width="98%" cellspacing="0"> 4 <TMPL_IF masterlist>4 <TMPL_IF vrflist> 5 5 <tr class="heading"> 6 <td>Master netblock</td> 7 <td>Primary VRF</td> 8 <td>Aggregation/Containers</td> 9 <td>Allocated netblocks</td> 10 <td>Free netblocks</td> 11 <td>Largest free block</td> 6 <td>VRF</td> 7 <td>Comment</td> 12 8 </tr> 13 <TMPL_LOOP NAME= masterlist>9 <TMPL_LOOP NAME=vrflist> 14 10 <tr> 15 <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 <td><TMPL_VAR NAME=routed></td> 18 <td><TMPL_VAR NAME=allocated></td> 19 <td><TMPL_VAR NAME=free></td> 20 <td><TMPL_VAR ESCAPE=HTML NAME=bigfree></td> 11 <td><a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=showvrf&vrf=<TMPL_VAR NAME=vrf>"><TMPL_VAR NAME=vrf></a></td> 12 <td><TMPL_VAR comment></td> 21 13 </tr> 22 14 </TMPL_LOOP> 23 15 <TMPL_ELSE> 24 16 <tr class="heading"> 25 <td>No netblock data</td>17 <td>No VRFs defined</td> 26 18 </tr> 27 19 </TMPL_IF> 28 20 </table> 29 <TMPL_IF add master>21 <TMPL_IF addvrf> 30 22 <br> 31 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=add master">Add new master block</a>23 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=addvrf">Add new VRF</a> 32 24 </TMPL_IF> 33 <br><br>34 Note: Free blocks noted here include both routed and unrouted blocks.35 25 </div> 36
Note:
See TracChangeset
for help on using the changeset viewer.