dilanua 8 years ago
parent 1cca664e96
commit bff3b3ee12

@ -3,16 +3,17 @@
{{unit "mdm.unit.device.qr-modal"}} {{unit "mdm.unit.device.qr-modal"}}
{{#zone "content"}} {{#zone "content"}}
{{#if isAuthorized}} {{#if deviceFound}}
<h1 class="page-sub-title device-id device-select" data-deviceid="{{device.deviceIdentifier}}" data-type="{{device.type}}"> {{#if isAuthorized}}
Device {{device.name}} <h1 class="page-sub-title device-id device-select" data-deviceid="{{device.deviceIdentifier}}" data-type="{{device.type}}">
{{#if device.viewModel.model}} Device {{device.name}}
<span class="lbl-device"> {{#if device.viewModel.model}}
<span class="lbl-device">
( {{device.viewModel.vendor}} {{device.viewModel.model}} ) ( {{device.viewModel.vendor}} {{device.viewModel.model}} )
</span> </span>
{{/if}} {{/if}}
</h1> </h1>
<div class="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;"> <div class="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;">
<div class="media"> <div class="media">
<div class="media-left media-middle asset-image col-xs-2 col-sm-2 col-md-2 col-lg-2"> <div class="media-left media-middle asset-image col-xs-2 col-sm-2 col-md-2 col-lg-2">
<div class="thumbnail icon"><i class="square-element text fw fw-mobile"></i></div> <div class="thumbnail icon"><i class="square-element text fw fw-mobile"></i></div>
@ -72,304 +73,314 @@
</div> </div>
</div> </div>
</div> </div>
<div class="media tab-responsive"> <div class="media tab-responsive">
<div class="media-left col-xs-1 col-sm-1 col-md-2 col-lg-2 hidden-xs"> <div class="media-left col-xs-1 col-sm-1 col-md-2 col-lg-2 hidden-xs">
<ul class="list-group nav nav-pills nav-stacked" role="tablist"> <ul class="list-group nav nav-pills nav-stacked" role="tablist">
<li role="presentation" class="list-group-item active"> <li role="presentation" class="list-group-item active">
<a href="#device_details_tab" role="tab" data-toggle="tab" aria-controls="device_details_tab"> <a href="#device_details_tab" role="tab" data-toggle="tab" aria-controls="device_details_tab">
<i class="icon fw fw-mobile"></i><span class="hidden-sm">Device Details</span> <i class="icon fw fw-mobile"></i><span class="hidden-sm">Device Details</span>
</a> </a>
</li> </li>
<li role="presentation" class="list-group-item"> <li role="presentation" class="list-group-item">
<a href="#policy_compliance_tab" role="tab" data-toggle="tab" aria-controls="policy_compliance_tab"> <a href="#policy_compliance_tab" role="tab" data-toggle="tab" aria-controls="policy_compliance_tab">
<i class="icon fw fw-policy"></i><span class="hidden-sm">Policy Compliance</span> <i class="icon fw fw-policy"></i><span class="hidden-sm">Policy Compliance</span>
</a> </a>
</li> </li>
<li role="presentation" class="list-group-item"> <li role="presentation" class="list-group-item">
<a href="#device_location_tab" role="tab" data-toggle="tab" <a href="#device_location_tab" role="tab" data-toggle="tab"
data-lat="{{device.viewModel.location.latitude}}" data-lat="{{device.viewModel.location.latitude}}"
data-long="{{device.viewModel.location.longitude}}" data-long="{{device.viewModel.location.longitude}}"
aria-controls="device_location_tab"> aria-controls="device_location_tab">
<i class="icon fw fw-map-location"></i><span class="hidden-sm">Device Location</span> <i class="icon fw fw-map-location"></i><span class="hidden-sm">Device Location</span>
</a> </a>
</li> </li>
<li role="presentation" class="list-group-item"> <li role="presentation" class="list-group-item">
<a href="#installed_applications_tab" role="tab" data-toggle="tab" aria-controls="installed_applications_tab"> <a href="#installed_applications_tab" role="tab" data-toggle="tab" aria-controls="installed_applications_tab">
<i class="icon fw fw-application"></i><span class="hidden-sm">Installed Applications</span> <i class="icon fw fw-application"></i><span class="hidden-sm">Installed Applications</span>
</a> </a>
</li> </li>
<li role="presentation" class="list-group-item"> <li role="presentation" class="list-group-item">
<a href="#event_log_tab" role="tab" data-toggle="tab" aria-controls="event_log_tab"> <a href="#event_log_tab" role="tab" data-toggle="tab" aria-controls="event_log_tab">
<i class="icon fw fw-text"></i><span class="hidden-sm">Operations Log</span> <i class="icon fw fw-text"></i><span class="hidden-sm">Operations Log</span>
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
{{#defineZone "device-detail-properties"}} {{#defineZone "device-detail-properties"}}
<div class="media-body add-padding-left-5x remove-padding-xs"> <div class="media-body add-padding-left-5x remove-padding-xs">
<div class="panel-group tab-content remove-padding" id="tabs" role="tablist" aria-multiselectable="true"> <div class="panel-group tab-content remove-padding" id="tabs" role="tablist" aria-multiselectable="true">
<div class="arrow-left hidden-xs"></div> <div class="arrow-left hidden-xs"></div>
<div class="panel panel-default" role="tabpanel" id="device_details_tab"> <div class="panel panel-default" role="tabpanel" id="device_details_tab">
<div class="panel-heading visible-xs collapsed" id="device_details"> <div class="panel-heading visible-xs collapsed" id="device_details">
<h4 class="panel-title"> <h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#tabs" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> <a role="button" data-toggle="collapse" data-parent="#tabs" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<i class="fw fw-mobile fw-2x"></i> <i class="fw fw-mobile fw-2x"></i>
Device Details Device Details
<i class="caret-updown fw fw-down"></i> <i class="caret-updown fw fw-down"></i>
</a> </a>
</h4> </h4>
</div> </div>
<div class="panel-heading display-none-xs">Device Details</div> <div class="panel-heading display-none-xs">Device Details</div>
<div id="loading-content" class="col-centered"> <div id="loading-content" class="col-centered">
<i class="fw fw-settings fw-spin fw-2x"></i> Loading Device Details... <i class="fw fw-settings fw-spin fw-2x"></i> Loading Device Details...
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="device_details">
<div class="panel-body ">
<div class="device-detail-body">
<!-- device summary -->
{{#equal device.type "windows"}}
<div class="message message-info">
<h4 class="remove-margin"><i class="icon fw fw-info"></i>Not available yet</h4>
</div> </div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="device_details"> {{/equal}}
<div class="panel-body "> {{#if device.viewModel.BatteryLevel}}
<div class="device-detail-body"> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<!-- device summary --> <div class="col-md-12">
{{#equal device.type "windows"}} <div class="wr-stats-board-tile">
<div class="message message-info"> <div class="tile-name">BATTERY</div>
<h4 class="remove-margin"><i class="icon fw fw-info"></i>Not available yet</h4> <div>
<div class="tile-icon"><i class="fw fw-battery"></i></div>
<div class="tile-stats">
{{device.viewModel.BatteryLevel}} %
</div> </div>
{{/equal}} </div>
{{#if device.viewModel.BatteryLevel}} </div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> </div>
<div class="col-md-12"> </div>
<div class="wr-stats-board-tile"> {{/if}}
<div class="tile-name">BATTERY</div> {{#if device.viewModel.DeviceCapacity}}
<div> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<div class="tile-icon"><i class="fw fw-battery"></i></div> <div class="col-md-12">
<div class="tile-stats"> <div class="wr-stats-board-tile">
{{device.viewModel.BatteryLevel}} % <div class="tile-name">STORAGE</div>
</div> <div>
</div> <div class="tile-icon"><i class="fw fw-hdd"></i></div>
</div> <div class="tile-stats">
</div> {{device.viewModel.DeviceCapacityPercentage}} %
</div>
{{/if}}
{{#if device.viewModel.DeviceCapacity}}
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<div class="col-md-12">
<div class="wr-stats-board-tile">
<div class="tile-name">STORAGE</div>
<div>
<div class="tile-icon"><i class="fw fw-hdd"></i></div>
<div class="tile-stats">
{{device.viewModel.DeviceCapacityPercentage}} %
<span class="tile-stats-free"> <span class="tile-stats-free">
{{device.viewModel.AvailableDeviceCapacity}} GB Free {{device.viewModel.AvailableDeviceCapacity}} GB Free
</span> </span>
</div>
</div>
</div>
</div>
</div> </div>
{{/if}} </div>
{{#if device.viewModel.internal_memory.FreeCapacity}} </div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> </div>
<div class="col-md-12"> </div>
<div class="wr-stats-board-tile"> {{/if}}
<div class="tile-name">LOCAL STORAGE</div> {{#if device.viewModel.internal_memory.FreeCapacity}}
<div> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<div class="tile-icon"><i class="fw fw-hdd"></i></div> <div class="col-md-12">
<div class="tile-stats"> <div class="wr-stats-board-tile">
{{device.viewModel.internal_memory.DeviceCapacityPercentage}} % <div class="tile-name">LOCAL STORAGE</div>
<div>
<div class="tile-icon"><i class="fw fw-hdd"></i></div>
<div class="tile-stats">
{{device.viewModel.internal_memory.DeviceCapacityPercentage}} %
<span class="tile-stats-free"> <span class="tile-stats-free">
{{device.viewModel.internal_memory.FreeCapacity}} GB Free {{device.viewModel.internal_memory.FreeCapacity}} GB Free
</span> </span>
</div>
</div>
</div>
</div>
</div> </div>
{{/if}} </div>
{{#if device.viewModel.external_memory.FreeCapacity}} </div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> </div>
<div class="col-md-12"> </div>
<div class="wr-stats-board-tile"> {{/if}}
<div class="tile-name">EXTERNAL STORAGE</div> {{#if device.viewModel.external_memory.FreeCapacity}}
<div> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<div class="tile-icon"><i class="fw fw-usb-drive"></i></div> <div class="col-md-12">
<div class="tile-stats"> <div class="wr-stats-board-tile">
{{device.viewModel.external_memory.DeviceCapacityPercentage}} % <div class="tile-name">EXTERNAL STORAGE</div>
<div>
<div class="tile-icon"><i class="fw fw-usb-drive"></i></div>
<div class="tile-stats">
{{device.viewModel.external_memory.DeviceCapacityPercentage}} %
<span class="tile-stats-free"> <span class="tile-stats-free">
{{device.viewModel.external_memory.FreeCapacity}} GB Free {{device.viewModel.external_memory.FreeCapacity}} GB Free
</span> </span>
</div>
</div>
</div>
</div>
</div> </div>
{{/if}} </div>
</div> </div>
</div> </div>
</div> </div>
</div> {{/if}}
<div class="panel panel-default visible-xs-block" role="tabpanel" id="policy_compliance_tab"> </div>
<div class="panel-heading visible-xs collapsed" id="policy_compliance"> </div>
<h4 class="panel-title"> </div>
<a role="button" data-toggle="collapse" data-parent="#tabs" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo"> </div>
<i class="fw fw-policy fw-2x"></i> <div class="panel panel-default visible-xs-block" role="tabpanel" id="policy_compliance_tab">
Policy Compliance <div class="panel-heading visible-xs collapsed" id="policy_compliance">
<i class="caret-updown fw fw-down"></i> <h4 class="panel-title">
</a> <a role="button" data-toggle="collapse" data-parent="#tabs" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
</h4> <i class="fw fw-policy fw-2x"></i>
</div> Policy Compliance
<div class="panel-heading display-none-xs"> <i class="caret-updown fw fw-down"></i>
Policy Compliance </a>
</h4>
</div>
<div class="panel-heading display-none-xs">
Policy Compliance
<span> <span>
<a href="javascript:void(0);" id="refresh-policy"> <a href="javascript:void(0);" id="refresh-policy">
<i class="fw fw-refresh"></i> <i class="fw fw-refresh"></i>
</a> </a>
</span> </span>
</div> </div>
<div id="collapseTwo" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="policy_compliance"> <div id="collapseTwo" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="policy_compliance">
<div class="panel-body "> <div class="panel-body ">
<span class="visible-xs add-padding-2x text-right"> <span class="visible-xs add-padding-2x text-right">
<a href="javascript:void(0);" id="refresh-policy"> <a href="javascript:void(0);" id="refresh-policy">
<i class="fw fw-refresh"></i> <i class="fw fw-refresh"></i>
</a> </a>
</span> </span>
<div id="policy-spinner" class="wr-advance-operations-init hidden"> <div id="policy-spinner" class="wr-advance-operations-init hidden">
<i class="fw fw-settings fw-spin fw-2x"></i> Loading Policy Compliance... <i class="fw fw-settings fw-spin fw-2x"></i> Loading Policy Compliance...
</div> </div>
<div id="policy-list-container"> <div id="policy-list-container">
<div class="message message-info"> <div class="message message-info">
<h4 class="remove-margin"><i class="icon fw fw-info"></i>There is no active policy for this device.</h4> <h4 class="remove-margin"><i class="icon fw fw-info"></i>There is no active policy for this device.</h4>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default visible-xs-block" role="tabpanel" id="device_location_tab">
<div class="panel-heading visible-xs collapsed" id="device_location">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#tabs" href="#collapseThree" aria-expanded="true" aria-controls="collapseThree">
<i class="fw fw-map-location fw-2x"></i>
Device Location
<i class="caret-updown fw fw-down"></i>
</a>
</h4>
</div>
<div class="panel-heading display-none-xs">Device Location</div>
<div id="collapseThree" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="device_location">
<div class="panel-body">
<div id="map-error" class="message message-danger">
<h4 class="remove-margin"><i class="icon fw fw-error"></i>Device location cannot be retrieved.</h4>
</div>
<div id="device-location"
data-lat="{{device.viewModel.location.latitude}}"
data-long="{{device.viewModel.location.longitude}}">
</div>
</div>
</div>
</div> </div>
<div class="panel panel-default visible-xs-block" role="tabpanel" id="installed_applications_tab"> </div>
<div class="panel-heading visible-xs collapsed" id="installed_applications"> </div>
<h4 class="panel-title"> </div>
<a role="button" data-toggle="collapse" data-parent="#tabs" href="#collapseFour" aria-expanded="true" aria-controls="collapseFour"> </div>
<i class="fw fw-application fw-2x"></i> <div class="panel panel-default visible-xs-block" role="tabpanel" id="device_location_tab">
Installed Applications <div class="panel-heading visible-xs collapsed" id="device_location">
<i class="caret-updown fw fw-down"></i> <h4 class="panel-title">
</a> <a role="button" data-toggle="collapse" data-parent="#tabs" href="#collapseThree" aria-expanded="true" aria-controls="collapseThree">
</h4> <i class="fw fw-map-location fw-2x"></i>
</div> Device Location
<div class="panel-heading display-none-xs"> <i class="caret-updown fw fw-down"></i>
Installed Applications </a>
</h4>
</div>
<div class="panel-heading display-none-xs">Device Location</div>
<div id="collapseThree" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="device_location">
<div class="panel-body">
<div id="map-error" class="message message-danger">
<h4 class="remove-margin"><i class="icon fw fw-error"></i>Device location cannot be retrieved.</h4>
</div>
<div id="device-location"
data-lat="{{device.viewModel.location.latitude}}"
data-long="{{device.viewModel.location.longitude}}">
</div>
</div>
</div>
</div>
<div class="panel panel-default visible-xs-block" role="tabpanel" id="installed_applications_tab">
<div class="panel-heading visible-xs collapsed" id="installed_applications">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#tabs" href="#collapseFour" aria-expanded="true" aria-controls="collapseFour">
<i class="fw fw-application fw-2x"></i>
Installed Applications
<i class="caret-updown fw fw-down"></i>
</a>
</h4>
</div>
<div class="panel-heading display-none-xs">
Installed Applications
<span> <span>
<a href="javascript:void(0);" id="refresh-apps"> <a href="javascript:void(0);" id="refresh-apps">
<i class="fw fw-refresh"></i> <i class="fw fw-refresh"></i>
</a> </a>
</span> </span>
</div> </div>
<div id="collapseFour" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="installed_applications"> <div id="collapseFour" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="installed_applications">
<div class="panel-body "> <div class="panel-body ">
<span class="visible-xs add-padding-2x text-right"> <span class="visible-xs add-padding-2x text-right">
<a href="javascript:void(0);" id="refresh-apps"> <a href="javascript:void(0);" id="refresh-apps">
<i class="fw fw-refresh"></i> <i class="fw fw-refresh"></i>
</a> </a>
</span> </span>
<div id="apps-spinner" class="wr-advance-operations-init hidden"> <div id="apps-spinner" class="wr-advance-operations-init hidden">
<i class="fw fw-settings fw-spin fw-2x"></i> Loading Applications List... <i class="fw fw-settings fw-spin fw-2x"></i> Loading Applications List...
</div> </div>
<div id="applications-list-container"> <div id="applications-list-container">
<div class="message message-info"> <div class="message message-info">
<h4><i class="icon fw fw-info"></i>No applications found.</h4> <h4><i class="icon fw fw-info"></i>No applications found.</h4>
<p>Please try refreshing the list in a while.</p> <p>Please try refreshing the list in a while.</p>
</div>
</div>
</div>
</div>
</div> </div>
<div class="panel panel-default visible-xs-block" role="tabpanel" id="event_log_tab"> </div>
<div class="panel-heading visible-xs collapsed" id="event_log"> </div>
<h4 class="panel-title"> </div>
<a role="button" data-toggle="collapse" data-parent="#tabs" href="#collapseFive" aria-expanded="true" aria-controls="collapseFive"> </div>
<i class="fw fw-text fw-2x"></i> <div class="panel panel-default visible-xs-block" role="tabpanel" id="event_log_tab">
Operations Logs <div class="panel-heading visible-xs collapsed" id="event_log">
<i class="caret-updown fw fw-down"></i> <h4 class="panel-title">
</a> <a role="button" data-toggle="collapse" data-parent="#tabs" href="#collapseFive" aria-expanded="true" aria-controls="collapseFive">
</h4> <i class="fw fw-text fw-2x"></i>
</div> Operations Logs
<div class="panel-heading display-none-xs"> <i class="caret-updown fw fw-down"></i>
Operations Logs </a>
</h4>
</div>
<div class="panel-heading display-none-xs">
Operations Logs
<span> <span>
<a href="javascript:void(0);" id="refresh-operations"> <a href="javascript:void(0);" id="refresh-operations">
<i class="fw fw-refresh"></i> <i class="fw fw-refresh"></i>
</a> </a>
</span> </span>
</div> </div>
<div id="collapseFive" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="event_log"> <div id="collapseFive" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="event_log">
<div class="panel-body"> <div class="panel-body">
<span class="visible-xs add-padding-2x text-right"> <span class="visible-xs add-padding-2x text-right">
<a href="javascript:void(0);" id="refresh-operations"> <a href="javascript:void(0);" id="refresh-operations">
<i class="fw fw-refresh"></i> <i class="fw fw-refresh"></i>
</a> </a>
</span> </span>
<div id="operations-spinner" class="wr-advance-operations-init hidden"> <div id="operations-spinner" class="wr-advance-operations-init hidden">
<i class="fw fw-settings fw-spin fw-2x"></i> Loading Operations Log... <i class="fw fw-settings fw-spin fw-2x"></i> Loading Operations Log...
</div> </div>
<div id="operations-log-container"> <div id="operations-log-container">
<div class="message message-info"> <div class="message message-info">
<h4 class="remove-margin"><i class="icon fw fw-info"></i>There are no operations, performed yet on this device.</h4> <h4 class="remove-margin"><i class="icon fw fw-info"></i>There are no operations, performed yet on this device.</h4>
</div>
</div>
<table class="table table-striped table-hover table-bordered display data-table" id="operations-log-table">
<thead>
<tr class="sort-row">
<th>Operation Code</th>
<th>Status</th>
<th>Request created at</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div> </div>
</div> </div>
<table class="table table-striped table-hover table-bordered display data-table" id="operations-log-table">
<thead>
<tr class="sort-row">
<th>Operation Code</th>
<th>Status</th>
<th>Request created at</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div> </div>
{{/defineZone}} </div>
</div>
</div>
</div> </div>
</div> {{/defineZone}}
</div>
</div>
{{else}}
<h1 class="page-sub-title">
Permission Denied
</h1>
<br>
You are not authorized to view specified device in the system.
{{/if}}
{{else}} {{else}}
<h1 class="page-sub-title"> <h1 class="page-sub-title">
Permission Denied Device not found
</h1> </h1>
<br> <br>
You are not authorized to view specified device in the system. You have tried to access either a removed or non-existing device.
{{/if}} {{/if}}
{{/zone}} {{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
{{#if isAuthorized}} {{#if isAuthorized}}
<!--suppress HtmlUnknownTarget -->
<script id="policy-view" src="{{@unit.publicUri}}/templates/policy-compliance.hbs" <script id="policy-view" src="{{@unit.publicUri}}/templates/policy-compliance.hbs"
data-device-id="{{device.deviceIdentifier}}" data-device-type="{{device.type}}" data-device-id="{{device.deviceIdentifier}}" data-device-type="{{device.type}}"
type="text/x-handlebars-template"></script> type="text/x-handlebars-template"></script>
<!--suppress HtmlUnknownTarget -->
<script id="applications-list" src="{{@unit.publicUri}}/templates/applications-list.hbs" <script id="applications-list" src="{{@unit.publicUri}}/templates/applications-list.hbs"
data-device-id="{{device.deviceIdentifier}}" data-device-type="{{device.type}}" data-device-id="{{device.deviceIdentifier}}" data-device-type="{{device.type}}"
type="text/x-handlebars-template"></script> type="text/x-handlebars-template"></script>
<!--suppress HtmlUnknownTarget -->
<script id="operations-log" src="{{@unit.publicUri}}/templates/operations-log.hbs" <script id="operations-log" src="{{@unit.publicUri}}/templates/operations-log.hbs"
data-device-id="{{device.deviceIdentifier}}" data-device-type="{{device.type}}" data-device-id="{{device.deviceIdentifier}}" data-device-type="{{device.type}}"
type="text/x-handlebars-template"></script> type="text/x-handlebars-template"></script>

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

Loading…
Cancel
Save