diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index c6d227d..306edac 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -143,7 +143,7 @@ .reg-io-grid .io-fieldset .io-row input, .reg-io-grid .io-fieldset .io-row select {padding: 4px 6px;border: 1px solid #aaa;border-radius: 4px;font-size: 14px;width: 100%;box-sizing: border-box;} .reg-io-grid .io-fieldset .io-row.checkbox-group {display: flex;align-items: center;gap: 16px;grid-column: 2 / 3;} - .reg-io-grid .io-fieldset .io-row .checkbox-with-text {display: flex;align-items: center;gap: 10px;width: 100%;} + .reg-io-grid .io-fieldset .io-row .checkbox-with-text {display: flex;align-items: center;gap: 10px;width: 10%;} .reg-io-grid .io-fieldset .io-row .checkbox-with-text input[type="checkbox"] {width: auto;margin: 0;} /* 비활성 input 시각화 */ @@ -239,6 +239,7 @@ SSID List + @@ -331,6 +332,10 @@ class="colon">: GATEWAY: + SERVER IP: + SERVER PORT: @@ -557,16 +562,28 @@ AI0 + + AI1 + + AI2 + + AI3 DI0 + + DI1 + + DI2 + + DI3 @@ -586,6 +603,7 @@ Save to Protocol Download Device File + @@ -1251,7 +1269,7 @@ const newRow = opcUaRowTemplate.content.cloneNode(true); newRow.querySelector('.opcua-field-display').textContent = field.field ?? ''; newRow.querySelector('.opcua-addr-display').textContent = field.addr ?? ''; - newRow.querySelector('.opcua-ns-display').textContent = field.idt ?? ''; + newRow.querySelector('.opcua-ns-display').textContent = field.ns ?? ''; newRow.querySelector('.opcua-odt-display').textContent = field.odt ?? ''; newRow.querySelector('.opcua-dv-display').textContent = field.dv ?? ''; newRow.querySelector('.opcua-shift-display').textContent = field.shift ?? ''; @@ -2067,6 +2085,13 @@ alert('device 설정 전송 중 통신 오류 발생'); }); + const isConfigValid = isValidRegisterConfig(collectConfigData()); + + if (!isConfigValid) { + // 유효성 검사에 실패하면 경고 메시지를 띄우고 함수 실행을 중단합니다. + alert("현재 Register 설정이 유효하지 않습니다. 저장할 수 없습니다. 콘솔을 확인하세요."); + return; // 여기서 저장을 중단하고 다음 코드를 실행하지 않습니다. + } fetch('http://localhost:8080/setting/protocol', { method: 'POST', headers: {'Content-Type': 'application/json'}, @@ -2093,13 +2118,12 @@ })}) document.querySelectorAll('.download-protocol-file').forEach(btn=>{btn.addEventListener('click', () => { - downloadProtocolJson(collectData(data)); + downloadProtocolJson(collectConfigData(data)); })}) - document.getElementById('reg_can_input')?.addEventListener('change', toggleProtocolMenus);//-------------------------------- + document.getElementById('reg_can_input')?.addEventListener('change', toggleProtocolMenus); - // DOMContentLoaded 내부에 추가: CAN 테이블도 처음에 빈 행이 없으면 하나 추가 const canFieldList = document.getElementById('can-field-list'); if (canFieldList.children.length === 0) { const canRowTemplate = document.getElementById('can-row-template'); @@ -2124,6 +2148,10 @@ document.getElementById('can_mask_input').value = tr.querySelector('.can-mask-display').textContent; }); }); + + + +