mirror of
https://github.com/pi-hole/web.git
synced 2026-05-08 09:39:05 +01:00
Pass group_enabled boolean to web interface and show if entry was disabled due to group setting. Although the current web interface does not support group-based management, this may aid in debugging if users interact the database directly.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -14,7 +14,8 @@ var fullName = listType === "white" ? "Whitelist" : "Blacklist";
|
||||
|
||||
function addListEntry(entry, index, list, button, type)
|
||||
{
|
||||
var used = entry.enabled === "1" ? "used" : "not-used";
|
||||
var used = (entry.enabled === "1" && entry.group_enabled === "1") ? "used" : "not-used";
|
||||
var groupmessage = entry.group_enabled === "1" ? "" : "(disabled due to group)";
|
||||
var comment = entry.comment.length > 0 ? " - " + entry.comment : "";
|
||||
var date_added = new Date(parseInt(entry.date_added)*1000);
|
||||
var date_modified = new Date(parseInt(entry.date_modified)*1000);
|
||||
@@ -23,7 +24,7 @@ function addListEntry(entry, index, list, button, type)
|
||||
list.append(
|
||||
"<li id=\"" + index + "\" class=\"list-group-item " + used + " clearfix\">" +
|
||||
"<span title=\"" + tooltip + "\" data-toggle=\"tooltip\" data-placement=\"right\">" +
|
||||
entry.domain + comment + "</span>" +
|
||||
entry.domain + comment + " " + groupmessage + "</span>" +
|
||||
"<button class=\"btn btn-danger btn-xs pull-right\" type=\"button\">" +
|
||||
"<span class=\"glyphicon glyphicon-trash\"></span></button></li>"
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@ $db = SQLite3_connect($GRAVITYDB);
|
||||
function getTableContent($listname) {
|
||||
global $db;
|
||||
$entries = array();
|
||||
$results = $db->query("SELECT * FROM $listname");
|
||||
$results = $db->query("SELECT a.*,b.enabled AS group_enabled FROM $listname a INNER JOIN domain_groups b ON b.id = a.group_id");
|
||||
|
||||
while($results !== false && $res = $results->fetchArray(SQLITE3_ASSOC))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user