Merge branch 'release-2.0.x' of https://github.com/wso2/carbon-device-mgt into release-2.0.x

4.x.x
geethkokila 8 years ago
commit fbfbed7060

@ -525,7 +525,7 @@ var userModule = function () {
if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/policies/list")) { if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/policies/list")) {
permissions["LIST_POLICIES"] = true; permissions["LIST_POLICIES"] = true;
} }
if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/add")) { if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/enroll")) {
permissions["ADD_DEVICE"] = true; permissions["ADD_DEVICE"] = true;
} }
if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/add")) { if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/add")) {

@ -73,11 +73,6 @@
{{/zone}} {{/zone}}
{{#zone "content"}} {{#zone "content"}}
<div class="row wr-device-board" style="margin-top: -10px;">
<div class="col-lg-12 wr-secondary-bar">
<span class="page-sub-title">{{title}}</span>
</div>
</div>
<div class="wr-device-list row"> <div class="wr-device-list row">
<div class="wr-hidden-operations wr-advance-operations"></div> <div class="wr-hidden-operations wr-advance-operations"></div>
<div class="col-md-12 wr-page-content"> <div class="col-md-12 wr-page-content">
@ -157,34 +152,41 @@
{{else}} {{else}}
<div id="ast-container" class="ast-container list-view"> <div id="ast-container" class="ast-container list-view">
<div class="ctrl-info-panel col-centered text-center wr-login"> <div class="ctrl-info-panel col-centered text-center wr-login">
<h2>You don't have any device <h3 class="text-muted">
<i class="fw fw-devices fw-3x"></i>
</h3>
<h3 class="text-muted">
You don't have any device
{{#if groupName}} {{#if groupName}}
assigned to this group assigned to this group
{{else}} {{else}}
registered enrolled
{{/if}} {{/if}}
at the moment.</h2> at the moment.
<br /> </h3>
<h3>
<p class="text-center">
{{#if groupName}} {{#if groupName}}
<a href="{{@app.context}}/devices" class="wr-btn"> <!--suppress HtmlUnknownTarget -->
<span class="fw-stack"> <a href="{{@app.context}}/devices" class="btn-operations btn-default">
<i class="fw fw-ring fw-stack-2x"></i> <span class="fw-stack">
<i class="fw fw-add fw-stack-1x"></i> <i class="fw fw-ring fw-stack-2x"></i>
</span> <i class="fw fw-add fw-stack-1x"></i>
</span>
Assign from My Devices Assign from My Devices
</a> </a>
{{else}} {{else}}
<a href="{{@app.context}}/device/enroll" class="wr-btn"> {{#if permissions.enroll}}
<span class="fw-stack"> <!--suppress HtmlUnknownTarget -->
<i class="fw fw-ring fw-stack-2x"></i> <a href="{{@app.context}}/device/enroll" class="btn-operations btn-default">
<i class="fw fw-add fw-stack-1x"></i> <span class="fw-stack">
</span> <i class="fw fw-ring fw-stack-2x"></i>
Enroll New Device <i class="fw fw-add fw-stack-1x"></i>
</a> </span>
Enroll New Device
</a>
{{/if}}
{{/if}} {{/if}}
</p> </h3>
</div> </div>
</div> </div>
{{/if}} {{/if}}

@ -79,18 +79,21 @@
{{else}} {{else}}
<div id="ast-container" class="ast-container list-view"> <div id="ast-container" class="ast-container list-view">
<div class="ctrl-info-panel col-centered text-center wr-login"> <div class="ctrl-info-panel col-centered text-center wr-login">
<h2>You don't have any group registered at the moment.</h2> <h3 class="text-muted">
<br /> <i class="fw fw-grouping fw-3x"></i>
</h3>
<h3 class="text-muted">You don't have any group registered at the moment</h3>
{{#if permissions.ADD_GROUP}} {{#if permissions.ADD_GROUP}}
<p class="text-center"> <h3>
<a href="{{@app.context}}/group/add" class="wr-btn"> <!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/group/add" class="btn-operations btn-default">
<span class="fw-stack"> <span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i> <i class="fw fw-add fw-stack-1x"></i>
</span> </span>
Add New Group Add New Group
</a> </a>
</p> </h3>
{{/if}} {{/if}}
</div> </div>
</div> </div>

@ -151,22 +151,26 @@ $.fn.datatables_extended = function(settings){
} }
function getAdvanceToolBar(){ function getAdvanceToolBar(){
if(table.hasClass('sorting-enabled')){ if (!table.hasClass('no-toolbar')) {
return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' + if (table.hasClass('sorting-enabled')) {
'<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' + return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' +
'<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' + '<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' + '<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' + '<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'<li><button class="btn btn-default" data-toggle="dropdown"><i class="fw fw-sort"></i></button>' + dropdownmenu[0].outerHTML + '</li>' + '<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'</ul>' '<li><button class="btn btn-default" data-toggle="dropdown"><i class="fw fw-sort"></i></button>' + dropdownmenu[0].outerHTML + '</li>' +
'</ul>'
} else {
return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' +
'<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' +
'<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'</ul>'
}
}else{ }else{
return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' + return '';
'<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' + }
'<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'</ul>'
};
} }

@ -15,38 +15,33 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
}} }}
<div class="row wr-device-board">
<div class="col-lg-12 wr-secondary-bar">
<span class="page-sub-title">Device Types</span>
</div>
</div>
<div class="container-fluid"> <div class="container-fluid">
<span id="device-listing-status-msg"></span> <table class="table table-striped table-hover list-table no-operations display responsive nowrap data-table grid-view no-toolbar"
<table class="table table-striped table-hover list-table no-operations display responsive nowrap data-table grid-view" id="device-type-grid">
id="device-grid">
<thead> <thead>
<tr class="sort-row"> <tr class="sort-row">
<th class="no-sort"></th> <th class="no-sort"></th>
<th>By Device Type</th> <th>By Device Type</th>
<th class="no-sort"></th> <th class="no-sort"></th>
</tr> </tr>
<tr class="filter-row filter-box">
<th data-for="By Category" class="select-filter"></th>
<th data-for="By Device Type" class="text-filter"></th>
<th></th>
</tr>
</thead> </thead>
<tbody id="ast-container"> <tbody id="ast-container">
</tbody> </tbody>
</table> </table>
</div> </div>
<br class="c-both"/> <br class="c-both"/>
<div id="content-filter-types" style="display: none">
<div class="sort-title">Sort By</div>
<div class="sort-options">
<a href="#">By Device Type<span class="ico-sort-asc"></span></a>
</div>
</div>
{{#if virtualDeviceTypesList}} {{#if virtualDeviceTypesList}}
<div class="row wr-device-board"> <div class="row wr-device-board">
<div class="col-lg-12 wr-secondary-bar"> <div class="col-lg-12 wr-secondary-bar">
<span class="page-sub-title">Virtual Devices</span> <span class="page-sub-title">Virtual Device Types</span>
</div> </div>
</div> </div>
<h3 style="margin-left: 10px;">Don't have a device?</h3> <h3 style="margin-left: 10px;">Don't have a device?</h3>

@ -141,7 +141,7 @@ function loadDevices(searchType, searchParam){
compileTemplate(viewModel, deviceListingSrc); compileTemplate(viewModel, deviceListingSrc);
} }
} else { } else {
$('#device-grid').addClass('hidden'); $('#device-type-grid').addClass('hidden');
$('#device-listing-status-msg').html( $('#device-listing-status-msg').html(
'<div class="col-centered text-center"><h3 class="text-muted"><i class="fw fw-mobile fw-3x"></i>' + '<div class="col-centered text-center"><h3 class="text-muted"><i class="fw fw-mobile fw-3x"></i>' +
'</h3><h3 class="text-muted">No device type is available to be displayed.</h3>' + '</h3><h3 class="text-muted">No device type is available to be displayed.</h3>' +
@ -167,7 +167,7 @@ function compileTemplate(viewModel, templateSrc){
$("#ast-container").html($("#ast-container").html() + template(viewModel)); $("#ast-container").html($("#ast-container").html() + template(viewModel));
compiledDeviceTypesCount++; compiledDeviceTypesCount++;
if(deviceTypeCount == compiledDeviceTypesCount){ if(deviceTypeCount == compiledDeviceTypesCount){
$('#device-grid').datatables_extended({"bFilter": true, "order": [[ 1, "asc" ]]}); $('#device-type-grid').datatables_extended({"bFilter": false, "order": [[ 1, "asc" ]]});
} }
}); });
} }
@ -194,7 +194,7 @@ function openCollapsedNav(){
*/ */
$(document).ready(function () { $(document).ready(function () {
loadDevices(); loadDevices();
//$('#device-grid').datatables_extended(); //$('#device-type-grid').datatables_extended();
/* Adding selected class for selected devices */ /* Adding selected class for selected devices */
$(deviceCheckbox).each(function () { $(deviceCheckbox).each(function () {

@ -22,14 +22,6 @@
{{/zone}} {{/zone}}
{{#zone "navMenu-items"}} {{#zone "navMenu-items"}}
{{#if permissions.VIEW_DASHBOARD}}
<li>
<a href="{{@app.context}}">
<i class="fw fw-dashboard"></i>
Admin Dashboard
</a>
</li>
{{/if}}
{{#if permissions.LIST_OWN_DEVICES}} {{#if permissions.LIST_OWN_DEVICES}}
<li> <li>
<a href="{{@app.context}}/devices"> <a href="{{@app.context}}/devices">

@ -309,14 +309,34 @@ var responsiveTextRatio = 0.2,
} }
}); });
//Append advance operations to list table toolbar function getAdvanceToolBar() {
$('.dataTable.list-table').closest('.dataTables_wrapper').find('.dataTablesTop .dataTables_toolbar').html('' + if (!table.hasClass('no-toolbar')) {
'<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' + if (table.hasClass('sorting-enabled')) {
'<li><button data-click-event="toggle-selected" class="btn btn-default btn-primary">Select All</li>' + return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' + '<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' + '<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button class="btn btn-default" data-toggle="dropdown"><i class="fw fw-sort"></i></button>'+dropdownmenu[0].outerHTML+'</li>' + '<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'</ul>' '<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'<li><button class="btn btn-default" data-toggle="dropdown"><i class="fw fw-sort"></i></button>' + dropdownmenu[0].outerHTML + '</li>' +
'</ul>'
} else {
return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' +
'<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' +
'<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'</ul>'
}
} else {
return '';
}
}
/**
* append advance operations to list table toolbar
*/
$('.dataTable.list-table').closest('.dataTables_wrapper').find('.dataTablesTop .dataTables_toolbar').html(
getAdvanceToolBar()
); );
//Sorting dropdown menu select function //Sorting dropdown menu select function

@ -0,0 +1,71 @@
#*
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.
*#
<EmailConfig>
<Subject>You have been invited to enroll your devices in WSO2 IoT Server</Subject>
<Body>
<![CDATA[
<html>
<head>
<title>WSO2 IoT Server</title>
</head>
<body style="color: #666666; background-color:#cdcdcd; padding: 0px; margin: 0px;">
<div style="background-color:#cdcdcd; font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; padding: 20px 0px; margin: 0px;">
<div style="width: 86%; max-width: 650px; padding: 2%; background-color: #ffffff; margin: auto; border-radius: 14px;">
<div style="background-color: #49c8f5; line-height: 0px; border-top-left-radius: 10px; border-top-right-radius: 10px; padding: 0px 10px 0px 0px;">
<div style="display: inline-block; line-height: 0px;">
<img src="http://b.content.wso2.com/sites/all/2015-june-theme/navigation/wso2-nav-logo.png"
alt="WSO2" style="margin: 0px 20px 0px 25px; width: 100%; max-width: 251px;"/>
</div>
</div>
<div style="background-color: #ffffff; line-height: 170%; color: #666666; padding: 20px 25px;">
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px 20px;">
Hi $first-name,
</p>
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
You have been invited to enrol devices with WSO2 IoT Server.
Click <a href="$base-url-https/devicemgt/device/enroll">here</a> to enrol the WSO2 IoT Server devices to begin.</p>
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
Should you need assistance, please contact your administrator.
</p>
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 20px 0px 5px;">
Regards,
</p>
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
WSO2 IoT Server Administrator
</p>
</div>
<div style="background-color: #333333; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="padding: 0px 20px 0px 0px;"><img
src="http://b.content.wso2.com/newsletter/images/wso2-logo-cloud-footer.png" alt="WSO2"
style="margin: 15px 0px 15px 25px; width: 100%; max-width: 258px;"/></td>
</tr>
</table>
</div>
</div>
</div>
</body>
</html>
]]>
</Body>
</EmailConfig>

@ -0,0 +1,81 @@
#*
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.
*#
<EmailConfig>
<Subject>You have successfully been registered in WSO2 IoT Server</Subject>
<Body>
<![CDATA[
<html>
<head>
<title>WSO2 IoT Server</title>
</head>
<body style="color: #666666; background-color:#cdcdcd; padding: 0px; margin: 0px;">
<div style="background-color:#cdcdcd; font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; padding: 20px 0px; margin: 0px;">
<div style="width: 86%; max-width: 650px; padding: 2%; background-color: #ffffff; margin: auto; border-radius: 14px;">
<div style="background-color: #49c8f5; line-height: 0px; border-top-left-radius: 10px; border-top-right-radius: 10px; padding: 0px 10px 0px 0px;">
<div style="display: inline-block; line-height: 0px;">
<img src="http://b.content.wso2.com/sites/all/2015-june-theme/navigation/wso2-nav-logo.png"
alt="WSO2" style="margin: 0px 20px 0px 25px; width: 100%; max-width: 251px;"/>
</div>
</div>
<div style="background-color: #ffffff; line-height: 170%; color: #666666; padding: 20px 25px;">
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px 20px;">
Hi $first-name,
</p>
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
You have been registered in WSO2 IoT Server and invited to enrol your device.
Click <a href="$base-url-https/devicemgt/device/enroll">here</a> to enrol the WSO2 IoT Server devices to begin.</p>
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
Use following credentials to log in to WSO2 IoT Server.
</p>
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
<b>Username:</b> $username
<br/>
<b>Password:</b> $password
</p>
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
Should you need assistance, please contact your administrator.
</p>
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 20px 0px 5px;">
Regards,
</p>
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
WSO2 IoT Server Administrator
</p>
</div>
<div style="background-color: #333333; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="padding: 0px 20px 0px 0px;"><img
src="http://b.content.wso2.com/newsletter/images/wso2-logo-cloud-footer.png" alt="WSO2"
style="margin: 15px 0px 15px 25px; width: 100%; max-width: 258px;"/></td>
</tr>
</table>
</div>
</div>
</div>
</body>
</html>
]]>
</Body>
</EmailConfig>

@ -3,4 +3,6 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/license-config.xml,target:${installFolder}/../../conf/etc/license-config.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/license-config.xml,target:${installFolder}/../../conf/etc/license-config.xml,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/remote-appmanager-config.xml,target:${installFolder}/../../conf/etc/remote-appmanager-config.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/remote-appmanager-config.xml,target:${installFolder}/../../conf/etc/remote-appmanager-config.xml,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/dbscripts/cdm,target:${installFolder}/../../../dbscripts/cdm,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/dbscripts/cdm,target:${installFolder}/../../../dbscripts/cdm,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/rxts/license.rxt,target:${installFolder}/../../../repository/resources/rxts/license.rxt,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/rxts/license.rxt,target:${installFolder}/../../../repository/resources/rxts/license.rxt,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/email-templates);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/email/templates,target:${installFolder}/../../../repository/resources/email-templates,overwrite:true);\
Loading…
Cancel
Save