LoRa Packet Forwarder 单选按钮修改

This commit is contained in:
xusd 2024-07-31 11:09:02 +08:00
parent c53d3348af
commit ad41584915

View File

@ -303,6 +303,22 @@
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<script th:inline="javascript"> <script th:inline="javascript">
$(document).ready(function (){
var readyRadioValue = $('input[name=mqttKeep][checked]').val();
console.log(readyRadioValue)
checkRadio(readyRadioValue);
$('.mqttKeep').on('ifChecked', function(event){
var radio = $(event.target).val();
checkRadio(radio);
})
})
function checkRadio(value){
if (value === '1'){
document.getElementById('mqttHeartbeat').style.display = 'block';
}else {
document.getElementById('mqttHeartbeat').style.display = 'none';
}
}
var prefix = ctx + "lora/agreement"; var prefix = ctx + "lora/agreement";
$("#form").validate({ $("#form").validate({
focusCleanup: true focusCleanup: true
@ -346,9 +362,6 @@
$.operate.save(prefix + "/edit", form); $.operate.save(prefix + "/edit", form);
} }
} }
</script>
</body>
<script>
document.addEventListener('DOMContentLoaded', (event) => { document.addEventListener('DOMContentLoaded', (event) => {
// DOM完全加载和解析完成后执行的代码 // DOM完全加载和解析完成后执行的代码
cleanDiv() cleanDiv()
@ -368,3 +381,4 @@
document.getElementById('agreement5').style.display = 'none'; document.getElementById('agreement5').style.display = 'none';
} }
</script> </script>
</body>