diff --git a/shorewall/shorewall-lib.pl b/shorewall/shorewall-lib.pl index 76ea1f865..dcf8a4997 100755 --- a/shorewall/shorewall-lib.pl +++ b/shorewall/shorewall-lib.pl @@ -1065,78 +1065,57 @@ return ( &is_fw($_[0]) ? $text{'list_fw'} : sub tos_form { -local ($zone, $host) = split(/:/, $_[0], 2); -print " $text{'tos_0z'}\n"; -print "\n"; +my ($zone, $host) = split(/:/, $_[0], 2); my ($zf, $found) = &zone_field("source", $zone, 1); -print $zf; -printf "\n", - $found ? "" : $zone; - -print "
$text{'rules_inzone'}\n"; -printf " %s\n", - $host ? "checked" : "", $text{'rules_addr'}; -printf " \n", - join(" ", split(/,/, $host)); +print &ui_table_row($text{'tos_0z'}, + $zf." ". + &ui_textbox("sother", $found ? "" : $zone, 10)."
\n". + "$text{'rules_inzone'}\n". + &ui_checkbox("sinzone_def", 1, $text{'rules_addr'}, $host ? 1 : 0)." ". + &ui_textbox("sinzone", join(" ", split(/,/, $host)), 50), + 3); ($zone, $host) = split(/:/, $_[1], 2); -print " $text{'tos_1z'}\n"; -print "\n"; ($zf, $found) = &zone_field("dest", $zone, 1); -print $zf; -printf "\n", +print &ui_table_row($text{'tos_1z'}, + $zf." ". + &ui_textbox("dother", $found ? "" : $zone, 10)."
\n". + "$text{'rules_inzone'}\n". + &ui_checkbox("dinzone_def", 1, $text{'rules_addr'}, $host ? 1 : 0)." ". + &ui_textbox("dinzone", join(" ", split(/,/, $host)), 50), + 3); $found ? "" : $zone; -print "
$text{'rules_inzone'}\n"; -printf " %s\n", - $host ? "checked" : "", $text{'rules_addr'}; -printf " \n", - join(" ", split(/,/, $host)); - -print " $text{'tos_2'}\n"; -print "\n"; -printf " \n", - $found ? "" : $_[2]; +push(@opts, [ '', $text{'list_other'} ]); +print &ui_table_row($text{'tos_2'}, + &ui_select("proto", $found ? $_[2] : '', \@opts)." ". + &ui_textbox("pother", $found ? "" : $_[2], 5)); -print " $text{'tos_3'} \n"; -printf " %s\n", - $_[3] eq '' || $_[3] eq '-' ? "checked" : "", $text{'list_any'}; -printf " %s\n", - $_[3] eq '' || $_[3] eq '-' ? "" : "checked", $text{'rules_ranges'}; -printf " \n", - $_[3] eq '' || $_[3] eq '-' ? "" : join(" ", split(/,/, $_[3])); +print &ui_table_row($text{'tos_3'}, + &ui_opt_textbox("sport", + $_[3] eq '-' ? '' : join(" ", split(/,/, $_[3])), + 30, $text{'list_any'}, $text{'rules_ranges'})); -print " $text{'tos_4'} \n"; -printf " %s\n", - $_[4] eq '' || $_[4] eq '-' ? "checked" : "", $text{'list_any'}; -printf " %s\n", - $_[4] eq '' || $_[4] eq '-' ? "" : "checked", $text{'rules_ranges'}; -printf " \n", - $_[4] eq '' || $_[4] eq '-' ? "" : join(" ", split(/,/, $_[4])); +print &ui_table_row($text{'tos_4'}, + &ui_opt_textbox("dport", + $_[4] eq '-' ? '' : join(" ", split(/,/, $_[4])), + 30, $text{'list_any'}, $text{'rules_ranges'})); -print " $text{'tos_5'}\n"; -print " \n"; +print &ui_table_row($text{'tos_5'}, + &ui_select("tos", $_[5], \@opts, 1, 0, $_[5] ? 1 : 0)); -print " $text{'tos_6'}\n"; -printf " \n", - $_[6] eq "-" ? "" : $_[6]; +print &ui_table_row($text{'tos_6'}, + &ui_textbox("mark", $_[6] eq "-" ? "" : $_[6], 50)); } sub tos_validate