mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 13:08:13 +08:00
重复任务上传星期参数
This commit is contained in:
@@ -335,9 +335,9 @@ static int HttpAddTask(httpd_request_t *req)
|
|||||||
require_noerr(err, exit);
|
require_noerr(err, exit);
|
||||||
|
|
||||||
pTimedTask task = (pTimedTask)malloc(sizeof(struct TimedTask));
|
pTimedTask task = (pTimedTask)malloc(sizeof(struct TimedTask));
|
||||||
int re = sscanf(buf, "%ld %d %d", &task->prs_time, &task->socket_idx, &task->on);
|
int re = sscanf(buf, "%ld %d %d %d", &task->prs_time, &task->socket_idx, &task->on, &task->weekday);
|
||||||
http_log("AddTask buf[%s] re[%d] (%ld %d %d)",
|
http_log("AddTask buf[%s] re[%d] (%ld %d %d %d)",
|
||||||
buf, re, task->prs_time, task->socket_idx, task->on);
|
buf, re, task->prs_time, task->socket_idx, task->on, task->weekday);
|
||||||
if (task->prs_time < 1577428136 || task->prs_time > 9577428136
|
if (task->prs_time < 1577428136 || task->prs_time > 9577428136
|
||||||
|| task->socket_idx < 0 || task->socket_idx > 5
|
|| task->socket_idx < 0 || task->socket_idx > 5
|
||||||
|| (task->on != 0 && task->on != 1))
|
|| (task->on != 0 && task->on != 1))
|
||||||
@@ -346,7 +346,7 @@ static int HttpAddTask(httpd_request_t *req)
|
|||||||
re = 0;
|
re = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* mess = re == 3 && AddTask(task) ? "OK" : "NO";
|
char* mess = (re == 4 && AddTask(task)) ? "OK" : "NO";
|
||||||
|
|
||||||
send_http(mess, strlen(mess), exit, &err);
|
send_http(mess, strlen(mess), exit, &err);
|
||||||
exit:
|
exit:
|
||||||
|
|||||||
@@ -824,16 +824,21 @@ function AddTimedTask() {
|
|||||||
var tim = task_time.value;
|
var tim = task_time.value;
|
||||||
var idx = document.getElementById("task_skt_idx").value;
|
var idx = document.getElementById("task_skt_idx").value;
|
||||||
var on = document.getElementById("task_on").checked;
|
var on = document.getElementById("task_on").checked;
|
||||||
|
var wkd = $("input[name='task_weekday']")[0].value;
|
||||||
|
|
||||||
datatime = dat + "T" + tim; // yyyy-MM-ddTHH:mm:ss
|
datatime = dat + "T" + tim; // yyyy-MM-ddTHH:mm:ss
|
||||||
var prs_time = Math.round(new Date(datatime) / 1000);
|
var prs_time = Math.round(new Date(datatime) / 1000);
|
||||||
//prs_time = prs_time + parseInt(sec);
|
//prs_time = prs_time + parseInt(sec);
|
||||||
on = on ? "1" : "0";
|
on = on ? "1" : "0";
|
||||||
var cmd = prs_time + " " + idx + " " + on;
|
var cmd = prs_time + " " + idx + " " + on + " " + wkd;
|
||||||
if (cmd.length >= 16) {
|
if (cmd.length != 16) {
|
||||||
alert("CMD ERROR!");
|
alert("CMD ERROR!");
|
||||||
}
|
}
|
||||||
HttpPost("/task", function (re) {
|
HttpPost("/task", function (re) {
|
||||||
|
if (re != "OK") {
|
||||||
|
alert(re);
|
||||||
|
return;
|
||||||
|
}
|
||||||
GetTimedTask();
|
GetTimedTask();
|
||||||
}, cmd);
|
}, cmd);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const unsigned char js_pack[0xd2f9] = {
|
const unsigned char js_pack[0xd2f9] = {
|
||||||
0x1f,0x8b,0x08,0x00,0xd4,0xb2,0x64,0x5e,0x02,0xff,0xd4,0xbd,0xfb,0x92,0xdb,0x36,
|
0x1f,0x8b,0x08,0x00,0xfb,0xb5,0x64,0x5e,0x02,0xff,0xd4,0xbd,0xfb,0x92,0xdb,0x36,
|
||||||
0xd2,0x38,0xfa,0xff,0x56,0xed,0x3b,0x8c,0xb8,0x59,0x85,0x1c,0x41,0x1a,0x69,0x1c,
|
0xd2,0x38,0xfa,0xff,0x56,0xed,0x3b,0x8c,0xb8,0x59,0x85,0x1c,0x41,0x1a,0x69,0x1c,
|
||||||
0x3b,0x31,0x65,0x8c,0xca,0xb1,0x9d,0x8d,0xf7,0x8b,0x93,0x6c,0x9c,0xcb,0x66,0x35,
|
0x3b,0x31,0x65,0x8c,0xca,0xb1,0x9d,0x8d,0xf7,0x8b,0x93,0x6c,0x9c,0xcb,0x66,0x35,
|
||||||
0x4a,0x8a,0x57,0x89,0x1a,0x49,0xd4,0xe8,0xe2,0x19,0x65,0xa4,0x7d,0x9f,0xdf,0x6b,
|
0x4a,0x8a,0x57,0x89,0x1a,0x49,0xd4,0xe8,0xe2,0x19,0x65,0xa4,0x7d,0x9f,0xdf,0x6b,
|
||||||
@@ -3376,7 +3376,7 @@ const unsigned char js_pack[0xd2f9] = {
|
|||||||
0xbf,0x4c,0x3e,0x46,0xd2,0xfd,0x34,0x78,0x48,0x96,0xc1,0x2f,0xe4,0xf2,0x79,0xfc,
|
0xbf,0x4c,0x3e,0x46,0xd2,0xfd,0x34,0x78,0x48,0x96,0xc1,0x2f,0xe4,0xf2,0x79,0xfc,
|
||||||
0x0f,0x08,0xad,0x74,0xc2,0xee,0xee,0x02,0x00};
|
0x0f,0x08,0xad,0x74,0xc2,0xee,0xee,0x02,0x00};
|
||||||
const unsigned char css_pack[0x61ae] = {
|
const unsigned char css_pack[0x61ae] = {
|
||||||
0x1f,0x8b,0x08,0x00,0xd4,0xb2,0x64,0x5e,0x02,0xff,0xed,0xbd,0x79,0x73,0xdb,0xc8,
|
0x1f,0x8b,0x08,0x00,0xfb,0xb5,0x64,0x5e,0x02,0xff,0xed,0xbd,0x79,0x73,0xdb,0xc8,
|
||||||
0xf5,0x28,0xfa,0x7f,0xaa,0xf2,0x1d,0x70,0x9d,0x9a,0x1a,0x6b,0x42,0xc8,0xd8,0x49,
|
0xf5,0x28,0xfa,0x7f,0xaa,0xf2,0x1d,0x70,0x9d,0x9a,0x1a,0x6b,0x42,0xc8,0xd8,0x49,
|
||||||
0x4a,0x95,0x54,0xbc,0x8f,0x26,0x96,0x9c,0x78,0x19,0x8f,0x9d,0x5f,0x9e,0x0b,0x04,
|
0x4a,0x95,0x54,0xbc,0x8f,0x26,0x96,0x9c,0x78,0x19,0x8f,0x9d,0x5f,0x9e,0x0b,0x04,
|
||||||
0x9a,0x24,0x24,0x90,0x60,0x00,0x50,0x1b,0x4b,0xb7,0xee,0x07,0xb9,0xef,0xcb,0xbd,
|
0x9a,0x24,0x24,0x90,0x60,0x00,0x50,0x1b,0x4b,0xb7,0xee,0x07,0xb9,0xef,0xcb,0xbd,
|
||||||
@@ -4939,8 +4939,8 @@ const unsigned char css_pack[0x61ae] = {
|
|||||||
0x61,0x33,0x3c,0xa3,0xba,0x11,0x8e,0xab,0xb3,0xcb,0x19,0xdd,0xae,0x6b,0xd7,0x55,
|
0x61,0x33,0x3c,0xa3,0xba,0x11,0x8e,0xab,0xb3,0xcb,0x19,0xdd,0xae,0x6b,0xd7,0x55,
|
||||||
0x16,0x6d,0x5c,0x59,0x14,0xc7,0xd0,0x88,0x87,0xa3,0xb1,0x31,0x0e,0x28,0xd5,0x57,
|
0x16,0x6d,0x5c,0x59,0x14,0xc7,0xd0,0x88,0x87,0xa3,0xb1,0x31,0x0e,0x28,0xd5,0x57,
|
||||||
0x73,0x82,0xb5,0x04,0xff,0x3f,0x47,0x5b,0xb3,0x64,0x93,0xba,0x02,0x00};
|
0x73,0x82,0xb5,0x04,0xff,0x3f,0x47,0x5b,0xb3,0x64,0x93,0xba,0x02,0x00};
|
||||||
const unsigned char web_index_html[0x2537] = {
|
const unsigned char web_index_html[0x2551] = {
|
||||||
0x1f,0x8b,0x08,0x00,0xd4,0xb2,0x64,0x5e,0x02,0xff,0xed,0x7d,0x6b,0x8f,0xe3,0x58,
|
0x1f,0x8b,0x08,0x00,0xfb,0xb5,0x64,0x5e,0x02,0xff,0xed,0x7d,0x6b,0x8f,0xe3,0x58,
|
||||||
0x76,0xd8,0x77,0x03,0xfe,0x0f,0x77,0x38,0x0b,0x97,0x2a,0x2d,0x52,0x7c,0x88,0x94,
|
0x76,0xd8,0x77,0x03,0xfe,0x0f,0x77,0x38,0x0b,0x97,0x2a,0x2d,0x52,0x7c,0x88,0x94,
|
||||||
0x54,0x5d,0x55,0x4e,0x6f,0x75,0xef,0xd6,0xc4,0xd5,0xd3,0xbd,0x53,0xb5,0xbd,0x4e,
|
0x54,0x5d,0x55,0x4e,0x6f,0x75,0xef,0xd6,0xc4,0xd5,0xd3,0xbd,0x53,0xb5,0xbd,0x4e,
|
||||||
0x66,0x06,0x05,0x96,0x74,0x25,0xb1,0x9b,0x12,0x35,0x24,0x55,0x8f,0x1e,0x37,0x90,
|
0x66,0x06,0x05,0x96,0x74,0x25,0xb1,0x9b,0x12,0x35,0x24,0x55,0x8f,0x1e,0x37,0x90,
|
||||||
@@ -5506,33 +5506,35 @@ const unsigned char web_index_html[0x2537] = {
|
|||||||
0x92,0x69,0x74,0xf0,0xa0,0x65,0xeb,0x0e,0x59,0xed,0xa2,0x79,0xd9,0xc0,0x32,0xf7,
|
0x92,0x69,0x74,0xf0,0xa0,0x65,0xeb,0x0e,0x59,0xed,0xa2,0x79,0xd9,0xc0,0x32,0xf7,
|
||||||
0xcc,0xfe,0x9e,0x69,0x6a,0xb2,0xde,0xaa,0xa7,0xb8,0x2a,0x3b,0x51,0x90,0x76,0x75,
|
0xcc,0xfe,0x9e,0x69,0x6a,0xb2,0xde,0xaa,0xa7,0xb8,0x2a,0x3b,0x51,0x90,0x76,0x75,
|
||||||
0x98,0x22,0x0a,0x06,0xc0,0x79,0x6d,0x39,0x46,0x51,0x2b,0x62,0x91,0xf5,0x94,0xe4,
|
0x98,0x22,0x0a,0x06,0xc0,0x79,0x6d,0x39,0x46,0x51,0x2b,0x62,0x91,0xf5,0x94,0xe4,
|
||||||
0xa7,0x5b,0xef,0x56,0xfa,0xb2,0x68,0xbe,0xb1,0xaf,0x78,0x7e,0x25,0xfc,0x56,0xe6,
|
0xa7,0x5b,0xef,0x56,0xfa,0xb2,0x68,0xbe,0xb1,0xaf,0x78,0x7e,0x25,0xfc,0x56,0x99,
|
||||||
0x3b,0xd1,0xb5,0xe7,0x1c,0x04,0xcc,0x41,0x36,0xce,0x48,0x6c,0x82,0x19,0xe6,0x74,
|
0x23,0x7e,0x55,0x93,0x16,0x6a,0x34,0x94,0x99,0xcb,0xc5,0x88,0x20,0x67,0x3c,0x10,
|
||||||
0xd8,0x0d,0xfc,0xa7,0x3f,0x7d,0xaa,0x03,0xb1,0xc7,0xc7,0x7b,0xb3,0xd9,0x5e,0x92,
|
0x0c,0x22,0x75,0x46,0xd2,0x16,0xcc,0x30,0x15,0xc4,0x6e,0xe0,0x3f,0xfd,0xe9,0x53,
|
||||||
0x14,0xa1,0x70,0x2e,0xf4,0x07,0xb0,0x8e,0x4b,0xa7,0x46,0x1c,0x2d,0xe7,0xa3,0x16,
|
0x1d,0x78,0x74,0x7c,0xbc,0x37,0x9b,0xed,0x25,0x49,0x11,0x41,0xe7,0xba,0x72,0x00,
|
||||||
0x06,0x96,0x8f,0xf3,0x98,0x81,0x9c,0x34,0xeb,0x48,0x4b,0xe1,0x4e,0x47,0xea,0x26,
|
0xcb,0xbf,0x74,0x6a,0xc4,0xd1,0x72,0x3e,0x6a,0x61,0x3c,0xfa,0x38,0x0f,0x35,0xc8,
|
||||||
0xa9,0x0d,0x19,0x87,0x8f,0xe6,0x69,0x2b,0xe1,0x43,0xd1,0x92,0xc8,0x81,0x0f,0x4c,
|
0xb7,0xb3,0x8e,0xb4,0x82,0xee,0x74,0xa4,0x6e,0x92,0xb6,0x91,0x4d,0xf9,0x68,0x9e,
|
||||||
0xe5,0x8b,0x4c,0xbe,0x56,0x26,0xab,0x67,0x23,0xb5,0xbb,0x88,0xbc,0x33,0x95,0xa2,
|
0xb6,0x12,0x3e,0x14,0x2d,0x89,0x0b,0xf0,0x81,0x4f,0x00,0xc4,0x03,0x00,0xad,0xcc,
|
||||||
0xeb,0x68,0x5e,0x2c,0x26,0xa0,0x75,0xb1,0x92,0x3b,0x60,0x96,0x57,0x89,0xfa,0xb5,
|
0x71,0xcf,0x46,0x6a,0x77,0x11,0xb0,0x67,0x9a,0x48,0xd7,0x42,0xdb,0xe8,0x12,0xf8,
|
||||||
0xa3,0xa7,0x8f,0xd9,0x93,0x4f,0x3e,0x79,0xf6,0xc9,0x07,0x0d,0x8f,0x0a,0xd6,0x19,
|
0x52,0xac,0x47,0xa0,0xa7,0x14,0xe7,0x58,0x5e,0x65,0xe1,0xa0,0x1d,0x3d,0x7d,0xcc,
|
||||||
0xe1,0x15,0x81,0x26,0x1f,0x09,0x43,0x56,0xb7,0x7f,0x28,0x9a,0x59,0x28,0xa3,0x64,
|
0x9e,0x7c,0xf2,0xc9,0xb3,0x4f,0x3e,0x68,0x78,0xda,0xb0,0xce,0x8e,0x4b,0xe9,0x43,
|
||||||
0xf0,0x71,0x6f,0x88,0x18,0xab,0xa3,0x3d,0x28,0x1a,0x6c,0x5c,0x2b,0x68,0x42,0x8f,
|
0x35,0x01,0x2a,0x80,0x97,0x16,0xb3,0x3e,0x11,0xb1,0xa2,0x52,0xe4,0xa5,0x01,0xe3,
|
||||||
0x19,0x69,0x22,0x49,0x16,0x7b,0xf6,0x27,0x1f,0x14,0x91,0x4e,0x3d,0x7e,0xe5,0xf8,
|
0xea,0x06,0x14,0xc5,0x36,0x14,0xe6,0x40,0x72,0x39,0xb8,0x3b,0x45,0xa0,0xda,0xd1,
|
||||||
0xc5,0x46,0x27,0xd9,0xe1,0x16,0x6e,0xf8,0xd9,0xd9,0xa3,0x95,0x2d,0x48,0xe5,0x99,
|
0x1e,0x14,0x0d,0x36,0xae,0x56,0x34,0x61,0x49,0x18,0xd9,0x02,0x92,0x6d,0xf6,0xec,
|
||||||
0x82,0xa5,0xd0,0x67,0x07,0x24,0xae,0x13,0xc0,0xfc,0x0c,0x45,0x59,0x6e,0x25,0x1e,
|
0x4f,0x3e,0x28,0x62,0xad,0x7a,0xfc,0xca,0xf1,0x8b,0xad,0x56,0xb2,0xcb,0x2f,0x02,
|
||||||
0x43,0x75,0x13,0x8b,0xc5,0x80,0x10,0x40,0x95,0xf8,0x67,0xc0,0x32,0xec,0x73,0x0c,
|
0x81,0x67,0x67,0x8f,0x56,0x36,0x41,0x95,0xa7,0x1a,0x96,0x6a,0x97,0x1d,0xd1,0xb8,
|
||||||
0x8a,0x9d,0x28,0x8d,0xfb,0xcb,0xca,0x56,0xb4,0x4c,0x28,0x6f,0xf1,0x71,0xe9,0x13,
|
0x4e,0x05,0xf2,0x53,0x1c,0x65,0xcd,0x91,0xa6,0x08,0xaa,0x9b,0x66,0x48,0x0c,0x08,
|
||||||
0x3c,0x48,0xe2,0x04,0x77,0x69,0x81,0x0d,0x6b,0x51,0x4a,0xab,0xd8,0xd0,0x95,0x6d,
|
0x21,0x5c,0x89,0x7f,0x06,0x2c,0xc3,0x3e,0xc7,0xa0,0xd8,0x0b,0xd3,0xb8,0xc3,0xad,
|
||||||
0xe4,0x1a,0xed,0xac,0x86,0x19,0x98,0xed,0x2c,0x02,0xae,0xe7,0xd9,0xd9,0x84,0x18,
|
0x6c,0x45,0x0b,0x95,0xf2,0x16,0x1f,0xd8,0x3e,0xc1,0xa3,0x2c,0x4e,0x70,0x9f,0x18,
|
||||||
0x4d,0xe5,0xd7,0x2d,0xb3,0x58,0xbe,0x55,0x98,0x48,0x34,0x55,0x5d,0xfe,0x1a,0x4e,
|
0x58,0xd1,0x16,0x25,0xd5,0x8a,0x2d,0x65,0xd9,0x56,0xb2,0xd1,0xce,0x6a,0xa0,0x83,
|
||||||
0x90,0xda,0xf1,0x78,0x48,0x2b,0x85,0x52,0x67,0x4a,0x9f,0xda,0xe9,0xa8,0xce,0x58,
|
0xf9,0xd6,0x22,0xe4,0x7b,0x9e,0x9d,0x8e,0x88,0xf1,0x5c,0x7e,0xdd,0x32,0x8b,0x05,
|
||||||
0x5a,0x94,0x96,0x6d,0xf3,0xc6,0x12,0xf5,0x6b,0xd1,0xcf,0x46,0x54,0x16,0x00,0x19,
|
0x64,0x85,0x89,0x44,0x53,0x35,0xe8,0x58,0xc3,0x09,0xd2,0x60,0x1e,0x0f,0x69,0xad,
|
||||||
0x12,0xfb,0x8a,0xc7,0x0e,0xa3,0x21,0x25,0x0d,0x20,0xf6,0xc3,0x93,0x4a,0x5a,0xbb,
|
0x52,0xaa,0x5f,0x29,0xa3,0x9d,0x8e,0x1a,0x0e,0x48,0xcb,0xe2,0xb2,0x6d,0xde,0x58,
|
||||||
0x9b,0x32,0x66,0x05,0x17,0xea,0xb2,0x65,0x42,0xfa,0x0a,0x51,0xfc,0xea,0x67,0xff,
|
0xa2,0x7e,0x2d,0xfa,0xd9,0x88,0xca,0x12,0x24,0x43,0x62,0x5f,0x89,0x19,0xc2,0x68,
|
||||||
0xf0,0xf6,0x9f,0x7f,0xa6,0x3c,0x46,0x15,0xa7,0x12,0xae,0x7d,0x88,0x9a,0x1d,0x5c,
|
0x48,0x69,0x0b,0x88,0x3e,0xf1,0xac,0x94,0xd6,0xee,0xa6,0x9c,0x5d,0xc1,0x85,0xba,
|
||||||
0x98,0x3b,0x0c,0xb8,0x3e,0xc7,0x53,0x85,0x6a,0xbb,0xa8,0xcf,0x3c,0xb3,0x43,0xeb,
|
0x7c,0x9d,0x90,0xbe,0x42,0x14,0xbf,0xfa,0xd9,0x3f,0xbc,0xfd,0xe7,0x9f,0x29,0x0f,
|
||||||
0xf2,0x47,0x5f,0xca,0xc3,0x82,0xec,0x18,0xc2,0xea,0xcc,0x61,0xf3,0x86,0x99,0xcb,
|
0x72,0xc5,0xb9,0x88,0x6b,0x1f,0xe3,0x66,0x47,0x27,0xe6,0x2e,0x0b,0xae,0xcf,0xf1,
|
||||||
0x10,0x51,0xfc,0x63,0x9c,0xe7,0xeb,0x33,0xac,0xca,0xe5,0x91,0xd9,0xae,0x94,0x1d,
|
0x5c,0xa3,0xda,0x2e,0xea,0x53,0xd7,0xec,0xd8,0xbc,0xfc,0xe1,0x9b,0xf2,0xb8,0x22,
|
||||||
0xd3,0xaf,0x5b,0xef,0x56,0x5d,0x69,0x71,0x1e,0xa2,0xc4,0xa0,0x8c,0x61,0xd2,0xfe,
|
0x3b,0x08,0xb1,0x3a,0x73,0xd8,0xbc,0x61,0xe6,0x32,0x44,0x14,0x0f,0x1d,0xe7,0x4f,
|
||||||
0x4c,0x74,0xe9,0x17,0xd1,0xe8,0x86,0x76,0xa2,0xa2,0x47,0x86,0x8b,0xff,0x0f,0xd0,
|
0x0c,0x32,0xac,0xca,0x05,0x9a,0xd9,0xae,0x94,0x1d,0xd3,0xef,0x6b,0xef,0x56,0x9d,
|
||||||
0x74,0xa8,0x03,0x28,0xa5,0x00,0x00};
|
0x79,0x71,0x22,0xa3,0xc4,0xa0,0x8c,0x61,0xd2,0x0e,0x51,0x0c,0x2a,0x2e,0xa2,0xd1,
|
||||||
|
0x0d,0xed,0x85,0xc5,0x98,0x00,0x2e,0xfe,0x3f,0x94,0xb2,0x2d,0x57,0xaa,0xa5,0x00,
|
||||||
|
0x00};
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ struct TimedTask
|
|||||||
time_t prs_time; //被执行的格林尼治时间戳
|
time_t prs_time; //被执行的格林尼治时间戳
|
||||||
int socket_idx; //要控制的插孔
|
int socket_idx; //要控制的插孔
|
||||||
int on; //开或者关
|
int on; //开或者关
|
||||||
|
int weekday; //星期重复 0代表不重复
|
||||||
pTimedTask next; //下一个任务(按之间排序)
|
pTimedTask next; //下一个任务(按之间排序)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user