Fixing android-sense to support auto-generated operations

merge-requests/1/head
Rasika Perera 9 years ago
parent 506a48569b
commit 0a060d9a73

@ -14,7 +14,7 @@
Operations
</div>
<div class="add-margin-top-4x">
{{unit "iot.unit.device.operation-bar" device=device}}
{{unit "iot.unit.device.operation-bar" device=device backendApiUri=backendApiUri}}
</div>
{{/zone}}

@ -20,13 +20,14 @@ function onRequest(context) {
var log = new Log("device-view.js");
var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter("id");
var devicemgtProps = require('/app/conf/devicemgt-props.js').config();
if (deviceType && deviceId) {
var deviceModule = require("/app/modules/device.js").deviceModule;
var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") {
return {"device": device};
return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/android_sense/"};
} else {
response.sendError(404, "Device Id " + deviceId + "of type " + deviceType + " cannot be found!");
exit();

Loading…
Cancel
Save