more work on aqhome-cgi

This commit is contained in:
Martin Preuss
2025-09-13 02:17:45 +02:00
parent 3bda196b79
commit 90f6ce73e4
8 changed files with 752 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
#include "aqhome-cgi/service/module.h"
#include "aqhome-cgi/modules/mdevices.h"
#include "aqhome-cgi/modules/madmin.h"
#include <gwenhywfar/debug.h>
#include <gwenhywfar/timestamp.h>
@@ -81,6 +82,25 @@ AQH_MODULE *_loadSubModule(AQH_MODULE *m, AQCGI_REQUEST *rq, AQH_SESSION *sessio
GWEN_Buffer_AppendArgs(nbuf, "%s/devices", s?s:".");
AQH_ModDevices_Extend(mSub, AQH_ModService_GetService(m), GWEN_Buffer_GetStart(nbuf));
AQH_Module_Tree2_AddChild(m, mSub);
GWEN_Buffer_free(nbuf);
return mSub;
}
}
else if (strcasecmp(sModuleName, "admin")==0) {
AQH_MODULE *mSub;
mSub=AQH_Service_LoadModule(sv, sModuleName);
if (mSub) {
const char *s;
GWEN_BUFFER *nbuf;
nbuf=GWEN_Buffer_new(0, 256, 0, 1);
s=AQH_ModService_GetBaseFolder(m);
GWEN_Buffer_AppendArgs(nbuf, "%s/devices", s?s:".");
AQH_ModAdmin_Extend(mSub, AQH_ModService_GetService(m), GWEN_Buffer_GetStart(nbuf));
AQH_Module_Tree2_AddChild(m, mSub);
GWEN_Buffer_free(nbuf);
return mSub;
}