Adding Geo fencing link to Android device

revert-dabc3590
dunithd 8 years ago
parent 41095da20c
commit 8c36f31030

@ -20,6 +20,7 @@ function onRequest(context) {
var log = new Log("device-view.js"); var log = new Log("device-view.js");
var deviceType = context.uriParams.deviceType; var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter("id"); var deviceId = request.getParameter("id");
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var autoCompleteParams = [ var autoCompleteParams = [
{"name" : "deviceId", "value" : deviceId} {"name" : "deviceId", "value" : deviceId}
]; ];

@ -20,6 +20,7 @@ function onRequest(context) {
var log = new Log("device-view.js"); var log = new Log("device-view.js");
var deviceType = context.uriParams.deviceType; var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter("id"); var deviceId = request.getParameter("id");
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var autoCompleteParams = [ var autoCompleteParams = [
{"name" : "deviceId", "value" : deviceId} {"name" : "deviceId", "value" : deviceId}
]; ];

@ -20,6 +20,7 @@ function onRequest(context) {
var log = new Log("device-view.js"); var log = new Log("device-view.js");
var deviceType = context.uriParams.deviceType; var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter("id"); var deviceId = request.getParameter("id");
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var autoCompleteParams = [ var autoCompleteParams = [
{"name" : "deviceId", "value" : deviceId} {"name" : "deviceId", "value" : deviceId}
]; ];

@ -336,6 +336,13 @@
<div id="device-location" <div id="device-location"
data-lat="{{device.location.latitude}}" data-lat="{{device.location.latitude}}"
data-long="{{device.location.longitude}}"> data-long="{{device.location.longitude}}">
<a class="padding-left"
href="{{portalUrl}}/portal/dashboards/geo-dashboard/?GLOBAL-STATE={{anchor}}">
<span class="fw-fw-map-location">
<i class="fw fw-map-location fw-2x"></i>
</span> View device on the map
</a>
</div> </div>
{{else}} {{else}}
<div id="map-error" class="message message-warning"> <div id="map-error" class="message message-warning">

@ -21,6 +21,7 @@ function onRequest(context) {
var deviceType = context["uriParams"]["deviceType"]; var deviceType = context["uriParams"]["deviceType"];
var deviceId = request.getParameter("id"); var deviceId = request.getParameter("id");
var deviceViewData = {}; var deviceViewData = {};
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
if (deviceType && deviceId) { if (deviceType && deviceId) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
@ -210,5 +211,9 @@ function onRequest(context) {
]; ];
deviceViewData["autoCompleteParams"] = autoCompleteParams; deviceViewData["autoCompleteParams"] = autoCompleteParams;
deviceViewData["portalUrl"] = devicemgtProps['portalURL'];
var anchor = { "device" : { "id" : deviceId, "type" : deviceType}};
deviceViewData["anchor"] = JSON.stringify(anchor);
return deviceViewData; return deviceViewData;
} }

Loading…
Cancel
Save