diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/add-device.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/add-device.hbs index 8586a439..6461dac9 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/add-device.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/add-device.hbs @@ -1,9 +1,9 @@ {{authorized}} {{layout "fluid"}} {{#zone "title"}} - WSO2 MDM | Device Management + WSO2 IoT Server | Device Management {{/zone}} {{#zone "body"}} - {{unit "appbar" link="device-store" title="Device Store"}} + {{unit "appbar" title="Add Device" enableBack="true"}} {{unit "store-listing"}} {{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/android.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/android.hbs index 0a7b07f9..6cef790b 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/android.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/android.hbs @@ -1,8 +1,8 @@ {{layout "fluid"}} {{#zone "title"}} - WSO2 DC | Android + WSO2 IoT Server | Android {{/zone}} {{#zone "body"}} - {{unit "appbar" link="store" title="STORE"}} + {{unit "appbar" link="dashboard" enableBack="true" title="Android"}} {{unit "android"}} {{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/android_sense.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/android_sense.hbs index b8b0b319..5ebcecac 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/android_sense.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/android_sense.hbs @@ -1,8 +1,8 @@ {{layout "fluid"}} {{#zone "title"}} - WSO2 DC | Android Sense + WSO2 IoT Server | Android Sense {{/zone}} {{#zone "body"}} - {{unit "appbar" link="store" title="STORE"}} + {{unit "appbar" link="dashboard" enableBack="true" title="Android Sense"}} {{unit "android_sense"}} {{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/arduino.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/arduino.hbs index afbe5b13..17accb6b 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/arduino.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/arduino.hbs @@ -1,8 +1,8 @@ {{layout "fluid"}} {{#zone "title"}} - WSO2 DC | Arduino + WSO2 IoT Server | Arduino {{/zone}} {{#zone "body"}} - {{unit "appbar" link="store" title="STORE"}} + {{unit "appbar" link="dashboard" enableBack="true" title="Arduino"}} {{unit "arduino"}} {{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/digital_display.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/digital_display.hbs index 89d1b6d6..ad2aded8 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/digital_display.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/digital_display.hbs @@ -1,8 +1,8 @@ {{layout "fluid"}} {{#zone "title"}} - WSO2 DC | FireAlarm + WSO2 IoT Server | Digital Display {{/zone}} {{#zone "body"}} - {{unit "appbar" link="store" title="STORE"}} + {{unit "appbar" link="dashboard" enableBack="true" title="Digital Display"}} {{unit "digital_display"}} {{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/firealarm.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/firealarm.hbs index 8330160f..62e96fee 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/firealarm.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/firealarm.hbs @@ -1,8 +1,8 @@ {{layout "fluid"}} {{#zone "title"}} - WSO2 DC | FireAlarm + WSO2 IoT Server | FireAlarm {{/zone}} {{#zone "body"}} - {{unit "appbar" link="store" title="STORE"}} + {{unit "appbar" link="dashboard" enableBack="true" title="FireAlarm"}} {{unit "firealarm"}} {{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/raspberrypi.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/raspberrypi.hbs index 11e7f64b..fddafa72 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/raspberrypi.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/raspberrypi.hbs @@ -1,8 +1,8 @@ {{layout "fluid"}} {{#zone "title"}} - WSO2 DC | FireAlarm + WSO2 IoT Server | Raspberry Pi {{/zone}} {{#zone "body"}} - {{unit "appbar" link="store" title="STORE"}} + {{unit "appbar" link="dashboard" enableBack="true" title="Raspberry Pi"}} {{unit "raspberrypi"}} {{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/sensebot.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/sensebot.hbs index a1b5049d..ab307ed1 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/sensebot.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/sensebot.hbs @@ -1,8 +1,8 @@ {{layout "fluid"}} {{#zone "title"}} - WSO2 DC | FireAlarm + WSO2 IoT Server | Sensebot {{/zone}} {{#zone "body"}} - {{unit "appbar" link="store" title="STORE"}} + {{unit "appbar" link="dashboard" enableBack="true" title="Sensebot"}} {{unit "sensebot"}} {{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/windows.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/windows.hbs deleted file mode 100644 index 8b87456d..00000000 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/devices/windows.hbs +++ /dev/null @@ -1,8 +0,0 @@ -{{layout "fluid"}} -{{#zone "title"}} - WSO2 DC | Windows -{{/zone}} -{{#zone "body"}} - {{unit "appbar" link="store" title="STORE"}} - {{unit "windows"}} -{{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/groups/add-group.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/groups/add-group.hbs new file mode 100644 index 00000000..9fdaf7a3 --- /dev/null +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/groups/add-group.hbs @@ -0,0 +1,9 @@ +{{authorized}} +{{layout "fluid"}} +{{#zone "title"}} + WSO2 IoT Server | Group Management +{{/zone}} +{{#zone "body"}} + {{unit "appbar" title="Add Group" enableBack="true"}} + {{unit "group-add"}} +{{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/pages/groups.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/pages/groups/index.hbs similarity index 100% rename from modules/distribution/src/repository/jaggeryapps/iotserver/pages/groups.hbs rename to modules/distribution/src/repository/jaggeryapps/iotserver/pages/groups/index.hbs diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/appbar/appbar.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/appbar/appbar.js index e1a7f8d8..3bc3d7f6 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/appbar/appbar.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/appbar/appbar.js @@ -90,19 +90,17 @@ function onRequest(context) { icon: "fw-add", url: "/iotserver/devices/add-device" }); + } + if (permissions.ADD_DEVICE) { links["device-mgt"].push({ title: "Add Group", icon: "fw-add", - url: "#", - class: "add-group-link" + url: "/iotserver/groups/add-group" }); - } - if (permissions.ADD_DEVICE) { links["group-mgt"].push({ title: "Add Group", icon: "fw-add", - url: "#", - class: "add-group-link" + url: "/iotserver/groups/add-group" }); } }// end-if-user diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/device-listing.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/device-listing.hbs index 52a4c2c5..d4ee9d87 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/device-listing.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/device-listing.hbs @@ -314,47 +314,6 @@ -
-
-
-
-

Please enter name and description for new group

-
- -
- -
-
- -
- -
- -
-
-
-
- -
-
-
-
-

Group successfully added.

-
-
-
-
-
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/group-add.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/group-add.hbs new file mode 100644 index 00000000..620a9a50 --- /dev/null +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/group-add.hbs @@ -0,0 +1,35 @@ +{{#zone "main"}} + +{{/zone}} +{{#zone "bottomLibJs"}} + +{{/zone}} diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/group-add.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/group-add.js new file mode 100644 index 00000000..10097811 --- /dev/null +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/group-add.js @@ -0,0 +1,4 @@ +function onRequest(context){ + context.registerPath = "api/user/register"; + return context; +} diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/group-add.json b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/group-add.json new file mode 100644 index 00000000..0e0dcd23 --- /dev/null +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/group-add.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/public/js/group-add.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/public/js/group-add.js new file mode 100644 index 00000000..527c83dd --- /dev/null +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-add/public/js/group-add.js @@ -0,0 +1,58 @@ +$(function () { + $("button#add-group-btn").click(function () { + + var name = $("input#name").val(); + var description = $("input#description").val(); + + if (!name) { + $('.wr-validation-summary strong').text("Group Name is a required field. It cannot be empty."); + $('.wr-validation-summary').removeClass("hidden"); + return false; + } else { + + var addGroupAPI = "/iotserver/api/group/add"; + + var group = {"name": name, "description": description}; + invokerUtil.post( + addGroupAPI, + group, + function (data, txtStatus, jqxhr) { + var status = jqxhr.status; + if (status == 200) { + if (data != "false") { + $('.wr-validation-summary strong').text("Group created. You will be redirected to groups"); + $('.wr-validation-summary').removeClass("hidden"); + $('.wr-validation-summary strong').removeClass("label-danger"); + $('.wr-validation-summary strong').addClass("label-success"); + setTimeout(function () { + history.go(-1); + }, 1500); + } else { + $('.wr-validation-summary strong').text("Exception at backend."); + $('.wr-validation-summary strong').removeClass("label-danger"); + $('.wr-validation-summary strong').addClass("label-warning"); + } + } else if (status == 400) { + $('.wr-validation-summary strong').text("Exception at backend."); + $('.wr-validation-summary strong').removeClass("label-danger"); + $('.wr-validation-summary strong').addClass("label-warning"); + } else if (status == 403) { + $('.wr-validation-summary strong').text("Action not permitted."); + } else if (status == 409) { + $('.wr-validation-summary strong').text("Group exists."); + $('.wr-validation-summary strong').removeClass("label-default"); + $('.wr-validation-summary strong').addClass("label-success"); + } + }, function () { + $('.wr-validation-summary strong').text("An unexpected error occurred."); + $('.wr-validation-summary').removeClass("hidden"); + return false; + } + ); + + } + }); +}); + + + diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/group-listing.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/group-listing.hbs index 92c46f88..c1d642b7 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/group-listing.hbs +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/group-listing.hbs @@ -112,47 +112,6 @@
-
-
-
-
-

Please enter name and description for new group

-
- -
- -
-
- -
- -
- -
-
-
-
- -
-
-
-
-

Group successfully added.

-
-
-
-
-
diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/js/group-listing.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/js/group-listing.js index 24be4bce..af23137c 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/js/group-listing.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/js/group-listing.js @@ -68,10 +68,6 @@ $(document).ready(function () { loadGroups(); changeGroupView('grid', $('a.ctrl-filter-grid')); - var path = window.location.pathname; - if (path == '/iotserver/groups/add-group'){ - addNewGroup(); - } }); /* @@ -234,68 +230,6 @@ var errorHandler = function () { }); }; -function attachGroupAdding() { - /** - * Following click function would execute - * when a user clicks on "Remove" link - * on Group Management page in WSO2 IoT Server Console. - */ - $("a.add-group-link").click(addNewGroup); -} - -var addNewGroup = function () { - var addGroupApi = "/iotserver/api/group/add"; - $(modalPopupContent).html($('#add-group-modal-content').html()); - showPopup(); - - $("a#add-group-yes-link").click(function () { - var newGroupName = $('#add-group-name').val(); - var newGroupDescription = $('#add-group-description').val(); - var group = {"name": newGroupName, "description": newGroupDescription}; - invokerUtil.post( - addGroupApi, - group, - function (data, txtStatus, jqxhr) { - var status = jqxhr.status; - if (status == 200) { - if (data != "false") { - $(modalPopupContent).html($('#add-group-200-content').html()); - loadGroups(); - setTimeout(function () { - hidePopup(); - }, 2000); - } else { - $(modalPopupContent).html($('#group-400-content').html()); - $("a#group-400-link").click(function () { - hidePopup(); - }); - } - } else if (status == 400) { - $(modalPopupContent).html($('#group-400-content').html()); - $("a#group-400-link").click(function () { - hidePopup(); - }); - } else if (status == 403) { - $(modalPopupContent).html($('#agroup-403-content').html()); - $("a#group-403-link").click(function () { - hidePopup(); - }); - } else if (status == 409) { - $(modalPopupContent).html($('#group-409-content').html()); - $("a#group-409-link").click(function () { - hidePopup(); - }); - } - }, errorHandler - ); - }); - - $("a#add-group-cancel-link").click(function () { - hidePopup(); - }); - -} - /** * Following functions should be triggered after AJAX request is made. */ diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/theme/public/css/font-wso2.css b/modules/distribution/src/repository/jaggeryapps/iotserver/units/theme/public/css/font-wso2.css index 7f63df98..ce1f2b71 100755 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/theme/public/css/font-wso2.css +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/theme/public/css/font-wso2.css @@ -34,7 +34,7 @@ .fw-lg { font-size: 1.33333333em; line-height: 0.75em; - vertical-align: -15%; + vertical-align: 25%; } .fw-2x { font-size: 2em; diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/public/images/windows-thumb.png b/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/public/images/windows-thumb.png deleted file mode 100644 index 3b668256..00000000 Binary files a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/public/images/windows-thumb.png and /dev/null differ diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/public/images/windows.png b/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/public/images/windows.png deleted file mode 100644 index 3b668256..00000000 Binary files a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/public/images/windows.png and /dev/null differ diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/public/store.json b/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/public/store.json deleted file mode 100644 index a3256aa5..00000000 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/public/store.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "title" : "Windows", - "description":"Connect Your Windows mobile into the WSO2 IoT Server" -} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/windows.hbs b/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/windows.hbs deleted file mode 100644 index 51966cb3..00000000 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/windows.hbs +++ /dev/null @@ -1,90 +0,0 @@ -{{#zone "main"}} -
-
-
-
-

Windows

-
-

Connect your Windows Mobile - to the WSO2 IoT server.

-
-
-
-
- -
-
-

Ingredients

-
-

Hardware Requirements

-

- - - - Arduino Uno

- - - - Arduino Ethernet / WiFi Shield -

-
- - - -
- -
- -
-
-

Prepare


-

Get your device ready

-
- 01 Mount the Ethernet / Wifi shield on the Arduino Uno device. -
-
- 02 Mount the Ethernet / Wifi shield on the Arduino Uno device. -
-
- 03 Mount the Ethernet / Wifi shield on the Arduino Uno device. -
-
-
-
-
-

Connect (Quickstart)

-
-

Internet of Things Foundation Quickstart connection

-
- 01 Use the following command to download the installer from GitHub:
-
-
- 02 Download the Sketch installer from the Arduino website http://arduino.cc/en/Main/Software
-
-
- 03 Install the Sketch program
-
-
- 04 Use the Sketch program to open the samples code: http://tinyurl.com/EUHackathonRobot
-
-
- 05 View the lower part of the Sketch pad window to check that the COM connection is shown as active
-
-
-
-
-{{/zone}} -{{#zone "topCss"}} - - -{{/zone}} \ No newline at end of file diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/windows.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/windows.js deleted file mode 100644 index 68606eea..00000000 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/windows.js +++ /dev/null @@ -1,4 +0,0 @@ -function onRequest(context){ - context.sketchPath = "../api/device/sketch/download"; - return context; -} diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/windows.json b/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/windows.json deleted file mode 100644 index 3dbff381..00000000 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/windows/windows.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "predicate": "false" -} \ No newline at end of file