arp列表终版

This commit is contained in:
zifan 2023-09-21 10:47:57 +08:00
parent 80d9ba5f9e
commit 6e3d9489fb
1 changed files with 49 additions and 25 deletions

View File

@ -6,10 +6,32 @@
<meta name="author" content="zifan">
<meta name="keywords" content="物联网">
<title>ARP列表</title>
<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>
</head>
<body>
<table id="arpTable" width="700" align="center" border="1">
<div></div>
<div class="tablecenter">
<table id="arpTable" width="700" align="center" border="1" cellspacing="0">
<thead>
<th>ID</th>
<th>ip地址</th>
@ -19,12 +41,14 @@
</tbody>
</table>
</div>
<div></div>
<div></div>
<script>
window.onload = function () {
fetch("/cgi-bin/ip.cgi").then(resp => resp.json()).then(data => {
if (data.code == 0) {
fetch("/cgi-bin/arp.cgi").then(resp => resp.json()).then(data => {
arpTableBody.innerText = "";
data.data.forEach(rowData => {
data.forEach(rowData => {
let tr = document.createElement("tr");
let td1 = document.createElement("td");
let td2 = document.createElement("td");
@ -38,7 +62,7 @@
arpTableBody.append(tr);
});
}
})
)
}
</script>
</body>