|
|
|
@ -450,6 +450,7 @@ |
|
|
|
<div class="config-actions"> |
|
|
|
<button id="loadProtocolBtn">Load Protocol File</button> |
|
|
|
<button id="saveProtocolBtn">Save to Protocol</button> |
|
|
|
<button id="uploadProtocolBtn">Upload to Device</button> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
|
|
|
|
@ -531,6 +532,7 @@ |
|
|
|
<div id="modbus-bottom-actions"> |
|
|
|
<button id="loadModbusBtn">Load Protocol File</button> |
|
|
|
<button id="saveModbusBtn">Save Protocol File</button> |
|
|
|
<button id="uploadModbusBtn">Upload to Device</button> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
|
|
|
|
@ -604,6 +606,7 @@ |
|
|
|
<div id="opcUa-bottom-actions"> |
|
|
|
<button id="loadOpcUaFileBtn">Load Protocol File</button> |
|
|
|
<button id="saveOpcUaFileBtn">Save to Protocol</button> |
|
|
|
<button id="uploadOpcuaFileBtn">Upload to Device</button> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
|
|
|
|
@ -670,6 +673,7 @@ |
|
|
|
<div id="can-bottom-actions"> |
|
|
|
<button id="loadCanBtn">Load Protocol File</button> |
|
|
|
<button id="saveCanBtn">Save Protocol File</button> |
|
|
|
<button id="uploadCanBtn">Upload to Device</button> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
|
|
|
|
@ -1704,6 +1708,85 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
document.getElementById('uploadProtocolBtn').addEventListener('click', () => { |
|
|
|
fetch('http://localhost:8080/setting/register-upload', { |
|
|
|
method: 'POST', |
|
|
|
headers: {'Content-Type': 'application/json'}, |
|
|
|
body: JSON.stringify(collectConfigData()) |
|
|
|
}) |
|
|
|
.then(res => res.json()) |
|
|
|
.then(data => { |
|
|
|
// result_code가 200이면 성공 |
|
|
|
if (data.result && data.result.result_code === 200) { |
|
|
|
alert('하드웨어 업로드 성공!'); |
|
|
|
} else { |
|
|
|
alert('하드웨어 업로드 실패: ' + (data.result?.result_message || data.body || '')); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
alert('통신 오류: ' + err.message); |
|
|
|
}); |
|
|
|
}); |
|
|
|
document.getElementById('uploadModbusBtn').addEventListener('click', () => { |
|
|
|
fetch('http://localhost:8080/setting/register-upload', { |
|
|
|
method: 'POST', |
|
|
|
headers: {'Content-Type': 'application/json'}, |
|
|
|
body: JSON.stringify(collectConfigData()) |
|
|
|
}) |
|
|
|
.then(res => res.json()) |
|
|
|
.then(data => { |
|
|
|
// result_code가 200이면 성공 |
|
|
|
if (data.result && data.result.result_code === 200) { |
|
|
|
alert('하드웨어 업로드 성공!'); |
|
|
|
} else { |
|
|
|
alert('하드웨어 업로드 실패: ' + (data.result?.result_message || data.body || '')); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
alert('통신 오류: ' + err.message); |
|
|
|
}); |
|
|
|
}); |
|
|
|
document.getElementById('uploadOpcuaFileBtn').addEventListener('click', () => { |
|
|
|
fetch('http://localhost:8080/setting/register-upload', { |
|
|
|
method: 'POST', |
|
|
|
headers: {'Content-Type': 'application/json'}, |
|
|
|
body: JSON.stringify(collectConfigData()) |
|
|
|
}) |
|
|
|
.then(res => res.json()) |
|
|
|
.then(data => { |
|
|
|
// result_code가 200이면 성공 |
|
|
|
if (data.result && data.result.result_code === 200) { |
|
|
|
alert('하드웨어 업로드 성공!'); |
|
|
|
} else { |
|
|
|
alert('하드웨어 업로드 실패: ' + (data.result?.result_message || data.body || '')); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
alert('통신 오류: ' + err.message); |
|
|
|
}); |
|
|
|
}); |
|
|
|
document.getElementById('uploadCanBtn').addEventListener('click', () => { |
|
|
|
fetch('http://localhost:8080/setting/register-upload', { |
|
|
|
method: 'POST', |
|
|
|
headers: {'Content-Type': 'application/json'}, |
|
|
|
body: JSON.stringify(collectConfigData()) |
|
|
|
}) |
|
|
|
.then(res => res.json()) |
|
|
|
.then(data => { |
|
|
|
// result_code가 200이면 성공 |
|
|
|
if (data.result && data.result.result_code === 200) { |
|
|
|
alert('하드웨어 업로드 성공!'); |
|
|
|
} else { |
|
|
|
alert('하드웨어 업로드 실패: ' + (data.result?.result_message || data.body || '')); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
alert('통신 오류: ' + err.message); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |