- Timestamp:
- 10/08/14 17:31:48 (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r629 r630 590 590 ## IPDB::listFree() 591 591 # Gets a list of free blocks in the requested parent/master and VRF instance in both CIDR and range notation 592 # Takes a parent/master and an optional VRF specifier that defaults to empty.592 # Takes a parent/master ID and an optional VRF specifier that defaults to empty. 593 593 # Returns an arrayref to a list of hashrefs containing the CIDR and range-notation blocks 594 594 # Returns some extra flags in the hashrefs for routed blocks, since those can have several subtypes … … 599 599 # Just In Case 600 600 $args{vrf} = '' if !$args{vrf}; 601 $args{rdepth} = 1 if !$args{rdepth}; 602 603 # do it this way so we can waste a little less time iterating 604 # my $sth = $dbh->prepare("SELECT cidr FROM freeblocks WHERE parent = ? AND rdepth = ? AND vrf = ? ". 605 my $sth = $dbh->prepare("SELECT cidr FROM freeblocks WHERE parent = ? AND rdepth = ? ". 606 "ORDER BY cidr"); 607 # $sth->execute($args{master}, $args{rdepth}, $args{vrf}); 608 $sth->execute($args{master}, $args{rdepth}); 601 602 my $sth = $dbh->prepare("SELECT cidr,id FROM freeblocks WHERE parent_id = ? ORDER BY cidr"); 603 # $sth->execute($args{parent}, $args{vrf}); 604 $sth->execute($args{parent}); 609 605 my @flist; 610 while (my ($cidr ) = $sth->fetchrow_array()) {606 while (my ($cidr,$id) = $sth->fetchrow_array()) { 611 607 $cidr = new NetAddr::IP $cidr; 612 608 my %row = ( 613 609 fblock => "$cidr", 614 610 frange => $cidr->range, 611 fbid => $id, 612 fbparent => $args{parent}, 615 613 ); 616 614 push @flist, \%row; … … 626 624 my $pool = shift; 627 625 628 my $sth = $dbh->prepare("SELECT ip,custid,available,description,type, rdepth".629 " FROM poolips WHERE p ool= ? ORDER BY ip");626 my $sth = $dbh->prepare("SELECT ip,custid,available,description,type,id". 627 " FROM poolips WHERE parent_id = ? ORDER BY ip"); 630 628 $sth->execute($pool); 631 629 my @poolips; 632 while (my ($ip,$custid,$available,$desc,$type,$ rdepth) = $sth->fetchrow_array) {630 while (my ($ip,$custid,$available,$desc,$type,$id) = $sth->fetchrow_array) { 633 631 my %row = ( 634 632 ip => $ip, … … 637 635 desc => $desc, 638 636 delme => $available eq 'n', 639 ipdepth => $rdepth, 637 parent => $pool, 638 id => $id, 640 639 ); 641 640 push @poolips, \%row; -
trunk/templates/listpool.tmpl
r575 r630 31 31 <td> 32 32 <TMPL_IF delme> 33 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=edit& block=<TMPL_VAR NAME=ip>&rdepth=<TMPL_VAR NAME=ipdepth>"><TMPL_VAR NAME=ip></a>33 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=edit&id=<TMPL_VAR NAME=id>&basetype=i"><TMPL_VAR NAME=ip></a> 34 34 <TMPL_ELSE> 35 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=assign&block=<TMPL_VAR NAME=i p>&rdepth=<TMPL_VAR NAME=ipdepth>&fbtype=i"><TMPL_VAR NAME=ip></a>35 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=assign&block=<TMPL_VAR NAME=id>&parent=<TMPL_VAR NAME=parent>&fbtype=i"><TMPL_VAR NAME=ip></a> 36 36 </TMPL_IF> 37 37 </td> … … 40 40 <td><TMPL_VAR NAME=desc></td> 41 41 <TMPL_IF maydel><td><TMPL_IF delme> 42 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=delete&block=<TMPL_VAR NAME=i p>&rdepth=<TMPL_VAR NAME=ipdepth>&alloctype=<TMPL_VAR NAME=type>">Unassign this IP</a>42 <a href="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi?action=delete&block=<TMPL_VAR NAME=id>&basetype=i&parent=<TMPL_VAR NAME=parent>">Unassign this IP</a> 43 43 </TMPL_IF></td></TMPL_IF> 44 44 </tr>
Note:
See TracChangeset
for help on using the changeset viewer.