Commit dc44d88d authored by Franco Fichtner's avatar Franco Fichtner

reports: restyle a bit, move settings pages

parent c2036dfb
......@@ -7,7 +7,10 @@
<Password order="2" url="/system_usermanager_passwordmg.php" cssClass="fa fa-key fa-fw"/>
<Logout order="3" url="/index.php?logout" cssClass="fa fa-sign-out fa-fw"/>
</Lobby>
<System order="20" VisibleName="System" cssClass="fa fa-server">
<Reports order="15" cssClass="fa fa-area-chart">
<Settings order="100" url="/reports_settings.php" cssClass="fa fa-cog fa-fw"/>
</Reports>
<System order="20" cssClass="fa fa-server">
<Trust order="120" cssClass="fa fa-certificate fa-fw">
<Certificates url="/system_certmanager.php">
<workAround url="/system_certmanager.php*" visibility="hidden"/>
......@@ -57,7 +60,7 @@
<Settings order="20" cssClass="fa fa-cogs fa-fw">
<General order="100" url="/system_general.php"/>
<Notifications order="500" url="/system_advanced_notifications.php"/>
<LogFiles VisibleName="Logs/Reports" order="600" url="/diag_logs_settings.php"/>
<Logging order="600" url="/diag_logs_settings.php"/>
<Miscellaneous order="700" url="/system_advanced_misc.php"/>
<Tunables VisibleName="Tunables" order="800" url="/system_advanced_sysctl.php">
<Edit url="/system_advanced_sysctl.php*" visibility="hidden"/>
......@@ -115,7 +118,7 @@
<Devices url="/interfaces_ppps.php">
<Edit url="/interfaces_ppps_edit.php*" visibility="hidden"/>
</Devices>
<LogFile VisibleName="Log File" url="/diag_logs_ppp.php"/>
<LogFile VisibleName="Log File" url="/diag_logs_ppp.php"/>
</PPP>
<Wireless order="930" cssClass="fa fa-wifi fa-fw">
<Devices url="/interfaces_wireless.php">
......@@ -138,7 +141,7 @@
</Interfaces>
<Firewall order="40" cssClass="glyphicon glyphicon-fire">
<Aliases order="10" cssClass="fa fa-list-alt fa-fw">
<View order="100" url="/firewall_aliases.php">
<View order="100" url="/firewall_aliases.php">
<Edit url="/firewall_aliases_edit.php*" visibility="hidden"/>
</View>
<Import order="200" url="/firewall_aliases_import.php"/>
......@@ -158,7 +161,7 @@
<Outbound order="300" VisibleName="Outbound" url="/firewall_nat_out.php">
<OutboundEdit url="/firewall_nat_out_edit.php*" visibility="hidden"/>
</Outbound>
<NPT VisibleName="NPT (IPv6)" order="400" url="/firewall_nat_npt.php">
<NPT VisibleName="NPT (IPv6)" order="400" url="/firewall_nat_npt.php">
<NPTEdit url="/firewall_nat_npt_edit.php*" visibility="hidden"/>
</NPT>
</NAT>
......
......@@ -38,6 +38,7 @@
<patterns>
<pattern>ui/diagnostics/systemhealth/*</pattern>
<pattern>api/diagnostics/systemhealth/*</pattern>
<pattern>reports_settings.php</pattern>
</patterns>
</page-diagnostics-health>
<page-diagnostics-networkinsight>
......
<menu>
<Reporting order="15" VisibleName="Reporting" cssClass="fa fa-area-chart">
<Reports>
<Health order="10" url="/ui/diagnostics/systemhealth/" cssClass="fa fa-heartbeat fa-fw"/>
<NetworkInsight VisibleName="Network Insight" order="20" url="/ui/diagnostics/networkinsight/" cssClass="fa fa-exchange" />
</Reporting>
<Insight order="20" url="/ui/diagnostics/networkinsight/" cssClass="fa fa-binoculars fa-fw" />
<NetFlow order="30" url="/ui/diagnostics/netflow/" cssClass="fa fa-rss fa-fw"/>
</Reports>
<System>
<Diagnostics order="160" url="/ui/diagnostics/activity/" cssClass="fa fa-medkit fa-fw"/>
<Routes>
<Status order="20" url="/ui/diagnostics/interface/routes/"/>
</Routes>
<Settings>
<Netflow order="1000" VisibleName="NetFlow" url="/ui/diagnostics/netflow/"/>
</Settings>
</System>
<Interfaces>
<Diagnostics>
......
......@@ -31,20 +31,41 @@
require_once("guiconfig.inc");
require_once("interfaces.inc");
require_once("rrd.inc");
require_once("filter.inc");
require_once("system.inc");
require_once("pfsense-utils.inc");
require_once("services.inc");
function clear_all_log_files()
{
killbyname('syslogd');
$clog_files = array('dhcpd', 'filter', 'gateways', 'ipsec', 'l2tps', 'lighttpd', 'ntpd', 'openvpn', 'poes',
'portalauth', 'ppps', 'pptps', 'relayd', 'resolver', 'routing', 'system','vpn','wireless');
$log_files = array('squid/access', 'squid/cache', 'squid/store');
$clog_files = array(
'dhcpd',
'filter',
'gateways',
'ipsec',
'l2tps',
'lighttpd',
'ntpd',
'openvpn',
'poes',
'portalauth',
'ppps',
'pptps',
'relayd',
'resolver',
'routing',
'system',
'vpn',
'wireless',
);
$log_files = array(
'squid/access',
'squid/cache',
'squid/store',
);
foreach ($clog_files as $lfile) {
clear_clog("/var/log/{$lfile}.log", false);
......@@ -69,7 +90,6 @@ function is_valid_syslog_server($target) {
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig = array();
$pconfig['rrdenable'] = isset($config['rrd']['enable']);
$pconfig['reverse'] = isset($config['syslog']['reverse']);
$pconfig['nentries'] = !empty($config['syslog']['nentries']) ? $config['syslog']['nentries'] : 50;
$pconfig['remoteserver'] = !empty($config['syslog']['remoteserver']) ? $config['syslog']['remoteserver'] : null;
......@@ -99,11 +119,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($_POST['action']) && $_POST['action'] == "resetlogs") {
clear_all_log_files();
$savemsg = gettext("The log files have been reset.");
} elseif (!empty($_POST['action']) && $_POST['action'] == "ResetRRD") {
$savemsg = gettext('RRD data has been cleared.');
mwexec('/bin/rm /var/db/rrd/*');
enable_rrd_graphing();
setup_gateways_monitor();
} else {
$input_errors = array();
$pconfig = $_POST;
......@@ -168,8 +183,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($config['syslog']['filterdescriptions']);
}
$config['rrd']['enable'] = !empty($pconfig['rrdenable']);
write_config();
system_syslogd_start();
......@@ -190,7 +203,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
filter_pflog_start();
enable_rrd_graphing();
setup_gateways_monitor();
}
}
......@@ -268,13 +280,13 @@ function check_everything() {
$(document).ready(function() {
enable_change(false);
// messagebox, flush all rrd graphs
$("#ResetRRD").click(function(event){
// messagebox, flush all log files
$("#resetlogs").click(function(event){
event.preventDefault();
BootstrapDialog.show({
type:BootstrapDialog.TYPE_DANGER,
title: "<?= gettext("Syslog");?>",
message: "<?=gettext('Do you really want to reset the RRD graphs? This will erase all graph data.');?>",
message: "<?=gettext('Do you really want to reset the log files? This will erase all local log data.');?>",
buttons: [{
label: "<?= gettext("No");?>",
action: function(dialogRef) {
......@@ -282,34 +294,12 @@ $(document).ready(function() {
}}, {
label: "<?= gettext("Yes");?>",
action: function(dialogRef) {
$("#action").val("ResetRRD");
$("#action").val("resetlogs");
$("#iform").submit()
}
}]
});
});
// messagebox, flush all log files
$("#resetlogs").click(function(event){
event.preventDefault();
BootstrapDialog.show({
type:BootstrapDialog.TYPE_DANGER,
title: "<?= gettext("Syslog");?>",
message: "<?=gettext('Do you really want to reset the log files? This will erase all local log data.');?>",
buttons: [{
label: "<?= gettext("No");?>",
action: function(dialogRef) {
dialogRef.close();
}}, {
label: "<?= gettext("Yes");?>",
action: function(dialogRef) {
$("#action").val("resetlogs");
$("#iform").submit()
}
}]
});
});
});
//]]>
......@@ -330,35 +320,6 @@ $(document).ready(function() {
<form action="diag_logs_settings.php" method="post" name="iform" id="iform">
<input type="hidden" id="action" name="action" value="" />
<div class="tab-content content-box col-xs-12 __mb">
<div class="table-responsive">
<table class="table table-striped">
<tr>
<td colspan="2"><strong><?=gettext('Reporting Database Options');?></strong></td>
</tr>
<tr>
<td width="22%"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Round-Robin-Database");?></td>
<td>
<input name="rrdenable" type="checkbox" id="rrdenable" value="yes" <?=!empty($pconfig['rrdenable']) ? "checked=\"checked\"" : ""?> onclick="enable_change(false)" />
&nbsp;<strong><?=gettext("Enables the RRD graphing backend.");?></strong>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
<input type="button" name="ResetRRD" id="ResetRRD" class="btn btn-default" value="<?=gettext("Reset RRD Data");?>" />
</td>
</tr>
<tr>
<td colspan="2">
<?=gettext("Graphs will not be allowed to be recreated within a 1 minute interval, please " .
"take this into account after changing the style.");?>
</td>
</tr>
</table>
</div>
</div>
<div class="tab-content content-box col-xs-12 __mb">
<div class="table-responsive">
<table class="table table-striped">
<tr>
......
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2007 Seth Mos <seth.mos@dds.nl>
Copyright (C) 2004-2009 Scott Ullrich
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("guiconfig.inc");
require_once("interfaces.inc");
require_once("rrd.inc");
require_once("system.inc");
require_once("pfsense-utils.inc");
require_once("services.inc");
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig = array();
$pconfig['rrdenable'] = isset($config['rrd']['enable']);
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!empty($_POST['action']) && $_POST['action'] == "ResetRRD") {
$savemsg = gettext('RRD data has been cleared.');
mwexec('/bin/rm /var/db/rrd/*');
} else {
$pconfig = $_POST;
$config['rrd']['enable'] = !empty($pconfig['rrdenable']);
$savemsg = get_std_save_message();
write_config();
}
enable_rrd_graphing();
setup_gateways_monitor();
}
legacy_html_escape_form_data($pconfig);
include("head.inc");
?>
<body>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
// messagebox, flush all rrd graphs
$("#ResetRRD").click(function(event){
event.preventDefault();
BootstrapDialog.show({
type:BootstrapDialog.TYPE_DANGER,
title: "<?= gettext("Syslog");?>",
message: "<?=gettext('Do you really want to reset the RRD graphs? This will erase all graph data.');?>",
buttons: [{
label: "<?= gettext("No");?>",
action: function(dialogRef) {
dialogRef.close();
}}, {
label: "<?= gettext("Yes");?>",
action: function(dialogRef) {
$("#action").val("ResetRRD");
$("#iform").submit()
}
}]
});
});
});
//]]>
</script>
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<?php
if (isset($savemsg)) {
print_info_box($savemsg);
}
?>
<section class="col-xs-12">
<form action="diag_logs_settings.php" method="post" name="iform" id="iform">
<input type="hidden" id="action" name="action" value="" />
<div class="tab-content content-box col-xs-12 __mb">
<div class="table-responsive">
<table class="table table-striped">
<tr>
<td colspan="2"><strong><?=gettext('Reporting Database Options');?></strong></td>
</tr>
<tr>
<td width="22%"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Round-Robin-Database");?></td>
<td>
<input name="rrdenable" type="checkbox" id="rrdenable" value="yes" <?=!empty($pconfig['rrdenable']) ? "checked=\"checked\"" : ""?>" />
&nbsp;<strong><?=gettext("Enables the RRD graphing backend.");?></strong>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>"" />
<input type="button" name="ResetRRD" id="ResetRRD" class="btn btn-default" value="<?=gettext("Reset RRD Data");?>" />
</td>
</tr>
<tr>
<td colspan="2">
<?=gettext("Graphs will not be allowed to be recreated within a 1 minute interval, please " .
"take this into account after changing the style.");?>
</td>
</tr>
</table>
</div>
</div>
</form>
</section>
</div>
</div>
</section>
<?php include("foot.inc"); ?>
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