application-manager-new
charithag 10 years ago
parent 08e30b1efb
commit edc4b1766f

@ -42,13 +42,7 @@ if (uriMatcher.match("/{context}/api/user/login/")) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("User Logged In : " + user); log.debug("User Logged In : " + user);
} }
var hasDevcies = (deviceManagementService.getDevicesOfUser(username).size() >= 1); response.sendRedirect(constants.WEB_APP_CONTEXT+"/dashboard");
if(hasDevcies){
response.sendRedirect(constants.WEB_APP_CONTEXT+"/devices");
}else{
response.sendRedirect(constants.WEB_APP_CONTEXT);
}
}, function () { }, function () {
response.sendRedirect(dcProps.appContext + "login?#auth-failed"); response.sendRedirect(dcProps.appContext + "login?#auth-failed");

@ -138,8 +138,6 @@
</div> </div>
</div> </div>
<!-- /dashboard --> <!-- /dashboard -->
<div id="event-stream-place-holder" style="padding-top: 20px;">
</div>
{{/zone}} {{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
<script src="{{self.publicURL}}/js/dashboard.js"></script> <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/group/all/count", "#group-count");
updateStats("/iotserver/api/policies/count", "#policy-count"); updateStats("/iotserver/api/policies/count", "#policy-count");
updateStats("/iotserver/api/users/count", "#user-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>

@ -20,3 +20,10 @@ var displayEvents = function () {
}); });
}); });
}; };
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> <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" /> <br class="c-both" />
</div> </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="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> <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" /> <br class="c-both" />
</div> </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="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> <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" /> <br class="c-both" />

Loading…
Cancel
Save