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:
DL6ER
2019-06-16 20:08:24 +02:00
parent 91c9865b70
commit 5f28a3816d
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -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 ? "&nbsp;-&nbsp;" + 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>"
);
+1 -1
View File
@@ -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))
{