mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Remove obsolete add.php script, use groups.php everywhere instead.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -106,9 +106,15 @@ function updateTopLists() {
|
||||
function add(domain, list) {
|
||||
var token = $("#token").text();
|
||||
$.ajax({
|
||||
url: "scripts/pi-hole/php/add.php",
|
||||
url: "scripts/pi-hole/php/groups.php",
|
||||
method: "post",
|
||||
data: { domain: domain, list: list, token: token },
|
||||
data: {
|
||||
domain: domain,
|
||||
list: list,
|
||||
token: token,
|
||||
action: "add_domain",
|
||||
comment: "Added from Audit Log"
|
||||
},
|
||||
success: function () {
|
||||
updateTopLists();
|
||||
},
|
||||
|
||||
@@ -92,16 +92,19 @@ function add(domain, list) {
|
||||
alSuccess.hide();
|
||||
alFailure.hide();
|
||||
$.ajax({
|
||||
url: "scripts/pi-hole/php/add.php",
|
||||
url: "scripts/pi-hole/php/groups.php",
|
||||
method: "post",
|
||||
data: { domain: domain, list: list, token: token },
|
||||
data: {
|
||||
domain: domain,
|
||||
list: list,
|
||||
token: token,
|
||||
action: "add_domain",
|
||||
comment: "Added from Long-Term-Data Query Log"
|
||||
},
|
||||
success: function (response) {
|
||||
if (
|
||||
response.indexOf("not a valid argument") !== -1 ||
|
||||
response.indexOf("is not a valid domain") !== -1
|
||||
) {
|
||||
if (!response.success) {
|
||||
alFailure.show();
|
||||
err.html(response);
|
||||
err.html(response.message);
|
||||
alFailure.delay(4000).fadeOut(2000, function () {
|
||||
alFailure.hide();
|
||||
});
|
||||
|
||||
@@ -39,19 +39,21 @@ function add(domain, list) {
|
||||
// add Domain to List after Modal has faded in
|
||||
alertModal.one("shown.bs.modal", function () {
|
||||
$.ajax({
|
||||
url: "scripts/pi-hole/php/add.php",
|
||||
url: "scripts/pi-hole/php/groups.php",
|
||||
method: "post",
|
||||
data: { domain: domain, list: list, token: token },
|
||||
data: {
|
||||
domain: domain,
|
||||
list: list,
|
||||
token: token,
|
||||
action: "add_domain",
|
||||
comment: "Added from Query Log"
|
||||
},
|
||||
success: function (response) {
|
||||
alProcessing.hide();
|
||||
if (
|
||||
response.indexOf("not a valid argument") !== -1 ||
|
||||
response.indexOf("is not a valid domain") !== -1 ||
|
||||
response.indexOf("Wrong token") !== -1
|
||||
) {
|
||||
if (!response.success) {
|
||||
// Failure
|
||||
alNetworkErr.hide();
|
||||
alCustomErr.html(response.replace("[✗]", ""));
|
||||
alCustomErr.html(response.message);
|
||||
alFailure.fadeIn(1000);
|
||||
setTimeout(function () {
|
||||
alertModal.modal("hide");
|
||||
|
||||
Reference in New Issue
Block a user