From 8ad1b0a8914282eed69c3afb1076a318015d7bef Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Wed, 7 Dec 2016 11:57:46 +0530 Subject: [PATCH] Removed unwanted analytics graphs and added redirect to portal app. --- .../analytics-view.js | 23 +---- .../device-view.hbs | 17 ---- .../analytics-view.hbs | 91 ------------------- 3 files changed, 3 insertions(+), 128 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.analytics-view/analytics-view.js 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.analytics-view/analytics-view.js index feb70be8b..312961852 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.analytics-view/analytics-view.js +++ 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.analytics-view/analytics-view.js @@ -17,26 +17,9 @@ */ function onRequest(context) { - var devices = context.unit.params.devices; - var deviceType = context.uriParams.deviceType; + var user = context.user; var deviceId = request.getParameter("deviceId"); - if (devices) { - return { - "devices": stringify(devices), - "backendApiUri": "/android_sense/stats/" - }; - } else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { - var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; - var device = deviceModule.viewDevice(deviceType, deviceId); - if (device && device.status != "error") { - return { - "device": device.content, - "backendApiUrl": "/android_sense/stats/" + deviceId + "/sensors/" - }; - } else { - response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); - exit(); - } - } + //Redirects to the portal app as we do not use the old analytics view. + response.sendRedirect(context.app.conf["portalURL"] + "/portal/dashboards/android-iot/real-time?owner=" + user.username + "&deviceId=" + deviceId); } \ No newline at end of file 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 5e940f349..ba9322aca 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 @@ -41,8 +41,6 @@ data-toggle="tab" aria-controls="device_statistics">Device Statistics -
  • Device Location
  • Operations Log
  • {{/zone}} @@ -53,15 +51,6 @@
    Device Statistics
    {{unit "cdmf.unit.device.type.android_sense.realtime.analytics-view" device=device}} -
    -
    Device Location
    -
    -
    -
    -
    -
    -
    Operations Log
    {{/zone}} - -{{#zone "bottomJs"}} - -{{/zone}} \ No newline at end of file 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.realtime.analytics-view/analytics-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.realtime.analytics-view/analytics-view.hbs index 86735e8ce..02f753c9f 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.realtime.analytics-view/analytics-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.realtime.analytics-view/analytics-view.hbs @@ -19,98 +19,7 @@
    -
    -
    -
    Battery
    -
    -
    -
    -
    -
    -
    Time
    -
    -
    -
    Light
    -
    -
    -
    -
    -
    -
    Time
    -
    - -
    -
    Pressure
    -
    -
    -
    -
    -
    -
    Time
    -
    - -
    -
    Proximity
    -
    -
    -
    -
    -
    -
    Time
    -
    - -
    -
    Accelerometer
    -
    -
    -
    -
    -
    -
    Time
    -
    - -
    -
    Magnetic
    -
    -
    -
    -
    -
    -
    Time
    -
    - -
    -
    Rotation
    -
    -
    -
    -
    -
    -
    Time
    -
    - -
    -
    Gyroscope
    -
    -
    -
    -
    -
    -
    Time
    -
    - -
    -
    Gravity
    -
    -
    -
    -
    -
    -
    Time
    -
    - -