|
|
@ -224,6 +224,21 @@ function loadDevices(searchType, searchParam) {
|
|
|
|
return true;
|
|
|
|
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) {
|
|
|
|
function groupingEnabled(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++) {
|
|
|
@ -323,12 +338,19 @@ function loadDevices(searchType, searchParam) {
|
|
|
|
var deviceType = row.deviceType;
|
|
|
|
var deviceType = row.deviceType;
|
|
|
|
var deviceIdentifier = row.deviceIdentifier;
|
|
|
|
var deviceIdentifier = row.deviceIdentifier;
|
|
|
|
var html = '<span></span>';
|
|
|
|
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') {
|
|
|
|
if (status != 'REMOVED') {
|
|
|
|
html = '';
|
|
|
|
html = '';
|
|
|
|
|
|
|
|
|
|
|
|
if (analyticsEnabled(row.deviceType)) {
|
|
|
|
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 +
|
|
|
|
html += '<a href="' + statURL +
|
|
|
|
deviceIdentifier + '&deviceName=' + row.name + '" ' + 'data-click-event="remove-form"' +
|
|
|
|
deviceIdentifier + '&deviceName=' + row.name + '" ' + 'data-click-event="remove-form"' +
|
|
|
|