dilanua 8 years ago
parent 1cca664e96
commit bff3b3ee12

@ -3,6 +3,7 @@
{{unit "mdm.unit.device.qr-modal"}}
{{#zone "content"}}
{{#if deviceFound}}
{{#if isAuthorized}}
<h1 class="page-sub-title device-id device-select" data-deviceid="{{device.deviceIdentifier}}" data-type="{{device.type}}">
Device {{device.name}}
@ -361,15 +362,25 @@
<br>
You are not authorized to view specified device in the system.
{{/if}}
{{else}}
<h1 class="page-sub-title">
Device not found
</h1>
<br>
You have tried to access either a removed or non-existing device.
{{/if}}
{{/zone}}
{{#zone "bottomJs"}}
{{#if isAuthorized}}
<!--suppress HtmlUnknownTarget -->
<script id="policy-view" src="{{@unit.publicUri}}/templates/policy-compliance.hbs"
data-device-id="{{device.deviceIdentifier}}" data-device-type="{{device.type}}"
type="text/x-handlebars-template"></script>
<!--suppress HtmlUnknownTarget -->
<script id="applications-list" src="{{@unit.publicUri}}/templates/applications-list.hbs"
data-device-id="{{device.deviceIdentifier}}" data-device-type="{{device.type}}"
type="text/x-handlebars-template"></script>
<!--suppress HtmlUnknownTarget -->
<script id="operations-log" src="{{@unit.publicUri}}/templates/operations-log.hbs"
data-device-id="{{device.deviceIdentifier}}" data-device-type="{{device.type}}"
type="text/x-handlebars-template"></script>

@ -26,6 +26,7 @@ function onRequest(context) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var response = deviceModule.viewDevice(deviceType, deviceId);
if (response["status"] == "success") {
deviceData["deviceFound"] = true;
deviceData["isAuthorized"] = true;
var device = response["content"];
@ -98,7 +99,10 @@ function onRequest(context) {
}
deviceData["device"] = device;
} else if (response["status"] == "unauthorized") {
deviceData["deviceFound"] = true;
deviceData["isAuthorized"] = false;
} else if (response["status"] == "notFound") {
deviceData["deviceFound"] = false;
}
return deviceData;
}

Loading…
Cancel
Save