mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
@@ -210,10 +210,12 @@ function initTable() {
|
||||
|
||||
// Disable autocorrect in the search box
|
||||
var input = document.querySelector("input[type=search]");
|
||||
input.setAttribute("autocomplete", "off");
|
||||
input.setAttribute("autocorrect", "off");
|
||||
input.setAttribute("autocapitalize", "off");
|
||||
input.setAttribute("spellcheck", false);
|
||||
if (input !== null) {
|
||||
input.setAttribute("autocomplete", "off");
|
||||
input.setAttribute("autocorrect", "off");
|
||||
input.setAttribute("autocapitalize", "off");
|
||||
input.setAttribute("spellcheck", false);
|
||||
}
|
||||
}
|
||||
|
||||
function addAdlist() {
|
||||
|
||||
@@ -244,10 +244,12 @@ function initTable() {
|
||||
|
||||
// Disable autocorrect in the search box
|
||||
var input = document.querySelector("input[type=search]");
|
||||
input.setAttribute("autocomplete", "off");
|
||||
input.setAttribute("autocorrect", "off");
|
||||
input.setAttribute("autocapitalize", "off");
|
||||
input.setAttribute("spellcheck", false);
|
||||
if (input !== null) {
|
||||
input.setAttribute("autocomplete", "off");
|
||||
input.setAttribute("autocorrect", "off");
|
||||
input.setAttribute("autocapitalize", "off");
|
||||
input.setAttribute("spellcheck", false);
|
||||
}
|
||||
|
||||
table.on("order.dt", function () {
|
||||
var order = table.order();
|
||||
@@ -257,6 +259,7 @@ function initTable() {
|
||||
$("#resetButton").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$("#resetButton").on("click", function () {
|
||||
table.order([[0, "asc"]]).draw();
|
||||
$("#resetButton").hide();
|
||||
@@ -264,7 +267,7 @@ function initTable() {
|
||||
}
|
||||
|
||||
function addClient() {
|
||||
var ip = $("#select").val();
|
||||
var ip = $("#select").val().trim();
|
||||
var comment = $("#new_comment").val();
|
||||
|
||||
utils.disableAll();
|
||||
|
||||
@@ -52,12 +52,6 @@ $(document).ready(function () {
|
||||
$("#wildcard_checkbox").prop("checked", false);
|
||||
}
|
||||
});
|
||||
// Disable autocorrect in the search box
|
||||
var input = document.querySelector("input[type=search]");
|
||||
input.setAttribute("autocomplete", "off");
|
||||
input.setAttribute("autocorrect", "off");
|
||||
input.setAttribute("autocapitalize", "off");
|
||||
input.setAttribute("spellcheck", false);
|
||||
|
||||
$("#add2black, #add2white").on("click", addDomain);
|
||||
|
||||
@@ -286,6 +280,14 @@ function initTable() {
|
||||
}
|
||||
}
|
||||
});
|
||||
// Disable autocorrect in the search box
|
||||
var input = document.querySelector("input[type=search]");
|
||||
if (input !== null) {
|
||||
input.setAttribute("autocomplete", "off");
|
||||
input.setAttribute("autocorrect", "off");
|
||||
input.setAttribute("autocapitalize", "off");
|
||||
input.setAttribute("spellcheck", false);
|
||||
}
|
||||
|
||||
table.on("order.dt", function () {
|
||||
var order = table.order();
|
||||
|
||||
@@ -110,6 +110,15 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
// Disable autocorrect in the search box
|
||||
var input = document.querySelector("input[type=search]");
|
||||
if (input !== null) {
|
||||
input.setAttribute("autocomplete", "off");
|
||||
input.setAttribute("autocorrect", "off");
|
||||
input.setAttribute("autocapitalize", "off");
|
||||
input.setAttribute("spellcheck", false);
|
||||
}
|
||||
|
||||
table.on("order.dt", function () {
|
||||
var order = table.order();
|
||||
if (order[0][0] !== 0 || order[0][1] !== "asc") {
|
||||
|
||||
@@ -68,6 +68,8 @@ $(document).ready(function () {
|
||||
rowCallback: function (row, data) {
|
||||
var color,
|
||||
mark,
|
||||
maxiter,
|
||||
index,
|
||||
lastQuery = parseInt(data.lastQuery);
|
||||
var network_recent = $(".network-recent").css("background-color");
|
||||
var network_old = $(".network-old").css("background-color");
|
||||
@@ -110,8 +112,9 @@ $(document).ready(function () {
|
||||
$("td:eq(3)", row).html("<em>unknown</em>");
|
||||
} else {
|
||||
var names = [];
|
||||
var maxiter = Math.min(data.name.length, MAXIPDISPLAY);
|
||||
for (var index = 0; index < maxiter; index++) {
|
||||
maxiter = Math.min(data.name.length, MAXIPDISPLAY);
|
||||
index = 0;
|
||||
for (index = 0; index < maxiter; index++) {
|
||||
var name = data.name[index];
|
||||
names.push('<a href="queries.php?client=' + name + '">' + name + "</a>");
|
||||
}
|
||||
@@ -121,19 +124,20 @@ $(document).ready(function () {
|
||||
// have more to show here
|
||||
names.push("...");
|
||||
}
|
||||
|
||||
$("td:eq(3)", row).html(names.join("<br>"));
|
||||
$("td:eq(3)", row).hover(function () {
|
||||
this.title = data.name.join("\n");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Set number of queries to localized string (add thousand separators)
|
||||
$("td:eq(6)", row).html(data.numQueries.toLocaleString());
|
||||
|
||||
var ips = [];
|
||||
var maxiter = Math.min(data.ip.length, MAXIPDISPLAY);
|
||||
for (var index = 0; index < maxiter; index++) {
|
||||
maxiter = Math.min(data.ip.length, MAXIPDISPLAY);
|
||||
index = 0;
|
||||
for (index = 0; index < maxiter; index++) {
|
||||
var ip = data.ip[index];
|
||||
ips.push('<a href="queries.php?client=' + ip + '">' + ip + "</a>");
|
||||
}
|
||||
|
||||
@@ -137,10 +137,10 @@ function addCustomDNSEntry($ip="", $domain="", $json_reply=true)
|
||||
try
|
||||
{
|
||||
if(isset($_REQUEST['ip']))
|
||||
$ip = $_REQUEST['ip'];
|
||||
$ip = trim($_REQUEST['ip']);
|
||||
|
||||
if(isset($_REQUEST['domain']))
|
||||
$domain = $_REQUEST['domain'];
|
||||
$domain = trim($_REQUEST['domain']);
|
||||
|
||||
if (empty($ip))
|
||||
return error("IP must be set");
|
||||
|
||||
@@ -488,7 +488,7 @@ if ($_POST['action'] == 'get_groups') {
|
||||
$domains = explode(' ', trim($_POST['domain']));
|
||||
$total = count($domains);
|
||||
$added = 0;
|
||||
$stmt = $db->prepare('INSERT INTO domainlist (domain,type,comment) VALUES (:domain,:type,:comment)');
|
||||
$stmt = $db->prepare('REPLACE INTO domainlist (domain,type,comment) VALUES (:domain,:type,:comment)');
|
||||
if (!$stmt) {
|
||||
throw new Exception('While preparing statement: ' . $db->lastErrorMsg());
|
||||
}
|
||||
|
||||
@@ -262,10 +262,10 @@ function addStaticDHCPLease($mac, $ip, $hostname) {
|
||||
if(array_key_exists("custom".$i,$_POST))
|
||||
{
|
||||
$exploded = explode("#", $_POST["custom".$i."val"], 2);
|
||||
$IP = $exploded[0];
|
||||
$IP = trim($exploded[0]);
|
||||
if(count($exploded) > 1)
|
||||
{
|
||||
$port = $exploded[1];
|
||||
$port = trim($exploded[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -326,22 +326,25 @@ function addStaticDHCPLease($mac, $ip, $hostname) {
|
||||
// Check if Conditional Forwarding is requested
|
||||
if(isset($_POST["conditionalForwarding"]))
|
||||
{
|
||||
$conditionalForwardingIP = trim($_POST["conditionalForwardingIP"]);
|
||||
$conditionalForwardingDomain = trim($_POST["conditionalForwardingDomain"]);
|
||||
|
||||
// Validate conditional forwarding IP
|
||||
if (!validIP($_POST["conditionalForwardingIP"]))
|
||||
if (!validIP($conditionalForwardingIP))
|
||||
{
|
||||
$error .= "Conditional forwarding IP (".htmlspecialchars($_POST["conditionalForwardingIP"]).") is invalid!<br>";
|
||||
$error .= "Conditional forwarding IP (".htmlspecialchars($conditionalForwardingIP).") is invalid!<br>";
|
||||
}
|
||||
|
||||
// Validate conditional forwarding domain name
|
||||
if(!validDomain($_POST["conditionalForwardingDomain"]))
|
||||
if(!validDomain($conditionalForwardingDomain))
|
||||
{
|
||||
$error .= "Conditional forwarding domain name (".htmlspecialchars($_POST["conditionalForwardingDomain"]).") is invalid!<br>";
|
||||
$error .= "Conditional forwarding domain name (".htmlspecialchars($conditionalForwardingDomain).") is invalid!<br>";
|
||||
}
|
||||
if(!$error)
|
||||
{
|
||||
$addressArray = explode(".", $_POST["conditionalForwardingIP"]);
|
||||
$addressArray = explode(".", $conditionalForwardingIP);
|
||||
$reverseAddress = $addressArray[2].".".$addressArray[1].".".$addressArray[0].".in-addr.arpa";
|
||||
$extra .= " conditional_forwarding ".$_POST["conditionalForwardingIP"]." ".$_POST["conditionalForwardingDomain"]." $reverseAddress";
|
||||
$extra .= " conditional_forwarding ".$conditionalForwardingIP." ".$conditionalForwardingDomain." $reverseAddress";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,9 +591,9 @@ function addStaticDHCPLease($mac, $ip, $hostname) {
|
||||
|
||||
if(isset($_POST["addstatic"]))
|
||||
{
|
||||
$mac = $_POST["AddMAC"];
|
||||
$ip = $_POST["AddIP"];
|
||||
$hostname = $_POST["AddHostname"];
|
||||
$mac = trim($_POST["AddMAC"]);
|
||||
$ip = trim($_POST["AddIP"]);
|
||||
$hostname = trim($_POST["AddHostname"]);
|
||||
|
||||
addStaticDHCPLease($mac, $ip, $hostname);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user