prepared for u_mqtttopic module.
This commit is contained in:
@@ -145,6 +145,7 @@ void _setFromObject(AQH_DEVICE *device, const AQH_DEVICE *srcDevice)
|
||||
{
|
||||
AQH_Device_SetRoomId(device, AQH_Device_GetRoomId(srcDevice));
|
||||
AQH_Device_SetName(device, AQH_Device_GetName(srcDevice));
|
||||
AQH_Device_SetDeviceType(device, AQH_Device_GetDeviceType(srcDevice));
|
||||
AQH_Device_SetLocation(device, AQH_Device_GetLocation(srcDevice));
|
||||
AQH_Device_SetDescription(device, AQH_Device_GetDescription(srcDevice));
|
||||
}
|
||||
@@ -252,18 +253,26 @@ void _writeEditingTable(AQH_HTTP_URLHANDLER *uh, GWEN_DB_NODE *dbValues, GWEN_BU
|
||||
}
|
||||
GWEN_Buffer_AppendString(pageBuf, "</select></td></tr>");
|
||||
|
||||
GWEN_Buffer_AppendArgs(pageBuf,
|
||||
" <tr>"
|
||||
" <td><label for=\"deviceType\">%s: </label></td>"
|
||||
" <td><input type=\"text\" name=\"deviceType\" value=\"%s\"></td>"
|
||||
" </tr>",
|
||||
I18N("Type"),
|
||||
dbValues?GWEN_DB_GetCharValue(dbValues, "deviceType", 0, ""):"");
|
||||
GWEN_Buffer_AppendArgs(pageBuf,
|
||||
" <tr>"
|
||||
" <td><label for=\"location\">%s: </label></td>"
|
||||
" <td><input type=\"text\" name=\"location\" value=\"%s\" required></td>"
|
||||
" </tr>"
|
||||
" <td><input type=\"text\" name=\"location\" value=\"%s\"></td>"
|
||||
" </tr>",
|
||||
I18N("Location"),
|
||||
dbValues?GWEN_DB_GetCharValue(dbValues, "location", 0, ""):"");
|
||||
GWEN_Buffer_AppendArgs(pageBuf,
|
||||
" <tr>"
|
||||
" <td><label for=\"description\">%s: </label></td>"
|
||||
" <td><input type=\"text\" name=\"description\" value=\"%s\"></td>"
|
||||
" </tr>"
|
||||
" </table>",
|
||||
I18N("Location"),
|
||||
dbValues?GWEN_DB_GetCharValue(dbValues, "location", 0, ""):"",
|
||||
I18N("Description"),
|
||||
dbValues?GWEN_DB_GetCharValue(dbValues, "description", 0, ""):"");
|
||||
}
|
||||
@@ -283,11 +292,12 @@ void _listObjectsIntoBuffer(AQH_HTTP_URLHANDLER *uh, GWEN_BUFFER *pageBuf)
|
||||
"<h2>%s</h2>"
|
||||
"<table class=\"dataTable\">"
|
||||
"<thead>"
|
||||
" <tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th></th></tr>"
|
||||
" <tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th></th></tr>"
|
||||
"</thead>",
|
||||
I18N("Devices"),
|
||||
I18N("Name"),
|
||||
I18N("Room"),
|
||||
I18N("Type"),
|
||||
I18N("Location"),
|
||||
I18N("Description"));
|
||||
GWEN_Buffer_AppendString(pageBuf, "<tbody>");
|
||||
@@ -301,6 +311,7 @@ void _listObjectsIntoBuffer(AQH_HTTP_URLHANDLER *uh, GWEN_BUFFER *pageBuf)
|
||||
int roomId;
|
||||
const char *name;
|
||||
const char *roomName=NULL;
|
||||
const char *devType;
|
||||
const char *descr;
|
||||
const char *location;
|
||||
const AQH_ROOM *r=NULL;
|
||||
@@ -313,15 +324,17 @@ void _listObjectsIntoBuffer(AQH_HTTP_URLHANDLER *uh, GWEN_BUFFER *pageBuf)
|
||||
roomName=AQH_Room_GetName(r);
|
||||
|
||||
name=AQH_Device_GetName(device);
|
||||
devType=AQH_Device_GetDeviceType(device);
|
||||
descr=AQH_Device_GetDescription(device);
|
||||
location=AQH_Device_GetLocation(device);
|
||||
GWEN_Buffer_AppendArgs(pageBuf,
|
||||
"<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td>"
|
||||
"<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>"
|
||||
"<td><a href=\"/devices/edit/%lu\">"
|
||||
"<IMG src=\"/pics/edit.png\" width=32 height=32 align=left border=0></a></td>"
|
||||
"</tr>",
|
||||
name?name:"",
|
||||
roomName?roomName:"",
|
||||
devType?devType:"",
|
||||
location?location:"",
|
||||
descr?descr:"", id);
|
||||
|
||||
|
||||
@@ -51,6 +51,13 @@
|
||||
<flags>own with_getbymember</flags>
|
||||
</member>
|
||||
|
||||
<member name="deviceType" type="char_ptr" maxlen="64">
|
||||
<default>0</default>
|
||||
<preset>0</preset>
|
||||
<access>public</access>
|
||||
<flags>own</flags>
|
||||
</member>
|
||||
|
||||
<member name="location" type="char_ptr" maxlen="32">
|
||||
<default>0</default>
|
||||
<preset>0</preset>
|
||||
|
||||
@@ -23,11 +23,25 @@
|
||||
<inlines>
|
||||
</inlines>
|
||||
|
||||
|
||||
|
||||
</lang>
|
||||
|
||||
|
||||
<enums>
|
||||
|
||||
<enum id="AQH_MQTT_TOPIC_TYPE" prefix="AQH_MqttTopicType_">
|
||||
<item name="num">
|
||||
<descr>numeric type</descr>
|
||||
</item>
|
||||
|
||||
<item name="json">
|
||||
<descr>json data</descr>
|
||||
</item>
|
||||
|
||||
</enum>
|
||||
|
||||
</enums>
|
||||
|
||||
|
||||
<members>
|
||||
|
||||
<member name="id" type="uint64_t" maxlen="8">
|
||||
|
||||
Reference in New Issue
Block a user