mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Refactoring
This commit is contained in:
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…
Reference in New Issue
Block a user