From 84711e58c6bc2d2d67a9122977b6ca24f4d455c9 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Mon, 29 May 2017 12:58:06 +0530 Subject: [PATCH] Added geo-fencing to the devicemgt app --- .../device-view.hbs | 4 +++- .../device-view.hbs | 21 ++++--------------- .../device-view.js | 1 + 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.hbs b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.hbs index 63edd3ba2..e9ddee339 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.hbs +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view/device-view.hbs @@ -39,7 +39,7 @@
  • Operations Log
  • Device Location
  • + aria-controls="geo_dashboard" onclick="initializeGeoFencing()">Device Location {{/zone}} {{#zone "device-view-tab-contents"}} @@ -73,6 +73,8 @@
    Device Location
    +
    + {{unit "cdmf.unit.geo-dashboard" device=device}} {{#if locationHistory}}
    diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs index 189bcf087..5e8b39e2d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.hbs @@ -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 @@ + aria-controls="device_location_tab" + onclick="initializeGeoFencing()"> @@ -345,21 +346,7 @@ aria-labelledby="device_location">
    {{#if device.location}} -
    -
    -
    - {{#unless isCloud}} - - - - - Add Geo Fencing - - {{/unless}} + {{unit "cdmf.unit.geo-dashboard" device=device}} {{else}}

    diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js index ea56974af..ef84b0c0f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js @@ -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"];