merge-requests/1/head
charithag 9 years ago
commit 64b1d81da7

@ -38,6 +38,7 @@ var FEATURE_DESCRIPTION = "featureDescription";
var PLATFORM_ANDROID = "android";
var PLATFORM_IOS = "ios";
var DEVICE_ENROLLMENT = "enrollment";
var VENDOR_APPLE = "Apple";
var ERRORS = {

@ -167,6 +167,7 @@ deviceModule = function () {
var data = {};
//XMLHTTPRequest's GET
log.info(removeDeviceEndpoint);
return del(removeDeviceEndpoint, data, "text");
};
@ -177,6 +178,7 @@ deviceModule = function () {
var data = {};
//XMLHTTPRequest's POST
log.info(updateDeviceEndpoint+ "?name="+device.name);
return post(updateDeviceEndpoint+ "?name="+device.name, data, "text");
};
@ -264,7 +266,7 @@ deviceModule = function () {
properties[constants.DEVICE_VENDOR] = constants.VENDOR_APPLE;
}
deviceObject[constants.DEVICE_PROPERTIES] = properties;
deviceObject[constants.DEVICE_ENROLLMENT] = device.getDateOfEnrolment();
return deviceObject;
}
};

@ -4,6 +4,6 @@
WSO2 DC | FireAlarm
{{/zone}}
{{#zone "body"}}
{{unit "appbar" link="device-mgt" title="Device Management"}}
{{unit "appbar" link="analytics" title="Device Analytics"}}
{{unit "analytics"}}
{{/zone}}

@ -9,7 +9,7 @@ function onRequest(context) {
"device-mgt": [],
"store": [],
"dashboard": [],
"statistics" : []
"analytics" : []
};
var dashboardLink = {
title: "Go back to Dashboard",
@ -35,7 +35,7 @@ function onRequest(context) {
links.profiles.push(dashboardLink);
links.store.push(dashboardLink);
links.store.push(storeLink);
links.statistics.push(deviceMgtLink);
links.analytics.push(deviceMgtLink);
links['device-mgt'].push(dashboardLink);
if (user) {

@ -4,7 +4,9 @@
<label class="device-id device-select" data-deviceid="{{device.deviceIdentifier}}" data-type="{{device.type}}">
Device {{device.name}}
<span class="lbl-device">
({{device.viewModel.vendor}} {{device.viewModel.model}})
{{#if device.viewModel.vendor}}
({{device.viewModel.vendor}} {{device.viewModel.model}})
{{/if}}
</span>
</label>
</div>
@ -26,11 +28,13 @@
<img src="{{self.publicURL}}/img/device_icons/{{device.type}}.png" style="width:200px" />
</div>
<div class="col-lg-12 col-sm-4 ast-desc">
<div class="ast-device-desc"><b>Device:</b> {{device.viewModel.vendor}} {{device.properties.model}}</div>
<div class="ast-device-desc"><b>Model:</b> {{device.viewModel.model}}</div>
<div class="ast-device-desc"><b>IMEI:</b> {{device.viewModel.imei}}</div>
{{#if device.viewModel.udid}}<div class="ast-device-desc"><b>UDID:</b> {{device.viewModel.udid}}</div>{{/if}}
{{#if device.viewModel.phoneNumber}}<div class="ast-device-desc"><b>Phone Number:</b> {{device.viewModel.phoneNumber}}</div>{{/if}}
<div class="ast-device-desc"><b>Owner:</b> {{device.owner}}</div>
<div class="ast-device-desc"><b>Date of Enrollment:</b><br/> <span class="formatDate">{{device.enrollment}}</span></div>
<!--<div class="ast-device-desc"><b>Device:</b> {{device.viewModel.vendor}} {{device.properties.model}}</div>-->
<!--<div class="ast-device-desc"><b>Model:</b> {{device.viewModel.model}}</div>-->
<!--<div class="ast-device-desc"><b>IMEI:</b> {{device.viewModel.imei}}</div>-->
<!--{{#if device.viewModel.udid}}<div class="ast-device-desc"><b>UDID:</b> {{device.viewModel.udid}}</div>{{/if}}-->
<!--{{#if device.viewModel.phoneNumber}}<div class="ast-device-desc"><b>Phone Number:</b> {{device.viewModel.phoneNumber}}</div>{{/if}}-->
</div>
</div>
</div>
@ -93,25 +97,46 @@
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<!-- device location -->
<!-- statistics -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<div class="panel-heading" role="tab" id="headingFour">
<h2 class="sub-title panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>
</span>
Device Location
Device Statistics
</a>
</h2>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div id="device-location" style="height:400px" class="panel-body">
<div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour">
<div class="panel-body">
<a href="../../devices/analytics?deviceId={{deviceId}}&deviceType={{deviceType}}" ><i class="fw fw-charts"></i> Show Statistics</a>
</div>
</div>
</div>
<!-- /statistics -->
<!-- device location -->
<!--<div class="panel panel-default">-->
<!--<div class="panel-heading" role="tab" id="headingOne">-->
<!--<h2 class="sub-title panel-title">-->
<!--<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">-->
<!--<span class="fw-stack">-->
<!--<i class="fw fw-ring fw-stack-2x"></i>-->
<!--<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>-->
<!--</span>-->
<!--Device Location-->
<!--</a>-->
<!--</h2>-->
<!--</div>-->
<!--<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">-->
<!--<div id="device-location" style="height:400px" class="panel-body">-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!-- /device location -->
<!-- policies -->
@ -136,46 +161,27 @@
<!-- /policies -->
<!-- installed applications -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingThree">
<h2 class="sub-title panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>
</span>
Installed Applications
</a>
</h2>
</div>
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
<div class="panel-body">
Not available yet
</div>
</div>
</div>
<!--<div class="panel panel-default">-->
<!--<div class="panel-heading" role="tab" id="headingThree">-->
<!--<h2 class="sub-title panel-title">-->
<!--<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">-->
<!--<span class="fw-stack">-->
<!--<i class="fw fw-ring fw-stack-2x"></i>-->
<!--<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>-->
<!--</span>-->
<!--Installed Applications-->
<!--</a>-->
<!--</h2>-->
<!--</div>-->
<!--<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">-->
<!--<div class="panel-body">-->
<!--Not available yet-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!-- /installed applications -->
<!-- statistics -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingFour">
<h2 class="sub-title panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-arrow fw-down-arrow fw-stack-1x"></i>
</span>
Device Statistics
</a>
</h2>
</div>
<div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour">
<div class="panel-body">
<a href="../../devices/analytics?deviceId={{deviceId}}&deviceType={{deviceType}}" ><i class="fw fw-charts"></i> Show Statistics</a>
</div>
</div>
</div>
<!-- /statistics -->
</div>

@ -13,7 +13,6 @@ function onRequest(context) {
if (device){
var viewModel = {};
var deviceInfo = device.properties.DEVICE_INFO;
log.info(deviceInfo);
if (deviceInfo != undefined && String(deviceInfo.toString()).length > 0){
deviceInfo = JSON.parse(deviceInfo);
if (device.type == "ios"){
@ -28,7 +27,6 @@ function onRequest(context) {
viewModel.DeviceCapacityPercentage = Math.round(viewModel.DeviceCapacityUsed
/ viewModel.DeviceCapacity * 10000) /100;
}else if(device.type == "android"){
viewModel.imei = device.properties.IMEI;
viewModel.model = device.properties.DEVICE_MODEL;
viewModel.vendor = device.properties.VENDOR;
@ -48,6 +46,7 @@ function onRequest(context) {
viewModel.external_memory.DeviceCapacityPercentage = Math.round(deviceInfo.EXTERNAL_AVAILABLE_MEMORY
/deviceInfo.EXTERNAL_TOTAL_MEMORY * 10000) /100;
}
viewModel.enrollment = device.enrollment;
device.viewModel = viewModel;
}
}

@ -16,6 +16,13 @@
* under the License.
*/
function formatDates(){
$(".formatDate").each(function(){
var timeStamp = $(this).html();
$(this).html(new Date(parseInt(timeStamp)).toUTCString());
});
}
(function () {
var deviceId = $(".device-id");
var deviceIdentifier = deviceId.data("deviceid");
@ -35,6 +42,7 @@
$(document).ready(function(){
loadOperationBar(deviceType);
loadMap();
formatDates();
});
function loadMap(){
var map;

@ -168,6 +168,7 @@ function loadDevices(searchType, searchParam) {
addDeviceSelectedClass(this);
});
attachEvents();
formatDates();
}
};
invokerUtil.get(serviceURL,
@ -180,6 +181,12 @@ $(document).ready(function () {
loadDevices();
});
function formatDates(){
$(".formatDate").each(function(){
var timeStamp = $(this).html();
$(this).html(new Date(parseInt(timeStamp)).toUTCString());
});
}
/**
* Sorting function of users

@ -8,15 +8,16 @@
</label>
</div>
<div class="itm-ast">
<a href="device/{{type}}/{{id}}">
<a href="device/{{type}}/{{deviceIdentifier}}">
<div class="ast-img"><img src="{{../imageLocation}}{{type}}.png"/></div>
<div class="ast-desc">
<div class="ast-title">
<h3 class="ast-name">Device {{name}}</h3>
<span class="ast-auth">Owner: {{owner}}</span>
<span class="ast-auth">Device Type: {{type}}</span>
<span class="ast-auth">Date of Enrollment: <span class="formatDate">{{dateOfEnrolment}}</span></span>
</div>
<div class="ast-model">
<span class="ast-ver">{{type}}</span>
<span class="ast-ver">{{owner}}</span>
<span class="ast-published">{{status}}</span>
<div class="ast-btn-group">

Loading…
Cancel
Save