|
|
|
@ -224,6 +224,21 @@ function loadDevices(searchType, searchParam) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getAnalyticsView(type) {
|
|
|
|
|
var deviceTypes = deviceListing.data("deviceTypes");
|
|
|
|
|
for (var i = 0; i < deviceTypes.length; i++) {
|
|
|
|
|
if (deviceTypes[i].type == type) {
|
|
|
|
|
var analyticsView = deviceTypes[i].analyticsView;
|
|
|
|
|
if (analyticsEnabled == undefined) {
|
|
|
|
|
// if undefined go to default analytics view
|
|
|
|
|
return "none";
|
|
|
|
|
}
|
|
|
|
|
return analyticsView;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return "none";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function groupingEnabled(type) {
|
|
|
|
|
var deviceTypes = deviceListing.data("deviceTypes");
|
|
|
|
|
for (var i = 0; i < deviceTypes.length; i++) {
|
|
|
|
@ -323,12 +338,19 @@ function loadDevices(searchType, searchParam) {
|
|
|
|
|
var deviceType = row.deviceType;
|
|
|
|
|
var deviceIdentifier = row.deviceIdentifier;
|
|
|
|
|
var html = '<span></span>';
|
|
|
|
|
var statURL = $("#device-listing").data("analitics-url");
|
|
|
|
|
var portalUrl = $("#device-listing").data("portal-url");
|
|
|
|
|
var serverUrl = $("#device-listing").data("server-url");
|
|
|
|
|
var userDomain = $("#device-listing").data("userDomain");
|
|
|
|
|
var statURL;
|
|
|
|
|
if (status != 'REMOVED') {
|
|
|
|
|
html = '';
|
|
|
|
|
|
|
|
|
|
if (analyticsEnabled(row.deviceType)) {
|
|
|
|
|
|
|
|
|
|
switch (getAnalyticsView(deviceType)) {
|
|
|
|
|
case "DAS" : { statURL =portalUrl + "/portal/t/"+ userDomain+ "/dashboards/android-iot/battery?owner=" +currentUser+"&deviceId=";break;}
|
|
|
|
|
default : {statURL=context+ "/device/" + row.deviceType +"/analytics?deviceId="}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
html += '<a href="' + statURL +
|
|
|
|
|
deviceIdentifier + '&deviceName=' + row.name + '" ' + 'data-click-event="remove-form"' +
|
|
|
|
|