Skip to content

Commit c666d22

Browse files
authored
Remove the loggingButton from Settings > System > Actions (#3747)
2 parents 5d16e2c + c280cb5 commit c666d22

2 files changed

Lines changed: 3 additions & 70 deletions

File tree

scripts/js/settings-system.js

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -185,32 +185,6 @@ function updateMetrics() {
185185
});
186186
}
187187

188-
function showQueryLoggingButton(state) {
189-
if (state) {
190-
$("#loggingButton").addClass("btn-warning");
191-
$("#loggingButton").removeClass("btn-success");
192-
$("#loggingButton").text("Disable query logging");
193-
$("#loggingButton").data("state", "enabled");
194-
} else {
195-
$("#loggingButton").addClass("btn-success");
196-
$("#loggingButton").removeClass("btn-warning");
197-
$("#loggingButton").text("Enable query logging");
198-
$("#loggingButton").data("state", "disabled");
199-
}
200-
}
201-
202-
function getLoggingButton() {
203-
$.ajax({
204-
url: document.body.dataset.apiurl + "/config/dns/queryLogging",
205-
})
206-
.done(data => {
207-
showQueryLoggingButton(data.config.dns.queryLogging);
208-
})
209-
.fail(data => {
210-
apiFailure(data);
211-
});
212-
}
213-
214188
$(".confirm-restartdns").confirm({
215189
text:
216190
"Are you sure you want to send a restart command to your DNS server?<br><br>" +
@@ -284,47 +258,9 @@ $(".confirm-flusharp").confirm({
284258
dialogClass: "modal-dialog",
285259
});
286260

287-
$("#loggingButton").confirm({
288-
text:
289-
"Are you sure you want to switch query logging mode?<br><br>" +
290-
"<strong>This will restart the DNS server.</strong><br>" +
291-
"As consequence of this action, your DNS cache will be cleared and you may temporarily lose your internet connection.<br>" +
292-
"Furthermore, you will be logged out of the web interface.",
293-
title: "Confirmation required",
294-
confirm() {
295-
const data = { config: {} };
296-
data.config.dns = {};
297-
data.config.dns.queryLogging = $("#loggingButton").data("state") !== "enabled";
298-
$.ajax({
299-
url: document.body.dataset.apiurl + "/config/dns/queryLogging",
300-
type: "PATCH",
301-
dataType: "json",
302-
processData: false,
303-
contentType: "application/json; charset=utf-8",
304-
data: JSON.stringify(data),
305-
})
306-
.done(data => {
307-
showQueryLoggingButton(data.config.dns.queryLogging);
308-
})
309-
.fail(data => {
310-
apiFailure(data);
311-
});
312-
},
313-
cancel() {
314-
// nothing to do
315-
},
316-
confirmButton: "Yes, change query logging",
317-
cancelButton: "No, go back",
318-
post: true,
319-
confirmButtonClass: "btn-danger",
320-
cancelButtonClass: "btn-default",
321-
dialogClass: "modal-dialog",
322-
});
323-
324261
$(() => {
325262
updateHostInfo();
326263
updateMetrics();
327-
getLoggingButton();
328264

329265
const ctx = document.getElementById("cachePieChart").getContext("2d");
330266
cachePieChart = new Chart(ctx, {

settings-system.lp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,13 @@ mg.include('scripts/lua/settings_header.lp','r')
251251
</div>
252252
<div class="box-body">
253253
<div class="row">
254-
<div class="col-xs-12 col-md-6 col-lg-3">
255-
<button type="button" id="loggingButton" class="btn btn-block button-pad btn-primary"><i class="fa fa-spinner fa-pulse"></i></button>
256-
</div>
257-
<div class="col-xs-12 col-md-6 col-lg-3">
254+
<div class="col-xs-12 col-md-4">
258255
<button type="button" class="btn btn-warning confirm-restartdns btn-block button-pad destructive_action" disabled>Restart DNS resolver</button>
259256
</div>
260-
<div class="col-xs-12 col-md-6 col-lg-3">
257+
<div class="col-xs-12 col-md-4">
261258
<button type="button" class="btn btn-danger confirm-flusharp btn-block button-pad destructive_action" disabled>Flush network table</button>
262259
</div>
263-
<div class="col-xs-12 col-md-6 col-lg-3">
260+
<div class="col-xs-12 col-md-4">
264261
<button type="button" class="btn btn-danger confirm-flushlogs btn-block button-pad destructive_action" disabled>Flush logs (last 24 hours)</button>
265262
</div>
266263
</div>

0 commit comments

Comments
 (0)