forked from community/device-mgt-core
parent
06a7fd2f1a
commit
3dc23c5708
0
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.listing/public/templates/listing.hbs → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/templates/listing.hbs
0
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.listing/public/templates/listing.hbs → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/templates/listing.hbs
@ -1,264 +0,0 @@
|
||||
{{#if deviceCount}}
|
||||
<span id="permission" data-permission="{{permissions}}"></span>
|
||||
<div id="loading-content" class="col-centered">
|
||||
<i class="fw fw-settings fw-spin fw-2x"></i>
|
||||
|
||||
Loading devices . . .
|
||||
<br>
|
||||
</div>
|
||||
<div id="device-listing-status" class="raw hidden">
|
||||
<ul style="list-style-type: none;">
|
||||
<li class="message message-info" >
|
||||
<h4>
|
||||
<i class="icon fw fw-info"></i>
|
||||
<a id="device-listing-status-msg"></a>
|
||||
</h4>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="device-table">
|
||||
<table class="table table-striped table-hover list-table display responsive nowrap data-table grid-view hidden" id="device-grid">
|
||||
<thead>
|
||||
<tr class="sort-row">
|
||||
<th class="no-sort"></th>
|
||||
<th>By Device Name</th>
|
||||
<th>By Owner</th>
|
||||
<th>By Status</th>
|
||||
<th>By Platform</th>
|
||||
<th>By Ownership</th>
|
||||
<th class="no-sort"></th>
|
||||
</tr>
|
||||
<tr class="filter-row filter-box">
|
||||
<th class="no-sort"></th>
|
||||
<th data-for="By Device name" class="text-filter"></th>
|
||||
<th data-for="By Owner" class="text-filter"></th>
|
||||
<th data-for="By Status" class="select-filter"></th>
|
||||
<th data-for="By Platform" class="select-filter data-platform"></th>
|
||||
<th data-for="By Ownership" class="select-filter"></th>
|
||||
<th class="no-sort"></th>
|
||||
</tr>
|
||||
<tr class="bulk-action-row">
|
||||
<th colspan="7">
|
||||
<div id = "operation-bar" class="hidden">
|
||||
{{unit "mdm.unit.device.operation-bar"}}
|
||||
</div>
|
||||
<div id="operation-guide" class="bs-callout bs-callout-info">
|
||||
<h4>Enabling Device Operations</h4>
|
||||
<p>To enable device operations, select the desired platform from above filter.</p>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="ast-container">
|
||||
|
||||
<br class="c-both" />
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<br class="c-both"/>
|
||||
<div id="content-filter-types" style="display: none">
|
||||
<div class="sort-title">Sort By</div>
|
||||
<div class="sort-options">
|
||||
<a href="#">By Device Name<span class="ico-sort-asc"></span></a>
|
||||
<a href="#">By Owner</a>
|
||||
<a href="#">By Status</a>
|
||||
<a href="#">By Platform</a>
|
||||
<a href="#">By Ownership</a>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div id="ast-container" class="ast-container list-view">
|
||||
<div class="ctrl-info-panel col-centered text-center wr-login">
|
||||
<h2>You don't have any device
|
||||
{{#if groupId}}
|
||||
assigned to this group
|
||||
{{else}}
|
||||
registered
|
||||
{{/if}}
|
||||
at the moment.</h2>
|
||||
<br/>
|
||||
|
||||
<p class="text-center">
|
||||
{{#if groupId}}
|
||||
<a href="{{@app.context}}/devices" class="wr-btn">
|
||||
<span class="fw-stack">
|
||||
<i class="fw fw-ring fw-stack-2x"></i>
|
||||
<i class="fw fw-add fw-stack-1x"></i>
|
||||
</span>
|
||||
Assign from My Devices
|
||||
</a>
|
||||
{{else}}
|
||||
<a href="{{@app.context}}/device/enroll" class="wr-btn">
|
||||
<span class="fw-stack">
|
||||
<i class="fw fw-ring fw-stack-2x"></i>
|
||||
<i class="fw fw-add fw-stack-1x"></i>
|
||||
</span>
|
||||
Enroll New Device
|
||||
</a>
|
||||
{{/if}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div id="group-device-modal-content" class="hide">
|
||||
<div class="modal-content">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-centered">
|
||||
<h3>Please select group</h3>
|
||||
<div id="user-groups">Loading...</div>
|
||||
<div class="buttons">
|
||||
<a href="#" id="group-device-yes-link" class="btn-operations">
|
||||
Assign
|
||||
</a>
|
||||
|
||||
<a href="#" id="group-device-cancel-link" class="btn-operations">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="group-associate-device-200-content" class="hide">
|
||||
<div class="modal-content">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-centered">
|
||||
<h3>Device was successfully associated with group.</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="group-deassociate-device-200-content" class="hide">
|
||||
<div class="modal-content">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-centered">
|
||||
<h3>Device was successfully removed from group.</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="remove-device-modal-content" class="hide">
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-6 col-centered">
|
||||
<h3>Do you really want to remove this device from your Devices List?</h3>
|
||||
|
||||
<div class="buttons">
|
||||
<a href="#" id="remove-device-yes-link" class="btn-operations">
|
||||
Yes
|
||||
</a>
|
||||
|
||||
<a href="#" id="remove-device-cancel-link" class="btn-operations">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="remove-device-200-content" class="hide">
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-6 col-centered">
|
||||
<h3>Device was successfully removed.</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="edit-device-modal-content" class="hide">
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-6 col-centered">
|
||||
<h3>Please enter new name for the device?</h3>
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
<input id="edit-device-name" style="color:#3f3f3f;padding:5px" type="text"
|
||||
value=""
|
||||
placeholder="Type here" size="60">
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<a href="#" id="edit-device-yes-link" class="btn-operations">
|
||||
Rename
|
||||
</a>
|
||||
|
||||
<a href="#" id="edit-device-cancel-link" class="btn-operations">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="edit-device-200-content" class="hide">
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-6 col-centered">
|
||||
<h3>Device was successfully updated.</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="device-400-content" class="hide">
|
||||
<div class="modal-content">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-centered center-container">
|
||||
<h3>Exception at backend. Try Later.</h3>
|
||||
<br/>
|
||||
<div class="buttons">
|
||||
<a href="#" id="device-400-link" class="btn-operations">
|
||||
Ok
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="device-403-content" class="hide">
|
||||
<div class="modal-content">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-centered center-container">
|
||||
<h3>Operation not permitted.</h3>
|
||||
<br/>
|
||||
<div class="buttons">
|
||||
<a href="#" id="device-403-link" class="btn-operations">
|
||||
Ok
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="device-409-content" class="hide">
|
||||
<div class="modal-content">
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-centered center-container">
|
||||
<h3>Device does not exist.</h3>
|
||||
<br/>
|
||||
<div class="buttons">
|
||||
<a href="#" id="remove-device-409-link" class="btn-operations">
|
||||
Ok
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#zone "bottomJs"}}
|
||||
<script id="device-listing" data-current-user="{{currentUser.username}}"
|
||||
data-image-resource="{{@app.context}}/public/cdmf.unit.device.type."
|
||||
src="{{@unit.publicUri}}/templates/listing.hbs"
|
||||
type="text/x-handlebars-template"></script>
|
||||
{{js "js/listing.js"}}
|
||||
{{/zone}}
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
*
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
function onRequest(context) {
|
||||
var page_data = {};
|
||||
var groupId = request.getParameter("groupId");
|
||||
var userModule = require("/app/modules/user.js").userModule;
|
||||
var constants = require("/app/modules/constants.js");
|
||||
var deviceModule = require("/app/modules/device.js").deviceModule;
|
||||
var permissions = [];
|
||||
var currentUser = session.get(constants.USER_SESSION_KEY);
|
||||
if (currentUser) {
|
||||
if (userModule.isAuthorized("/permission/admin/device-mgt/admin/devices/list")) {
|
||||
permissions.push("LIST_DEVICES");
|
||||
} else if (userModule.isAuthorized("/permission/admin/device-mgt/user/devices/list")) {
|
||||
permissions.push("LIST_OWN_DEVICES");
|
||||
}else if(userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/policies/list")){
|
||||
permissions.push("LIST_POLICIES");
|
||||
}
|
||||
|
||||
if (userModule.isAuthorized("/permission/admin/device-mgt/admin/devices/remove")) {
|
||||
permissions.push("REMOVE_DEVICE");
|
||||
}
|
||||
|
||||
page_data.permissions = stringify(permissions);
|
||||
page_data.currentUser = currentUser;
|
||||
var deviceCount;
|
||||
if (groupId) {
|
||||
var groupModule = require("/app/modules/group.js").groupModule;
|
||||
deviceCount = groupModule.getDevices(groupId).data.length;
|
||||
page_data.groupId = groupId;
|
||||
} else {
|
||||
deviceCount = deviceModule.getOwnDevicesCount();
|
||||
}
|
||||
if (deviceCount > 0){
|
||||
page_data.deviceCount = deviceCount;
|
||||
var utility = require("/app/modules/utility.js").utility;
|
||||
var data = deviceModule.getDeviceTypes();
|
||||
var deviceTypes = [];
|
||||
if(data.data) {
|
||||
for(var i = 0; i < data.data.length; i++) {
|
||||
deviceTypes.push({
|
||||
"type" : data.data[i].name,
|
||||
"category" : utility.getDeviceTypeConfig(data.data[i].name).deviceType.category
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
page_data.deviceTypes = deviceTypes;
|
||||
}
|
||||
}
|
||||
return page_data;
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"index": 30
|
||||
}
|
Loading…
Reference in new issue