mirror of
https://github.com/pi-hole/web.git
synced 2026-04-22 01:39:50 +01:00
Add button for pihole arpflush on Pi-hole settings page
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -82,19 +82,19 @@ $(".confirm-flushlogs").confirm({
|
||||
dialogClass: "modal-dialog modal-mg"
|
||||
});
|
||||
|
||||
$(".confirm-disablelogging").confirm({
|
||||
text: "Are you sure you want to disable logging and flush your Pi-hole logs?",
|
||||
$(".confirm-flusharp").confirm({
|
||||
text: "Are you sure you want to flush your network table?",
|
||||
title: "Confirmation required",
|
||||
confirm(button) {
|
||||
$("#disablelogsform").submit();
|
||||
$("#flusharpform").submit();
|
||||
},
|
||||
cancel(button) {
|
||||
// nothing to do
|
||||
},
|
||||
confirmButton: "Yes, disable logs and flush my logs",
|
||||
confirmButton: "Yes, flush my network table",
|
||||
cancelButton: "No, go back",
|
||||
post: true,
|
||||
confirmButtonClass: "btn-danger",
|
||||
confirmButtonClass: "btn-warning",
|
||||
cancelButtonClass: "btn-success",
|
||||
dialogClass: "modal-dialog modal-mg"
|
||||
});
|
||||
|
||||
@@ -735,6 +735,15 @@ function readAdlists()
|
||||
$error .= "Invalid privacy level (".$level.")!";
|
||||
}
|
||||
break;
|
||||
// Flush network table
|
||||
case "flusharp":
|
||||
exec("sudo pihole arpflush quiet", $output);
|
||||
$error = implode($output, "<br>");
|
||||
if(strlen($error) == 0)
|
||||
{
|
||||
$success .= "The network table has been flushed";
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Option not found
|
||||
|
||||
@@ -1331,9 +1331,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
|
||||
</div>
|
||||
<p class="hidden-md hidden-lg"></p>
|
||||
<div class="col-md-4">
|
||||
<?php if ($piHoleLogging) { ?>
|
||||
<button type="button" class="btn btn-danger confirm-disablelogging form-control">Disable query logging and flush logs</button>
|
||||
<?php } ?>
|
||||
<button type="button" class="btn btn-warning confirm-flusharp form-control">Flush network table</button>
|
||||
</div>
|
||||
<p class="hidden-md hidden-lg"></p>
|
||||
<div class="col-md-4">
|
||||
@@ -1359,9 +1357,8 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
|
||||
<input type="hidden" name="field" value="flushlogs">
|
||||
<input type="hidden" name="token" value="<?php echo $token ?>">
|
||||
</form>
|
||||
<form role="form" method="post" id="disablelogsform">
|
||||
<input type="hidden" name="field" value="Logging">
|
||||
<input type="hidden" name="action" value="Disable">
|
||||
<form role="form" method="post" id="flusharpform">
|
||||
<input type="hidden" name="field" value="flusharp">
|
||||
<input type="hidden" name="token" value="<?php echo $token ?>">
|
||||
</form>
|
||||
<form role="form" method="post" id="disablelogsform-noflush">
|
||||
|
||||
Reference in New Issue
Block a user