forked from community/device-mgt-plugins
* Added the feature insert, changed the feature_id to int and added device_type to features * Included the updated database file * Developed the feature to view device features * Developed the implementation to call the Operation Manager from the UIrevert-dabc3590
parent
69a822c8d1
commit
3f7b93163b
Binary file not shown.
@ -0,0 +1,40 @@
|
|||||||
|
<%
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var verb = request.getMethod();
|
||||||
|
var uri = request.getRequestURI();
|
||||||
|
var callPath=uri.replace("/cdm/api/","");
|
||||||
|
var log = new Log();
|
||||||
|
var deviceModule = require("/modules/device.js");
|
||||||
|
|
||||||
|
if (uri != null) {
|
||||||
|
var uriMatcher = new URIMatcher(callPath);
|
||||||
|
//log.info(callPath);
|
||||||
|
log.info(uriMatcher.match("operation/{type}/{deviceid}/{operation}"));
|
||||||
|
if (uriMatcher.match("operation/{type}/{deviceid}/{operation}")) {
|
||||||
|
|
||||||
|
var deviceId = uriMatcher.elements().deviceid;
|
||||||
|
var type = uriMatcher.elements().type;
|
||||||
|
var operation = uriMatcher.elements().operation;
|
||||||
|
var result = deviceModule.performOperation(deviceId, operation,[],type);
|
||||||
|
<!--log.info(result);-->
|
||||||
|
<!--print(result);-->
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%>
|
@ -1,3 +1,21 @@
|
|||||||
<%
|
<%
|
||||||
// footer includes
|
// footer includes
|
||||||
%>
|
%>
|
||||||
|
<!-- Modal -->
|
||||||
|
<div class="modal fade" id="confirmModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
|
<h4 class="modal-title" id="myModalLabel">Operation Confirmation</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
Do you wish to perform this operation?
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||||
|
<button type="button" class="btn btn-primary" onclick="performOperation()">Confirm</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Reference in new issue