mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Add support for hybrid device types which has emulation/virtual capabilities
This commit is contained in:
parent
5ff3ba3fcc
commit
78b7037aa9
@ -67,8 +67,8 @@
|
|||||||
<div class="try-device-container" id="{{deviceTypeName}}">
|
<div class="try-device-container" id="{{deviceTypeName}}">
|
||||||
<div class="message message-info try-device-message">
|
<div class="message message-info try-device-message">
|
||||||
<p class="try-device-text">
|
<p class="try-device-text">
|
||||||
<button id="{{deviceTypeName}}_btn" onclick="location.href='{{@app
|
<button id="{{deviceTypeName}}_btn"
|
||||||
.context}}/device/{{deviceTypeName}}/enroll'"
|
onclick="location.href='{{@app.context}}/device/{{deviceTypeName}}/enroll?type=virtual'"
|
||||||
class="btn btn-default btn-primary">Try
|
class="btn btn-default btn-primary">Try
|
||||||
</button>
|
</button>
|
||||||
our {{deviceTypeLabel}} device
|
our {{deviceTypeLabel}} device
|
||||||
|
|||||||
@ -21,6 +21,7 @@ function onRequest(context) {
|
|||||||
var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType";
|
var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType";
|
||||||
var DTYPE_CONF_DEVICE_CATEGORY = "category";
|
var DTYPE_CONF_DEVICE_CATEGORY = "category";
|
||||||
var DTYPE_CONF_DEVICE_TYPE_LABEL_KEY = "label";
|
var DTYPE_CONF_DEVICE_TYPE_LABEL_KEY = "label";
|
||||||
|
var DTYPE_CONF_VIRTUAL_DEVICE_TYPE_LABEL_KEY = "virtualLabel";
|
||||||
|
|
||||||
var viewModel = {};
|
var viewModel = {};
|
||||||
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
|
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
|
||||||
@ -54,6 +55,25 @@ function onRequest(context) {
|
|||||||
"deviceCategory": deviceCategory,
|
"deviceCategory": deviceCategory,
|
||||||
"thumb": utility.getDeviceThumb(deviceType)
|
"thumb": utility.getDeviceThumb(deviceType)
|
||||||
});
|
});
|
||||||
|
} else if (deviceCategory == 'hybrid') {
|
||||||
|
var virtualLabel = configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_VIRTUAL_DEVICE_TYPE_LABEL_KEY];
|
||||||
|
if (!virtualLabel) {
|
||||||
|
virtualLabel = deviceTypeLabel;
|
||||||
|
}
|
||||||
|
virtualDeviceTypesList.push({
|
||||||
|
"hasCustTemplate": false,
|
||||||
|
"deviceTypeLabel": virtualLabel,
|
||||||
|
"deviceTypeName": deviceType,
|
||||||
|
"deviceCategory": deviceCategory,
|
||||||
|
"thumb": utility.getDeviceThumb(deviceType)
|
||||||
|
});
|
||||||
|
deviceTypesList.push({
|
||||||
|
"hasCustTemplate": false,
|
||||||
|
"deviceTypeLabel": deviceTypeLabel,
|
||||||
|
"deviceTypeName": deviceType,
|
||||||
|
"deviceCategory": deviceCategory,
|
||||||
|
"thumb": utility.getDeviceThumb(deviceType)
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
deviceTypesList.push({
|
deviceTypesList.push({
|
||||||
"hasCustTemplate": false,
|
"hasCustTemplate": false,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user