Merge pull request #508 from dunithd/release-3.0.x

Adding Geo fencing link to Android device
merge-requests/1/head
Rasika Perera 8 years ago committed by GitHub
commit 82a1839fe9

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

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

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

@ -336,6 +336,13 @@
<div id="device-location"
data-lat="{{device.location.latitude}}"
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>
{{else}}
<div id="map-error" class="message message-warning">

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

Loading…
Cancel
Save