Skip to content

Commit 422a048

Browse files
committed
feat: authoritative plugin fields
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
1 parent c843ea5 commit 422a048

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

docs/DEBUG_TIPS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Please follow tips 1 - 4 to get a more detailed error.
44

55
## 1. More Logging
66

7-
When debugging an issue always set the highest log level:
7+
When debugging an issue always set the highest log level in **Settings -> Core**:
88

99
`LOG_LEVEL='trace'`
1010

front/deviceDetailsEdit.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function getDeviceData() {
275275
const fieldName = setting.setKey.replace('NEWDEV_', '');
276276
if (trackedFields[fieldName] && mac != "new") {
277277
const sourceField = fieldName + "Source";
278-
const currentSource = deviceData[sourceField] || "";
278+
const currentSource = deviceData[sourceField] || "UNKNOWN";
279279
const isLocked = currentSource === "LOCKED";
280280
const lockIcon = isLocked ? "fa-lock" : "fa-lock-open";
281281
const lockTitle = isLocked ? getString("FieldLock_Unlock_Tooltip") : getString("FieldLock_Lock_Tooltip");
@@ -292,7 +292,7 @@ function getDeviceData() {
292292
const fieldName2 = setting.setKey.replace('NEWDEV_', '');
293293
if (trackedFields[fieldName2] && mac != "new") {
294294
const sourceField = fieldName2 + "Source";
295-
const currentSource = deviceData[sourceField] || "NEWDEV";
295+
const currentSource = deviceData[sourceField] || "UNKNOWN";
296296
const sourceTitle = getString("FieldLock_Source_Label") + currentSource;
297297
const sourceColor = currentSource === "USER" ? "text-warning" : (currentSource === "LOCKED" ? "text-danger" : "text-muted");
298298
inlineControl += `<span class="input-group-addon pointer ${sourceColor}" title="${sourceTitle}">
@@ -561,7 +561,7 @@ function toggleFieldLock(mac, fieldName) {
561561

562562
// Get current source value
563563
const sourceField = fieldName + "Source";
564-
const currentSource = deviceData[sourceField] || "NEWDEV";
564+
const currentSource = deviceData[sourceField] || "UNKNOWN";
565565
const shouldLock = currentSource !== "LOCKED";
566566

567567
const payload = {
@@ -600,7 +600,7 @@ function toggleFieldLock(mac, fieldName) {
600600
// Update source indicator
601601
const sourceIndicator = lockBtn.next();
602602
if (sourceIndicator.hasClass("input-group-addon")) {
603-
const sourceValue = shouldLock ? "LOCKED" : "NEWDEV";
603+
const sourceValue = shouldLock ? "LOCKED" : "UNKNOWN";
604604
const sourceClass = shouldLock ? "input-group-addon text-danger" : "input-group-addon text-muted";
605605
sourceIndicator.text(sourceValue);
606606
sourceIndicator.attr("class", sourceClass);

server/api_server/graphql_endpoint.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ class Device(ObjectType):
9191
devParentRelType = String(description="Relationship type to parent")
9292
devReqNicsOnline = Int(description="Required NICs online flag")
9393
devMacSource = String(description="Source tracking for devMac (USER, LOCKED, NEWDEV, or plugin prefix)")
94-
devNameSource = String(description="Source tracking for devName")
95-
devFqdnSource = String(description="Source tracking for devFQDN")
96-
devLastIpSource = String(description="Source tracking for devLastIP")
97-
devVendorSource = String(description="Source tracking for devVendor")
98-
devSsidSource = String(description="Source tracking for devSSID")
99-
devParentMacSource = String(description="Source tracking for devParentMAC")
100-
devParentPortSource = String(description="Source tracking for devParentPort")
101-
devParentRelTypeSource = String(description="Source tracking for devParentRelType")
94+
devNameSource = String(description="Source tracking for devName (USER, LOCKED, NEWDEV, or plugin prefix)")
95+
devFqdnSource = String(description="Source tracking for devFQDN (USER, LOCKED, NEWDEV, or plugin prefix)")
96+
devLastIpSource = String(description="Source tracking for devLastIP (USER, LOCKED, NEWDEV, or plugin prefix)")
97+
devVendorSource = String(description="Source tracking for devVendor (USER, LOCKED, NEWDEV, or plugin prefix)")
98+
devSsidSource = String(description="Source tracking for devSSID (USER, LOCKED, NEWDEV, or plugin prefix)")
99+
devParentMacSource = String(description="Source tracking for devParentMAC (USER, LOCKED, NEWDEV, or plugin prefix)")
100+
devParentPortSource = String(description="Source tracking for devParentPort (USER, LOCKED, NEWDEV, or plugin prefix)")
101+
devParentRelTypeSource = String(description="Source tracking for devParentRelType (USER, LOCKED, NEWDEV, or plugin prefix)")
102102
devVlanSource = String(description="Source tracking for devVlan")
103103

104104

server/db/db_upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from messaging.in_app import write_notification # noqa: E402 [flake8 lint suppression]
1010

1111

12-
# Define the expected Devices table columns (hardcoded base schema) [v25.5.24]
12+
# Define the expected Devices table columns (hardcoded base schema) [v26.1/2.XX]
1313
EXPECTED_DEVICES_COLUMNS = [
1414
"devMac",
1515
"devName",

server/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def get_setting(key):
189189
SETTINGS_LASTCACHEDATE = fileModifiedTime
190190

191191
if key not in SETTINGS_CACHE:
192-
mylog("none", [f"[Settings] ⚠ ERROR - setting_missing - {key} not in {settingsFile}"],)
192+
mylog("verbose", [f"[Settings] INFO - setting_missing - {key} not in {settingsFile}"],)
193193
return None
194194

195195
return SETTINGS_CACHE[key]

0 commit comments

Comments
 (0)