API CHANGE - extend http callback for drivers so it includes bPreState boolean so we can add HTML either before state div (without refresh) or in state div (refreshing)

This commit is contained in:
openshwprojects
2025-04-13 19:18:30 +02:00
committed by GitHub
parent db1942c10c
commit 00890d1cf4
27 changed files with 171 additions and 73 deletions

View File

@ -340,16 +340,14 @@ int http_fn_index(http_request_t* request) {
poststr(request, "</div>"); // end div#change
#if defined(ENABLE_DRIVER_WIDGET)
if (DRV_IsRunning("Widget")) {
DRV_Widget_BeforeState(request);
}
#endif
#if ENABLE_OBK_BERRY
void Berry_SaveRequest(http_request_t *r);
Berry_SaveRequest(request);
CMD_Berry_RunEventHandlers_StrInt(CMD_EVENT_ON_HTTP, "prestate", (int)request);
#endif
#ifndef OBK_DISABLE_ALL_DRIVERS
DRV_AppendInformationToHTTPIndexPage(request, true);
#endif
poststr(request, "<div id=\"state\">"); // replaceable content follows
}
@ -770,7 +768,7 @@ int http_fn_index(http_request_t* request) {
poststr(request, "</table>");
#ifndef OBK_DISABLE_ALL_DRIVERS
DRV_AppendInformationToHTTPIndexPage(request);
DRV_AppendInformationToHTTPIndexPage(request, false);
#endif
if (1) {