Update device details page

charithag 9 years ago
parent eda0c2ddd0
commit 17ec128571

@ -3,7 +3,7 @@
{{#defineZone "device-detail-top"}}
<div class="row wr-device-board">
<div class="col-lg-12 wr-secondary-bar">
<label class="device-id device-select" data-deviceid="{{device.deviceIdentifier}}" data-type="{{device.type}}">
<label class="device-id device-select" data-deviceid="{{device.deviceIdentifier}}" data-type="{{device.type}} data-appcontext="{{@app.context}}">
{{device.name}}
</label>
</div>

@ -8,7 +8,6 @@ function onRequest(context) {
var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") {
log.info(device);
return {"device": device};
}
}

@ -22,19 +22,7 @@
var deviceType = deviceId.data("type");
var payload = [deviceIdentifier];
var operationTable;
if (deviceType == "ios") {
var serviceUrl = "/ios/operation/deviceinfo";
} else if (deviceType == "android") {
var serviceUrl = "/mdm-android-agent/operation/device-info";
}
if(serviceUrl){
invokerUtil.post(serviceUrl, payload,
function(message){
console.log(message);
}, function (message) {
console.log(message);
});
}
$(document).ready(function(){
$(".panel-body").removeClass("hidden");
$("#loading-content").remove();

@ -1,5 +1,5 @@
function onRequest(context) {
var log = new Log("detail.js");
var log = new Log("device-view.js");
var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter("id");
@ -7,19 +7,8 @@ function onRequest(context) {
var deviceModule = require("/app/modules/device.js").deviceModule;
var device = deviceModule.viewDevice(deviceType, deviceId);
if (device) {
var viewModel = {};
var deviceInfo = device.properties.DEVICE_INFO;
if (deviceInfo != undefined && String(deviceInfo.toString()).length > 0) {
deviceInfo = parse(stringify(deviceInfo));
viewModel.system = device.properties.IMEI;
viewModel.machine = "Virtual Firealarm";
viewModel.vendor = device.properties.VENDOR;
if (device && device.status != "error") {
return {"device": device};
}
device.viewModel = viewModel;
}
context.device = device;
return context;
}
}
Loading…
Cancel
Save