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/public/js/device-detail.js 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/public/js/device-detail.js
deleted file mode 100644
index 730a132be5..0000000000
--- 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/public/js/device-detail.js
+++ /dev/null
@@ -1,197 +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.
- */
-
-(function () {
- var deviceId = $(".device-id");
- var deviceIdentifier = deviceId.data("deviceid");
- var deviceType = deviceId.data("type");
- var payload = [deviceIdentifier];
- var operationTable;
- if (deviceType == "ios") {
- var serviceUrl = "/ios/operation/deviceinfo";
- } else if (deviceType == "android") {
- var serviceUrl = "/mdm-android-agent/operation/device-info";
- }
- if(serviceUrl){
- invokerUtil.post(serviceUrl, payload,
- function(message){
- console.log(message);
- }, function (message) {
- console.log(message);
- });
- }
- $(document).ready(function(){
- $(".panel-body").removeClass("hidden");
- $("#loading-content").remove();
- loadOperationBar(deviceType);
- loadOperationsLog();
- loadApplicationsList();
- loadPolicyCompliance();
-
- $("#refresh-policy").click(function () {
- $('#policy-spinner').removeClass('hidden');
- loadPolicyCompliance();
- });
-
- $("#refresh-apps").click(function () {
- $('#apps-spinner').removeClass('hidden');
- loadApplicationsList();
- });
-
- $("#refresh-operations").click(function () {
- $('#operations-spinner').removeClass('hidden');
- loadOperationsLog(true);
- });
-
- });
-
- function loadOperationsLog(update) {
- var operationsLog = $("#operations-log");
- var deviceListingSrc = operationsLog.attr("src");
- var deviceId = operationsLog.data("device-id");
- var deviceType = operationsLog.data("device-type");
-
- $.template("operations-log", deviceListingSrc, function (template) {
- var serviceURL = "/devicemgt_admin/operations/"+deviceType+"/"+deviceId;
-
- var successCallback = function (data) {
- data = JSON.parse(data);
- $('#operations-spinner').addClass('hidden');
- var viewModel = {};
- viewModel.operations = data;
- if(data.length > 0){
- var content = template(viewModel);
- if(!update) {
- $("#operations-log-container").html(content);
- operationTable = $('#operations-log-table').datatables_extended();
- }else{
- $('#operations-log-table').dataTable().fnClearTable();
- for(var i=0; i < data.length; i++) {
- var status;
- if(data[i].status == "COMPLETED") {
- status = "
Completed";
- } else if(data[i].status == "PENDING") {
- status = "
Pending";
- } else if(data[i].status == "ERROR") {
- status = "
Error";
- } else if(data[i].status == "IN_PROGRESS") {
- status = "
In Progress";
- }
-
- $('#operations-log-table').dataTable().fnAddData([
- data[i].code,
- status,
- data[i].createdTimeStamp
- ]);
- }
- }
- }
-
- };
- invokerUtil.get(serviceURL,
- successCallback, function(message){
- console.log(message);
- });
- });
-
- }
-
- function loadApplicationsList() {
- var applicationsList = $("#applications-list");
- var deviceListingSrc = applicationsList.attr("src");
- var deviceId = applicationsList.data("device-id");
- var deviceType = applicationsList.data("device-type");
-
- $.template("application-list", deviceListingSrc, function (template) {
- var serviceURL = "/devicemgt_admin/operations/"+deviceType+"/"+deviceId+"/apps";
-
- var successCallback = function (data) {
- data = JSON.parse(data);
- $('#apps-spinner').addClass('hidden');
- var viewModel = {};
- if(data != null && data.length > 0) {
- for (var i = 0; i < data.length; i++) {
- data[i].name = data[i].name.replace(/[^\w\s]/gi, ' ');
- data[i].name = data[i].name.replace(/[0-9]/g, ' ');
- }
- }
- viewModel.applications = data;
- viewModel.deviceType = deviceType;
- if(data.length > 0){
- var content = template(viewModel);
- $("#applications-list-container").html(content);
- }
-
- };
- invokerUtil.get(serviceURL,
- successCallback, function(message){
- console.log(message);
- });
- });
- }
-
- function loadPolicyCompliance() {
- var policyCompliance = $("#policy-view");
- var policySrc = policyCompliance.attr("src");
- var deviceId = policyCompliance.data("device-id");
- var deviceType = policyCompliance.data("device-type");
- var activePolicy = null;
-
- $.template("policy-view", policySrc, function (template) {
- var serviceURLPolicy ="/devicemgt_admin/policies/"+deviceType+"/"+deviceId+"/active-policy"
- var serviceURLCompliance = "/devicemgt_admin/policies/"+deviceType+"/"+deviceId;
-
- var successCallbackCompliance = function (data) {
- var viewModel = {};
- viewModel.policy = activePolicy;
- viewModel.deviceType = deviceType;
- if(data != null && data.complianceFeatures!= null && data.complianceFeatures != undefined && data.complianceFeatures.length > 0) {
- viewModel.compliance = "NON-COMPLIANT";
- viewModel.complianceFeatures = data.complianceFeatures;
- var content = template(viewModel);
- $("#policy-list-container").html(content);
- } else {
- viewModel.compliance = "COMPLIANT";
- var content = template(viewModel);
- $("#policy-list-container").html(content);
- $("#policy-compliance-table").addClass("hidden");
- }
-
- };
-
- var successCallbackPolicy = function (data) {
- data = JSON.parse(data);
- $('#policy-spinner').addClass('hidden');
- if(data != null && data.active == true){
- activePolicy = data;
- invokerUtil.get(serviceURLCompliance,
- successCallbackCompliance, function(message){
- console.log(message);
- });
- }
- };
-
- invokerUtil.get(serviceURLPolicy,
- successCallbackPolicy, function(message){
- console.log(message);
- });
- });
-
- }
-
-}());
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/public/js/load-map.js 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/public/js/load-map.js
deleted file mode 100644
index 92ae2d2d8d..0000000000
--- 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/public/js/load-map.js
+++ /dev/null
@@ -1,55 +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.
- */
-
-$(document).ready(function(){
- if (document.getElementById('device-location')){
- loadMap();
- }
-});
-
-function loadMap() {
- var map;
- function initialize() {
- var mapOptions = {
- zoom: 18
- };
- var lat = $("#device-location").data("lat");
- var long = $("#device-location").data("long");
-
- if(lat != null && lat != undefined && lat != "" && long != null && long != undefined && long != "") {
- $("#map-error").hide();
- $("#device-location").show();
- map = new google.maps.Map(document.getElementById('device-location'),
- mapOptions);
-
- var pos = new google.maps.LatLng(lat,
- long);
- var marker = new google.maps.Marker({
- position: pos,
- map: map
- });
-
- map.setCenter(pos);
- }else{
- $("#device-location").hide();
- $("#map-error").show();
- }
-
- }
- google.maps.event.addDomListener(window, 'load', initialize);
-}
\ No newline at end of file
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/public/templates/applications-list.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/public/templates/applications-list.hbs
deleted file mode 100644
index 8fba28621b..0000000000
--- 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/public/templates/applications-list.hbs
+++ /dev/null
@@ -1,12 +0,0 @@
-
\ No newline at end of file
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/public/templates/operations-log.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/public/templates/operations-log.hbs
deleted file mode 100644
index cc5db5117a..0000000000
--- 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/public/templates/operations-log.hbs
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- Operation Code |
- Status |
- Request created at |
-
-
-
- {{#each operations}}
-
- {{code}} |
-
- {{#equal status "COMPLETED"}} Completed{{/equal}}
- {{#equal status "PENDING"}} Pending{{/equal}}
- {{#equal status "ERROR"}} Error{{/equal}}
- {{#equal status "IN_PROGRESS"}} In Progress{{/equal}}
- |
- {{createdTimeStamp}} |
-
- {{/each}}
-
-
-
\ No newline at end of file
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/public/templates/policy-compliance.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/public/templates/policy-compliance.hbs
deleted file mode 100644
index 6dabda7870..0000000000
--- 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/public/templates/policy-compliance.hbs
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
- {{#equal deviceType "android"}}
-
- {{/equal}}
- {{#equal deviceType "ios"}}
-
- {{/equal}}
- {{#equal deviceType "windows"}}
-
- {{/equal}}
-
-
- {{policy.policyName}}
- {{deviceType}}
-
-
-
-
-
-
- Ownership Type : {{policy.ownershipType}}
-
-
-
-
- Compliance Type : {{policy.compliance}}
-
-
-
-
- Compliance :
- {{#equal compliance "COMPLIANT"}}
- Compliant
- {{/equal}}
- {{#equal compliance "NON-COMPLIANT"}}
- Not Compliant
- {{/equal}}
-
-
-
-
-
-
-
-
-
-
-
- Feature |
- Compliance |
-
-
-
- {{#each complianceFeatures}}
-
- {{featureCode}} |
-
- {{#equal compliance true}} Compliant{{/equal}}
- {{#equal compliance false}} Not Compliant{{/equal}}
- |
-
- {{/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.policy.edit/edit.hbs b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.policy.edit/edit.hbs
index 236884f289..4418289187 100644
--- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.policy.edit/edit.hbs
+++ b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.policy.edit/edit.hbs
@@ -41,7 +41,7 @@
data-direct="{{@app.context}}/policies/">
View policy list
-
+
diff --git a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.policy.wizard/public/js/policy-create.js b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.policy.wizard/public/js/policy-create.js
index fb89d22f31..84e9886436 100644
--- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.policy.wizard/public/js/policy-create.js
+++ b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.policy.wizard/public/js/policy-create.js
@@ -267,6 +267,7 @@ function publishToDevice() {
"description": policy["description"],
"compliance": policy["selectedNonCompliantAction"],
"ownershipType": "ANY",
+ "deviceId": getParameterByName('deviceId'),
"profile": {
"profileName": policy["policyName"],
"deviceType": {
@@ -659,4 +660,11 @@ $(document).ready(function () {
$("." + nextStep).removeClass("hidden");
}
});
-});
\ No newline at end of file
+});
+
+function getParameterByName(name) {
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
+ var regex = new RegExp("[\\?&]" + name + "=([^]*)"),
+ results = regex.exec(location.search);
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
+}
\ 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.policy.wizard/wizard.hbs b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.policy.wizard/wizard.hbs
index b579f8d98f..4cc6fa2726 100644
--- a/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.policy.wizard/wizard.hbs
+++ b/features/device-mgt-iot-feature/org.wso2.carbon.device.mgt.iot.feature/src/main/resources/jaggeryapps/devicemgt/app/units/iot.unit.policy.wizard/wizard.hbs
@@ -48,7 +48,7 @@
data-direct="{{@app.context}}/policies">
View policy list
-
+
@@ -229,7 +229,7 @@