mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-31 07:12:23 -07:00
feat: authoritative plugin fields
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
@@ -101,8 +101,8 @@ a[target="_blank"] {
|
||||
----------------------------------------------------------------------------- */
|
||||
.logs
|
||||
{
|
||||
color:white;
|
||||
background-color: black;
|
||||
color:white !important;
|
||||
background-color: black !important;
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: .85em;
|
||||
|
||||
|
||||
@@ -518,7 +518,7 @@ textarea[readonly],
|
||||
.form-control[readonly] {
|
||||
background-color: #545659 !important;
|
||||
border-color: #3d444b;
|
||||
color: #888a8c;
|
||||
color: #979a9d;
|
||||
cursor: not-allowed;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
--color-gray: #8c8c8c;
|
||||
--color-white: #fff;
|
||||
}
|
||||
|
||||
|
||||
:root {
|
||||
--datatable-bgcolor: rgba(64, 76, 88, 0.8);
|
||||
}
|
||||
@@ -427,7 +427,7 @@
|
||||
background: transparent;
|
||||
color: var(--color-white);
|
||||
}
|
||||
|
||||
|
||||
/* Used in debug log page */
|
||||
.log-red {
|
||||
color: #ff4038;
|
||||
@@ -519,9 +519,9 @@
|
||||
input[readonly],
|
||||
textarea[readonly],
|
||||
.form-control[readonly] {
|
||||
background-color: #2f353b !important;
|
||||
background-color: #545659 !important;
|
||||
border-color: #3d444b;
|
||||
color: #c7cdd3;
|
||||
color: #979a9d;
|
||||
cursor: not-allowed;
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -693,7 +693,7 @@
|
||||
.db_tools_table_cell_b:nth-child(1) {background: #272c30}
|
||||
.db_tools_table_cell_b:nth-child(2) {background: #272c30}
|
||||
|
||||
.db_info_table {
|
||||
.db_info_table {
|
||||
display: table;
|
||||
border-spacing: 0em;
|
||||
font-weight: 400;
|
||||
@@ -757,7 +757,7 @@
|
||||
.small-box:hover .icon {
|
||||
font-size: 3em;
|
||||
}
|
||||
.small-box .icon {
|
||||
.small-box .icon {
|
||||
top: 0.01em;
|
||||
font-size: 3.25em;
|
||||
}
|
||||
@@ -808,7 +808,7 @@
|
||||
|
||||
.thresholdFormControl
|
||||
{
|
||||
color:#000;
|
||||
color:#000;
|
||||
}
|
||||
|
||||
.btn:hover
|
||||
|
||||
@@ -276,9 +276,9 @@ function getDeviceData() {
|
||||
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_', '');
|
||||
if (trackedFields[fieldName] && fieldName !== "devFQDN" && mac != "new") {
|
||||
if (trackedFields[fieldName] && fieldName !== "devFQDN" && fieldName !== "devMac" && mac != "new") {
|
||||
const sourceField = fieldName + "Source";
|
||||
|
||||
const currentSource = deviceData[sourceField] || "N/A";
|
||||
|
||||
@@ -46,7 +46,7 @@ function renderList(
|
||||
data: JSON.stringify({ rawSql: base64Sql }),
|
||||
contentType: "application/json",
|
||||
success: function(data) {
|
||||
console.log("SQL query response:", data);
|
||||
// console.log("SQL query response:", data);
|
||||
|
||||
// Parse the returned SQL data
|
||||
let sqlOption = [];
|
||||
@@ -62,7 +62,7 @@ function renderList(
|
||||
// Concatenate options from SQL query with the supplied options
|
||||
options = options.concat(sqlOption);
|
||||
|
||||
console.log("Combined options:", options);
|
||||
// console.log("Combined options:", options);
|
||||
|
||||
// Process the combined options
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -16,8 +16,12 @@ function askDeleteDevice() {
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
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(
|
||||
getString("DevDetail_button_Delete"),
|
||||
@@ -54,13 +58,17 @@ function deleteDevice() {
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
function deleteDeviceByMac(mac) {
|
||||
// Check MAC
|
||||
mac = getMac()
|
||||
// only try getting mac from URL if not supplied - used in inline buttons on in teh my devices listing pages
|
||||
if(isEmpty(mac))
|
||||
{
|
||||
mac = getMac()
|
||||
}
|
||||
|
||||
const apiBase = getApiBase();
|
||||
const apiToken = getSetting("API_TOKEN");
|
||||
const url = `${apiBase}/device/${mac}/delete`;
|
||||
|
||||
|
||||
$.ajax({
|
||||
url,
|
||||
method: "DELETE",
|
||||
|
||||
@@ -193,14 +193,18 @@ sql_online_history = "SELECT * FROM Online_History"
|
||||
sql_plugins_events = "SELECT * FROM Plugins_Events"
|
||||
sql_plugins_history = "SELECT * FROM Plugins_History ORDER BY DateTimeChanged DESC"
|
||||
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
|
||||
WHERE eve_PendingAlertEmail = 1
|
||||
AND eve_EventType = 'New Device'
|
||||
ORDER BY eve_DateTime ) t1
|
||||
LEFT JOIN
|
||||
( SELECT devName, devMac as devMac_t2 FROM Devices) t2
|
||||
ON t1.devMac = t2.devMac_t2"""
|
||||
GROUP BY eve_MAC
|
||||
ORDER BY lastEvent
|
||||
) t1
|
||||
LEFT JOIN
|
||||
( SELECT devName, devMac as devMac_t2 FROM Devices ) t2
|
||||
ON t1.devMac = t2.devMac_t2"""
|
||||
|
||||
|
||||
sql_generateGuid = """
|
||||
|
||||
Reference in New Issue
Block a user