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" <li><a class="list-group-item" href="#event_log" role="tab" data-toggle="tab"
aria-controls="event_log">Operations Log</a></li> aria-controls="event_log">Operations Log</a></li>
<li><a class="list-group-item location_tab" href="#geo_dashboard" role="tab" data-toggle="tab" <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}}
{{#zone "device-view-tab-contents"}} {{#zone "device-view-tab-contents"}}
@ -73,6 +73,8 @@
<div class="panel panel-default tab-pane" <div class="panel panel-default tab-pane"
id="geo_dashboard" role="tabpanel" aria-labelledby="geo_dashboard"> id="geo_dashboard" role="tabpanel" aria-labelledby="geo_dashboard">
<div class="panel-heading">Device Location</div> <div class="panel-heading">Device Location</div>
<br/>
{{unit "cdmf.unit.geo-dashboard" device=device}}
{{#if locationHistory}} {{#if locationHistory}}
<div id="device-location" <div id="device-location"
data-locations = "{{locationHistory}}"> 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.lib.qrcode"}}
{{unit "cdmf.unit.device.type.qr-modal"}} {{unit "cdmf.unit.device.type.qr-modal"}}
@ -137,7 +137,8 @@
<a href="#device_location_tab" role="tab" data-toggle="tab" <a href="#device_location_tab" role="tab" data-toggle="tab"
data-lat="{{device.location.latitude}}" data-lat="{{device.location.latitude}}"
data-long="{{device.location.longitude}}" 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 <i class="icon fw fw-map-location"></i><span
class="hidden-sm">Device Location</span> class="hidden-sm">Device Location</span>
</a> </a>
@ -345,21 +346,7 @@
aria-labelledby="device_location"> aria-labelledby="device_location">
<div class="panel-body"> <div class="panel-body">
{{#if device.location}} {{#if device.location}}
<div id="device-location" {{unit "cdmf.unit.geo-dashboard" device=device}}
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}}
{{else}} {{else}}
<div id="map-error" class="message message-warning"> <div id="map-error" class="message message-warning">
<h4 class="remove-margin"> <h4 class="remove-margin">

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

Loading…
Cancel
Save