Added geo-fencing to the devicemgt app

revert-dabc3590
Rasika Perera 8 years ago
parent e7af2ee4a4
commit 84711e58c6

@ -39,7 +39,7 @@
<li><a class="list-group-item" href="#event_log" role="tab" data-toggle="tab"
aria-controls="event_log">Operations Log</a></li>
<li><a class="list-group-item location_tab" href="#geo_dashboard" role="tab" data-toggle="tab"
aria-controls="geo_dashboard">Device Location</a></li>
aria-controls="geo_dashboard" onclick="initializeGeoFencing()">Device Location</a></li>
{{/zone}}
{{#zone "device-view-tab-contents"}}
@ -73,6 +73,8 @@
<div class="panel panel-default tab-pane"
id="geo_dashboard" role="tabpanel" aria-labelledby="geo_dashboard">
<div class="panel-heading">Device Location</div>
<br/>
{{unit "cdmf.unit.geo-dashboard" device=device}}
{{#if locationHistory}}
<div id="device-location"
data-locations = "{{locationHistory}}">

@ -1,4 +1,4 @@
{{unit "cdmf.unit.device.type.android.leaflet"}}
{{!unit "cdmf.unit.device.type.android.leaflet"}}
{{unit "cdmf.unit.lib.qrcode"}}
{{unit "cdmf.unit.device.type.qr-modal"}}
@ -137,7 +137,8 @@
<a href="#device_location_tab" role="tab" data-toggle="tab"
data-lat="{{device.location.latitude}}"
data-long="{{device.location.longitude}}"
aria-controls="device_location_tab">
aria-controls="device_location_tab"
onclick="initializeGeoFencing()">
<i class="icon fw fw-map-location"></i><span
class="hidden-sm">Device Location</span>
</a>
@ -345,21 +346,7 @@
aria-labelledby="device_location">
<div class="panel-body">
{{#if device.location}}
<div id="device-location"
data-lat="{{device.location.latitude}}"
data-long="{{device.location.longitude}}"
data-locations="{{device.locationHistory}}">
</div>
<br/>
{{#unless isCloud}}
<a class="padding-left" target="_blank"
href="{{portalUrl}}/portal/dashboards/geo-dashboard/?GLOBAL-STATE={{anchor}}">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-map-location fw-stack-1x"></i>
</span> Add Geo Fencing
</a>
{{/unless}}
{{unit "cdmf.unit.geo-dashboard" device=device}}
{{else}}
<div id="map-error" class="message message-warning">
<h4 class="remove-margin">

@ -142,6 +142,7 @@ function onRequest(context) {
viewModel["location"] = {};
viewModel["location"]["latitude"] = filteredDeviceData["latestDeviceInfo"]["location"]["latitude"];
viewModel["location"]["longitude"] = filteredDeviceData["latestDeviceInfo"]["location"]["longitude"];
viewModel["location"]["updatedTime"] = filteredDeviceData["latestDeviceInfo"]["location"]["updatedTime"];
}
if (filteredDeviceData["latestDeviceInfo"]["vendor"] && filteredDeviceData["latestDeviceInfo"]["deviceModel"]) {
viewModel["vendor"] = filteredDeviceData["latestDeviceInfo"]["vendor"];

Loading…
Cancel
Save