summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2014-12-22 17:39:26 -0600
committerChris Buechler <cmb@pfsense.org>2014-12-22 17:39:26 -0600
commitb5d827f644b3ae4fbd9e7a58d6e4bb1e34897fed (patch)
treee45beb189016fb3718551deedc79058cd8d9bf95 /usr/local/www/widgets
parent07499022f16be530ad6caab2ef0452c1cc6dd7a2 (diff)
parentacfef9f5f790a8fbdd4bafa8838ceedd227236be (diff)
downloadpfsense-b5d827f644b3ae4fbd9e7a58d6e4bb1e34897fed.zip
pfsense-b5d827f644b3ae4fbd9e7a58d6e4bb1e34897fed.tar.gz
Merge pull request #1400 from phil-davis/patch-17
Diffstat (limited to 'usr/local/www/widgets')
-rw-r--r--usr/local/www/widgets/widgets/log.widget.php56
1 files changed, 46 insertions, 10 deletions
diff --git a/usr/local/www/widgets/widgets/log.widget.php b/usr/local/www/widgets/widgets/log.widget.php
index fb240fb..2677ee5 100644
--- a/usr/local/www/widgets/widgets/log.widget.php
+++ b/usr/local/www/widgets/widgets/log.widget.php
@@ -105,11 +105,30 @@ else
/* Called by the AJAX updater */
function format_log_line(row) {
- var line = '<td class="listMRlr" align="center">' + row[0] + '<\/td>' +
- '<td class="listMRr ellipsis" title="' + row[1] + '">' + row[1].slice(0,-3) + '<\/td>' +
- '<td class="listMRr ellipsis" title="' + row[2] + '">' + row[2] + '<\/td>' +
- '<td class="listMRr ellipsis" title="' + row[3] + '">' + row[3] + '<\/td>' +
- '<td class="listMRr ellipsis" title="' + row[4] + '">' + row[4] + '<\/td>';
+ var rrText = "<?php echo gettext("Reverse Resolve with DNS"); ?>";
+
+ if ( row[8] == '6' ) {
+ srcIP = '[' + row[3] + ']';
+ dstIP = '[' + row[5] + ']';
+ } else {
+ srcIP = row[3];
+ dstIP = row[5];
+ }
+
+ if ( row[4] == '' )
+ srcPort = '';
+ else
+ srcPort = ':' + row[4];
+ if ( row[6] == '' )
+ dstPort = '';
+ else
+ dstPort = ':' + row[6];
+
+ var line = '<td class="listMRlr" align="center">' + row[0] + '</td>' +
+ '<td class="listMRr ellipsis" title="' + row[1] + '">' + row[1].slice(0,-3) + '</td>' +
+ '<td class="listMRr ellipsis" title="' + row[2] + '">' + row[2] + '</td>' +
+ '<td class="listMRr ellipsis" title="' + srcIP + srcPort + '"><a href="diag_dns.php?host=' + row[3] + '" title="' + rrText + '">' + srcIP + '</a></td>' +
+ '<td class="listMRr ellipsis" title="' + dstIP + dstPort + '"><a href="diag_dns.php?host=' + row[5] + '" title="' + rrText + '">' + dstIP + '</a>' + dstPort + '</td>';
var nentriesacts = "<?php echo $nentriesacts; ?>";
var nentriesinterfaces = "<?php echo $nentriesinterfaces; ?>";
@@ -188,6 +207,24 @@ function format_log_line(row) {
foreach ($filterlog as $filterent):
$evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
$rowIndex++;
+ if ($filterent['version'] == '6') {
+ $srcIP = "[" . htmlspecialchars($filterent['srcip']) . "]";
+ $dstIP = "[" . htmlspecialchars($filterent['dstip']) . "]";
+ } else {
+ $srcIP = htmlspecialchars($filterent['srcip']);
+ $dstIP = htmlspecialchars($filterent['dstip']);
+ }
+
+ if ($filterent['srcport'])
+ $srcPort = ":" . htmlspecialchars($filterent['srcport']);
+ else
+ $srcPort = "";
+
+ if ($filterent['dstport'])
+ $dstPort = ":" . htmlspecialchars($filterent['dstport']);
+ else
+ $dstPort = "";
+
?>
<tr class="<?=$evenRowClass?>">
<td class="listMRlr nowrap" align="center">
@@ -197,19 +234,18 @@ function format_log_line(row) {
</td>
<td class="listMRr ellipsis nowrap" title="<?php echo htmlspecialchars($filterent['time']);?>"><?php echo substr(htmlspecialchars($filterent['time']),0,-3);?></td>
<td class="listMRr ellipsis nowrap" title="<?php echo htmlspecialchars($filterent['interface']);?>"><?php echo htmlspecialchars($filterent['interface']);?></td>
- <td class="listMRr ellipsis nowrap" title="<?php echo htmlspecialchars($filterent['src']);?>">
+ <td class="listMRr ellipsis nowrap" title="<?php echo $srcIP . $srcPort;?>">
<a href="diag_dns.php?host=<?php echo "{$filterent['srcip']}"; ?>" title="<?=gettext("Reverse Resolve with DNS");?>">
- <?php echo htmlspecialchars($filterent['srcip']);?></a></td>
- <td class="listMRr ellipsis nowrap" title="<?php echo htmlspecialchars($filterent['dst']);?>">
+ <?php echo $srcIP;?></a></td>
+ <td class="listMRr ellipsis nowrap" title="<?php echo $dstIP . $dstPort;?>">
<a href="diag_dns.php?host=<?php echo "{$filterent['dstip']}"; ?>" title="<?=gettext("Reverse Resolve with DNS");?>">
- <?php echo htmlspecialchars($filterent['dstip']);?></a><?php echo ":" . htmlspecialchars($filterent['dstport']);?></td>
+ <?php echo $dstIP;?></a><?php echo $dstPort;?></td>
<?php
if ($filterent['proto'] == "TCP")
$filterent['proto'] .= ":{$filterent['tcpflags']}";
?>
</tr>
<?php endforeach; ?>
- <tr style="display:none;"><td></td></tr>
</tbody>
</table>
OpenPOWER on IntegriCloud