From 59df602f6bdbf6f3b9cf79b5aadb8ed34725ce66 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Sun, 26 Jul 2015 09:21:34 +0530 Subject: [PATCH] adding policy creation --- .../jaggeryapps/iotserver/modules/device.js | 1 + .../jaggeryapps/iotserver/modules/policy.js | 4 + .../units/policy-create/policy-create.hbs | 191 +- .../policy-create/public/css/codemirror.css | 344 + .../public/images/RaspberryPi.png | Bin 0 -> 8006 bytes .../policy-create/public/images/android.png | Bin 0 -> 6472 bytes .../public/images/arduino-thumb.png | Bin 0 -> 9862 bytes .../public/images/banner-img-3.png | Bin 0 -> 17519 bytes .../public/images/beagleBone.png | Bin 0 -> 10433 bytes .../public/images/digitaldisplay-thumb.png | Bin 0 -> 8161 bytes .../public/images/firealarm-thumb.png | Bin 0 -> 10339 bytes .../policy-create/public/images/intel.png | Bin 0 -> 5068 bytes .../units/policy-create/public/images/ios.png | Bin 0 -> 3963 bytes .../public/images/sensebot-thumb.png | Bin 0 -> 15059 bytes .../policy-create/public/images/windows.png | Bin 0 -> 1696 bytes .../policy-create/public/js/codemirror.js | 8722 +++++++++++++++++ .../policy-create/public/js/policy-create.js | 54 +- .../units/policy-create/public/js/sql.js | 312 + .../policy-create/public/js/store-listing.js | 74 + .../public/templates/store-listing.hbs | 19 + .../store-listing/public/js/store-listing.js | 1 + 21 files changed, 9562 insertions(+), 160 deletions(-) create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/css/codemirror.css create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/RaspberryPi.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/android.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/arduino-thumb.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/banner-img-3.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/beagleBone.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/digitaldisplay-thumb.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/firealarm-thumb.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/intel.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/ios.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/sensebot-thumb.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/images/windows.png create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/js/codemirror.js create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/js/sql.js create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/js/store-listing.js create mode 100644 modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/public/templates/store-listing.hbs diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js index 935d4071..845c2ea2 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/device.js @@ -147,6 +147,7 @@ deviceModule = function () { if (deviceUnit.isExists()) { deviceTypeObject = {}; deviceTypeObject["name"] = deviceType.getName(); + deviceTypeObject["id"] = deviceType.getId(); var storeProperties = privateMethods.getStoreDefinition(deviceType.getName()); if (storeProperties) { deviceTypeObject["storeTitle"] = storeProperties.title; diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/policy.js b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/policy.js index 0e7d3f1e..c7501239 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/modules/policy.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/modules/policy.js @@ -26,6 +26,10 @@ policyModule = function () { var publicMethods = {}; var privateMethods = {}; + publicMethods.addPolicy = function (name, deviceType, policyDefinition) { + + }; + publicMethods.getPolicies = function () { //TODO-This method returns includes dummy policy data diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/policy-create.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/policy-create.hbs index f6a93084..b7fb40b0 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/policy-create.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/policy-create/policy-create.hbs @@ -1,21 +1,63 @@ + {{#zone "main"}} + + + + + + + + + +
@@ -75,7 +117,7 @@
-