From 4701a71986812d0d08dcdcf8219eb15ef76a4157 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Wed, 9 Aug 2023 01:57:31 +0200 Subject: [PATCH] Started experimenting with styles. --- apps/aqhome-storage/u_rooms.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/aqhome-storage/u_rooms.c b/apps/aqhome-storage/u_rooms.c index ea3f499..90b8738 100644 --- a/apps/aqhome-storage/u_rooms.c +++ b/apps/aqhome-storage/u_rooms.c @@ -188,7 +188,7 @@ int _handlePost(AQH_HTTP_URLHANDLER *uh, AQH_HTTP_REQUEST *rq) rv=_handlePostAdd(uh, rq); else { DBG_ERROR(NULL, "Invalid url (2nd member is [%s])", s); - msgOut=AQH_HttpService_CreateResponseMsg(AQH_HttpUrlHandler_GetHttpService(uh), 500, "Internal Error", protocol, NULL); + msgOut=AQH_HttpService_CreateResponseMsg(AQH_HttpUrlHandler_GetHttpService(uh), 404, "Not found", protocol, NULL); AQH_HttpRequest_SetResponseMsg(rq, msgOut); return 0; } @@ -196,12 +196,11 @@ int _handlePost(AQH_HTTP_URLHANDLER *uh, AQH_HTTP_REQUEST *rq) } else { DBG_ERROR(NULL, "Invalid url (2nd member missing)"); - msgOut=AQH_HttpService_CreateResponseMsg(AQH_HttpUrlHandler_GetHttpService(uh), 500, "Internal Error", protocol, NULL); + msgOut=AQH_HttpService_CreateResponseMsg(AQH_HttpUrlHandler_GetHttpService(uh), 404, "Not found", protocol, NULL); AQH_HttpRequest_SetResponseMsg(rq, msgOut); return 0; } } - // TODO return 0; } @@ -225,11 +224,14 @@ void _handleGetList(AQH_HTTP_URLHANDLER *uh, AQH_HTTP_REQUEST *rq, GWEN_BUFFER * GWEN_Buffer_AppendArgs(pageBuf, "

%s

" - "" - " ", + "
Id%s%s
" + "" + " " + "", I18N("Rooms"), I18N("Name"), I18N("Description")); + GWEN_Buffer_AppendString(pageBuf, ""); rl=AQH_Storage_GetRoomList(sto); if (rl) { const AQH_ROOM *r; @@ -248,6 +250,7 @@ void _handleGetList(AQH_HTTP_URLHANDLER *uh, AQH_HTTP_REQUEST *rq, GWEN_BUFFER * r=AQH_Room_List_Next(r); } } + GWEN_Buffer_AppendString(pageBuf, ""); GWEN_Buffer_AppendArgs(pageBuf, "
Id%s%s
%s
", I18N("Add Room")); } else {