From 845a8cb8f73235d5c101828376beb7ae46429429 Mon Sep 17 00:00:00 2001 From: kamidu Date: Tue, 25 Apr 2017 17:35:42 +0530 Subject: [PATCH] enable statics url --- .../devicemgt/app/pages/cdmf.page.devices/devices.hbs | 2 +- .../devicemgt/app/pages/cdmf.page.devices/devices.js | 7 +++++++ .../app/pages/cdmf.page.devices/public/js/listing.js | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs index bdd2e9d39b..7b68b15449 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs @@ -519,7 +519,7 @@ {{/zone}} {{#zone "bottomJs"}} - {{js "js/listing.js"}} {{/zone}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js index 0f3f8066fd..56a9c452fa 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js @@ -78,5 +78,12 @@ function onRequest(context) { viewModel.deviceTypes = stringify(deviceTypes); } } + + var mdmProps = require("/app/modules/conf-reader/main.js")["conf"]; + var cUser = userModule.getUser(); + var analiticsServer = mdmProps["dashboardServerURL"]; + var analiticsURL = analiticsServer + "/portal/t/" + cUser.userDomain + "/dashboards/android-iot/battery?owner=" + cUser.username + "&deviceId="; + viewModel.analiticsURL = analiticsURL; + return viewModel; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js index 28c0e1f074..8876c06928 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js @@ -323,11 +323,14 @@ function loadDevices(searchType, searchParam) { var deviceType = row.deviceType; var deviceIdentifier = row.deviceIdentifier; var html = ''; + var statURL = $("#device-listing").data("analitics-url"); if (status != 'REMOVED') { html = ''; if (analyticsEnabled(row.deviceType)) { - html += '' + '' +