feat: authoritative plugin fields

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-01-24 23:02:02 +11:00
parent 3775e21dc7
commit abfe452996
7 changed files with 35 additions and 23 deletions

View File

@@ -101,8 +101,8 @@ a[target="_blank"] {
----------------------------------------------------------------------------- */ ----------------------------------------------------------------------------- */
.logs .logs
{ {
color:white; color:white !important;
background-color: black; background-color: black !important;
font-family: 'Courier New', monospace; font-family: 'Courier New', monospace;
font-size: .85em; font-size: .85em;

View File

@@ -518,7 +518,7 @@ textarea[readonly],
.form-control[readonly] { .form-control[readonly] {
background-color: #545659 !important; background-color: #545659 !important;
border-color: #3d444b; border-color: #3d444b;
color: #888a8c; color: #979a9d;
cursor: not-allowed; cursor: not-allowed;
opacity: 1; opacity: 1;
} }

View File

@@ -22,7 +22,7 @@
--color-gray: #8c8c8c; --color-gray: #8c8c8c;
--color-white: #fff; --color-white: #fff;
} }
:root { :root {
--datatable-bgcolor: rgba(64, 76, 88, 0.8); --datatable-bgcolor: rgba(64, 76, 88, 0.8);
} }
@@ -427,7 +427,7 @@
background: transparent; background: transparent;
color: var(--color-white); color: var(--color-white);
} }
/* Used in debug log page */ /* Used in debug log page */
.log-red { .log-red {
color: #ff4038; color: #ff4038;
@@ -519,9 +519,9 @@
input[readonly], input[readonly],
textarea[readonly], textarea[readonly],
.form-control[readonly] { .form-control[readonly] {
background-color: #2f353b !important; background-color: #545659 !important;
border-color: #3d444b; border-color: #3d444b;
color: #c7cdd3; color: #979a9d;
cursor: not-allowed; cursor: not-allowed;
opacity: 1; opacity: 1;
} }
@@ -693,7 +693,7 @@
.db_tools_table_cell_b:nth-child(1) {background: #272c30} .db_tools_table_cell_b:nth-child(1) {background: #272c30}
.db_tools_table_cell_b:nth-child(2) {background: #272c30} .db_tools_table_cell_b:nth-child(2) {background: #272c30}
.db_info_table { .db_info_table {
display: table; display: table;
border-spacing: 0em; border-spacing: 0em;
font-weight: 400; font-weight: 400;
@@ -757,7 +757,7 @@
.small-box:hover .icon { .small-box:hover .icon {
font-size: 3em; font-size: 3em;
} }
.small-box .icon { .small-box .icon {
top: 0.01em; top: 0.01em;
font-size: 3.25em; font-size: 3.25em;
} }
@@ -808,7 +808,7 @@
.thresholdFormControl .thresholdFormControl
{ {
color:#000; color:#000;
} }
.btn:hover .btn:hover

View File

@@ -276,9 +276,9 @@ function getDeviceData() {
fieldData = localizeTimestamp(fieldData) fieldData = localizeTimestamp(fieldData)
} }
// Add lock/unlock button for tracked fields (not for new devices) // Add lock/unlock icon button for tracked fields (not for new devices)
const fieldName = setting.setKey.replace('NEWDEV_', ''); const fieldName = setting.setKey.replace('NEWDEV_', '');
if (trackedFields[fieldName] && fieldName !== "devFQDN" && mac != "new") { if (trackedFields[fieldName] && fieldName !== "devFQDN" && fieldName !== "devMac" && mac != "new") {
const sourceField = fieldName + "Source"; const sourceField = fieldName + "Source";
const currentSource = deviceData[sourceField] || "N/A"; const currentSource = deviceData[sourceField] || "N/A";

View File

@@ -46,7 +46,7 @@ function renderList(
data: JSON.stringify({ rawSql: base64Sql }), data: JSON.stringify({ rawSql: base64Sql }),
contentType: "application/json", contentType: "application/json",
success: function(data) { success: function(data) {
console.log("SQL query response:", data); // console.log("SQL query response:", data);
// Parse the returned SQL data // Parse the returned SQL data
let sqlOption = []; let sqlOption = [];
@@ -62,7 +62,7 @@ function renderList(
// Concatenate options from SQL query with the supplied options // Concatenate options from SQL query with the supplied options
options = options.concat(sqlOption); options = options.concat(sqlOption);
console.log("Combined options:", options); // console.log("Combined options:", options);
// Process the combined options // Process the combined options
setTimeout(() => { setTimeout(() => {

View File

@@ -16,8 +16,12 @@ function askDeleteDevice() {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
function askDelDevDTInline(mac) { function askDelDevDTInline(mac) {
// Check MAC
mac = getMac() // only try getting mac from URL if not supplied - used in inline buttons on in the my devices listing pages
if(isEmpty(mac))
{
mac = getMac()
}
showModalWarning( showModalWarning(
getString("DevDetail_button_Delete"), getString("DevDetail_button_Delete"),
@@ -54,13 +58,17 @@ function deleteDevice() {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
function deleteDeviceByMac(mac) { function deleteDeviceByMac(mac) {
// Check MAC // only try getting mac from URL if not supplied - used in inline buttons on in teh my devices listing pages
mac = getMac() if(isEmpty(mac))
{
mac = getMac()
}
const apiBase = getApiBase(); const apiBase = getApiBase();
const apiToken = getSetting("API_TOKEN"); const apiToken = getSetting("API_TOKEN");
const url = `${apiBase}/device/${mac}/delete`; const url = `${apiBase}/device/${mac}/delete`;
$.ajax({ $.ajax({
url, url,
method: "DELETE", method: "DELETE",

View File

@@ -193,14 +193,18 @@ sql_online_history = "SELECT * FROM Online_History"
sql_plugins_events = "SELECT * FROM Plugins_Events" sql_plugins_events = "SELECT * FROM Plugins_Events"
sql_plugins_history = "SELECT * FROM Plugins_History ORDER BY DateTimeChanged DESC" sql_plugins_history = "SELECT * FROM Plugins_History ORDER BY DateTimeChanged DESC"
sql_new_devices = """SELECT * FROM ( sql_new_devices = """SELECT * FROM (
SELECT eve_IP as devLastIP, eve_MAC as devMac SELECT eve_IP as devLastIP,
eve_MAC as devMac,
MAX(eve_DateTime) as lastEvent
FROM Events_Devices FROM Events_Devices
WHERE eve_PendingAlertEmail = 1 WHERE eve_PendingAlertEmail = 1
AND eve_EventType = 'New Device' AND eve_EventType = 'New Device'
ORDER BY eve_DateTime ) t1 GROUP BY eve_MAC
LEFT JOIN ORDER BY lastEvent
( SELECT devName, devMac as devMac_t2 FROM Devices) t2 ) t1
ON t1.devMac = t2.devMac_t2""" LEFT JOIN
( SELECT devName, devMac as devMac_t2 FROM Devices ) t2
ON t1.devMac = t2.devMac_t2"""
sql_generateGuid = """ sql_generateGuid = """