smart-green-house-server-an.../html/record_of_operations_histor...

52 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="keywords" content="">
<title>历史操作表</title>
</head>
<body>
<h1 align="center">历史操作表</h1>
<table id="arpTable" width="500" border="1" align="center">
<thead>
<th>用户名</th>
<th>操作指令</th>
<th>操作时间</th>
</thead>
<tbody id="arpBody" align="center">
</tbody>
</table>
<script>
window.onload = function () {
query("");
}
function query(val) {
fetch("/cgi-bin/router_showarp.cgi").then(resp =>
resp.json()).then(data => {
if (data.code == 0) {
arpBody.innerText = "";
data.data.forEach(rowData => {
let tr = document.createElement("tr");
let td1 = document.createElement("td");
let td2 = document.createElement("td");
td1.innerText = rowData.ip;
td2.innerText = rowData.mac;
tr.append(td1, td2);
arpBody.append(tr);
})
}
});
}
</script>
</body>
</html>