2020-03-06 16:53:22 +01:00
|
|
|
<!-- logfile output tab -->
|
|
|
|
<div class="tab-pane fade" id="logging">
|
|
|
|
<h4><?php echo _("Logging") ?></h4>
|
2022-09-27 12:04:29 +02:00
|
|
|
<p><?php echo _("Enable these options to log <code>dhcpcd</code> and <code>dnsmasq</code> activity.") ?></p>
|
2020-03-06 16:53:22 +01:00
|
|
|
|
|
|
|
<div class="custom-control custom-switch">
|
|
|
|
<input class="custom-control-input" id="log-dhcp" type="checkbox" name="log-dhcp" value="1" <?php echo $conf['log-dhcp'] ? ' checked="checked"' : "" ?> aria-describedby="log-dhcp-requests">
|
|
|
|
<label class="custom-control-label" for="log-dhcp"><?php echo _("Log DHCP requests") ?></label>
|
|
|
|
</div>
|
|
|
|
<div class="custom-control custom-switch">
|
|
|
|
<input class="custom-control-input" id="log-queries" type="checkbox" name="log-queries" value="1" <?php echo $conf['log-queries'] ? ' checked="checked"' : "" ?> aria-describedby="log-dhcp-queries">
|
2022-09-27 11:46:59 +02:00
|
|
|
<label class="custom-control-label align-middle" for="log-queries"><?php echo _("Log DNS queries") ?></label>
|
|
|
|
<input type="button" class="btn btn-outline btn-warning btn-sm align-top ml-4" id="js-cleardnsmasq-log" value="<?php echo _("Clear log"); ?>" />
|
2020-03-06 16:53:22 +01:00
|
|
|
</div>
|
|
|
|
|
2020-12-26 10:55:54 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="form-group col-md-8 mt-2">
|
|
|
|
<?php
|
|
|
|
if ($conf['log-dhcp'] == 1 || $conf['log-queries'] == 1) {
|
2022-01-05 12:30:09 +01:00
|
|
|
exec('sudo /bin/chmod o+r '.RASPI_DHCPCD_LOG);
|
2021-11-17 19:06:43 +01:00
|
|
|
$log = file_get_contents(RASPI_DHCPCD_LOG);
|
2022-09-27 11:46:59 +02:00
|
|
|
echo '<textarea class="logoutput" id="dnsmasq-log">'.htmlspecialchars($log, ENT_QUOTES).'</textarea>';
|
2020-12-26 10:55:54 +01:00
|
|
|
} else {
|
|
|
|
echo '<textarea class="logoutput my-3"></textarea>';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-06 16:53:22 +01:00
|
|
|
</div><!-- /.tab-pane -->
|