mirror of
https://github.com/pi-hole/web.git
synced 2026-05-08 09:39:05 +01:00
Don't use idstring in messages when it's not necessary
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
@@ -465,7 +465,7 @@ function delItems(ids) {
|
||||
|
||||
utils.disableAll();
|
||||
var idstring = ids.join(", ");
|
||||
utils.showAlert("info", "", "Deleting Adlist with ID: " + idstring, "...");
|
||||
utils.showAlert("info", "", "Deleting adlist(s) ...", "<ul>" + address + "</ul>");
|
||||
|
||||
$.ajax({
|
||||
url: "scripts/pi-hole/php/groups.php",
|
||||
@@ -479,7 +479,7 @@ function delItems(ids) {
|
||||
utils.showAlert(
|
||||
"success",
|
||||
"far fa-trash-alt",
|
||||
"Successfully deleted adlists: " + idstring,
|
||||
"Successfully deleted adlist(s): ",
|
||||
"<ul>" + address + "</ul>"
|
||||
);
|
||||
for (var id in ids) {
|
||||
@@ -488,7 +488,12 @@ function delItems(ids) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
utils.showAlert("error", "", "Error while deleting adlists: " + idstring, response.message);
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
"Error while deleting adlist(s): " + idstring,
|
||||
response.message
|
||||
);
|
||||
}
|
||||
|
||||
// Clear selection after deletion
|
||||
@@ -497,7 +502,12 @@ function delItems(ids) {
|
||||
})
|
||||
.fail(function (jqXHR, exception) {
|
||||
utils.enableAll();
|
||||
utils.showAlert("error", "", "Error while deleting adlists: " + idstring, jqXHR.responseText);
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
"Error while deleting adlist(s): " + idstring,
|
||||
jqXHR.responseText
|
||||
);
|
||||
console.log(exception); // eslint-disable-line no-console
|
||||
});
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ function delItems(ids) {
|
||||
|
||||
utils.disableAll();
|
||||
var idstring = ids.join(", ");
|
||||
utils.showAlert("info", "", "Deleting client with ID: " + idstring, "...");
|
||||
utils.showAlert("info", "", "Deleting client(s)...", "<ul>" + items + "</ul>");
|
||||
|
||||
$.ajax({
|
||||
url: "scripts/pi-hole/php/groups.php",
|
||||
@@ -376,7 +376,7 @@ function delItems(ids) {
|
||||
utils.showAlert(
|
||||
"success",
|
||||
"far fa-trash-alt",
|
||||
"Successfully deleted clients: " + idstring,
|
||||
"Successfully deleted client(s): ",
|
||||
"<ul>" + items + "</ul>"
|
||||
);
|
||||
for (var id in ids) {
|
||||
@@ -385,7 +385,12 @@ function delItems(ids) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
utils.showAlert("error", "", "Error while deleting clients: " + idstring, response.message);
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
"Error while deleting client(s): " + idstring,
|
||||
response.message
|
||||
);
|
||||
}
|
||||
|
||||
// Clear selection after deletion
|
||||
@@ -394,7 +399,12 @@ function delItems(ids) {
|
||||
})
|
||||
.fail(function (jqXHR, exception) {
|
||||
utils.enableAll();
|
||||
utils.showAlert("error", "", "Error while deleting clients: " + idstring, jqXHR.responseText);
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
"Error while deleting client(s): " + idstring,
|
||||
jqXHR.responseText
|
||||
);
|
||||
console.log(exception); // eslint-disable-line no-console
|
||||
});
|
||||
}
|
||||
|
||||
@@ -455,7 +455,7 @@ function delItems(ids) {
|
||||
|
||||
utils.disableAll();
|
||||
var idstring = ids.join(", ");
|
||||
utils.showAlert("info", "", "Deleting item with ID: " + idstring, "...");
|
||||
utils.showAlert("info", "", "Deleting domain(s)...", "<ul>" + items + "</ul>");
|
||||
|
||||
$.ajax({
|
||||
url: "scripts/pi-hole/php/groups.php",
|
||||
@@ -469,7 +469,7 @@ function delItems(ids) {
|
||||
utils.showAlert(
|
||||
"success",
|
||||
"far fa-trash-alt",
|
||||
"Successfully deleted items: " + idstring,
|
||||
"Successfully deleted domain(s): ",
|
||||
"<ul>" + items + "</ul>"
|
||||
);
|
||||
for (var id in ids) {
|
||||
@@ -478,7 +478,12 @@ function delItems(ids) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
utils.showAlert("error", "", "Error while deleting items: " + idstring, response.message);
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
"Error while deleting domain(s): " + idstring,
|
||||
response.message
|
||||
);
|
||||
}
|
||||
|
||||
// Clear selection after deletion
|
||||
@@ -487,7 +492,12 @@ function delItems(ids) {
|
||||
})
|
||||
.fail(function (jqXHR, exception) {
|
||||
utils.enableAll();
|
||||
utils.showAlert("error", "", "Error while deleting items: " + idstring, jqXHR.responseText);
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
"Error while deleting domain(s): " + idstring,
|
||||
jqXHR.responseText
|
||||
);
|
||||
console.log(exception); // eslint-disable-line no-console
|
||||
});
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ function delItems(ids) {
|
||||
|
||||
utils.disableAll();
|
||||
var idstring = ids.join(", ");
|
||||
utils.showAlert("info", "", "Deleting group with ID: " + idstring, "...");
|
||||
utils.showAlert("info", "", "Deleting group(s)...", "<ul>" + items + "</ul>");
|
||||
|
||||
$.ajax({
|
||||
url: "scripts/pi-hole/php/groups.php",
|
||||
@@ -238,7 +238,7 @@ function delItems(ids) {
|
||||
utils.showAlert(
|
||||
"success",
|
||||
"far fa-trash-alt",
|
||||
"Successfully deleted groups: " + idstring,
|
||||
"Successfully deleted group(s): ",
|
||||
"<ul>" + items + "</ul>"
|
||||
);
|
||||
for (var id in ids) {
|
||||
@@ -247,7 +247,12 @@ function delItems(ids) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
utils.showAlert("error", "", "Error while deleting groups: " + idstring, response.message);
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
"Error while deleting group(s): " + idstring,
|
||||
response.message
|
||||
);
|
||||
}
|
||||
|
||||
// Clear selection after deletion
|
||||
@@ -256,7 +261,12 @@ function delItems(ids) {
|
||||
})
|
||||
.fail(function (jqXHR, exception) {
|
||||
utils.enableAll();
|
||||
utils.showAlert("error", "", "Error while deleting groups: " + idstring, jqXHR.responseText);
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
"Error while deleting group(s): " + idstring,
|
||||
jqXHR.responseText
|
||||
);
|
||||
console.log(exception); // eslint-disable-line no-console
|
||||
});
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@ function delMsg(ids) {
|
||||
|
||||
utils.disableAll();
|
||||
var idstring = ids.join(", ");
|
||||
utils.showAlert("info", "", "Deleting message with ID: " + idstring, "...");
|
||||
utils.showAlert("info", "", "Deleting message(s)...");
|
||||
|
||||
$.ajax({
|
||||
url: "scripts/pi-hole/php/message.php",
|
||||
@@ -349,19 +349,19 @@ function delMsg(ids) {
|
||||
.done(function (response) {
|
||||
utils.enableAll();
|
||||
if (response.success) {
|
||||
utils.showAlert(
|
||||
"success",
|
||||
"far fa-trash-alt",
|
||||
"Successfully deleted messages: " + idstring,
|
||||
""
|
||||
);
|
||||
utils.showAlert("success", "far fa-trash-alt", "Successfully deleted message(s)", "");
|
||||
for (var id in ids) {
|
||||
if (Object.hasOwnProperty.call(ids, id)) {
|
||||
table.row(id).remove().draw(false).ajax.reload(null, false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
utils.showAlert("error", "", "Error while deleting message: " + idstring, response.message);
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
"Error while deleting message(s): " + idstring,
|
||||
response.message
|
||||
);
|
||||
}
|
||||
|
||||
// Clear selection after deletion
|
||||
@@ -373,7 +373,12 @@ function delMsg(ids) {
|
||||
)
|
||||
.fail(function (jqXHR, exception) {
|
||||
utils.enableAll();
|
||||
utils.showAlert("error", "", "Error while deleting message: " + idstring, jqXHR.responseText);
|
||||
utils.showAlert(
|
||||
"error",
|
||||
"",
|
||||
"Error while deleting message(s): " + idstring,
|
||||
jqXHR.responseText
|
||||
);
|
||||
console.log(exception); // eslint-disable-line no-console
|
||||
});
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ function deleteNetworkEntry() {
|
||||
var id = tr.attr("data-id");
|
||||
|
||||
utils.disableAll();
|
||||
utils.showAlert("info", "", "Deleting network table entry with ID " + parseInt(id, 10), "...");
|
||||
utils.showAlert("info", "", "Deleting network table entry...");
|
||||
$.ajax({
|
||||
url: "scripts/pi-hole/php/network.php",
|
||||
method: "post",
|
||||
@@ -74,12 +74,7 @@ function deleteNetworkEntry() {
|
||||
success: function (response) {
|
||||
utils.enableAll();
|
||||
if (response.success) {
|
||||
utils.showAlert(
|
||||
"success",
|
||||
"far fa-trash-alt",
|
||||
"Successfully deleted network table entry # ",
|
||||
id
|
||||
);
|
||||
utils.showAlert("success", "far fa-trash-alt", "Successfully deleted network table entry");
|
||||
tableApi.row(tr).remove().draw(false).ajax.reload(null, false);
|
||||
} else {
|
||||
utils.showAlert(
|
||||
|
||||
Reference in New Issue
Block a user