拼表格

This commit is contained in:
zogodo
2020-02-21 17:54:40 +08:00
parent 964d79b786
commit 340aaaba2d
2 changed files with 504 additions and 497 deletions

View File

@@ -223,13 +223,14 @@
<!-- <button class="submit_bt" onclick="DelTimedTask()">TestDelete</button> --> <!-- <button class="submit_bt" onclick="DelTimedTask()">TestDelete</button> -->
<table id="timed_task_tb"> <table id="timed_task_tb">
<tr> <tr>
<th>Index</th> <th></th>
<th>Time</th> <th>Time</th>
<th>Socket</th> <th>Socket</th>
<th>On</th> <th>On</th>
<th>Option</th>
</tr> </tr>
<tr> <tr>
<td colspan="4">Please Sync</td> <td colspan="5">Please Sync</td>
</tr> </tr>
</table> </table>
<button onclick="GetTimedTask()">Sync</button> <button onclick="GetTimedTask()">Sync</button>
@@ -544,15 +545,16 @@ function GetTimedTask() {
HttpGet("/task", function (re) { HttpGet("/task", function (re) {
var tb_html = "\ var tb_html = "\
<tr>\ <tr>\
<th>Index</th>\ <th></th>\
<th>Time</th>\ <th>Time</th>\
<th>Socket</th>\ <th>Socket</th>\
<th>On</th>\ <th>On</th>\
<th>Option</th>\
</tr>"; </tr>";
console.log(re); console.log(re);
var tasks = JSON.parse(re); var tasks = JSON.parse(re);
if (tasks.length == 0) { if (tasks.length == 0) {
tb_html += "<tr><td colspan='4'>No Timed Task</td></tr>"; tb_html += "<tr><td colspan='5'>No Timed Task</td></tr>";
} }
for (var i = 0; i < tasks.length; i++) { for (var i = 0; i < tasks.length; i++) {
tb_html += "\ tb_html += "\
@@ -561,6 +563,7 @@ function GetTimedTask() {
<td>" + tasks[i].prs_time + "</td>\ <td>" + tasks[i].prs_time + "</td>\
<td>" + tasks[i].socket_idx + "</td>\ <td>" + tasks[i].socket_idx + "</td>\
<td>" + tasks[i].on + "</td>\ <td>" + tasks[i].on + "</td>\
<td><a href='javasvript:DeleteTask(" + tasks[i].socket_idx + ");'>Delete</a></td>\
</tr>"; </tr>";
} }
document.getElementById("timed_task_tb").innerHTML = tb_html; document.getElementById("timed_task_tb").innerHTML = tb_html;

File diff suppressed because it is too large Load Diff