mirror of
https://github.com/pi-hole/web.git
synced 2026-04-17 15:45:12 +01:00
Remove the loggingButton from Settings > System > Actions (#3747)
This commit is contained in:
@@ -185,32 +185,6 @@ function updateMetrics() {
|
||||
});
|
||||
}
|
||||
|
||||
function showQueryLoggingButton(state) {
|
||||
if (state) {
|
||||
$("#loggingButton").addClass("btn-warning");
|
||||
$("#loggingButton").removeClass("btn-success");
|
||||
$("#loggingButton").text("Disable query logging");
|
||||
$("#loggingButton").data("state", "enabled");
|
||||
} else {
|
||||
$("#loggingButton").addClass("btn-success");
|
||||
$("#loggingButton").removeClass("btn-warning");
|
||||
$("#loggingButton").text("Enable query logging");
|
||||
$("#loggingButton").data("state", "disabled");
|
||||
}
|
||||
}
|
||||
|
||||
function getLoggingButton() {
|
||||
$.ajax({
|
||||
url: document.body.dataset.apiurl + "/config/dns/queryLogging",
|
||||
})
|
||||
.done(data => {
|
||||
showQueryLoggingButton(data.config.dns.queryLogging);
|
||||
})
|
||||
.fail(data => {
|
||||
apiFailure(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(".confirm-restartdns").confirm({
|
||||
text:
|
||||
"Are you sure you want to send a restart command to your DNS server?<br><br>" +
|
||||
@@ -284,47 +258,9 @@ $(".confirm-flusharp").confirm({
|
||||
dialogClass: "modal-dialog",
|
||||
});
|
||||
|
||||
$("#loggingButton").confirm({
|
||||
text:
|
||||
"Are you sure you want to switch query logging mode?<br><br>" +
|
||||
"<strong>This will restart the DNS server.</strong><br>" +
|
||||
"As consequence of this action, your DNS cache will be cleared and you may temporarily lose your internet connection.<br>" +
|
||||
"Furthermore, you will be logged out of the web interface.",
|
||||
title: "Confirmation required",
|
||||
confirm() {
|
||||
const data = { config: {} };
|
||||
data.config.dns = {};
|
||||
data.config.dns.queryLogging = $("#loggingButton").data("state") !== "enabled";
|
||||
$.ajax({
|
||||
url: document.body.dataset.apiurl + "/config/dns/queryLogging",
|
||||
type: "PATCH",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
data: JSON.stringify(data),
|
||||
})
|
||||
.done(data => {
|
||||
showQueryLoggingButton(data.config.dns.queryLogging);
|
||||
})
|
||||
.fail(data => {
|
||||
apiFailure(data);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
// nothing to do
|
||||
},
|
||||
confirmButton: "Yes, change query logging",
|
||||
cancelButton: "No, go back",
|
||||
post: true,
|
||||
confirmButtonClass: "btn-danger",
|
||||
cancelButtonClass: "btn-default",
|
||||
dialogClass: "modal-dialog",
|
||||
});
|
||||
|
||||
$(() => {
|
||||
updateHostInfo();
|
||||
updateMetrics();
|
||||
getLoggingButton();
|
||||
|
||||
const ctx = document.getElementById("cachePieChart").getContext("2d");
|
||||
cachePieChart = new Chart(ctx, {
|
||||
|
||||
@@ -251,16 +251,13 @@ mg.include('scripts/lua/settings_header.lp','r')
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 col-lg-3">
|
||||
<button type="button" id="loggingButton" class="btn btn-block button-pad btn-primary"><i class="fa fa-spinner fa-pulse"></i></button>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-lg-3">
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<button type="button" class="btn btn-warning confirm-restartdns btn-block button-pad destructive_action" disabled>Restart DNS resolver</button>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-lg-3">
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<button type="button" class="btn btn-danger confirm-flusharp btn-block button-pad destructive_action" disabled>Flush network table</button>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-lg-3">
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<button type="button" class="btn btn-danger confirm-flushlogs btn-block button-pad destructive_action" disabled>Flush logs (last 24 hours)</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user