Update device details page

charithag 9 years ago
parent eda0c2ddd0
commit 17ec128571

@ -3,7 +3,7 @@
{{#defineZone "device-detail-top"}} {{#defineZone "device-detail-top"}}
<div class="row wr-device-board"> <div class="row wr-device-board">
<div class="col-lg-12 wr-secondary-bar"> <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}} {{device.name}}
</label> </label>
</div> </div>

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

@ -22,19 +22,7 @@
var deviceType = deviceId.data("type"); var deviceType = deviceId.data("type");
var payload = [deviceIdentifier]; var payload = [deviceIdentifier];
var operationTable; 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(){ $(document).ready(function(){
$(".panel-body").removeClass("hidden"); $(".panel-body").removeClass("hidden");
$("#loading-content").remove(); $("#loading-content").remove();

@ -1,5 +1,5 @@
function onRequest(context) { function onRequest(context) {
var log = new Log("detail.js"); var log = new Log("device-view.js");
var deviceType = context.uriParams.deviceType; var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter("id"); var deviceId = request.getParameter("id");
@ -7,19 +7,8 @@ function onRequest(context) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/device.js").deviceModule;
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device) { if (device && device.status != "error") {
var viewModel = {}; return {"device": device};
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;
}
device.viewModel = viewModel;
} }
context.device = device;
return context;
} }
} }
Loading…
Cancel
Save