do adv and scirpt
This commit is contained in:
parent
5e24f2918a
commit
5eb9d369f4
6 changed files with 11 additions and 24 deletions
74
webs/index.html
Normal file
74
webs/index.html
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page Title</title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/minimal2.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="begin"> begin </div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
function readFile(filePath) {
|
||||
var result = null;
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.open("GET", filePath, false);
|
||||
xmlhttp.send();
|
||||
if (xmlhttp.status==200) {
|
||||
result = xmlhttp.responseText;
|
||||
}
|
||||
xmlhttp.abort();
|
||||
return result;
|
||||
}
|
||||
|
||||
function show_table_one_row( str_req){
|
||||
var all_out = ""
|
||||
var str1 = readFile("?"+str_req+"&concat");
|
||||
console.log("["+ str1+"]")
|
||||
|
||||
|
||||
const sp1 = str1.split("|");
|
||||
all_out += "<H2>" + sp1[0] + "</H2>"
|
||||
const sp2 = sp1[1].split(",");
|
||||
|
||||
all_out += "<table>";
|
||||
all_out += "<tr>";
|
||||
for (let i = 0; i < sp2.length; i++) {
|
||||
const sp3 = sp2[i].split("=");
|
||||
if( sp3.length == 2){
|
||||
all_out += "<th>" + sp3[0] + "</th>"
|
||||
}
|
||||
}
|
||||
all_out += "</tr>";
|
||||
all_out += "<tr>";
|
||||
for (let i = 0; i < sp2.length; i++) {
|
||||
const sp3 = sp2[i].split("=");
|
||||
if( sp3.length == 2){
|
||||
all_out += "<td>" + sp3[1] + "</td>"
|
||||
}
|
||||
}
|
||||
|
||||
all_out += "</tr>";
|
||||
all_out += "</table>";
|
||||
return all_out;
|
||||
}
|
||||
|
||||
function RereshAll(){
|
||||
var all_out = ""
|
||||
all_out += show_table_one_row("machine")
|
||||
|
||||
//console.log("Test readFile " + str_out)
|
||||
all_out += show_table_one_row("order-position")
|
||||
|
||||
document.getElementById("begin").innerHTML = all_out;
|
||||
|
||||
}
|
||||
|
||||
|
||||
setInterval( RereshAll, 1000);
|
||||
</script>
|
||||
|
||||
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue