blob: 06ac556cfb89b9f6740a659cff11e7ff15b7767e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
<%= header('Address Blocks', menubar('Main Menu' => $p)) %>
<%
use NetAddr::IP;
my @addr_block = qsearch('addr_block', {});
my @router = qsearch('router', {});
my $block;
my $p2 = popurl(2);
my $path = $p2 . "edit/process/addr_block";
%>
<% if ($cgi->param('error')) { %>
<FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
<BR><BR>
<% } %>
<%=table()%>
<% foreach $block (sort {$a->NetAddr cmp $b->NetAddr} @addr_block) { %>
<TR>
<TD><%=$block->NetAddr%></TD>
<% if (my $router = $block->router) { %>
<% if (scalar($block->svc_broadband) == 0) { %>
<TD>
<%=$router->routername%>
</TD>
<TD>
<FORM ACTION="<%=$path%>/deallocate.cgi" METHOD="POST">
<INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$block->blocknum%>">
<INPUT TYPE="submit" NAME="submit" VALUE="Deallocate">
</FORM>
</TD>
<% } else { %>
<TD COLSPAN="2">
<%=$router->routername%>
</TD>
<% } %>
<% } else { %>
<TD>
<FORM ACTION="<%=$path%>/allocate.cgi" METHOD="POST">
<INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$block->blocknum%>">
<SELECT NAME="routernum" SIZE="1">
<% foreach (@router) { %>
<OPTION VALUE="<%=$_->routernum %>"><%=$_->routername%></OPTION>
<% } %>
</SELECT>
<INPUT TYPE="submit" NAME="submit" VALUE="Allocate">
</FORM>
</TD>
<TD>
<FORM ACTION="<%=$path%>/split.cgi" METHOD="POST">
<INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$block->blocknum%>">
<INPUT TYPE="submit" NAME="submit" VALUE="Split">
</FORM>
</TD>
</TR>
<% }
} %>
<TR><TD COLSPAN="3"><BR></TD></TR>
<TR>
<FORM ACTION="<%=$path%>/add.cgi" METHOD="POST">
<TD>Gateway/Netmask</TD>
<TD>
<INPUT TYPE="text" NAME="ip_gateway" SIZE="15">/<INPUT TYPE="text" NAME="ip_netmask" SIZE="2">
</TD>
<TD>
<INPUT TYPE="submit" NAME="submit" VALUE="Add">
</TD>
</FORM>
</TR>
</TABLE>
</BODY>
</HTML>
|