mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Fixes to the https://github.com/wso2/product-iots/issues/1251
This commit is contained in:
parent
e0ba152077
commit
c2089bc5dd
@ -153,5 +153,5 @@ select meta_owner, meta_deviceId, meta_timestamp, data_type as type, data_receiv
|
||||
insert into DataStream;
|
||||
|
||||
from AndroidSense[meta_type == 'gps']
|
||||
select meta_deviceId ,meta_type as meta_deviceType, meta_timestamp as timeStamp, gps_lat as latitude, gps_long as longitude
|
||||
select meta_deviceId ,'android_sense' as meta_deviceType, meta_timestamp as timeStamp, gps_lat as latitude, gps_long as longitude
|
||||
insert into geoLocationStream;
|
||||
@ -31,6 +31,9 @@
|
||||
{{/zone}}
|
||||
|
||||
{{#zone "device-details"}}
|
||||
<span class="device-id"
|
||||
data-deviceid="{{device.deviceIdentifier}}"
|
||||
data-type="{{device.type}}"></span>
|
||||
{{/zone}}
|
||||
|
||||
{{#zone "device-view-tabs"}}
|
||||
@ -38,45 +41,38 @@
|
||||
data-toggle="tab" aria-controls="device_statistics">Device
|
||||
Statistics</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>
|
||||
<li><a class="initGeoLocationLink" href="#geo_dashboard" role="tab" data-toggle="tab"
|
||||
aria-controls="geo_dashboard"
|
||||
data-lat="{{device.location.latitude}}"
|
||||
data-long="{{device.location.longitude}}">Device Location</a></li>
|
||||
{{/zone}}
|
||||
|
||||
{{#zone "device-view-tab-contents"}}
|
||||
<div class="panel panel-default tab-pane active"
|
||||
id="device_statistics" role="tabpanel" aria-labelledby="device_statistics">
|
||||
<div class="panel-heading">Device Statistics</div>
|
||||
{{unit "cdmf.unit.device.type.android_sense.realtime.analytics-view" device=device}}
|
||||
</div>
|
||||
<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}}">
|
||||
{{#if locationEnabled}}
|
||||
<div id="location" class="tab-pane">
|
||||
<div class="tab-actions">
|
||||
<div class="action-btn-container" id="location-action-bar">
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<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>
|
||||
{{unit "cdmf.unit.geo-dashboard" device=device noGeoFencing=false hideSearch=true}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div id="map-error" class="message message-warning">
|
||||
<h4 class="remove-margin">
|
||||
<i class="icon fw fw-warning"></i>
|
||||
Device location information is not available.
|
||||
Device location information is not available. Please check whether Geo Location Based Services is Enabled.
|
||||
</h4>
|
||||
</div>
|
||||
<p class="add-padding-5x"></p>
|
||||
<p class="add-padding-5x"></p>
|
||||
<p class="add-padding-5x"></p>
|
||||
{{/if}}
|
||||
<div id="chartWrapper">
|
||||
</div>
|
||||
</div>
|
||||
{{/zone}}
|
||||
@ -37,6 +37,7 @@ function onRequest(context) {
|
||||
viewObject.portalUrl = devicemgtProps['portalURL'];
|
||||
viewObject.anchor = encodeURI(JSON.stringify(anchor));
|
||||
viewObject.locationHistory = stringify(device.content.locationHistory);
|
||||
viewObject.locationEnabled = (device.content.locationHistory.length !== 0);
|
||||
return viewObject;
|
||||
} else {
|
||||
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user