Work on conversion to new UI

This commit is contained in:
Jamie Cameron
2013-05-10 15:24:43 -07:00
parent c178e0e145
commit af637034a1
39 changed files with 105 additions and 42 deletions
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=0
sort_mode=0
ipv6=1
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=2
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=0
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=2
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -11,3 +11,4 @@ tcpd_path=/usr/sbin/tcpd
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ rpc_file=/etc/rpc
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=0
sort_mode=0
ipv6=0
qm_mode=1
display_max=100
+1
View File
@@ -13,3 +13,4 @@ show_empty=1
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -15,3 +15,4 @@ show_empty=1
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ show_empty=0
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=2
sort_mode=0
ipv6=1
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -14,3 +14,4 @@ sort_mode=0
ipv6=0
inetd_dir=/etc/inet.d
qm_mode=0
display_max=100
+1
View File
@@ -9,3 +9,4 @@ rpc_file=/etc/rpc
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=0
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=0
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -11,3 +11,4 @@ tcpd_path=/usr/sbin/tcpd
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -11,3 +11,4 @@ tcpd_path=/usr/sbin/tcpd
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=0
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -11,3 +11,4 @@ extended_inetd=0
sort_mode=0
ipv6=1
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=0
sort_mode=0
ipv6=1
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -13,3 +13,4 @@ deny_file=/etc/hosts.deny
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -10,3 +10,4 @@ extended_inetd=0
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1
View File
@@ -5,3 +5,4 @@ rpc_inetd=0
sort_mode=0
ipv6=0
qm_mode=0
display_max=100
+1 -1
View File
@@ -1,6 +1,6 @@
line1=Configurable options,11
show_empty=Show services with no program,1,1-Yes,0-No
sort_mode=Sort services and programs by,1,0-Order in file,1-Name,2-Assignment
display_max=Maximum number of services to display,0
line2=System configuration,11
inetd_conf_file=Inetd configuration file,0
inetd_dir=Inetd configuration directory,3,None
+62 -39
View File
@@ -4,10 +4,11 @@
# from the services file
require './inetd-lib.pl';
&ReadParse();
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
&help_search_link("inetd", "man", "doc", "howto"));
# break down into rpc and internet services
# Break down into rpc and internet services
$j = 0;
foreach $i (&list_inets()) {
if ($i->[2]) {
@@ -24,11 +25,8 @@ foreach $i (&list_inets()) {
$j++;
}
print "<form action=edit_serv.cgi>\n";
print "<a href=\"edit_serv.cgi?new=1\">$text{'index_newservice'}</a>.<br>\n";
print "<table border width=100%>\n";
print "<tr $tb> <td><b>$text{'index_service'}</b></td> </tr>\n";
print "<tr $cb> <td><table width=100%>\n";
# Get and sort entries from /etc/services
@links = ( "<a href=\"edit_serv.cgi?new=1\">$text{'index_newservice'}</a>" );
$i = 0;
@slist = &list_services();
if ($config{'sort_mode'} == 1) {
@@ -41,38 +39,62 @@ elsif ($config{'sort_mode'} == 2) {
defined($int_disabled{$a->[1],$a->[3]}) ? 1 : 0) }
@slist;
}
foreach $s (@slist) {
$ia = $int_active{$s->[1],$s->[3]};
$id = $int_disabled{$s->[1],$s->[3]};
if ($ia =~ /\d/) { $op = "<b>"; $cl = "</b>"; $ip = $ia; }
elsif ($id =~ /\d/) { $op = "<i><b>"; $cl = "</b></i>"; $ip = $id; }
elsif (!$config{'show_empty'}) { next; }
else { $op = $cl = $ip = ""; }
if ($i%4 == 0) { print "<tr>\n"; }
print "<td>$op";
print "<a href=\"edit_serv.cgi?spos=$s->[5]&ipos=$ip\">",
&html_escape($s->[1]),"</a>(",&html_escape($s->[3]),")";
print "$cl</td>\n";
if ($i++%4 == 3) { print "</tr>\n"; }
}
print "</table></td></tr></table>\n";
print "<table width=100%><tr>\n";
print "<td><a href='edit_serv.cgi?new=1'>$text{'index_newservice'}</a></td>\n";
if (!$config{'show_empty'}) {
print "<td align=right>\n";
print "<input type=submit value='$text{'index_edit'}'>\n";
print "<input name=name size=12>\n";
print "<select name=proto>\n";
foreach $p (&list_protocols()) {
printf "<option value=%s %s>%s\n",
$p, $p eq "tcp" ? "selected" : "", $p;
}
print "</select></td>\n";
# Show search form if too many
if (@slist > $config{'display_max'}) {
print &ui_form_start("index.cgi");
print "<b>$text{'index_search'}</b> ",
&ui_textbox("search", $in{'search'}, 30)," ",
&ui_submit($text{'index_sok'}),"<p>\n";
print &ui_form_end();
}
# Apply search
if ($in{'search'}) {
@slist = grep { $_->[1] =~ /\Q$in{'search'}\E/i } @slist;
}
if (!@slist) {
# Nothing found!
print "<b>$text{'index_none'}</b><p>\n";
}
elsif (@slist <= $config{'display_max'} || $in{'search'}) {
# Show services
@grid = ( );
foreach $s (@slist) {
$ia = $int_active{$s->[1],$s->[3]};
$id = $int_disabled{$s->[1],$s->[3]};
if ($ia =~ /\d/) { $op = "<b>"; $cl = "</b>"; $ip = $ia; }
elsif ($id =~ /\d/) { $op = "<i><b>"; $cl = "</b></i>"; $ip = $id; }
elsif (!$config{'show_empty'}) { next; }
else { $op = $cl = $ip = ""; }
push(@grid, $op.
"<a href=\"edit_serv.cgi?spos=$s->[5]&ipos=$ip\">".
&html_escape($s->[1])."</a> (".&html_escape($s->[3]).")".
$cl);
}
print &ui_links_row(\@links);
print &ui_grid_table(\@grid, 4, 100, undef, undef,
$text{'index_service'});
}
else {
# Too many to show
print "<b>$text{'index_toomany'}</b><p>\n";
}
print &ui_links_row(\@links);
if (!$config{'show_empty'}) {
# If only services with commands are shown, use this form to jump
# to editing a named service
print &ui_form_start("edit_serv.cgi");
print &ui_submit($text{'index_edit'})," ",
&ui_textbox("name", undef, 20)," ",
&ui_select("proto", "tcp", [ &list_protocols() ]),"\n";
print &ui_form_end();
}
print "</tr></table></form>\n";
print &ui_hr();
print "<a href=\"edit_rpc.cgi?new=1\">$text{'index_newrpc'}</a>. <br>\n";
print "<table border width=100%>\n";
print "<tr $tb> <td><b>$text{'index_rpc'}</b></td> </tr>\n";
@@ -108,11 +130,12 @@ print "</table></td></tr></table>\n";
print "<a href=\"edit_rpc.cgi?new=1\">$text{'index_newrpc'}</a>. <p>\n";
print &ui_hr();
print "<form action=restart_inetd.cgi>\n";
print "<table width=100%> <tr>\n";
print "<td><input type=submit value=\"$text{'index_apply'}\"></td>\n";
print "<td valign=top> $text{'index_applymsg'}</td>\n";
print "</tr> </table> </form>\n";
print &ui_buttons_start();
print &ui_buttons_row("restart_inetd.cgi",
$text{'index_apply'}, $text{'index_applymsg'});
print &ui_buttons_end();
&ui_print_footer("/", $text{'index'});
+6 -2
View File
@@ -1,15 +1,19 @@
index_title=Internet Services
index_title=Network Services and Protocols
index_list=service list
index_save=Save
index_delete=Delete
index_create=Create
index_edit=Edit service:
index_service=Internet Services
index_newservice=Create a new internet service
index_newservice=Create a new internet service.
index_rpc=RPC Programs
index_newrpc=Create a new RPC program
index_apply=Apply Changes
index_applymsg=Click this button to apply the current configuration by sending a SIGHUP signal to the running <tt>inetd</tt> process
index_search=Display services matching:
index_sok=Search
index_toomany=There are too many internet services to display on this page.
index_none=No internet services matched your search.
error_restart=Failed to restart Inetd
error_saverpc=Failed to save RPC program