Changeset 806 for trunk/cgi-bin


Ignore:
Timestamp:
03/07/16 18:05:24 (8 years ago)
Author:
Kris Deugau
Message:

/trunk

Promote VRFs to top-level entities. See #54.

1 of mumble; convert index page to list VRFs instead of master blocks.

Location:
trunk/cgi-bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r799 r806  
    2929        &initIPDBGlobals &connectDB &finish &checkDBSanity
    3030        &addMaster &touchMaster
    31         &listSummary &listSubs &listContainers &listAllocations &listForMerge &listFree &listPool
     31        &listVRF &listSummary &listSubs &listContainers &listAllocations &listForMerge &listFree &listPool
    3232        &getMasterList &getTypeList &getPoolSelect &findAllocateFrom
    3333        &ipParent &subParent &blockParent &getBreadCrumbs &getRoutedCity
     
    4545                &initIPDBGlobals &connectDB &finish &checkDBSanity
    4646                &addMaster &touchMaster
    47                 &listSummary &listSubs &listContainers &listAllocations &listForMerge &listFree &listPool
     47                &listVRF &listSummary &listSubs &listContainers &listAllocations &listForMerge &listFree &listPool
    4848                &getMasterList &getTypeList &getPoolSelect &findAllocateFrom
    4949                &ipParent &subParent &blockParent &getBreadCrumbs &getRoutedCity
     
    843843  return ('OK','OK');
    844844} # 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
     850sub 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()
    845855
    846856
  • trunk/cgi-bin/main.cgi

    r800 r806  
    259259
    260260
    261 # Initial display:  Show master blocks with total allocated subnets, total free subnets
     261# Initial display:  Show list of VRFs
    262262sub 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/) );
    267268} # showSummary
    268269
Note: See TracChangeset for help on using the changeset viewer.