mirror of
https://github.com/pi-hole/web.git
synced 2026-04-27 12:15:00 +01:00
Add new button to allow both regex filters and legacy wildcards (get automatically converted to regex format)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -126,12 +126,14 @@ window.onload = refresh(false);
|
||||
function add(arg) {
|
||||
var locallistType = listType;
|
||||
var domain = $("#domain");
|
||||
var wild = false;
|
||||
if(domain.val().length === 0){
|
||||
return;
|
||||
}
|
||||
if(arg === "wild")
|
||||
if(arg === "wild" || arg === "regex")
|
||||
{
|
||||
locallistType = "wild";
|
||||
locallistType = arg;
|
||||
wild = true;
|
||||
}
|
||||
|
||||
var alInfo = $("#alInfo");
|
||||
@@ -146,8 +148,8 @@ function add(arg) {
|
||||
method: "post",
|
||||
data: {"domain":domain.val().trim(), "list":locallistType, "token":token},
|
||||
success: function(response) {
|
||||
if (locallistType !== "wild" && response.indexOf("] Pi-hole blocking is ") === -1 ||
|
||||
locallistType === "wild" && response.length > 1) {
|
||||
if (!wild && response.indexOf("] Pi-hole blocking is ") === -1 ||
|
||||
wild && response.length > 1) {
|
||||
alFailure.show();
|
||||
err.html(response);
|
||||
alFailure.delay(4000).fadeOut(2000, function() {
|
||||
@@ -200,6 +202,10 @@ $("#btnAddWildcard").on("click", function() {
|
||||
add("wild");
|
||||
});
|
||||
|
||||
$("#btnAddRegex").on("click", function() {
|
||||
add("regex");
|
||||
});
|
||||
|
||||
$("#btnRefresh").on("click", function() {
|
||||
refresh(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user