merge-requests/1/head
charithag 9 years ago
parent 08e30b1efb
commit edc4b1766f

@ -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");

@ -138,8 +138,6 @@
</div>
</div>
<!-- /dashboard -->
<div id="event-stream-place-holder" style="padding-top: 20px;">
</div>
{{/zone}}
{{#zone "bottomJs"}}
<script src="{{self.publicURL}}/js/dashboard.js"></script>

@ -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());
});
}
});

@ -1,27 +0,0 @@
<div class="col-lg-12 wr-secondary-bar" style="width: inherit;">
<label class="device-id device-select" style="font-size: 20px; margin-bottom: 0px;">
Device Events Stream
</label>
</div>
<br/>
<div style="padding: 15px;">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th width="20%">Time</th>
<th width="20%">Device</th>
<th>Activity</th>
</tr>
</thead>
<tbody>
{{#each data}}
<tr>
<td width="20%" class="formatDate">{{time}}</td>
<td width="20%">{{deviceName}}</td>
<td>{{activity}}</td>
</tr>
{{/each}}
</tbody>
</table>
</div>

@ -19,4 +19,11 @@ var displayEvents = function () {
console.log(message);
});
});
};
};
function formatDates() {
$(".formatDate").each(function () {
var timeStamp = $(this).html();
$(this).html(new Date(parseInt(timeStamp)).toUTCString());
});
}

@ -8,12 +8,12 @@
<div class="itm-wiz"><div class="col-md-offset-2"><img src="{{self.publicURL}}/images/step-01.png" style="width:85px" ></div><div class="wiz-lbl hidden-xs"><span>Select your Device</span></div></div>
<br class="c-both" />
</div>
<div class="col-md-1 col-xs-1 wr-showcase"><i class="fw fw-right" style="font-size:28px; font-weight:100; margin-top:28px; color:#11375B"></i></div>
<div class="col-md-1 col-xs-1 wr-showcase" style="padding-top: 50px"><i class="fw fw-right" style="font-size:28px; font-weight:100; margin-top:28px; color:#11375B"></i></div>
<div class="col-md-3 col-xs-4">
<div class="itm-wiz"><div class="col-md-offset-2"><img src="{{self.publicURL}}/images/step-02.png" style="width:85px"></div><div class="wiz-lbl hidden-xs"><span>Enroll your Device</span></div></div>
<br class="c-both" />
</div>
<div class="col-md-1 col-xs-1 wr-showcase"><i class="fw fw-right" style="font-size:28px; font-weight:100; margin-top:28px; color:#11375B"></i></div>
<div class="col-md-1 col-xs-1 wr-showcase" style="padding-top: 50px"><i class="fw fw-right" style="font-size:28px; font-weight:100; margin-top:28px; color:#11375B"></i></div>
<div class="col-md-3 col-xs-4 ">
<div class="itm-wiz"><div class="col-md-offset-2"><img src="{{self.publicURL}}/images/step-03.png" style="width:85px"></div><div class="wiz-lbl hidden-xs"><span>Manage your Device</span></div></div>
<br class="c-both" />

Loading…
Cancel
Save