Commit 4032bc53 authored by Franco Fichtner's avatar Franco Fichtner

logs: move last entries away from status section

parent fba56a9a
...@@ -51,6 +51,11 @@ ...@@ -51,6 +51,11 @@
<Routing url="/diag_logs_routing.php"/> <Routing url="/diag_logs_routing.php"/>
<Resolver url="/diag_logs_resolver.php"/> <Resolver url="/diag_logs_resolver.php"/>
<Wireless url="/diag_logs_wireless.php"/> <Wireless url="/diag_logs_wireless.php"/>
<DHCP url="/diag_logs_dhcp.php"/>
<PPP url="/diag_logs_ppp.php"/>
<VPN url="/diag_logs_vpn.php?vpntype=pptp">
<Type url="/diag_logs_vpn.php*"/>
</VPN>
</LogFiles> </LogFiles>
<Settings cssClass="fa fa-cogs"> <Settings cssClass="fa fa-cogs">
<General url="/system_general.php"/> <General url="/system_general.php"/>
...@@ -311,13 +316,6 @@ ...@@ -311,13 +316,6 @@
<DHCPv6Leases VisibleName="DHCP IPv6 Leases" url="/status_dhcpv6_leases.php"> <DHCPv6Leases VisibleName="DHCP IPv6 Leases" url="/status_dhcpv6_leases.php">
<DHCPv6LeasesDetails url="/status_dhcpv6_leases.php?*"/> <DHCPv6LeasesDetails url="/status_dhcpv6_leases.php?*"/>
</DHCPv6Leases> </DHCPv6Leases>
<LogFiles VisibleName="Log Files" cssClass="fa fa-eye">
<DHCP url="/diag_logs_dhcp.php"/>
<PPP url="/diag_logs_ppp.php"/>
<VPN url="/diag_logs_vpn.php?vpntype=pptp">
<Type url="/diag_logs_vpn.php*"/>
</VPN>
</LogFiles>
</Status> </Status>
<Help order="8" cssClass="glyphicon glyphicon-question-sign"> <Help order="8" cssClass="glyphicon glyphicon-question-sign">
<AboutThisPage VisibleName="About this Page" url="/help.php" IsExternal="Y"/> <AboutThisPage VisibleName="About this Page" url="/help.php" IsExternal="Y"/>
......
...@@ -34,6 +34,7 @@ require_once("system.inc"); ...@@ -34,6 +34,7 @@ require_once("system.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
$dhcpd_logfile = '/var/log/dhcpd.log'; $dhcpd_logfile = '/var/log/dhcpd.log';
$filtertext = '';
$nentries = 50; $nentries = 50;
if (isset($config['syslog']['nentries'])) { if (isset($config['syslog']['nentries'])) {
...@@ -46,6 +47,10 @@ if ($_POST['clear']) { ...@@ -46,6 +47,10 @@ if ($_POST['clear']) {
services_dhcpd_configure(); services_dhcpd_configure();
} }
if (isset($_POST['filtertext'])) {
$filtertext = htmlspecialchars($_POST['filtertext']);
}
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("DHCP")); $pgtitle = array(gettext("Status"),gettext("System logs"),gettext("DHCP"));
$shortcut_section = "dhcp"; $shortcut_section = "dhcp";
include("head.inc"); include("head.inc");
...@@ -66,8 +71,13 @@ include("head.inc"); ...@@ -66,8 +71,13 @@ include("head.inc");
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr><td colspan="2"><?= sprintf(gettext('Last %s DHCP service log entries'), $nentries); ?></strong></td><tr> <tr><td colspan="2">
<?php dump_clog($dhcpd_logfile, $nentries); ?> <form id="clearform" name="clearform" action="diag_logs_dhcp.php" method="post" class="__mt">
<input id="filtertext" name="filtertext" value="<?=$filtertext;?>" />
<input id="filtersubmit" name="filtersubmit" type="submit" class="btn btn-primary" value="<?=gettext("Filter");?>" />
</form>
</td></tr>
<?php dump_clog($dhcpd_logfile, $nentries, $filtertext); ?>
<tr><td colspan="2"> <tr><td colspan="2">
<form action="diag_logs_dhcp.php" method="post"> <form action="diag_logs_dhcp.php" method="post">
<input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" /> <input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" />
......
...@@ -33,10 +33,10 @@ require_once("system.inc"); ...@@ -33,10 +33,10 @@ require_once("system.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
$ppps_logfile = '/var/log/ppps.log'; $ppps_logfile = '/var/log/ppps.log';
$filtertext = '';
$nentries = 50;
if (empty($config['syslog']['nentries'])) { if (isset($config['syslog']['nentries'])) {
$nentries = 50;
} else {
$nentries = $config['syslog']['nentries']; $nentries = $config['syslog']['nentries'];
} }
...@@ -44,6 +44,10 @@ if ($_POST['clear']) { ...@@ -44,6 +44,10 @@ if ($_POST['clear']) {
clear_clog($ppps_logfile); clear_clog($ppps_logfile);
} }
if (isset($_POST['filtertext'])) {
$filtertext = htmlspecialchars($_POST['filtertext']);
}
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("PPP")); $pgtitle = array(gettext("Status"),gettext("System logs"),gettext("PPP"));
include("head.inc"); include("head.inc");
...@@ -64,8 +68,13 @@ include("head.inc"); ...@@ -64,8 +68,13 @@ include("head.inc");
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr><td colspan="2"><?= sprintf(gettext("Last %s PPP log entries"),$nentries);?></strong></td></tr> <tr><td colspan="2">
<?php dump_clog($ppps_logfile, $nentries); ?> <form id="clearform" name="clearform" action="diag_logs_ppp.php" method="post" class="__mt">
<input id="filtertext" name="filtertext" value="<?=$filtertext;?>" />
<input id="filtersubmit" name="filtersubmit" type="submit" class="btn btn-primary" value="<?=gettext("Filter");?>" />
</form>
</td></tr>
<?php dump_clog($ppps_logfile, $nentries, $filtertext); ?>
<tr><td colspan="2"> <tr><td colspan="2">
<form action="diag_logs_ppp.php" method="post"> <form action="diag_logs_ppp.php" method="post">
<input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" /> <input name="clear" type="submit" class="btn" value="<?= gettext("Clear log");?>" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment