@@ -278,7 +278,7 @@ function getDeviceData() {
278278
279279 // Add lock/unlock button for tracked fields (not for new devices)
280280 const fieldName = setting.setKey.replace('NEWDEV_', '');
281- if (trackedFields[fieldName] && mac != "new") {
281+ if (trackedFields[fieldName] && fieldName !== "devFQDN" && mac != "new") {
282282 const sourceField = fieldName + "Source";
283283 const currentSource = deviceData[sourceField] || "N/A";
284284 const isLocked = currentSource === "LOCKED";
@@ -291,6 +291,11 @@ function getDeviceData() {
291291 data-locked="${isLocked ? 1 : 0}">
292292 <i class="fa-solid ${lockIcon}"></i>
293293 </span>`;
294+ if (isLocked) {
295+ if (!disabledFields.includes(setting.setKey)) {
296+ disabledFields.push(setting.setKey);
297+ }
298+ }
294299 }
295300
296301 // Add source indicator for tracked fields
@@ -603,14 +608,22 @@ function toggleFieldLock(mac, fieldName) {
603608 // Update local source state
604609 deviceData[sourceField] = shouldLock ? "LOCKED" : "";
605610
611+ const fieldKey = `NEWDEV_${fieldName}`;
612+ const fieldInput = $(`#${fieldKey}`);
613+ fieldInput.prop("readonly", shouldLock);
614+
606615 // Update source indicator
607616 const sourceIndicator = lockBtn.next();
608617 if (sourceIndicator.hasClass("input-group-addon")) {
609- const sourceValue = shouldLock ? "LOCKED" : "N/A";
610- const sourceClass = shouldLock ? "input-group-addon text-danger" : "input-group-addon pointer text-muted";
611- sourceIndicator.text(sourceValue);
612- sourceIndicator.attr("class", sourceClass);
613- sourceIndicator.attr("title", getString("FieldLock_Source_Label") + sourceValue);
618+ if (shouldLock) {
619+ const sourceValue = "LOCKED";
620+ const sourceClass = "input-group-addon pointer text-danger";
621+ sourceIndicator.text(sourceValue);
622+ sourceIndicator.attr("class", sourceClass);
623+ sourceIndicator.attr("title", getString("FieldLock_Source_Label") + sourceValue);
624+ } else {
625+ sourceIndicator.remove();
626+ }
614627 }
615628
616629 showMessage(shouldLock ? getString("FieldLock_Locked") : getString("FieldLock_Unlocked"), 3000, "modal_green");
0 commit comments