mirror of
https://github.com/pi-hole/web.git
synced 2026-04-22 01:39:50 +01:00
Directly modify gravity tables from the lists pages.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -119,6 +119,11 @@ function sub(index, entry, arg) {
|
||||
heading = "#h3-regex";
|
||||
locallistType = arg;
|
||||
}
|
||||
var alInfo = $("#alInfo");
|
||||
var alSuccess = $("#alSuccess");
|
||||
var alFailure = $("#alFailure");
|
||||
var alWarning = $("#alWarning");
|
||||
|
||||
var domain = $(list+" #"+index);
|
||||
domain.hide("highlight");
|
||||
$.ajax({
|
||||
@@ -126,14 +131,29 @@ function sub(index, entry, arg) {
|
||||
method: "post",
|
||||
data: {"domain":entry, "list":locallistType, "token":token},
|
||||
success: function(response) {
|
||||
if(response.length !== 0){
|
||||
return;
|
||||
}
|
||||
if (response.indexOf("Success") === -1) {
|
||||
alFailure.show();
|
||||
err.html(response);
|
||||
alFailure.delay(8000).fadeOut(2000, function() {
|
||||
alFailure.hide();
|
||||
});
|
||||
alInfo.delay(8000).fadeOut(2000, function() {
|
||||
alInfo.hide();
|
||||
});
|
||||
} else {
|
||||
alSuccess.show();
|
||||
alSuccess.delay(1000).fadeOut(2000, function() {
|
||||
alSuccess.hide();
|
||||
});
|
||||
alInfo.delay(1000).fadeOut(2000, function() {
|
||||
alInfo.hide();
|
||||
});
|
||||
domain.remove();
|
||||
if($(list+" li").length < 1)
|
||||
{
|
||||
$(heading).fadeOut(100);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, exception) {
|
||||
alert("Failed to remove the domain!");
|
||||
@@ -163,16 +183,7 @@ function add(type) {
|
||||
method: "post",
|
||||
data: {"domain":domain.val().trim(), "list":type, "token":token},
|
||||
success: function(response) {
|
||||
if (response.indexOf(" already exists in ") !== -1) {
|
||||
alWarning.show();
|
||||
warn.html(response);
|
||||
alWarning.delay(8000).fadeOut(2000, function() {
|
||||
alWarning.hide();
|
||||
});
|
||||
alInfo.delay(8000).fadeOut(2000, function() {
|
||||
alInfo.hide();
|
||||
});
|
||||
} else if (response.indexOf("DONE") === -1) {
|
||||
if (response.indexOf("Success") === -1) {
|
||||
alFailure.show();
|
||||
err.html(response);
|
||||
alFailure.delay(8000).fadeOut(2000, function() {
|
||||
|
||||
Reference in New Issue
Block a user