FE+BE+DOCS: lock fields, devVlan not saveable

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-01-26 11:19:49 +11:00
parent 9d6004d23d
commit 54a481f459
26 changed files with 63 additions and 29 deletions
@@ -1,6 +1,8 @@
# Quick Reference Guide - Device Field Lock/Unlock System
## One-Minute Overview
## Overview
![Field source and locks](./img/DEVICE_MANAGEMENT/field_sources_and_locks.png)
The device field lock/unlock system allows you to protect specific device fields from being automatically overwritten by scanning plugins. When you lock a field, NetAlertX remembers your choice and prevents plugins from changing that value until you unlock it.
+3 -1
View File
@@ -49,6 +49,8 @@ To speed up device population you can also copy data from an existing device. Th
## Field Locking (Preventing Plugin Overwrites)
![Field source and locks](./img/DEVICE_MANAGEMENT/field_sources_and_locks.png)
NetAlertX allows you to "lock" specific device fields to prevent plugins from automatically overwriting your custom values. This is useful when you've manually corrected information that might be discovered differently by discovery plugins.
### Quick Start
@@ -64,7 +66,7 @@ The following 10 fields support locking:
### See Also
- **For Users:** [Quick Reference - Device Field Lock/Unlock](QUICK_REFERENCE_FIELD_LOCK.md) - How to use field locking
- **For Users:** [Quick Reference - Device Field Lock/Unlock](DEVICE_FIELD_LOCK.md) - How to use field locking
- **For Developers:** [API Device Field Lock Documentation](API_DEVICE_FIELD_LOCK.md) - Technical API reference
- **For Plugin Developers:** [Plugin Field Configuration (SET_ALWAYS/SET_EMPTY)](PLUGINS_DEV_CONFIG.md) - Configure which fields plugins can update
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

+7
View File
@@ -440,6 +440,7 @@ function setDeviceData(direction = '', refreshCallback = '') {
devSSID: $('#NEWDEV_devSSID').val(),
devSite: $('#NEWDEV_devSite').val(),
devVlan: $('#NEWDEV_devVlan').val(),
devStaticIP: ($('#NEWDEV_devStaticIP')[0].checked * 1),
devScan: 1,
@@ -580,6 +581,12 @@ function toggleFieldLock(mac, fieldName) {
const currentSource = deviceData[sourceField] || "N/A";
const shouldLock = currentSource !== "LOCKED";
if(shouldLock && somethingChanged)
{
showMessage(getString("FieldLock_SaveBeforeLocking"), 5000, "modal_red");
return;
}
const payload = {
fieldName: fieldName,
lock: shouldLock ? 1 : 0
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -304,6 +304,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "Error updating field lock status",
"FieldLock_Lock_Tooltip": "Lock field (prevent plugin overwrites)",
"FieldLock_Locked": "Field locked",
"FieldLock_SaveBeforeLocking": "Save your changes before locking",
"FieldLock_Source_Label": "Source: ",
"FieldLock_Unlock_Tooltip": "Unlock field (allow plugin overwrites)",
"FieldLock_Unlocked": "Field unlocked",
+1
View File
@@ -302,6 +302,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "Errore durante l'aggiornamento dello stato di blocco del campo",
"FieldLock_Lock_Tooltip": "Blocca campo (impedisci sovrascrittura plugin)",
"FieldLock_Locked": "Campo bloccato",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "Sorgente: ",
"FieldLock_Unlock_Tooltip": "Sblocca campo (consenti sovrascritture plugin)",
"FieldLock_Unlocked": "Campo sbloccato",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "Ошибка при обновлении статуса блокировки поля",
"FieldLock_Lock_Tooltip": "Заблокировать поле (предотвратить перезапись плагином)",
"FieldLock_Locked": "Поле заблокировано",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "Источник: ",
"FieldLock_Unlock_Tooltip": "Разблокировать поле (разрешить перезапись плагином)",
"FieldLock_Unlocked": "Поле разблокировано",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "Помилка оновлення стану блокування поля",
"FieldLock_Lock_Tooltip": "Заблокувати поле (запобігти перезапису плагіном)",
"FieldLock_Locked": "Поле заблоковано",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "Джерело: ",
"FieldLock_Unlock_Tooltip": "Поле розблокування (дозволити перезапис плагіна)",
"FieldLock_Unlocked": "Поле розблоковано",
+1
View File
@@ -300,6 +300,7 @@
"FieldLock_Error": "",
"FieldLock_Lock_Tooltip": "",
"FieldLock_Locked": "",
"FieldLock_SaveBeforeLocking": "",
"FieldLock_Source_Label": "",
"FieldLock_Unlock_Tooltip": "",
"FieldLock_Unlocked": "",
+1 -1
View File
@@ -76,7 +76,7 @@ nav:
- Custom Properties: CUSTOM_PROPERTIES.md
- Device Display Settings: DEVICE_DISPLAY_SETTINGS.md
- Session Info: SESSION_INFO.md
- Field Lock/Unlock: QUICK_REFERENCE_FIELD_LOCK.md
- Field Lock/Unlock: DEVICE_FIELD_LOCK.md
- Icons and Topology:
- Icons: ICONS.md
- Network Topology: NETWORK_TREE.md
+9 -5
View File
@@ -429,7 +429,8 @@ class DeviceInstance:
"devDownAlerts": 0,
"devPresenceHours": 0,
"devFQDN": "",
"devForceStatus" : "dont_force"
"devForceStatus" : "dont_force",
"devVlan": ""
}
return device_data
@@ -536,7 +537,8 @@ class DeviceInstance:
"devIsNew",
"devIsArchived",
"devCustomProps",
"devForceStatus"
"devForceStatus",
"devVlan"
}
# Only mark USER for tracked fields that this method actually updates.
@@ -586,8 +588,8 @@ class DeviceInstance:
devParentRelType, devReqNicsOnline, devSkipRepeated,
devIsNew, devIsArchived, devLastConnection,
devFirstConnection, devLastIP, devGUID, devCustomProps,
devSourcePlugin, devForceStatus
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
devSourcePlugin, devForceStatus, devVlan
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
"""
values = (
@@ -621,6 +623,7 @@ class DeviceInstance:
data.get("devCustomProps") or "",
data.get("devSourcePlugin") or "DUMMY",
data.get("devForceStatus") or "dont_force",
data.get("devVlan") or "",
)
else:
@@ -631,7 +634,7 @@ class DeviceInstance:
devParentMAC=?, devParentPort=?, devSSID=?, devSite=?,
devStaticIP=?, devScan=?, devAlertEvents=?, devAlertDown=?,
devParentRelType=?, devReqNicsOnline=?, devSkipRepeated=?,
devIsNew=?, devIsArchived=?, devCustomProps=?, devForceStatus=?
devIsNew=?, devIsArchived=?, devCustomProps=?, devForceStatus=?, devVlan=?
WHERE devMac=?
"""
values = (
@@ -659,6 +662,7 @@ class DeviceInstance:
data.get("devIsArchived") or 0,
data.get("devCustomProps") or "",
data.get("devForceStatus") or "dont_force",
data.get("devVlan") or "",
normalized_mac,
)
@@ -257,7 +257,7 @@ All 10 lockable fields tested:
## Related Documentation
- **User Guide:** [QUICK_REFERENCE_FIELD_LOCK.md](../../docs/QUICK_REFERENCE_FIELD_LOCK.md) - User-friendly field locking instructions
- **User Guide:** [DEVICE_FIELD_LOCK.md](../../docs/DEVICE_FIELD_LOCK.md) - User-friendly field locking instructions
- **API Documentation:** [API_DEVICE_FIELD_LOCK.md](../../docs/API_DEVICE_FIELD_LOCK.md) - Endpoint documentation
- **Plugin Configuration:** [PLUGINS_DEV_CONFIG.md](../../docs/PLUGINS_DEV_CONFIG.md) - SET_ALWAYS/SET_EMPTY configuration guide
- **Device Management:** [DEVICE_MANAGEMENT.md](../../docs/DEVICE_MANAGEMENT.md) - Device management admin guide