Refactoring

revert-70aa11f8
GDLMadushanka 8 years ago
parent 85d07dc9cb
commit 36bd1c5daf

@ -86,12 +86,8 @@ function onRequest(context) {
var serverUrl = mdmProps["httpsURL"]; var serverUrl = mdmProps["httpsURL"];
var portalUrl = mdmProps["portalURL"]; var portalUrl = mdmProps["portalURL"];
var userDomain = context.user.domain; var userDomain = context.user.domain;
//var userName = context.user.username;
viewModel.serverUrl = serverUrl; viewModel.serverUrl = serverUrl;
viewModel.portalUrl = portalUrl; viewModel.portalUrl = portalUrl;
viewModel.userDomain = userDomain; viewModel.userDomain = userDomain;
//viewModel.userName = userName;
return viewModel; return viewModel;
} }

@ -224,6 +224,7 @@ function loadDevices(searchType, searchParam) {
return true; return true;
} }
// Read "analyticsView" from config.json and return value if exists
function getAnalyticsView(type) { function getAnalyticsView(type) {
var deviceTypes = deviceListing.data("deviceTypes"); var deviceTypes = deviceListing.data("deviceTypes");
for (var i = 0; i < deviceTypes.length; i++) { for (var i = 0; i < deviceTypes.length; i++) {
@ -347,6 +348,7 @@ function loadDevices(searchType, searchParam) {
if (analyticsEnabled(row.deviceType)) { if (analyticsEnabled(row.deviceType)) {
// redirecting to respective analytics view depending on device configs
switch (getAnalyticsView(deviceType)) { switch (getAnalyticsView(deviceType)) {
case "DAS" : { statURL =portalUrl + "/portal/t/"+ userDomain+ "/dashboards/android-iot/battery?owner=" +currentUser+"&deviceId=";break;} case "DAS" : { statURL =portalUrl + "/portal/t/"+ userDomain+ "/dashboards/android-iot/battery?owner=" +currentUser+"&deviceId=";break;}
default : {statURL=context+ "/device/" + row.deviceType +"/analytics?deviceId="} default : {statURL=context+ "/device/" + row.deviceType +"/analytics?deviceId="}

Loading…
Cancel
Save