From edc4b1766fa77b2b4dd259b7aac4736071a11dd3 Mon Sep 17 00:00:00 2001 From: charithag Date: Fri, 7 Aug 2015 15:00:23 +0530 Subject: [PATCH] Few fixes --- .../jaggeryapps/iotserver/api/user-api.jag | 8 +---- .../iotserver/units/dashboard/dashboard.hbs | 2 -- .../units/dashboard/public/js/dashboard.js | 30 +------------------ .../public/templates/event-stream.hbs | 27 ----------------- .../units/events/public/js/events.js | 9 +++++- .../iotserver/units/showcase/showcase.hbs | 4 +-- 6 files changed, 12 insertions(+), 68 deletions(-) delete mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/public/templates/event-stream.hbs diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/api/user-api.jag b/modules/distribution/src/repository/jaggeryapps/iotserver/api/user-api.jag index 8457a67f..1b5704b7 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/api/user-api.jag +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/api/user-api.jag @@ -42,13 +42,7 @@ if (uriMatcher.match("/{context}/api/user/login/")) { if (log.isDebugEnabled()) { log.debug("User Logged In : " + user); } - var hasDevcies = (deviceManagementService.getDevicesOfUser(username).size() >= 1); - - if(hasDevcies){ - response.sendRedirect(constants.WEB_APP_CONTEXT+"/devices"); - }else{ - response.sendRedirect(constants.WEB_APP_CONTEXT); - } + response.sendRedirect(constants.WEB_APP_CONTEXT+"/dashboard"); }, function () { response.sendRedirect(dcProps.appContext + "login?#auth-failed"); diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/dashboard.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/dashboard.hbs index 9f8604ab..5b2ed67a 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/dashboard.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/dashboard.hbs @@ -138,8 +138,6 @@ -
-
{{/zone}} {{#zone "bottomJs"}} diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/public/js/dashboard.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/public/js/dashboard.js index 7662c29c..fcc37aaf 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/public/js/dashboard.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/public/js/dashboard.js @@ -14,32 +14,4 @@ $(document).ready(function () { updateStats("/iotserver/api/group/all/count", "#group-count"); updateStats("/iotserver/api/policies/count", "#policy-count"); updateStats("/iotserver/api/users/count", "#user-count"); - - displayEvents(); -}); - -var displayEvents = function () { - var eventListing = $("#event-stream"); - var eventListingSrc = eventListing.attr("src"); - $.template("event-stream", eventListingSrc, function (template) { - var serviceURL = "/iotserver/api/event/list"; - var successCallback = function (data) { - var viewModel = {}; - viewModel.data = JSON.parse(data); - var content = template(viewModel); - $("#event-stream-place-holder").html(content); - formatDates(); - }; - invokerUtil.get(serviceURL, - successCallback, function (message) { - console.log(message); - }); - }); -} - -function formatDates() { - $(".formatDate").each(function () { - var timeStamp = $(this).html(); - $(this).html(new Date(parseInt(timeStamp)).toUTCString()); - }); -} +}); \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/public/templates/event-stream.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/public/templates/event-stream.hbs deleted file mode 100644 index accd43dc..00000000 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/dashboard/public/templates/event-stream.hbs +++ /dev/null @@ -1,27 +0,0 @@ -
- -
-
- -
- - - - - - - - - - {{#each data}} - - - - - - {{/each}} - -
TimeDeviceActivity
{{time}}{{deviceName}}{{activity}}
-
\ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/events/public/js/events.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/events/public/js/events.js index b88cb586..f23c7c0b 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/events/public/js/events.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/events/public/js/events.js @@ -19,4 +19,11 @@ var displayEvents = function () { console.log(message); }); }); -}; \ No newline at end of file +}; + +function formatDates() { + $(".formatDate").each(function () { + var timeStamp = $(this).html(); + $(this).html(new Date(parseInt(timeStamp)).toUTCString()); + }); +} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/showcase/showcase.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/showcase/showcase.hbs index 4f39266f..ea818259 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/showcase/showcase.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/showcase/showcase.hbs @@ -8,12 +8,12 @@

-
+

-
+