implemented front for last action, doxygen added
This commit is contained in:
parent
41f7e8ff6e
commit
daec0e0231
|
|
@ -214,6 +214,12 @@ function drawtimers(tarr) {
|
|||
var enb = (tarr[i - 1].enab == 1) ? "checked" : "";
|
||||
content += ("<label class=\"switch\"><input type=\"checkbox\" id=\"encb"+i+"\" value=\"1\" "+enb+"><span class=\"slider round\"></span></label></div>");
|
||||
|
||||
content += ("<div class=\"nowrap\">");
|
||||
content +=("<label for=\"encb"+i+"\">Last scheduled: </label>");
|
||||
enb = (tarr[i - 1].prev == 1) ? "checked" : "";
|
||||
content += ("<label class=\"switch\"><input type=\"checkbox\" id=\"encb"+i+"\" value=\"1\" "+enb+"><span class=\"slider round\"></span></label></div>");
|
||||
|
||||
|
||||
content += ("<div class=\"nowrap\">");
|
||||
content +=("<label for=\"tname"+i+"\">Timer name:</label>");
|
||||
content += ("<input type=\"text\" id=\"tname" + i + "\" value=\"" + tarr[i - 1].name + "\"></input></div>");
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ static void ExecuteLastAction()
|
|||
{
|
||||
if (GetAppConf()->Timers[shdl].enab &&
|
||||
!GetAppConf()->Timers[shdl].del &&
|
||||
GetAppConf()->Timers[shdl].prev &&
|
||||
GetAppConf()->Timers[shdl].obj == obj)
|
||||
{
|
||||
cron_expr cron_exp = { 0 };
|
||||
|
|
|
|||
|
|
@ -66,12 +66,14 @@ static HTTP_IO_RESULT HTTPPostApplication(httpd_req_t *req, char *PostData)
|
|||
if (result.dataType == JREAD_OBJECT)
|
||||
{
|
||||
T.num = jRead_int(tmp, "{'num'", NULL);
|
||||
T.del = jRead_int(tmp, "{'del'", NULL);
|
||||
T.enab = jRead_int(tmp, "{'enab'", NULL);
|
||||
T.prev = jRead_int(tmp, "{'prev'", NULL);
|
||||
jRead_string(tmp, "{'name'", T.name, sizeof(T.name), NULL);
|
||||
T.obj = jRead_int(tmp, "{'obj'", NULL);
|
||||
T.act = jRead_int(tmp, "{'act'", NULL);
|
||||
jRead_string(tmp, "{'cron'", T.cron, sizeof(T.cron), NULL);
|
||||
T.del = jRead_int(tmp, "{'del'", NULL);
|
||||
|
||||
memcpy(&GetAppConf()->Timers[T.num-1], &T, sizeof(cron_timer_t));
|
||||
WriteNVSAppConfig(GetAppConf());
|
||||
ReloadCronSheduler();
|
||||
|
|
|
|||
|
|
@ -35,12 +35,13 @@ static void HTTPPrint_crontmr(char *VarData, void *arg)
|
|||
memcpy(&T, &GetAppConf()->Timers[idx], sizeof(cron_timer_t));
|
||||
jwOpen(data, sizeof(data), JW_OBJECT, JW_COMPACT);
|
||||
jwObj_int("num", (unsigned int) T.num);
|
||||
jwObj_int("del", (T.del)?1:0);
|
||||
jwObj_int("enab", (T.enab)?1:0);
|
||||
jwObj_int("prev", (T.prev)?1:0);
|
||||
jwObj_string("name", T.name);
|
||||
jwObj_int("obj", (unsigned int) T.obj);
|
||||
jwObj_int("act", (unsigned int) T.act);
|
||||
jwObj_string("cron", T.cron);
|
||||
jwObj_int("del", (T.del)?1:0);
|
||||
jwEnd();
|
||||
jwClose();
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", data);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user