显示是否是循环任务

This commit is contained in:
zogodo
2020-03-08 19:02:50 +08:00
parent f2f1993611
commit d85657b9bf
3 changed files with 613 additions and 607 deletions

View File

@@ -238,18 +238,21 @@
<th>Time</th> <th>Time</th>
<th>Socket</th> <th>Socket</th>
<th>On</th> <th>On</th>
<th>Loop</th>
<th>Option</th> <th>Option</th>
</tr> </tr>
<tr> <tr>
<td>02-15 07:11:08</td> <td>02-15 07:11</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>0</td>
<td><a>Delete</a></td> <td><a>Delete</a></td>
</tr> </tr>
<tr> <tr>
<td>2020-02-15<br>07:11:08</td> <td>2020-02-15<br>07:11:08</td>
<td>1</td> <td>1</td>
<td>0</td> <td>0</td>
<td>6</td>
<td><a>Delete</a></td> <td><a>Delete</a></td>
</tr> </tr>
</table> </table>
@@ -794,12 +797,13 @@ function GetTimedTask() {
<th>Time</th>\ <th>Time</th>\
<th>Socket</th>\ <th>Socket</th>\
<th>On</th>\ <th>On</th>\
<th>Loop</th>\
<th>Option</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 += "\
@@ -807,6 +811,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>" + tasks[i].weekday + "</td>\
<td><a href='javascript:DelTimedTask(" + tasks[i].timestamp + ");'>Delete</a></td>\ <td><a href='javascript:DelTimedTask(" + tasks[i].timestamp + ");'>Delete</a></td>\
</tr>"; </tr>";
} }

File diff suppressed because it is too large Load Diff

View File

@@ -132,7 +132,7 @@ void ProcessTask()
char* GetTaskStr() char* GetTaskStr()
{ {
char* str = (char*)malloc(sizeof(char)*(task_count*80+2)); char* str = (char*)malloc(sizeof(char)*(task_count*89+2));
pTimedTask tmp_tsk = task_top; pTimedTask tmp_tsk = task_top;
char* tmp_str = str; char* tmp_str = str;
tmp_str[0] = '['; tmp_str[0] = '[';
@@ -144,10 +144,10 @@ char* GetTaskStr()
struct tm* tm_info; struct tm* tm_info;
time_t prs_time = tmp_tsk->prs_time + 28800; time_t prs_time = tmp_tsk->prs_time + 28800;
tm_info = localtime(&prs_time); tm_info = localtime(&prs_time);
strftime(buffer, 26, "%m-%d %H:%M:%S", tm_info); strftime(buffer, 26, "%m-%d %H:%M", tm_info);
sprintf(tmp_str, "{'timestamp':%ld,'prs_time':'%s','socket_idx':%d,'on':%d},", sprintf(tmp_str, "{'timestamp':%ld,'prs_time':'%s','socket_idx':%d,'on':%d,'weekday':%d},",
tmp_tsk->prs_time, buffer, tmp_tsk->socket_idx, tmp_tsk->on); tmp_tsk->prs_time, buffer, tmp_tsk->socket_idx, tmp_tsk->on, tmp_tsk->weekday);
tmp_str += strlen(tmp_str); tmp_str += strlen(tmp_str);
tmp_tsk = tmp_tsk->next; tmp_tsk = tmp_tsk->next;
} }