Convert add group option to separate page.

application-manager-new
charithag 9 years ago
parent b404c29a98
commit 25e27cc6ca

@ -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}}

@ -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}}

@ -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}}

@ -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}}

@ -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}}

@ -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}}

@ -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}}

@ -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}}

@ -1,8 +0,0 @@
{{layout "fluid"}}
{{#zone "title"}}
WSO2 DC | Windows
{{/zone}}
{{#zone "body"}}
{{unit "appbar" link="store" title="STORE"}}
{{unit "windows"}}
{{/zone}}

@ -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}}

@ -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

@ -314,47 +314,6 @@
</div>
</div>
<div id="add-group-modal-content" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>Please enter name and description for new group</h3>
<br/>
<div>
<input id="add-group-name" style="color:#3f3f3f;padding:5px" type="text" value=""
placeholder="Group Name" size="60">
</div>
<br/>
<div>
<input id="add-group-description" style="color:#3f3f3f;padding:5px" type="text" value=""
placeholder="Group Description" size="60">
</div>
<div class="buttons">
<a href="#" id="add-group-yes-link" class="btn-operations">
&nbsp;&nbsp;&nbsp;&nbsp;Add Group&nbsp;&nbsp;&nbsp;&nbsp;
</a>
&nbsp;&nbsp;
<a href="#" id="add-group-cancel-link" class="btn-operations">
&nbsp;&nbsp;&nbsp;&nbsp;Cancel&nbsp;&nbsp;&nbsp;&nbsp;
</a>
</div>
</div>
</div>
</div>
</div>
<div id="add-group-200-content" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>Group successfully added.</h3>
</div>
</div>
</div>
</div>
<div id="edit-group-modal-content" class="hide">
<div class="content">
<div class="row">

@ -0,0 +1,35 @@
{{#zone "main"}}
<div class="container col-md-12 col-lg-6 col-centered wr-content wr-login col-centered sign-panel">
<p class="page-sub-title">Add New Group</p>
<p>Create new device group on IoT Server</p>
<!-- validation -->
<span class="wr-validation-summary hidden center-block col-centered">
<strong class="label label-danger col-centered"></strong>
</span>
<hr />
<form method="GET" class="form-login-box" action="/iotserver/groups">
<label class="wr-input-label">Group Name</label>
<div class="wr-input-control">
<input type="text right" id="name" placeholder="Group Name">
</div>
<label class="wr-input-label">Description</label>
<div class="wr-input-control">
<input type="text right" id="description" placeholder="Description">
</div>
<div class="wr-input-control">
<button class="wr-btn" id="add-group-btn">&nbsp;&nbsp;&nbsp;&nbsp;Add&nbsp;&nbsp;&nbsp;&nbsp;</button>
<button class="wr-btn" onclick="javascript:history.go(-1)">&nbsp;&nbsp;&nbsp;&nbsp;Cancel&nbsp;&nbsp;&nbsp;&nbsp;</button>
</div>
</form>
</div>
{{/zone}}
{{#zone "bottomLibJs"}}
<script src="{{self.publicURL}}/js/group-add.js"></script>
{{/zone}}

@ -0,0 +1,4 @@
function onRequest(context){
context.registerPath = "api/user/register";
return context;
}

@ -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;
}
);
}
});
});

@ -112,47 +112,6 @@
</div>
</div>
<div id="add-group-modal-content" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>Please enter name and description for new group</h3>
<br/>
<div>
<input id="add-group-name" style="color:#3f3f3f;padding:5px" type="text" value=""
placeholder="Group Name" size="60">
</div>
<br/>
<div>
<input id="add-group-description" style="color:#3f3f3f;padding:5px" type="text" value=""
placeholder="Group Description" size="60">
</div>
<div class="buttons">
<a href="#" id="add-group-yes-link" class="btn-operations">
&nbsp;&nbsp;&nbsp;&nbsp;Add Group&nbsp;&nbsp;&nbsp;&nbsp;
</a>
&nbsp;&nbsp;
<a href="#" id="add-group-cancel-link" class="btn-operations">
&nbsp;&nbsp;&nbsp;&nbsp;Cancel&nbsp;&nbsp;&nbsp;&nbsp;
</a>
</div>
</div>
</div>
</div>
</div>
<div id="add-group-200-content" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>Group successfully added.</h3>
</div>
</div>
</div>
</div>
<div id="edit-group-modal-content" class="hide">
<div class="content">
<div class="row">

@ -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.
*/

@ -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;

@ -1,4 +0,0 @@
{
"title" : "Windows",
"description":"Connect Your Windows mobile into the WSO2 IoT Server"
}

@ -1,90 +0,0 @@
{{#zone "main"}}
<div class="container container-bg white-bg">
<div class=" margin-top-double">
<div class="row row padding-top-double padding-bottom-double margin-bottom-double">
<div class="col-lg-12 margin-top-double">
<h1 class="grey ">Windows</h1>
<hr>
<p class="margin-bottom-double light-grey ">Connect your Windows Mobile
to the WSO2 IoT server. </p>
</div>
</div>
<div class="row margin-bottom-double">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 padding-top">
<img src="{{self.publicURL}}/images/windows.png" class="img-responsive">
</div>
<div class="col-xs-12 col-sm-6 col-md-8 col-lg-8 padding-top">
<h2 class="uppercase">Ingredients</h2>
<hr>
<p class="grey margin-top">Hardware Requirements </p>
<br><br>
<span class="fw-stack fw-lg margin-right">
<i class="fw fw-ring fw-stack-2x"> </i>
<i class="fw fw-right-arrow fw-stack-1x"></i>
</span>Arduino Uno<br><br>
<span class="fw-stack fw-lg margin-right">
<i class="fw fw-ring fw-stack-2x"> </i>
<i class="fw fw-right-arrow fw-stack-1x"></i>
</span>Arduino Ethernet / WiFi Shield
<br /><br />
<form method="POST" class="float-left margin-right"
action="{{sketchPath}}">
<input type="hidden" name="deviceType" value="sensebot" />
<input type="hidden" name="sketchType" value="sensebot_wifi" />
<button class="wr-btn" type="submit">Create Sketch for
Wifi
</button>
</form>
<form method="POST" class="form-login-box float-left"
action="{{sketchPath}}">
<input type="hidden" name="deviceType" value="sensebot" />
<input type="hidden" name="sketchType" value="sensebot" />
<button class="wr-btn margin-right" type="submit">Create
Sketch
for Ethernet</button>
</form>
<br/>
</div>
<div class ="col-xs-12 col-sm-6 col-md-3 col-lg-12 padding-double grey-bg ">
<h2 class="uppercase">Prepare</h2><hr>
<p class="grey margin-top">Get your device ready </p>
<div class="margin-doubles padding-top-double light-grey margin-left-double margin-bottom ">
<span class="circle">01 </span> <span class="padding-left"> Mount the Ethernet / Wifi shield on the Arduino Uno device.</span>
</div>
<div class="margin-doubles padding-top-double light-grey margin-left-double margin-bottom">
<span class="circle">02 </span> <span class="padding-left"> Mount the Ethernet / Wifi shield on the Arduino Uno device.</span>
</div>
<div class="margin-doubles padding-top-double margin-bottom-double light-grey margin-left-double margin-bottom">
<span class="circle">03 </span> <span class="padding-left"> Mount the Ethernet / Wifi shield on the Arduino Uno device.</span>
</div>
</div>
</div>
<div class="row row padding-top-double padding-bottom-double margin-bottom-double ">
<div class="col-lg-12 margin-top-double">
<h2 class="uppercase ">Connect (Quickstart)</h2>
<hr>
<p class="margin-bottom-double light-grey ">Internet of Things Foundation Quickstart connection </p>
<div class="margin-doubles padding-top-double light-grey margin-left-double margin-bottom ">
<span class="circle">01 </span> <span class="padding-left">Use the following command to download the installer from GitHub:</span><br>
</div>
<div class="margin-doubles padding-top-double light-grey margin-left-double margin-bottom ">
<span class="circle">02 </span> <span class="padding-left">Download the Sketch installer from the Arduino website <a href="http://arduino.cc/en/Main/Software">http://arduino.cc/en/Main/Software</a></span><br>
</div>
<div class="margin-doubles padding-top-double light-grey margin-left-double margin-bottom ">
<span class="circle">03 </span> <span class="padding-left"> Install the Sketch program</span><br>
</div>
<div class="margin-doubles padding-top-double light-grey margin-left-double margin-bottom ">
<span class="circle">04 </span> <span class="padding-left">Use the Sketch program to open the samples code: <a href="http://tinyurl.com/EUHackathonRobot">http://tinyurl.com/EUHackathonRobot</a> </span><br>
</div>
<div class="margin-doubles padding-top-double light-grey margin-left-double margin-bottom ">
<span class="circle">05 </span> <span class="padding-left">View the lower part of the Sketch pad window to check that the COM connection is shown as active</span><br>
</div>
</div>
</div>
</div>
{{/zone}}
{{#zone "topCss"}}
<link href="{{self.publicURL}}/css/fontwso2.css" rel="stylesheet">
<link href="{{self.publicURL}}/css/fontwso2-extend.css" rel="stylesheet">
{{/zone}}

@ -1,4 +0,0 @@
function onRequest(context){
context.sketchPath = "../api/device/sketch/download";
return context;
}
Loading…
Cancel
Save