From 5e4d7d8cf9da29aca93bc16616b9010aa704049c Mon Sep 17 00:00:00 2001 From: charithag Date: Mon, 21 Dec 2015 11:36:06 +0530 Subject: [PATCH] Update device operations --- .../device-view.hbs | 2 +- .../device-view.hbs | 2 +- .../device-view.hbs | 2 +- .../operation-bar.hbs | 69 +++- .../operation-bar.js | 28 +- .../operation-bar.json | 3 +- .../public/js/operation-bar.js | 290 ++------------ .../templates/hidden-operations-ios.hbs | 366 ------------------ .../public/templates/operations.hbs | 130 ------- .../iot.unit.device.operation/operation.hbs | 40 -- .../iot.unit.device.operation/operation.js | 8 - .../iot.unit.device.operation/operation.json | 3 - .../public/js/operation.js | 42 -- .../device-view.hbs | 2 +- .../device-view.hbs | 2 +- .../operation-bar.hbs | 2 +- .../operation-bar.js | 4 - 17 files changed, 120 insertions(+), 875 deletions(-) delete mode 100644 features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/templates/hidden-operations-ios.hbs delete mode 100644 features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/templates/operations.hbs delete mode 100644 features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.hbs delete mode 100644 features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.js delete mode 100644 features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.json delete mode 100644 features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/public/js/operation.js delete mode 100644 features/device-mgt-mdm-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.js diff --git a/features/device-mgt-iot-arduino-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.device-view/device-view.hbs b/features/device-mgt-iot-arduino-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.device-view/device-view.hbs index ea91e3177a..02f1f018d1 100644 --- a/features/device-mgt-iot-arduino-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.device-view/device-view.hbs +++ b/features/device-mgt-iot-arduino-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.device-view/device-view.hbs @@ -15,7 +15,7 @@ Operations
- {{unit "iot.unit.device.operation" device=device}} + {{unit "iot.unit.device.operation-bar" device=device}}
{{/zone}} diff --git a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.hbs b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.hbs index 86d043bfad..c31f884e4b 100644 --- a/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.hbs +++ b/features/device-mgt-iot-digitaldisplay-feature/org.wso2.carbon.device.mgt.iot.digitaldisplay.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.digital_display.device-view/device-view.hbs @@ -15,7 +15,7 @@ Operations
- {{unit "iot.unit.device.operation" device=device}} + {{unit "iot.unit.device.operation-bar" device=device}}
{{/zone}} diff --git a/features/device-mgt-iot-droneanalyzer-feature/org.wso2.carbon.device.mgt.iot.droneanalyzer.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.drone_analyzer.device-view/device-view.hbs b/features/device-mgt-iot-droneanalyzer-feature/org.wso2.carbon.device.mgt.iot.droneanalyzer.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.drone_analyzer.device-view/device-view.hbs index 9bb42928b5..962177a6b3 100644 --- a/features/device-mgt-iot-droneanalyzer-feature/org.wso2.carbon.device.mgt.iot.droneanalyzer.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.drone_analyzer.device-view/device-view.hbs +++ b/features/device-mgt-iot-droneanalyzer-feature/org.wso2.carbon.device.mgt.iot.droneanalyzer.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.drone_analyzer.device-view/device-view.hbs @@ -15,7 +15,7 @@ Operations
- {{unit "iot.unit.device.operation" device=device}} + {{unit "iot.unit.device.operation-bar" device=device}}
{{/zone}} diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.hbs b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.hbs index fd1bc3133e..d7dbdd874d 100644 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.hbs +++ b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.hbs @@ -1,7 +1,66 @@ -
+{{#if control_operations}} +
+ + {{#each control_operations}} + + + {{name}} + + +
+
+
+
+

+ + + + + {{name}} +
+

+

+ {{description}} +
+

+ +
+ {{#each params}} + +
+ {{/each}} + + + +
+
+
+
+
+ {{/each}} +
+{{/if}} {{#zone "bottomJs"}} - - {{js "js/operation-bar.js"}} -{{/zone}} \ No newline at end of file + {{js "js/operation-bar.js"}} +{{/zone}} diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.js b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.js index 3e9c47af0e..0f8b869dd6 100644 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.js +++ b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.js @@ -1,4 +1,26 @@ -function onRequest (context) { - // var log = new Log("operation-bar.js"); - return context; +/* + * 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. + */ + +function onRequest(context) { + var log = new Log("operation.js"); + var operationModule = require("/app/modules/operation.js").operationModule; + var device = context.unit.params.device; + log.info(device); + var control_operations = operationModule.getControlOperations(device.type); + return {"control_operations": control_operations, "device": device}; } \ No newline at end of file diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.json b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.json index 56a988c763..688e939808 100644 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.json +++ b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/operation-bar.json @@ -1,4 +1,3 @@ { - "version": "1.0.0", - "extends": "cdmf.unit.device.operation-bar" + "version": "1.0.0" } \ No newline at end of file diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/js/operation-bar.js b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/js/operation-bar.js index 26666e1bfb..442731fc3a 100644 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/js/operation-bar.js +++ b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/js/operation-bar.js @@ -16,283 +16,41 @@ * under the License. */ -/* - * Setting-up global variables. - */ - -var operations = '.wr-operations', - modalPopup = '.wr-modalpopup', - modalPopupContainer = modalPopup + ' .modalpopup-container', - modalPopupContent = modalPopup + ' .modalpopup-content', - // deviceCheckbox = '#ast-container .ctrl-wr-asset .itm-select input[type="checkbox"]', - // showOperationsBtn = '#showOperationsBtn', - navHeight = $('#nav').height(), - headerHeight = $('header').height(), - offset = (headerHeight + navHeight), - // maxOperationsLimit = 15, - // hiddenOperation = '.wr-hidden-operations-content > div', - deviceSelection = '.device-select', - dataTableSelection = '.DTTT_selected', - currentOperationList = []; - -/* -* On window resize functions. -*/ -//$(window).resize(function(){ -// toggleMoreOperationsHeight(); -//}); - -/* - * On main div.container resize functions. - * @required jquery.resize.js - */ -//$('.container').resize(function(){ -// toggleMoreOperationsHeight(); -//}); - -/* - * On Show Operations click operation show toggling function. - */ -//function showOperations(){ -// $(operations).toggle('slide'); -//} - -/* - * Function to get selected devices ID's - */ -function getSelectedDeviceIds() { - var deviceIdentifierList = []; - $(deviceSelection).each(function (index) { - var device = $(this); - var deviceId = device.data('deviceid'); - var deviceType = device.data('type'); - deviceIdentifierList.push({ - "id" : deviceId, - "type" : deviceType - }); - }); - if(deviceIdentifierList.length == 0) { - var thisTable = $(".DTTT_selected").closest('.dataTables_wrapper').find('.dataTable').dataTable(); - thisTable.api().rows().every(function () { - if ($(this.node()).hasClass('DTTT_selected')) { - var deviceId = $(thisTable.api().row(this).node()).data('deviceid'); - var deviceType = $(thisTable.api().row(this).node()).data('devicetype'); - deviceIdentifierList.push({ - "id": deviceId, - "type": deviceType - }); - } - }); - } - - return deviceIdentifierList; -} - /* * On operation click function. * @param selection: Selected operation */ function operationSelect (selection) { - var deviceIdList = getSelectedDeviceIds(); - if (deviceIdList == 0) { - $(modalPopupContent).html($("#errorOperations").html()); - } else { - $(modalPopupContent).addClass("operation-data"); - $(modalPopupContent).html($(operations + " .operation[data-operation-code=" + selection + "]").html()); - $(modalPopupContent).data("operation-code", selection); - } + $(modalPopupContent).addClass("operation-data"); + $(modalPopupContent).html($(" .operation[data-operation-code=" + selection + "]").html()); + $(modalPopupContent).data("operation-code", selection); showPopup(); } -/* - * Function to open hidden device operations list - */ -//function toggleMoreOperations(){ -// $('.wr-hidden-operations, .wr-page-content').toggleClass('toggled'); -// $(showOperationsBtn).toggleClass('selected'); -// //$('.footer').toggleClass('wr-hidden-operations-toggled'); -//} +$(document).on('submit', 'form', function (e) { + e.preventDefault(); + var postOperationRequest = $.ajax({ + url: $(this).attr("action") + '&' + $(this).serialize(), + method: "post" + }); -/* - * Function to fit hidden device operation window height with the screen - */ -//function toggleMoreOperationsHeight(){ -// $('.wr-hidden-operations').css('min-height', $('html').height() - (offset+140)); -//} + var btnSubmit = $('#btnSend', this); + btnSubmit.addClass('hidden'); -/* - * Advance operations sub categories show/hide toggle function - */ -//function showAdvanceOperation(operation, button){ -// $(button).addClass('selected'); -// $(button).siblings().removeClass('selected'); -// $(hiddenOperation + '[data-operation-code="' + operation + '"]').show(); -// $(hiddenOperation + '[data-operation-code="' + operation + '"]').siblings().hide(); -//} + var lblSending = $('#lblSending', this); + lblSending.removeClass('hidden'); -function getDevicesByTypes (deviceList) { - var deviceTypes = {}; - $.each(deviceList, function (index, item) { - deviceTypes[item.type] = []; - if (item.type == "android" || item.type == "ios" || item.type == "windows") { - deviceTypes[item.type].push(item.id); - } -// if(item.type == "TemperatureController"){ -// deviceTypes[item.type].push(item.id); -// } + var lblSent = $('#lblSent', this); + postOperationRequest.done(function (data) { + lblSending.addClass('hidden'); + lblSent.removeClass('hidden'); + setTimeout(function () { + hidePopup(); + }, 3000); }); - return deviceTypes; -} - -function unloadOperationBar(){ - $("#showOperationsBtn").addClass("hidden"); - $(".wr-operations").html(""); -} -function loadOperationBar (deviceType) { - var operationBar = $("#operations-bar"); - var operationBarSrc = operationBar.attr("src"); - var platformType = deviceType; - $.template("operations-bar", operationBarSrc, function (template) { - var serviceURL = "/devicemgt_admin/features/" + platformType; -// if (deviceType == "TemperatureController") { -// serviceURL = "/devicemgt_admin/features/android"; -// } - var successCallback = function (data) { - var viewModel = {}; - // var iconMap = {}; -// if (deviceType == "TemperatureController") { -// data = [{ -// "id": 0, -// "code": "BUZZER", -// "name": "Buzz", -// "description": "Buzz the device", -// "deviceType": "TemperatureController", -// "metadataEntries": null -// }]; -// currentOperationList = viewModel.features = data.reduce(function (total, current) { -// total[current.code] = current; -// return total; -// }, {}); -// } - data = JSON.parse(data).filter(function (current) { - var iconName; - if (deviceType == "android"){ - iconName = operationModule.getAndroidIconForFeature(current.code); - current.type = deviceType; - } if (deviceType == "windows"){ - iconName = operationModule.getWindowsIconForFeature(current.code); - } else if (deviceType == "ios"){ - iconName = operationModule.getIOSIconForFeature(current.code); - } - if (iconName){ - current.icon = iconName; - return current; - } - }); - viewModel.features = data; - var content = template(viewModel); - $(".wr-operations").html(content); - }; - invokerUtil.get(serviceURL, - successCallback, function(message){ - console.log(message); - }); + postOperationRequest.fail(function (jqXHR, textStatus) { + lblSending.addClass('hidden'); + lblSent.addClass('hidden'); }); - // var hiddenOperationBar = $("#hidden-operations-bar-" + deviceType); - // var hiddenOperationBarSrc = hiddenOperationBar.attr("src"); -// if (hiddenOperationBarSrc){ -// $.template("hidden-operations-bar-" + deviceType, hiddenOperationBarSrc, function (template) { -// var serviceURL = "/devicemgt_admin/features/" + platformType; -// var successCallback = function (data) { -// var viewModel = {}; -// viewModel.features = data.reduce(function (total, current) { -// total[current.code] = current; -// return total; -// }, {}); -// currentOperationList = viewModel.features; -// var content = template(viewModel); -// $(".wr-hidden-operations").html(content); -// }; -// invokerUtil.get(serviceURL, -// successCallback, function(message){ -// console.log(message); -// }); -// }); -// $("#showOperationsBtn").removeClass("hidden"); -// } - -} - -function runOperation (operationName) { - var deviceIdList = getSelectedDeviceIds(); - var list = getDevicesByTypes(deviceIdList); - - var notificationBubble = ".wr-notification-bubble"; - var successCallback = function (data) { - console.log(data); -// $(".wr-notification-bar").append('
' + currentOperationList[operationName].name + -// '- Operation Successful!

'); - /*var notificationCount = parseInt($(notificationBubble).html()); - notificationCount++; - $(notificationBubble).html(notificationCount);*/ - if(operationName == "NOTIFICATION"){ - $(modalPopupContent).html($("#messageSuccess").html()); - }else { - $(modalPopupContent).html($("#operationSuccess").html()); - } - showPopup(); - }; - - var payload, serviceEndPoint; - if(list["ios"]){ - payload = operationModule.generatePayload("ios", operationName, list["ios"]); - serviceEndPoint = operationModule.getIOSServiceEndpoint(operationName); - } - if(list["android"]){ - payload = operationModule.generatePayload("android", operationName, list["android"]); - serviceEndPoint = operationModule.getAndroidServiceEndpoint(operationName); - } - if(list["windows"]){ - payload = operationModule.generatePayload("windows", operationName, list["windows"]); - serviceEndPoint = operationModule.getWindowsServiceEndpoint(operationName); - } -// if(list["TemperatureController"]){ -// payload = operationModule.generatePayload("TemperatureController", operationName, list["TemperatureController"]); -// serviceEndPoint = operationModule.getTemperatureControllerServiceEndpoint(operationName); -// } - console.log(payload); - invokerUtil.post(serviceEndPoint, payload, - successCallback, function(jqXHR, textStatus, errorThrown){ - console.log(textStatus); - }); - $(modalPopupContent).removeData(); - hidePopup(); -} - -/* - * DOM ready functions. - */ -$(document).ready(function(){ -// if($(operations + "> a").length > maxOperationsLimit){ -// $(showOperationsBtn).show(); -// } -// else{ -// $(operations).show(); -// } - $(operations).show(); - // toggleMoreOperationsHeight(); - //loadOperationBar("ios"); - /** - * Android App type javascript - */ -// $(".wr-modalpopup").on("click", ".appTypesInput", function(){ -// var appType = $(".appTypesInput").val(); -// if (appType == "Public") { -// $('.appURLInput').prop( "disabled", true ); -// }else if (appType == "Enterprise"){ -// $('.appURLInput').prop( "disabled", false ); -// } -// }).trigger("change"); -}); +}); \ No newline at end of file diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/templates/hidden-operations-ios.hbs b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/templates/hidden-operations-ios.hbs deleted file mode 100644 index 4cb006ef07..0000000000 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/templates/hidden-operations-ios.hbs +++ /dev/null @@ -1,366 +0,0 @@ -
- -
- - -
-
- -
- -
- -
- -
- -
- - -
- -
-
- - -
-
- - -
- Install -
- -
-
- -
- -
- -
- -
- -
- - -
- -
-
- - -
-
- - -
- Install -
-
-
- -
- -
- -
- Uninstall -
-
-
- - - -
- - -
- -
- -
- - -
- -
- - -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- Configure -
- - - -
- - -
- -
- - - -
-
- -
-
- Path Prefix -
-
-
- - - -
- -
- - - -
- -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- - - -
-
- -
-
- : -
-
-
- - - -
- -
- - - -
- -
- - - -
- -
- -
- - -
-
- - - -
-
- -
-
- -
-
- -
-
- -
-
- -
- Configure -
- - -
- -
- -
- -
- -
AirPlay password -
- -
- Configure -
- -
-
\ No newline at end of file diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/templates/operations.hbs b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/templates/operations.hbs deleted file mode 100644 index 573358a959..0000000000 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation-bar/public/templates/operations.hbs +++ /dev/null @@ -1,130 +0,0 @@ -
-
-
-
-

- - - - - Operation cannot be performed ! -

-

- Please select a device or a list of devices to perform an operation. -

- -
-
-
-
-
-
-
-
-

- - - - - Operation performed successfully ! -

-

- Operation has been queued to be sent to the device. -

- -
-
-
-
- -
-
-
-
-

- - - - - Message sent successfully ! -

-

- Message has been queued to be sent to the device. -

- -
-
-
-
-{{#each features}} - - - {{name}} - -
-
-
-
-

- - - - - {{name}} -
-

-

- {{#equal code "WIPE_DATA"}} - {{#equal type "android"}} - Enter PIN code (Optional - This is required only if the device type is BYOD). -

-
- -
-
- {{/equal}} - {{/equal}} - {{#equal code "NOTIFICATION"}} - Type your message below. -

-
- -
-
- {{/equal}} - {{#equal code "CHANGE_LOCK_CODE"}} - Type new lock-code below. -

- -
- {{/equal}} - Do you want to perform this operation on selected device(s) ? -
-

- -
-
-
-
-{{/each}} -
\ No newline at end of file diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.hbs b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.hbs deleted file mode 100644 index ca1b51de2c..0000000000 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.hbs +++ /dev/null @@ -1,40 +0,0 @@ -{{#if control_operations}} - - {{#each control_operations}} -
- - {{#each params}} - - {{/each}} - - - - -
- {{/each}} -{{/if}} - -{{#zone "bottomJs"}} - {{js "js/operation.js"}} -{{/zone}} diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.js b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.js deleted file mode 100644 index 2345998dac..0000000000 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.js +++ /dev/null @@ -1,8 +0,0 @@ -function onRequest(context) { - var log = new Log("operation.js"); - var operationModule = require("/app/modules/operation.js").operationModule; - var device = context.unit.params.device; - log.info(device); - var control_operations = operationModule.getControlOperations(device.type); - return {"control_operations": control_operations, "device": device}; -} \ No newline at end of file diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.json b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.json deleted file mode 100644 index 688e939808..0000000000 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/operation.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "version": "1.0.0" -} \ No newline at end of file diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/public/js/operation.js b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/public/js/operation.js deleted file mode 100644 index 0ab529bdc7..0000000000 --- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.device.operation/public/js/operation.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -$("form").on('submit', function (e) { - var postOperationRequest = $.ajax({ - url: $(this).attr("action") + '&' + $(this).serialize(), - method: "post" - }); - - var lblSending = $('#lblSending', this); - lblSending.removeClass('hidden'); - - var lblSent = $('#lblSent', this); - postOperationRequest.done(function (data) { - lblSending.addClass('hidden'); - lblSent.removeClass('hidden'); - setTimeout(function () { - lblSent.addClass('hidden'); - }, 3000); - }); - - postOperationRequest.fail(function (jqXHR, textStatus) { - lblSending.addClass('hidden'); - lblSent.addClass('hidden'); - }); - e.preventDefault(); -}); \ No newline at end of file diff --git a/features/device-mgt-iot-raspberrypi-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.device-view/device-view.hbs b/features/device-mgt-iot-raspberrypi-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.device-view/device-view.hbs index 78920e71bc..c94cf47301 100644 --- a/features/device-mgt-iot-raspberrypi-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.device-view/device-view.hbs +++ b/features/device-mgt-iot-raspberrypi-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.device-view/device-view.hbs @@ -15,7 +15,7 @@ Operations
- {{unit "iot.unit.device.operation" device=device}} + {{unit "iot.unit.device.operation-bar" device=device}}
{{/zone}} diff --git a/features/device-mgt-iot-virtualfirealarm-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.hbs b/features/device-mgt-iot-virtualfirealarm-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.hbs index fb86bb29e8..537a8243d4 100644 --- a/features/device-mgt-iot-virtualfirealarm-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.hbs +++ b/features/device-mgt-iot-virtualfirealarm-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view/device-view.hbs @@ -15,7 +15,7 @@ Operations
- {{unit "iot.unit.device.operation" device=device}} + {{unit "iot.unit.device.operation-bar" device=device}}
{{/zone}} diff --git a/features/device-mgt-mdm-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.hbs b/features/device-mgt-mdm-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.hbs index fd1bc3133e..78813761e7 100644 --- a/features/device-mgt-mdm-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.hbs +++ b/features/device-mgt-mdm-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.hbs @@ -1,4 +1,4 @@ -
+
{{#zone "bottomJs"}}