From 4e3b667ceb8818babf58025e15e89f4703d9d606 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 26 May 2015 22:50:36 +0545 Subject: Code style diag logs again while making a fix today I noticed that I had done these early-on and had not tabbed out the HTML nicely... --- usr/local/www/diag_logs.php | 7 +- usr/local/www/diag_logs_auth.php | 45 ++- usr/local/www/diag_logs_dhcp.php | 47 ++- usr/local/www/diag_logs_filter.php | 562 +++++++++++++++-------------- usr/local/www/diag_logs_filter_dynamic.php | 159 ++++---- usr/local/www/diag_logs_filter_summary.php | 34 +- usr/local/www/diag_logs_gateways.php | 4 +- usr/local/www/diag_logs_ipsec.php | 6 +- usr/local/www/diag_logs_ntpd.php | 2 +- usr/local/www/diag_logs_openvpn.php | 4 +- usr/local/www/diag_logs_ppp.php | 4 +- usr/local/www/diag_logs_relayd.php | 4 +- usr/local/www/diag_logs_resolver.php | 4 +- usr/local/www/diag_logs_routing.php | 4 +- usr/local/www/diag_logs_settings.php | 426 ++++++++++++---------- usr/local/www/diag_logs_vpn.php | 73 ++-- usr/local/www/diag_logs_wireless.php | 4 +- 17 files changed, 736 insertions(+), 653 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/diag_logs.php b/usr/local/www/diag_logs.php index 6520999..2cbfcbb 100755 --- a/usr/local/www/diag_logs.php +++ b/usr/local/www/diag_logs.php @@ -68,7 +68,7 @@ if ($filtertext) { $filtertextmeta="?filtertext=$filtertext"; } -$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("General")); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("General")); include("head.inc"); ?> @@ -95,7 +95,8 @@ include("head.inc"); ?> - + + - +
- + - - - + + + + +
+
-
-
- - - - - - -
-

- "/>
-
-
+
+ + + + + + + + +
+ +
+
+
+ "/> +
+
+
+
diff --git a/usr/local/www/diag_logs_dhcp.php b/usr/local/www/diag_logs_dhcp.php index c60af86..f87845d 100644 --- a/usr/local/www/diag_logs_dhcp.php +++ b/usr/local/www/diag_logs_dhcp.php @@ -58,7 +58,7 @@ if ($_POST['clear']) { services_dhcpd_configure(); } -$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("DHCP")); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("DHCP")); $shortcut_section = "dhcp"; include("head.inc"); @@ -67,7 +67,8 @@ include("head.inc"); - + - - - + + + + +
+
-
-
- - - - - - - -
-

- " />
NOTE: Clearing the log file will restart the DHCP daemon.
-
-
+
+ + + + + + + + + +
+ +
+
+
+ " /> +
+
NOTE: Clearing the log file will restart the DHCP daemon.
+
+
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php index f81b0f5..df24cd4 100644 --- a/usr/local/www/diag_logs_filter.php +++ b/usr/local/www/diag_logs_filter.php @@ -58,12 +58,11 @@ if (isset($_POST['resolve'])) { $response = array('resolve_ip' => $ip, 'resolve_text' => gettext("Cannot resolve")); } - echo json_encode(str_replace("\\","\\\\", $response)); // single escape chars can break JSON decode + echo json_encode(str_replace("\\", "\\\\", $response)); // single escape chars can break JSON decode exit; } -function getGETPOSTsettingvalue($settingname, $default) -{ +function getGETPOSTsettingvalue($settingname, $default) { $settingvalue = $default; if ($_GET[$settingname]) { $settingvalue = $_GET[$settingname]; @@ -126,7 +125,7 @@ if ($_POST['clear']) { clear_log_file($filter_logfile); } -$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Firewall")); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Firewall")); $shortcut_section = "firewall"; include("head.inc"); @@ -135,7 +134,8 @@ include("head.inc"); - + - + + + - - - - +?> + + + + + + + + + + + + + + +
+
-
+
-
- " summary="main area"> - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +" . find_rule_by_number_buffer($filterent['rulenum'], $filterent['tracker'], $filterent['act']) . ""); } - $rowIndex = 0; - foreach ($filterlog as $filterent): - $evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd"; - $rowIndex++;?> - - - - - ".find_rule_by_number_buffer($filterent['rulenum'],$filterent['tracker'],$filterent['act']).""); - } - - $int = strtolower($filterent['interface']); - $proto = strtolower($filterent['proto']); - if ($filterent['version'] == '6') { - $ipproto = "inet6"; - $filterent['srcip'] = "[{$filterent['srcip']}]"; - $filterent['dstip'] = "[{$filterent['dstip']}]"; - } else { - $ipproto = "inet"; - } - - $srcstr = $filterent['srcip'] . get_port_with_service($filterent['srcport'], $proto); - $src_htmlclass = str_replace(array('.', ':'), '-', $filterent['srcip']); - $dststr = $filterent['dstip'] . get_port_with_service($filterent['dstport'], $proto); - $dst_htmlclass = str_replace(array('.', ':'), '-', $filterent['dstip']); - ?> - - - - - - - - - - - - - - - + + + - - - - -
-
"> -
+
+
+ " summary="main area"> + + - - + + + + + + + + + + + + + + + + + + + +
+
"> + - - - - - - - - - - - - - - - - - - - - -
-
-
- /> Pass
- /> Block
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
" />
-
- ', '');?>   -    -
- -
-
"> -
- - - - - - - - - - - -
-
-
- -
-
-
-
-
-
-
-
-
 
-
" />
-
- ', '');?>   -
-
-
- -
+
+
+ /> Pass
+ /> Block
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
" />
+
+ ', '');?>   +    +
+ +
+
"> +
+ + + + + + + + + + + +
+
+
+ +
+
+
+
+
+
+
+
+
 
+
" />
+
+ ', '');?>   +
+
+
+ +
" class="listtopic"> + -
" class="listtopic"> - -
+
+ ', outputrule);"> + <?php echo $filterent['act'] .'/'. $filterent['tracker'];?> + + +
+
+ + Direction=OUT + + +
-
- ', outputrule);"> - <?php echo $filterent['act'] .'/'. $filterent['tracker'];?> -
- - Direction=OUT - - - ');" title="" class="ICON-" border="0" src="/themes//images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/> - " title="" onclick="return confirm('')"> - Icon Easy Rule: Add to Block List - ';?> - - ');" title="" class="ICON-" border="0" src="/themes//images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/> - " title="" onclick="return confirm('')"> - Icon Easy Rule: Pass this traffic - ';?> -
-
-
+ ');" title="" class="ICON-" border="0" src="/themes//images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/> + " title="" onclick="return confirm('')"> + Icon Easy Rule: Add to Block List + + ';?> + + ');" title="" class="ICON-" border="0" src="/themes//images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/> + " title="" onclick="return confirm('')"> + Icon Easy Rule: Pass this traffic + + ';?> +
-
- " /> -
-
-
-
+
+ +
+
+ " /> +
+
+ + +

TCP Flags: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, W - CWR

diff --git a/usr/local/www/diag_logs_filter_dynamic.php b/usr/local/www/diag_logs_filter_dynamic.php index f9d42f5..16ced9f 100755 --- a/usr/local/www/diag_logs_filter_dynamic.php +++ b/usr/local/www/diag_logs_filter_dynamic.php @@ -60,7 +60,7 @@ if ($_POST['clear']) { $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100); -$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Firewall (Dynamic View)")); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Firewall (Dynamic View)")); $shortcut_section = "firewall"; include("head.inc"); @@ -85,7 +85,7 @@ include("head.inc"); ?> /* Called by the AJAX updater */ function format_log_line(row) { - if ( row[8] == '6' ) { + if (row[8] == '6') { srcIP = '[' + row[3] + ']'; dstIP = '[' + row[5] + ']'; } else { @@ -93,12 +93,12 @@ include("head.inc"); dstIP = row[5]; } - if ( row[4] == '' ) { + if (row[4] == '') { srcPort = ''; } else { srcPort = ':' + row[4]; } - if ( row[6] == '' ) { + if (row[6] == '') { dstPort = ''; } else { dstPort = ':' + row[6]; @@ -116,7 +116,8 @@ include("head.inc"); - + - + + + - - - - + + + + +
+
-
+
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- ; -
- ', outputrule);"> - <?php echo $filterent['act'] .'/'. $filterent['tracker'];?> - -
-
-
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ; +
+ ', outputrule);"> + <?php echo $filterent['act'] .'/'. $filterent['tracker'];?> + +
+
+

: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR

diff --git a/usr/local/www/diag_logs_filter_summary.php b/usr/local/www/diag_logs_filter_summary.php index e4150a0..fe10383 100644 --- a/usr/local/www/diag_logs_filter_summary.php +++ b/usr/local/www/diag_logs_filter_summary.php @@ -189,7 +189,8 @@ include("head.inc"); ?> - + - + + + - - - +
+
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php"); display_top_tabs($tab_array); ?> -
+
$tab_array[] = array(gettext("Summary View"), true, "/diag_logs_filter_summary.php"); display_top_tabs($tab_array); ?> -
-
- - + + + - + + +
+
+
+ + +

@@ -233,10 +237,12 @@ foreach (array_keys($fields) as $field) { echo "

"; } ?> -
-
-
+
+
diff --git a/usr/local/www/diag_logs_gateways.php b/usr/local/www/diag_logs_gateways.php index 2991f2e..bb88615 100755 --- a/usr/local/www/diag_logs_gateways.php +++ b/usr/local/www/diag_logs_gateways.php @@ -69,7 +69,7 @@ if ($filtertext) { $filtertextmeta="?filtertext=$filtertext"; } -$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Gateways")); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Gateways")); $shortcut_section = "gateways"; include("head.inc"); @@ -115,7 +115,7 @@ include("head.inc");
- +
- +
- " /> + " /> diff --git a/usr/local/www/diag_logs_ntpd.php b/usr/local/www/diag_logs_ntpd.php index 921ec23..d9f6bf5 100644 --- a/usr/local/www/diag_logs_ntpd.php +++ b/usr/local/www/diag_logs_ntpd.php @@ -54,7 +54,7 @@ if ($_POST['clear']) { clear_log_file($ntpd_logfile); } -$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("NTP")); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("NTP")); $shortcut_section = "ntp"; include("head.inc"); diff --git a/usr/local/www/diag_logs_openvpn.php b/usr/local/www/diag_logs_openvpn.php index c9e4bed..374014d 100644 --- a/usr/local/www/diag_logs_openvpn.php +++ b/usr/local/www/diag_logs_openvpn.php @@ -43,7 +43,7 @@ ##|*MATCH=diag_logs_openvpn.php* ##|-PRIV -$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("OpenVPN")); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("OpenVPN")); $shortcut_section = "openvpn"; require("guiconfig.inc"); @@ -90,7 +90,7 @@ include("head.inc");
- + diff --git a/usr/local/www/diag_logs_ppp.php b/usr/local/www/diag_logs_ppp.php index c56c7e0..4ef3f9c 100644 --- a/usr/local/www/diag_logs_ppp.php +++ b/usr/local/www/diag_logs_ppp.php @@ -57,7 +57,7 @@ if ($_POST['clear']) { clear_log_file($ppp_logfile); } -$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("PPP")); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("PPP")); include("head.inc"); ?> @@ -88,7 +88,7 @@ include("head.inc");
- + diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php index 053dbc9..5468761 100644 --- a/usr/local/www/diag_logs_relayd.php +++ b/usr/local/www/diag_logs_relayd.php @@ -55,7 +55,7 @@ if ($_POST['clear']) { clear_log_file($relayd_logfile); } -$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Load Balancer")); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Load Balancer")); $shortcut_section = "relayd"; include("head.inc"); @@ -89,7 +89,7 @@ include("head.inc");
diff --git a/usr/local/www/diag_logs_resolver.php b/usr/local/www/diag_logs_resolver.php index 981d473..73e39a9 100755 --- a/usr/local/www/diag_logs_resolver.php +++ b/usr/local/www/diag_logs_resolver.php @@ -69,7 +69,7 @@ if ($filtertext) { $filtertextmeta="?filtertext=$filtertext"; } -$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("Resolver")); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Resolver")); if (isset($config['dnsmasq']['enable'])) { $shortcut_section = "forwarder"; } else { @@ -120,7 +120,7 @@ include("head.inc");
- +
- + diff --git a/usr/local/www/diag_logs_settings.php b/usr/local/www/diag_logs_settings.php index 9d1ecfa..c3d6993 100644 --- a/usr/local/www/diag_logs_settings.php +++ b/usr/local/www/diag_logs_settings.php @@ -264,7 +264,8 @@ function check_everything() {
- +
- + - - + + + + +
+
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Forward/Reverse Display /> -
GUI Log Entries to Display -
-
Log File Size (Bytes) -
- -

- - - . - . -
Log Firewall Default Blocks - /> -
- -
- /> -
- -
- /> -
-
- /> -
-
Web Server Log /> -
-
Raw Logs /> -
-
Filter descriptions - - -
- -
Local Logging onclick="enable_change(false)" /> - -
Reset Logs - " onclick="return confirm('')" /> -

- -
 
- -
- - -

- -
- -
- -
onclick="enable_change(false)" /> -
- - - - - - - - - - - - - - - - - -
 
-
- onclick="check_everything();" /> -

- /> -
- /> -
- /> -
- /> -
- /> -
- /> -
- /> -
- /> -
-
  " onclick="enable_change(true)" /> -
 
- . -
-
-
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Forward/Reverse Display + /> + +
GUI Log Entries to Display +
+ +
Log File Size (Bytes) +
+ +

+ + + . + . +
Log Firewall Default Blocks + /> +
+ +
+ /> +
+ +
+ /> +
+
+ /> +
+
Web Server Log + /> +
+ +
Raw Logs + /> +
+ +
Filter descriptions + + +
+ +
Local Logging + onclick="enable_change(false)" /> + + + + + + + +
Reset Logs + " onclick="return confirm('')" /> +

+ +
 
+ +
+ + +

+ +
+ +
+ +
+ onclick="enable_change(false)" /> + +
+ + + + + + + + + + + + + + + + + +
 
+
+ onclick="check_everything();" /> +

+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+ /> +
+
  + " onclick="enable_change(true)" /> +
  + + + + + +
+ . +
+
+