AudioHTML/network.html

196 lines
7.8 KiB
HTML
Raw Normal View History

2023-10-29 16:52:53 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/app.css" rel="stylesheet">
2023-11-08 00:29:39 +08:00
<script src="js/config.js"></script>
<script src="js/jquery-3.7.1.js"></script>
2023-10-29 16:52:53 +08:00
</head>
<body class="h-100 text-center text-bg-dark content-warp">
<div class="d-flex w-100 h-100 mx-auto flex-column">
<header class="mb-auto pb-5">
<div class="dotblock d-flex justify-content-between px-5 py-4">
<div class="fs-3">GEAZAN</div>
<div></div>
</div>
<div class="d-flex justify-content-center fw-bold border-black nav">
2023-11-03 00:47:21 +08:00
<div class="">
<a href="home.html">HOME</a>
</div>
<div class=""><a href="filter.html">FILTER</a></div>
<div class=""><a href="fs.html">FS</div>
<div class=""><a href="eq.html">EQ</a></div>
<div class=""><a href="ducking.html">DUCKING</a></div>
2023-10-29 16:52:53 +08:00
<div class="active"><a href="network.html">NETWORK</a></div>
<div class="">
2023-11-03 00:47:21 +08:00
<a href="security.html">SECURITY</a>
2023-10-29 16:52:53 +08:00
</div>
2023-11-03 00:47:21 +08:00
<div class=""><a href="control.html">CONTROL</a></div>
<div class="last "><a href="system.html">SYSTEM</a></div>
2023-10-29 16:52:53 +08:00
</div>
</header>
<main class="px-3 d-flex justify-content-center">
<div class="form">
<div class="border border-black m-6 password-form">
<div class=" m-5 mx-auto form" style="width: 500px;">
<div class="mb-3 row">
<label for="staticEmail" class="col-sm-5 col-form-label">IP Configuration</label>
<div class="col-sm-7 text-start py-2">
<div class="form-check form-check-inline">
2023-11-08 19:15:11 +08:00
<input class="form-check-input" checked type="radio" name="type" id="type-dhcp"
value="dhcp">
<label class="form-check-label" for="type-dhcp">DHCP</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="type" id="type-static"
value="static">
<label class="form-check-label" for="type-static">Static IP</label>
</div>
2023-10-29 16:52:53 +08:00
</div>
</div>
<div class="mb-3 row">
<label for="staticEmail" class="col-sm-5 col-form-label">Mac Address</label>
2023-11-08 19:15:11 +08:00
<div class="col-sm-7 text-start py-2" id="mac">
2023-10-29 16:52:53 +08:00
10-A6-56-EF-23-D6
</div>
</div>
<div class="mb-3 row">
2023-11-08 00:29:39 +08:00
<label for="ipaddress" class="col-sm-5 col-form-label">IP Address</label>
2023-10-29 16:52:53 +08:00
<div class="col-sm-7">
2023-11-08 00:29:39 +08:00
<input type="text" class="form-control" id="ipaddress">
2023-10-29 16:52:53 +08:00
</div>
</div>
<div class="mb-3 row">
2023-11-08 19:15:11 +08:00
<label for="subnet" class="col-sm-5 col-form-label">Subnet Mask</label>
2023-10-29 16:52:53 +08:00
<div class="col-sm-7">
2023-11-08 19:15:11 +08:00
<input type="text" class="form-control" id="subnet">
2023-10-29 16:52:53 +08:00
</div>
</div>
<div class="mb-3 row">
2023-11-08 00:29:39 +08:00
<label for="gateway" class="col-sm-5 col-form-label">Gateway</label>
2023-10-29 16:52:53 +08:00
<div class="col-sm-7">
2023-11-08 00:29:39 +08:00
<input type="text" class="form-control" id="gateway">
2023-10-29 16:52:53 +08:00
</div>
</div>
<div class="mb-3 row">
2023-11-08 00:29:39 +08:00
<label for="hostName" class="col-sm-5 col-form-label">Host Name</label>
2023-10-29 16:52:53 +08:00
<div class="col-sm-7">
2023-11-09 17:25:00 +08:00
<input type="text" class="form-control" id="hostName">
2023-10-29 16:52:53 +08:00
</div>
</div>
</div>
</div>
<div class="mt-5 pb-5">
2023-11-08 19:15:11 +08:00
<button type="button" class="btn btn-dark border border-black px-5" id="submit">Confirm</button>
2023-10-29 16:52:53 +08:00
</div>
</div>
</main>
<footer class="mt-auto text-white-50">
<div class="dotblock d-flex justify-content-between px-5 py-4">
<div class="">Geazan</div>
<div>www.geazan.com</div>
</div>
</footer>
</div>
2023-11-08 19:15:11 +08:00
<script>
2023-11-10 11:53:14 +08:00
var data = {}
2023-11-08 19:15:11 +08:00
document.addEventListener("DOMContentLoaded", function () {
//初始化配置
loadData()
})
$(document).ready(function () {
$("input[name='type']").on('change', function () {
console.log($("input[name=type]:checked").val())
checkDisable();
})
$("#submit").on('click', function () {
if (isValidIP($("#ipaddress").val()) == false) {
alert('The ip address format is incorrect')
return
}
if (isValidIP($('#subnet').val()) == false) {
alert('The subnet address format is incorrect')
return
}
if (isValidIP($('#gateway').val()) == false) {
alert('The gateway address format is incorrect')
return
}
if ($('#hostName').val().length > 32) {
alert('The host name contains a maximum of 32 characters')
return
}
})
})
function checkDisable() {
var type = $("input[name='type']:checked").val()
if (type == 'dhcp') {
$("#ipaddress").attr('disabled', "disabled");
$('#subnet').attr('disabled', "disabled");
$('#gateway').attr('disabled', "disabled");
}
2023-11-10 11:53:14 +08:00
else {
2023-11-08 19:15:11 +08:00
$("#ipaddress").removeAttr("disabled");
$('#subnet').removeAttr("disabled");
$('#gateway').removeAttr("disabled");
}
}
function loadData() {
2023-11-10 11:53:14 +08:00
let url = ""
$.ajax({
type: "GET",
url: url,
success: function (res) {
data = res.content
bindData()
},
error: function () {
data = {
config: "dhcp",
mac: '00-2F-33-7X-3B',
address: '127.0.0.10',
subnet: '255.255.255.0',
gateway: '127.0.0.1',
hostname: 'test-name'
}
bindData()
}
})
}
function bindData() {
console.log(data)
$('#mac').text(`${data.mac}`)
$("#ipaddress").val(`${data.address}`)
$('#subnet').val(`${data.subnet}`)
$('#gateway').val(`${data.gateway}`)
$('#hostName').val(`${data.hostname}`)
checkDisable();
2023-11-08 19:15:11 +08:00
}
function isValidIP(ip) {
var reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
return reg.test(ip);
}
</script>
2023-10-29 16:52:53 +08:00
</body>
</html>