From 06d646c87acce553464ca86c722049144d6616d1 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Tue, 9 May 2017 00:56:21 +0530 Subject: [PATCH] moved artifact deployment to the platform configuration --- .../configuration.hbs | 38 +++++++----- .../configuration.js} | 0 .../public/js/platform-configuration.js | 27 +++++++++ .../public/js/download.js | 27 --------- .../type-view.hbs | 3 - .../configuration.hbs | 47 ++++++++------- .../configuration.js} | 0 .../public/js/platform-configuration.js | 27 +++++++++ .../public/js/download.js | 27 --------- .../type-view.hbs | 5 -- .../configuration.hbs | 59 ++++++++----------- .../configuration.js} | 2 +- .../public/js/platform-configuration.js | 27 +++++++++ .../public/js/download.js | 27 --------- .../type-view.hbs | 3 - .../configuration.hbs | 59 ++++++++----------- .../configuration.js | 24 ++++++++ .../public/js/platform-configuration.js | 27 +++++++++ .../public/js/download.js | 27 --------- .../type-view.hbs | 3 - .../public/js/type-view.js | 29 +-------- .../type-view.hbs | 4 -- .../type-view.js | 2 - .../org.wso2.iot.android.sense_1.0.0.json | 0 24 files changed, 229 insertions(+), 265 deletions(-) rename components/device-types/{raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.js => androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.js} (100%) rename components/device-types/{virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.js => arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.js} (100%) rename components/device-types/{arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.js => raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.js} (96%) create mode 100644 components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.js create mode 100644 features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.hbs b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.hbs index 1f9b95d49..590edfa3d 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.hbs +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.hbs @@ -27,22 +27,32 @@ class="alert alert-danger hidden" role="alert"> -
- - -
-
- + +
+ + + + diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.js similarity index 100% rename from components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.js rename to components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/configuration.js diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/public/js/platform-configuration.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/public/js/platform-configuration.js index 950b6c500..6dce33a0a 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/public/js/platform-configuration.js +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration/public/js/platform-configuration.js @@ -95,3 +95,30 @@ var addConfiguration = function () { } ); }; + +function artifactUpload() { + var contentType = "application/json"; + var backendEndBasePath = "/api/device-mgt/v1.0"; + var urix = backendEndBasePath + "/admin/devicetype/deploy/android_sense"; + var defaultStatusClasses = "fw fw-stack-1x"; + var content = $("#androidsense-statistic-response-template").find(".content"); + var title = content.find("#title"); + var statusIcon = content.find("#status-icon"); + var data = {} + invokerUtil.post(urix, data, function (data) { + title.html("Deploying statistic artifacts. Please wait..."); + statusIcon.attr("class", defaultStatusClasses + " fw-check"); + $(modalPopupContent).html(content.html()); + showPopup(); + setTimeout(function () { + hidePopup(); + location.reload(true); + }, 5000); + + }, function (jqXHR) { + title.html("Failed to deploy artifacts, Please contact administrator."); + statusIcon.attr("class", defaultStatusClasses + " fw-error"); + $(modalPopupContent).html(content.html()); + showPopup(); + }, contentType); +} \ No newline at end of file diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js index fcb3c3754..fd6d5b2f3 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/public/js/download.js @@ -73,30 +73,3 @@ function attachEvents() { } } -function artifactUpload() { - var contentType = "application/json"; - - var urix = backendEndBasePath + "/admin/devicetype/deploy/android_sense"; - var defaultStatusClasses = "fw fw-stack-1x"; - var content = $("#androidsense-statistic-response-template").find(".content"); - var title = content.find("#title"); - var statusIcon = content.find("#status-icon"); - var data = {} - invokerUtil.post(urix, data, function (data) { - title.html("Deploying statistic artifacts. Please wait..."); - statusIcon.attr("class", defaultStatusClasses + " fw-check"); - $(modalPopupContent).html(content.html()); - showPopup(); - setTimeout(function () { - hidePopup(); - location.reload(true); - }, 5000); - - }, function (jqXHR) { - title.html("Failed to deploy artifacts, Please contact administrator."); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - $(modalPopupContent).html(content.html()); - showPopup(); - }, contentType); -} - diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs index a476d480f..3d1fdf997 100644 --- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs +++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view/type-view.hbs @@ -41,9 +41,6 @@ Enroll Device Download APK Invite by Email - {{#if permissions.IS_ADMIN}} - Deploy Analytics Artifacts - {{/if}} diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.hbs b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.hbs index 49dcbcd12..08e1c60a2 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.hbs +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.hbs @@ -27,36 +27,35 @@ class="alert alert-danger hidden" role="alert"> -
- - -
- - -
-
-
+ + {{#zone "bottomJs"}} {{js "js/platform-configuration.js"}} {{/zone}} diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.js b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.js similarity index 100% rename from components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.js rename to components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/configuration.js diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/public/js/platform-configuration.js b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/public/js/platform-configuration.js index b2f6a8fd5..56e1e2dc5 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/public/js/platform-configuration.js +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration/public/js/platform-configuration.js @@ -103,3 +103,30 @@ var addConfiguration = function () { } ); }; + +function artifactUpload() { + var contentType = "application/json"; + var backendEndBasePath = "/api/device-mgt/v1.0"; + var urix = backendEndBasePath + "/admin/devicetype/deploy/arduino"; + var defaultStatusClasses = "fw fw-stack-1x"; + var content = $("#arduino-statistic-response-template").find(".content"); + var title = content.find("#title"); + var statusIcon = content.find("#status-icon"); + var data = {} + invokerUtil.post(urix, data, function (data) { + title.html("Deploying statistic artifacts. Please wait..."); + statusIcon.attr("class", defaultStatusClasses + " fw-check"); + $(modalPopupContent).html(content.html()); + showPopup(); + setTimeout(function () { + hidePopup(); + location.reload(true); + }, 5000); + + }, function (jqXHR) { + title.html("Failed to deploy artifacts, Please contact administrator."); + statusIcon.attr("class", defaultStatusClasses + " fw-error"); + $(modalPopupContent).html(content.html()); + showPopup(); + }, contentType); +} \ No newline at end of file diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/public/js/download.js b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/public/js/download.js index 311d058d9..09436267e 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/public/js/download.js +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/public/js/download.js @@ -184,30 +184,3 @@ function doAction(data) { }); } } - -function artifactUpload() { - var contentType = "application/json"; - - var urix = backendEndBasePath + "/admin/devicetype/deploy/arduino"; - var defaultStatusClasses = "fw fw-stack-1x"; - var content = $("#arduino-statistic-response-template").find(".content"); - var title = content.find("#title"); - var statusIcon = content.find("#status-icon"); - var data = {} - invokerUtil.post(urix, data, function (data) { - title.html("Deploying statistic artifacts. Please wait..."); - statusIcon.attr("class", defaultStatusClasses + " fw-check"); - $(modalPopupContent).html(content.html()); - showPopup(); - setTimeout(function () { - hidePopup(); - location.reload(true); - }, 5000); - - }, function (jqXHR) { - title.html("Failed to deploy artifacts, Please contact administrator."); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - $(modalPopupContent).html(content.html()); - showPopup(); - }, contentType); -} \ No newline at end of file diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.hbs b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.hbs index 145b3ec63..23e65b173 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.hbs +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.hbs @@ -66,11 +66,6 @@ Download Sketch - {{#if permissions.IS_ADMIN}} - Deploy Analytics Artifacts - {{/if}} - diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.hbs b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.hbs index 8fc564c75..ef5652037 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.hbs +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.hbs @@ -27,43 +27,32 @@ class="alert alert-danger hidden" role="alert"> -
- - -
- - - -
- - -
-
- + +
+ + + + diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.js b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.js similarity index 96% rename from components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.js rename to components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.js index e1ef259f2..74111c244 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view/type-view.js +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/configuration.js @@ -16,7 +16,7 @@ * under the License. */ -function onRequest(context) { +function onRequest(context){ var viewModel = {}; var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; viewModel["permissions"] = userModule.getUIPermissions(); diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/public/js/platform-configuration.js b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/public/js/platform-configuration.js index c82bba71b..18c09d023 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/public/js/platform-configuration.js +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration/public/js/platform-configuration.js @@ -113,3 +113,30 @@ var addConfiguration = function () { } ); }; + +function artifactUpload() { + var contentType = "application/json"; + var backendEndBasePath = "/api/device-mgt/v1.0"; + var urix = backendEndBasePath + "/admin/devicetype/deploy/raspberrypi"; + var defaultStatusClasses = "fw fw-stack-1x"; + var content = $("#raspberrypi-statistic-response-template").find(".content"); + var title = content.find("#title"); + var statusIcon = content.find("#status-icon"); + var data = {} + invokerUtil.post(urix, data, function (data) { + title.html("Deploying statistic artifacts. Please wait..."); + statusIcon.attr("class", defaultStatusClasses + " fw-check"); + $(modalPopupContent).html(content.html()); + showPopup(); + setTimeout(function () { + hidePopup(); + location.reload(true); + }, 5000); + + }, function (jqXHR) { + title.html("Failed to deploy artifacts, Please contact administrator."); + statusIcon.attr("class", defaultStatusClasses + " fw-error"); + $(modalPopupContent).html(content.html()); + showPopup(); + }, contentType); +} diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/public/js/download.js b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/public/js/download.js index abd0a49f5..aced9b532 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/public/js/download.js +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/public/js/download.js @@ -182,31 +182,4 @@ function doAction(data) { hidePopup(); }); } -} - -function artifactUpload() { - var contentType = "application/json"; - - var urix = backendEndBasePath + "/admin/devicetype/deploy/raspberrypi"; - var defaultStatusClasses = "fw fw-stack-1x"; - var content = $("#raspberrypi-statistic-response-template").find(".content"); - var title = content.find("#title"); - var statusIcon = content.find("#status-icon"); - var data = {} - invokerUtil.post(urix, data, function (data) { - title.html("Deploying statistic artifacts. Please wait..."); - statusIcon.attr("class", defaultStatusClasses + " fw-check"); - $(modalPopupContent).html(content.html()); - showPopup(); - setTimeout(function () { - hidePopup(); - location.reload(true); - }, 5000); - - }, function (jqXHR) { - title.html("Failed to deploy artifacts, Please contact administrator."); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - $(modalPopupContent).html(content.html()); - showPopup(); - }, contentType); } \ No newline at end of file diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.hbs b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.hbs index 5fce7ec85..26cf66470 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.hbs +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view/type-view.hbs @@ -61,9 +61,6 @@ Download Agent - {{#if permissions.IS_ADMIN}} - Deploy Analytics Artifacts - {{/if}}
- - -
- - - -
- - -
-
- + +
+ + + + diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.js new file mode 100644 index 000000000..74111c244 --- /dev/null +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.js @@ -0,0 +1,24 @@ +/* + * 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 viewModel = {}; + var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; + viewModel["permissions"] = userModule.getUIPermissions(); + return viewModel; +} \ No newline at end of file diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js index 19f1c9ff3..fcb345809 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js @@ -103,3 +103,30 @@ var addConfiguration = function () { } ); }; + +function artifactUpload() { + var contentType = "application/json"; + var backendEndBasePath = "/api/device-mgt/v1.0"; + var urix = backendEndBasePath + "/admin/devicetype/deploy/virtual_firealarm"; + var defaultStatusClasses = "fw fw-stack-1x"; + var content = $("#virtual-firealarm-statistic-response-template").find(".content"); + var title = content.find("#title"); + var statusIcon = content.find("#status-icon"); + var data = {} + invokerUtil.post(urix, data, function (data) { + title.html("Deploying statistic artifacts. Please wait..."); + statusIcon.attr("class", defaultStatusClasses + " fw-check"); + $(modalPopupContent).html(content.html()); + showPopup(); + setTimeout(function () { + hidePopup(); + location.reload(true); + }, 5000); + + }, function (jqXHR) { + title.html("Failed to deploy artifacts, Please contact administrator."); + statusIcon.attr("class", defaultStatusClasses + " fw-error"); + $(modalPopupContent).html(content.html()); + showPopup(); + }, contentType); +} diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js index a667ef4cc..d4ceb751f 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js @@ -134,31 +134,4 @@ function doAction(data) { hideAgentDownloadPopup(); }); } -} - -function artifactUpload() { - var contentType = "application/json"; - - var urix = backendEndBasePath + "/admin/devicetype/deploy/virtual_firealarm"; - var defaultStatusClasses = "fw fw-stack-1x"; - var content = $("#virtualfirealarm-statistic-response-template").find(".content"); - var title = content.find("#title"); - var statusIcon = content.find("#status-icon"); - var data = {} - invokerUtil.post(urix, data, function (data) { - title.html("Deploying statistic artifacts. Please wait..."); - statusIcon.attr("class", defaultStatusClasses + " fw-check"); - $(modalPopupContent).html(content.html()); - showPopup(); - setTimeout(function () { - hidePopup(); - location.reload(true); - }, 5000); - - }, function (jqXHR) { - title.html("Failed to deploy artifacts, Please contact administrator."); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - $(modalPopupContent).html(content.html()); - showPopup(); - }, contentType); } \ No newline at end of file diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs index 6be6d141b..f34aa0d6f 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs @@ -54,9 +54,6 @@ Download Agent - {{#if permissions.IS_ADMIN}} - Deploy Analytics Artifacts - {{/if}}