feat: authoritative plugin fields

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-01-24 22:20:30 +11:00
parent 2acc180fd5
commit 3775e21dc7
11 changed files with 75 additions and 70 deletions

View File

@@ -280,6 +280,7 @@ function getDeviceData() {
const fieldName = setting.setKey.replace('NEWDEV_', '');
if (trackedFields[fieldName] && fieldName !== "devFQDN" && mac != "new") {
const sourceField = fieldName + "Source";
const currentSource = deviceData[sourceField] || "N/A";
const isLocked = currentSource === "LOCKED";
const lockIcon = isLocked ? "fa-lock" : "fa-lock-open";
@@ -302,12 +303,16 @@ function getDeviceData() {
const fieldName2 = setting.setKey.replace('NEWDEV_', '');
if (trackedFields[fieldName2] && mac != "new") {
const sourceField = fieldName2 + "Source";
const currentSource = deviceData[sourceField] || "N/A";
const sourceTitle = getString("FieldLock_Source_Label") + currentSource;
const sourceColor = currentSource === "USER" ? "text-warning" : (currentSource === "LOCKED" ? "text-danger" : "text-muted");
inlineControl += `<span class="input-group-addon pointer ${sourceColor}" title="${sourceTitle}">
${currentSource}
</span>`;
// only show if data available
if (deviceData[sourceField] != "")
{
const currentSource = deviceData[sourceField] || "N/A";
const sourceTitle = getString("FieldLock_Source_Label") + currentSource;
const sourceColor = currentSource === "USER" ? "text-warning" : (currentSource === "LOCKED" ? "text-danger" : "text-muted");
inlineControl += `<span class="input-group-addon pointer ${sourceColor}" title="${sourceTitle}">
${currentSource}
</span>`;
}
}
// handle devChildrenDynamic or NEWDEV_devChildrenNicsDynamic - selected values and options are the same