能测试添加, 能获取

This commit is contained in:
zogodo
2019-12-26 21:39:48 +08:00
parent f8a4404614
commit 764cfcfd94
5 changed files with 32 additions and 5 deletions

View File

@@ -200,7 +200,7 @@ exit:
static int HttpGetTasks(httpd_request_t *req)
{
pTimedTask pt = (pTimedTask)malloc(sizeof(struct TimedTask));
pt->time = time(NULL);
pt->time = time(NULL) + 5;
pt->socket_idx = 5;
pt->on = 0;
AddTask(pt);

View File

@@ -77,6 +77,11 @@
</div>
</fieldset>
<fieldset class="task">
<legend>Timed Task</legend>
<button onclick="GetTimedTask()">Test</button>
</fieldset>
<fieldset class="chart">
<legend>Power Status</legend>
<table class="pw">
@@ -437,6 +442,19 @@ function GetSysLog() {
});
}
function GetTimedTask() {
HttpGet("/task", function (re) {
alert(re);
});
}
function AddTimedTask() {
var sec = document.getElementById("task_time").value;
HttpPost("/task", function (re) {
alert(re);
}, sec);
}
</script>
</body>
</html>

File diff suppressed because one or more lines are too long