c-router-emulator/www/arp.html

70 lines
1.8 KiB
HTML
Raw Normal View History

2023-09-20 20:52:46 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="zifan">
<meta name="keywords" content="物联网">
<title>ARP列表</title>
2023-09-21 10:47:57 +08:00
<style>
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
body {
display: flex;
flex-direction: column;
justify-content: space-between;
}
#arpTable {
background-color: rgba(41, 117, 117, 0.667);
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.5);
}
</style>
2023-09-20 20:52:46 +08:00
</head>
<body>
2023-09-21 10:47:57 +08:00
<div></div>
<div class="tablecenter">
<table id="arpTable" width="700" align="center" border="1" cellspacing="0">
<thead>
<th>ID</th>
<th>ip地址</th>
<th>mac地址</th>
</thead>
<tbody id="arpTableBody" align="center">
</tbody>
</table>
</div>
<div></div>
<div></div>
2023-09-20 20:52:46 +08:00
<script>
window.onload = function () {
2023-09-21 10:47:57 +08:00
fetch("/cgi-bin/arp.cgi").then(resp => resp.json()).then(data => {
arpTableBody.innerText = "";
data.forEach(rowData => {
let tr = document.createElement("tr");
let td1 = document.createElement("td");
let td2 = document.createElement("td");
let td3 = document.createElement("td");
td1.innerText = rowData.id;
td2.innerText = rowData.ip;
td3.innerText = rowData.mac;
tr.append(td1, td2, td3);
arpTableBody.append(tr);
});
}
)
2023-09-20 20:52:46 +08:00
}
</script>
</body>
</html>