From ec9e54a3b32aed966d974474b76b4578b1ab8727 Mon Sep 17 00:00:00 2001 From: charithag Date: Thu, 6 Aug 2015 17:00:33 +0530 Subject: [PATCH] Show group or device name in analytics --- .../iotserver/units/analytics/analytics.js | 11 ++++++++--- .../iotserver/units/group-detail/group-detail.hbs | 2 +- .../group-listing/public/templates/group-listing.hbs | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/analytics.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/analytics.js index 353852b2..89a2a78e 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/analytics.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/analytics.js @@ -1,13 +1,18 @@ function onRequest(context){ - context.sketchPath = "api/device/sketch"; var groupId = request.getParameter("groupId"); + var title; if (groupId){ context.groupId = groupId; - context.title = "Group Analytics"; + title = request.getParameter("name"); }else{ context.groupId = 0; - context.title = "Device Analytics"; + var deviceModule = require("/modules/device.js").deviceModule; + var deviceId = request.getParameter("deviceId"); + var deviceType = request.getParameter("deviceType"); + + title = deviceModule.getDevice(deviceType, deviceId).name; } + context.title = title + " Analytics"; return context; } diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-detail/group-detail.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-detail/group-detail.hbs index ac63547d..0a0af0b6 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-detail/group-detail.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-detail/group-detail.hbs @@ -69,7 +69,7 @@
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/templates/group-listing.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/templates/group-listing.hbs index 48cc3556..47853be0 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/templates/group-listing.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/templates/group-listing.hbs @@ -42,7 +42,7 @@ Devices - +