resolving conflicts

revert-70aa11f8
thusithakalugamage 8 years ago
commit 6583305e19

@ -14,7 +14,7 @@ $(function () {
var modalPopup = ".modal";
var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-body";
var modalPopupContent = modalPopup + " .modal-content";
var body = "body";
var isInit = true;
@ -35,7 +35,7 @@ function setPopupMaxHeight() {
*/
function showPopup() {
$(modalPopup).modal('show');
setPopupMaxHeight();
//setPopupMaxHeight();
}
/*
@ -44,6 +44,8 @@ function showPopup() {
function hidePopup() {
$(modalPopupContent).html('');
$(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
}
/**

@ -440,7 +440,7 @@ $(document).ready(function () {
var modalPopup = ".modal";
var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-body";
var modalPopupContent = modalPopup + " .modal-content";
var body = "body";
/*
@ -456,7 +456,7 @@ function setPopupMaxHeight() {
*/
function showPopup() {
$(modalPopup).modal('show');
setPopupMaxHeight();
//setPopupMaxHeight();
}
/*
@ -465,6 +465,8 @@ function showPopup() {
function hidePopup() {
$(modalPopupContent).html('');
$(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
}
/**

@ -253,7 +253,7 @@ $(document).ready(function () {
var modalPopup = ".modal";
var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-body";
var modalPopupContent = modalPopup + " .modal-content";
var body = "body";
/*
@ -268,8 +268,8 @@ function setPopupMaxHeight() {
* show popup function.
*/
function showPopup() {
$(modalPopup).show();
setPopupMaxHeight();
$(modalPopup).modal('show');
//setPopupMaxHeight();
}
/*
@ -278,6 +278,8 @@ function showPopup() {
function hidePopup() {
$(modalPopupContent).html('');
$(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
}
/**

@ -63,7 +63,7 @@ var sortElements = function () {
var modalPopup = ".modal";
var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-body";
var modalPopupContent = modalPopup + " .modal-content";
var body = "body";
/*
@ -82,7 +82,7 @@ function setPopupMaxHeight() {
*/
function showPopup() {
$(modalPopup).modal('show');
setPopupMaxHeight();
//setPopupMaxHeight();
}
/*
@ -91,6 +91,8 @@ function showPopup() {
function hidePopup() {
$(modalPopupContent).html('');
$(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
}
/*

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2015, 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
@ -10,17 +10,62 @@
*
* 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
* "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.
*/
var loadRoleBasedActionURL = function (action, rolename) {
var href = $("#ast-container").data("app-context") + "role/" + action + "/" + rolename;
$(location).attr('href', href);
};
$(function () {
var sortableElem = '.wr-sortable';
$(sortableElem).sortable({
beforeStop: function () {
$(this).sortable('toArray');
}
});
$(sortableElem).disableSelection();
});
var apiBasePath = "/api/device-mgt/v1.0";
var modalPopup = ".modal";
var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-content";
var body = "body";
var isInit = true;
$(".icon .text").res_text(0.2);
/*
* set popup maximum height function.
*/
function setPopupMaxHeight() {
$(modalPopupContent).css('max-height', ($(body).height() - ($(body).height() / 100 * 30)));
$(modalPopupContainer).css('margin-top', (-($(modalPopupContainer).height() / 2)));
}
/*
* show popup function.
*/
function showPopup() {
$(modalPopup).modal('show');
//setPopupMaxHeight();
}
/*
* hide popup function.
*/
function hidePopup() {
$(modalPopupContent).html('');
$(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
}
/**
* Following function would execute
@ -31,103 +76,96 @@ function InitiateViewOption() {
$(location).attr('href', $(this).data("url"));
}
/**
* Sorting function of roles
* listed on Role Management page in WSO2 Devicemgt Console.
*/
var loadPaginatedObjects = function (objectGridId, objectGridContainer, objectGridTemplateSrc, serviceURL, callback) {
var templateSrc = $(objectGridTemplateSrc).attr("src");
$.template(objectGridId, templateSrc, function (template) {
invokerUtil.get(serviceURL,
function (data) {
data = callback(data);
if (data.length > 0 && data != null) {
$('#ast-container').removeClass('hidden');
$('#role-listing-status').hide();
for (var i = 0; i < data.viewModel.roles.length; i++) {
data.viewModel.roles[i].adminRole = $("#role-table").data("role");
}
var content = template(data.viewModel);
$(objectGridContainer).html(content);
if (isInit) {
$('#role-grid').datatables_extended_serverside_paging();
isInit = false;
}
$("#dt-select-all").addClass("hidden");
$(".icon .text").res_text(0.2);
} else {
$('#ast-container').addClass('hidden');
$('#role-listing-status-msg').text('No roles are available to be displayed.');
$('#role-listing-status').show();
}
//$(objectGridId).datatables_extended();
}, function (message) {
$('#ast-container').addClass('hidden');
$('#role-listing-status-msg').text('Invalid search query. Try again with a valid search ' +
'query');
$('#role-listing-status').show();
});
});
};
function loadRoles(searchQuery) {
function loadRoles() {
var loadingContent = $("#loading-content");
loadingContent.show();
var dataFilter = function(data){
var dataFilter = function (data) {
data = JSON.parse(data);
var objects = [];
$(data.roles).each(function( index ) {
objects.push({name: data.roles[index], DT_RowId : "role-" + data.roles[index]})
objects.push(
{
name: data.roles[index],
DT_RowId: "role-" + data.roles[index]
}
)
});
json = {
var json = {
"recordsTotal": data.count,
"recordsFiltered": data.count,
"data": objects
};
return JSON.stringify( json );
}
return JSON.stringify(json);
};
var fnCreatedRow = function( nRow, aData, iDataIndex ) {
//noinspection JSUnusedLocalSymbols
var fnCreatedRow = function (nRow, aData, iDataIndex) {
$(nRow).attr('data-type', 'selectable');
}
};
//noinspection JSUnusedLocalSymbols
var columns = [
{
class: "remove-padding icon-only content-fill",
data: null,
defaultContent: '<div class="thumbnail icon"> <i class="square-element text fw fw-user" style="font-size: 30px;"></i></div>'
defaultContent: "<div class='thumbnail icon'>" +
"<i class='square-element text fw fw-bookmark' style='font-size: 30px;'></i>" +
"</div>"
},
{
class: "fade-edge remove-padding-top",
class: "fade-edge",
data: "name",
defaultContent: ''
render: function (name, type, row, meta) {
return '<h4>&nbsp;&nbsp;' + name + '&nbsp;role</h4>';
}
},
{
class: "text-right content-fill text-left-on-grid-view no-wrap",
data: null,
render: function ( data, type, row, meta ) {
return '<a onclick="javascript:loadRoleBasedActionURL(\'edit\', \'' + data.name + '\')" data-role="' + data.name +
'" data-click-event="edit-form" class="btn padding-reduce-on-grid-view edit-role-link"><span class="fw-stack fw-lg">' +
'<i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-user fw-stack-1x"></i>' +
'<span class="fw-stack fw-move-right fw-move-bottom"><i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i>' +
'<i class="fw fw-circle fw-stack-2x"></i><i class="fw fw-edit fw-stack-1x fw-inverse"></i></span></span>' +
'<span class="hidden-xs hidden-on-grid-view">Edit</span></a>' +
'<a onclick="javascript:loadRoleBasedActionURL(\'edit-permission\', \'' + data.name +
'\')" data-role="' + data.name + '" data-click-event="edit-form" class="btn padding-reduce-on-grid-view edit-permission-link">' +
'<span class="fw-stack fw-lg"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-security-policy fw-stack-1x"></i>' +
'<span class="fw-stack fw-move-right fw-move-bottom"><i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i>' +
'<i class="fw fw-circle fw-stack-2x"></i><i class="fw fw-edit fw-stack-1x fw-inverse"></i></span></span>' +
'<span class="hidden-xs hidden-on-grid-view">Edit Permission</span></a>' +
'<a data-role="' + data.name + '" data-click-event="remove-form" class="btn padding-reduce-on-grid-view remove-role-link">' +
'<span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-delete fw-stack-1x"></i></span>' +
'<span class="hidden-xs hidden-on-grid-view">Remove</span></a>'
render: function (data, type, row, meta) {
return '&nbsp;' +
'<a onclick="javascript:loadRoleBasedActionURL(\'edit\', \'' + data.name + '\')" ' +
'data-role="' + data.name + '" ' +
'data-click-event="edit-form" ' +
'class="btn padding-reduce-on-grid-view edit-role-link">' +
'<span class="fw-stack">' +
'<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-bookmark fw-stack-1x"></i>' +
'<span class="fw-stack fw-move-right fw-move-bottom">' +
'<i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i>' +
'<i class="fw fw-circle fw-stack-2x"></i><i class="fw fw-edit fw-stack-1x fw-inverse"></i>' +
'</span>' +
'</span>' +
'<span class="hidden-xs hidden-on-grid-view">&nbsp;&nbsp;Edit</span>' +
'</a>' +
'&nbsp;<a onclick="javascript:loadRoleBasedActionURL(\'edit-permission\', \'' + data.name + '\')" ' +
'data-role="' + data.name + '" ' +
'data-click-event="edit-form" ' +
'class="btn padding-reduce-on-grid-view edit-permission-link">' +
'<span class="fw-stack">' +
'<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-security-policy fw-stack-1x"></i>' +
'<span class="fw-stack fw-move-right fw-move-bottom">' +
'<i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i>' +
'<i class="fw fw-circle fw-stack-2x"></i><i class="fw fw-edit fw-stack-1x fw-inverse"></i>' +
'</span>' +
'</span>' +
'<span class="hidden-xs hidden-on-grid-view">&nbsp;&nbsp;Edit Permission</span>' +
'</a>' +
'&nbsp;<a data-role="' + data.name + '" ' +
'data-click-event="remove-form" ' +
'class="btn padding-reduce-on-grid-view remove-role-link">' +
'<span class="fw-stack">' +
'<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-delete fw-stack-1x"></i>' +
'</span>' +
'<span class="hidden-xs hidden-on-grid-view">&nbsp;&nbsp;Remove</span>' +
'</a>';
}
}
];
@ -138,43 +176,10 @@ function loadRoles(searchQuery) {
};
$('#role-grid').datatables_extended_serverside_paging(null, '/api/device-mgt/v1.0/roles', dataFilter, columns, fnCreatedRow, null, options);
loadingContent.hide();
}
var modalPopup = ".modal";
var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-content";
var body = "body";
var isInit = true;
/*
* set popup maximum height function.
*/
function setPopupMaxHeight() {
$(modalPopupContent).css('max-height', ($(body).height() - ($(body).height() / 100 * 30)));
$(modalPopupContainer).css('margin-top', (-($(modalPopupContainer).height() / 2)));
}
/*
* show popup function.
*/
function showPopup() {
$(modalPopup).modal('show');
//setPopupMaxHeight();
}
/*
* hide popup function.
*/
function hidePopup() {
$(modalPopupContent).html('');
$(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
}
/**
* Following click function would execute
@ -212,17 +217,6 @@ $("#role-grid").on("click", ".remove-role-link", function () {
});
});
$("#search-btn").click(function () {
var searchQuery = $("#search-by-name").val();
if (searchQuery.trim() != "") {
loadRoles(searchQuery);
} else {
loadRoles();
}
});
$(document).ready(function () {
$('#role-listing-status').hide();
loadRoles();
isInit = true;
});

@ -104,23 +104,19 @@
</div>
<div id="invite-user-modal-content" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<h4>
An invitation mail will be sent to the selected user(s) to initiate an enrolment process.
Do you wish to continue ?
</h3>
<div class="buttons">
<a href="#" id="invite-user-yes-link" class="btn-operations">
yes
</a>
<a href="#" id="invite-user-cancel-link" class="btn-operations">
No
</a>
</div>
</h4>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="#" id="invite-user-yes-link" class="btn-operations">yes</a>
<a href="#" id="invite-user-cancel-link" class="btn-operations">No</a>
</div>
</div>
</div>
@ -141,138 +137,154 @@
</div>
<div id="invite-user-error-content" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>An unexpected error occurred. Try again later.</h3>
<div class="buttons">
<a href="#" id="invite-user-error-link" class="btn-operations">
Ok
</a>
<div class="modal-header">
<h3 class="pull-left modal-title">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-error fw-stack-1x"></i>
</span>
Unexpected Error
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<h4>
An unexpected error occurred. Try again later.
</h4>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="#" id="invite-user-error-link" class="btn-operations">Ok</a>
</div>
</div>
</div>
<div id="remove-user-modal-content" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>Do you really want to remove this user ?</h3>
<div class="buttons">
<a href="#" id="remove-user-yes-link" class="btn-operations">
Remove
</a>
<a href="#" id="remove-user-cancel-link" class="btn-operations">
Cancel
</a>
<div class="modal-header">
<h3 class="pull-left modal-title">
Remove User
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<h4>
Do you really want to remove this user ?
</h4>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="#" id="remove-user-yes-link" class="btn-operations">Remove</a>
<a href="#" id="remove-user-cancel-link" class="btn-operations">Cancel</a>
</div>
</div>
</div>
<div id="remove-user-success-content" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>Done. User was successfully removed.</h3>
<div class="buttons">
<a href="#" id="remove-user-success-link" class="btn-operations">
Ok
</a>
<div class="modal-header">
<h3 class="pull-left modal-title">
User Removed.
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<h4>
Done. User was successfully removed.
</h4>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="#" id="remove-user-success-link" class="btn-operations">Ok</a>
</div>
</div>
</div>
<div id="remove-user-error-content" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>An unexpected error occurred. Please try again later.</h3>
<div class="buttons">
<a href="#" id="remove-user-error-link" class="btn-operations">
Ok
</a>
<div class="modal-header">
<h3 class="pull-left modal-title">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-error fw-stack-1x"></i>
</span>
Unexpected Error
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<h4>
An unexpected error occurred. Please try again later.
</h4>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="#" id="remove-user-error-link" class="btn-operations">Ok</a>
</div>
</div>
</div>
<div id="errorUsers" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h2>
<div class="modal-header">
<h3 class="pull-left modal-title">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-error fw-stack-1x"></i>
</span>
Operation cannot be performed !
</h2>
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<h4>
Please select a user or a list of users to send invitation emails.
</h4>
<div class="buttons">
<a href="javascript:hidePopup()" class="btn-operations">
Ok
</a>
</div>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="javascript:hidePopup()" class="btn-operations">Ok</a>
</div>
</div>
</div>
<div id="errorUserView" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-error fw-stack-1x"></i>
</span>
<div class="modal-header">
<h3 class="pull-left modal-title">
Unauthorized action!
</h3>
</div>
</div>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
</div>
<div id="reset-password-window" class="hide">
<input type="hidden" id="user" value="{{user.username}}">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h2>
<div class="modal-header">
<h3 class="pull-left modal-title">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-key fw-stack-1x"></i>
</span>
Reset Password
</h2>
<br>
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<div id="notification-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<h4>
Enter new password
<br><br>
<!--suppress HtmlUnknownTag -->
<!--suppress HtmlFormInputWithoutLabel -->
<div>
<input type="password" class="form-control modal-input operationDataKeys" id="new-password" data-key="message"/>
</div>
<br>
Retype new password
<br><br>
<!--suppress HtmlFormInputWithoutLabel -->
<div>
<input type="password" class="form-control modal-input operationDataKeys" id="confirmed-password" data-key="message"/>
</div>
<br>
</h4>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="#" id="reset-password-yes-link" class="btn-operations">
&nbsp;&nbsp;&nbsp;&nbsp;Save&nbsp;&nbsp;&nbsp;&nbsp;
@ -284,14 +296,15 @@
</div>
</div>
</div>
</div>
</div>
<div id="reset-password-success-content" class="hide">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>Password reset is successful.</h3>
<div class="modal-header">
<h3 class="pull-left modal-title">
Password reset is successful.
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="#" id="reset-password-success-link" class="btn-operations">
&nbsp;&nbsp;&nbsp;&nbsp;Ok&nbsp;&nbsp;&nbsp;&nbsp;
@ -299,8 +312,6 @@
</div>
</div>
</div>
</div>
</div>
{{/zone}}
{{#zone "common-navigation"}}

@ -20,7 +20,7 @@
<script type="text/javascript">
var modalPopup = '.modal',
modalPopupContainer = modalPopup + ' .modal-content',
modalPopupContent = modalPopup + ' .modal-body';
modalPopupContent = modalPopup + ' .modal-content';
function openCollapsedNav(){
$(".wr-hidden-nav-toggle-btn").addClass("active");
$("#hiddenNav").slideToggle("slideDown", function () {
@ -55,6 +55,8 @@
$(modalPopupContent).html("");
$(modalPopupContent).removeClass("operation-data");
$(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
}
function generateQRCode(qrCodeClass){
@ -68,8 +70,8 @@
</script>
<script type="text/javascript">
function toggleEnrollment(){
$(".modal-body").html($("#qr-code-modal").html());
generateQRCode(".modal-body .qr-code");
$(".modal-content").html($("#qr-code-modal").html());
generateQRCode(".modal-content .qr-code");
showQRCodePopup();
}
</script>

@ -32,7 +32,7 @@ if (saveNewPrioritiesButtonEnabled) {
var modalPopup = ".modal";
var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-body";
var modalPopupContent = modalPopup + " .modal-content";
var body = "body";
/*
@ -50,8 +50,8 @@ function setPopupMaxHeight() {
* show popup function.
*/
function showPopup() {
$(modalPopup).show();
setPopupMaxHeight();
$(modalPopup).modal('show');
//setPopupMaxHeight();
}
/*
@ -60,6 +60,8 @@ function showPopup() {
function hidePopup() {
$(modalPopupContent).html('');
$(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
}
$(document).ready(function () {

@ -29,7 +29,7 @@
* @return {Null}
*/
var modalPopup = ".modal";
var modalPopupContent = modalPopup + " .modal-body";
var modalPopupContent = modalPopup + " .modal-content";
var apiBasePath = "/api/device-mgt/v1.0";
@ -39,6 +39,8 @@ var apiBasePath = "/api/device-mgt/v1.0";
function hidePopup() {
$(modalPopupContent).html('');
$(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
}
/*
@ -46,7 +48,7 @@ function hidePopup() {
*/
function showPopup() {
$(modalPopup).modal('show');
setPopupMaxHeight();
//setPopupMaxHeight();
}
$.fn.tree_view = function(){
var tree = $(this);

@ -25,17 +25,17 @@
<div id="change-password-window" class="hide">
<input type="hidden" id="user" value="{{username}}">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h4>
<div class="modal-header">
<h3 class="pull-left modal-title">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-key fw-stack-1x"></i>
</span>
Change Password
<br><br>
</h4>
</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<div id="notification-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
@ -59,13 +59,14 @@
</div>
<br>
</h3>
</div>
<div class="modal-footer">
<div class="buttons">
<a href="#" id="change-password-yes-link" class="btn-operations">Update</a>
<a href="#" id="change-password-cancel-link" class="btn-operations">Cancel</a>
</div>
</div>
</div>
</div>
</div>
<div id="change-password-success-content" class="hide">

@ -2642,64 +2642,7 @@ ul.tiles .icon {
/* ========================================================================
* modal popup styles
* ======================================================================== */
.modal-open {
padding: 0 !important;
}
.modal {
z-index: 100000001;
padding: 0 !important;
}
.modal-backdrop {
z-index: 100000000;
}
.modal-content {
background: #222;
color: #ffffff;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.modal-header {
border-bottom: none;
padding: 15px 15px 0;
}
.modal-header .close {
color: #ffffff;
text-shadow: none;
opacity: 0.8;
}
.modal-body {
padding: 0 15px;
}
.modal-dialog {
margin: 80px auto;
}
.modal-footer {
border-top: none;
}
@media only screen and (max-width: 768px) {
.modal {
padding: 0 15px !important;
}
}
@media only screen and (min-width: 1280px) {
.modal-dialog {
width: 1000px;
}
}
/* ========================================================================
* list group styles
@ -4018,72 +3961,6 @@ a.btn-operations {
}
/* modal pop-up styles */
.wr-modalpopup {
display: none;
}
.wr-modalpopup .modalpopup-container {
display: block;
min-height: 100px;
width: 100%;
position: fixed;
background: #11375B;
color: #fff;
z-index: 1000001;
align-content: center;
top: 50%;
}
.modalpopup-content {
position: relative;
overflow-x: hidden;
overflow-y: auto;
padding: 50px 60px 60px 60px;
}
.modalpopup-content h3 {
font-weight: 300;
}
.modalpopup-content h3 .fw-stack {
margin-right: 15px;
}
.wr-modalpopup .modalpopup-close-btn {
color: #fff;
z-index: 1000002;
cursor: pointer;
position: absolute;
top: 20px;
left: 20px;
padding: 5px 8px;
font-size: 18px;
}
.wr-modalpopup .modalpopup-close-btn:hover {
}
.wr-modalpopup .modalpopup-content .buttons {
margin-top: 30px;
}
.wr-modalpopup .modalpopup-content .buttons .btn-operations {
background: #fff;
color: #333;
text-transform: uppercase;
font-weight: 500;
}
.wr-modalpopup .modalpopup-bg {
position: fixed;
z-index: 1000000;
width: 100%;
height: 100%;
background: #000000;
opacity: 0.9;
display: block;
}
/* notification panel styles */
.wr-notification-bar, .wr-side-panel {
@ -6750,32 +6627,7 @@ ul.tiles .icon {
/* ========================================================================
* modal popup styles
* ======================================================================== */
.modal-open {
padding: 0 !important;
}
.modal {
z-index: 100000001;
padding: 0 !important;
}
.modal-backdrop {
z-index: 0;
}
.modal-content {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.modal-dialog {
margin: 80px auto;
}
@media only screen and (max-width: 768px) {
.modal {
padding: 0 15px !important;
}
}
/* ========================================================================
* asset details styles

@ -17,77 +17,4 @@
*/
/* modal pop-up styles */
.wr-modalpopup {
display: none;
}
.wr-modalpopup .modalpopup-container {
display: block;
min-height: 100px;
width: 100%;
position: fixed;
background: #11375B;
color: #fff;
z-index: 1000001;
align-content: center;
top: 50%;
left: 0%;
}
.modalpopup-content {
position: relative;
overflow-x: hidden;
overflow-y: auto;
padding: 50px;
}
.center-container {
left: 25%;
right: 25%;
}
.modal-content {
display: block;
/*padding: 2em 1.4em;*/
min-height: 110px;
background: none;
border: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.modalpopup-content h3 {
font-weight: 300;
font-size: 15px;
}
.modalpopup-content h3 .fw-stack {
margin-right: 15px;
}
.wr-modalpopup .modalpopup-close-btn {
color: #fff;
z-index: 1000002;
cursor: pointer;
position: absolute;
top: 30px;
left: 40px;
padding: 5px 8px;
font-size: 18px;
}
.wr-modalpopup .modalpopup-close-btn:hover {
}
.wr-modalpopup .modalpopup-bg {
position: fixed;
z-index: 1000000;
width: 100%;
height: 100%;
background: #000000;
opacity: 0.8;
display: block;
left: 0;
top: 0;
}

@ -26,7 +26,7 @@
{{~css "lib/font-wso2_1.2/css/font-wso2.css" combine=false}}
<!-- Theme LESS -->
{{~css "less/theme.less" combine=false}}
{{~css "css/theme-wso2.css"}}
{{~css "css/theme-wso2.css" combine=false}}
{{/zone}}
{{~#zone "topJs"}}

@ -145,10 +145,6 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE (
ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_POLICY (
ID INT(11) NOT NULL AUTO_INCREMENT ,
NAME VARCHAR(45) DEFAULT NULL ,
@ -168,9 +164,6 @@ CREATE TABLE IF NOT EXISTS DM_POLICY (
ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY (
ID INT(11) NOT NULL AUTO_INCREMENT ,
DEVICE_ID INT(11) NOT NULL ,
@ -190,9 +183,6 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY (
ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY (
ID INT(11) NOT NULL ,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
@ -210,10 +200,6 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY (
ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES (
ID INT(11) NOT NULL AUTO_INCREMENT,
PROFILE_ID INT(11) NOT NULL,
@ -229,9 +215,6 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES (
ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_ROLE_POLICY (
ID INT(11) NOT NULL AUTO_INCREMENT ,
ROLE_NAME VARCHAR(45) NOT NULL ,
@ -244,9 +227,6 @@ CREATE TABLE IF NOT EXISTS DM_ROLE_POLICY (
ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_USER_POLICY (
ID INT NOT NULL AUTO_INCREMENT ,
POLICY_ID INT NOT NULL ,
@ -259,8 +239,7 @@ CREATE TABLE IF NOT EXISTS DM_USER_POLICY (
ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY_APPLIED (
CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY_APPLIED (
ID INT NOT NULL AUTO_INCREMENT ,
DEVICE_ID INT NOT NULL ,
ENROLMENT_ID INT(11) NOT NULL,
@ -279,8 +258,6 @@ CREATE TABLE IF NOT EXISTS DM_USER_POLICY (
ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_CRITERIA (
ID INT NOT NULL AUTO_INCREMENT,
TENANT_ID INT NOT NULL,
@ -288,8 +265,6 @@ CREATE TABLE IF NOT EXISTS DM_CRITERIA (
PRIMARY KEY (ID)
);
CREATE TABLE IF NOT EXISTS DM_POLICY_CRITERIA (
ID INT NOT NULL AUTO_INCREMENT,
CRITERIA_ID INT NOT NULL,
@ -335,7 +310,6 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS (
PRIMARY KEY (ID)
);
CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT (
ID INT NOT NULL AUTO_INCREMENT,
POLICY_ID INT NOT NULL,
@ -344,7 +318,6 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT (
PRIMARY KEY (ID)
);
CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_FEATURES (
ID INT NOT NULL AUTO_INCREMENT,
COMPLIANCE_STATUS_ID INT NOT NULL,
@ -406,8 +379,6 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
);
-- NOTIFICATION TABLE END --
DROP TABLE IF EXISTS DM_DEVICE_INFO;
CREATE TABLE IF NOT EXISTS DM_DEVICE_INFO (
ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INT NULL,
@ -421,10 +392,6 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_INFO (
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS DM_DEVICE_LOCATION;
CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION (
ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INT NULL,
@ -445,7 +412,6 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION (
ON UPDATE NO ACTION
);
CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
ID INT NOT NULL AUTO_INCREMENT,
DEVICE_ID INT NOT NULL,
@ -473,9 +439,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
ON UPDATE NO ACTION
);
-- POLICY AND DEVICE GROUP MAPPING --
CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY (
ID INT NOT NULL AUTO_INCREMENT,
DEVICE_GROUP_ID INT NOT NULL,
@ -493,11 +457,9 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY (
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
-- END OF POLICY AND DEVICE GROUP MAPPING --
-- DASHBOARD RELATED VIEWS --
CREATE VIEW POLICY_COMPLIANCE_INFO AS
SELECT
DEVICE_INFO.DEVICE_ID,

@ -1,31 +1,31 @@
CREATE TABLE DM_DEVICE_TYPE (
ID INTEGER IDENTITY(1,1) NOT NULL,
NAME VARCHAR(50) DEFAULT NULL,
NAME VARCHAR(300) DEFAULT NULL,
PROVIDER_TENANT_ID INTEGER NULL,
SHARED_WITH_ALL_TENANTS BIT NOT NULL DEFAULT 0,
PRIMARY KEY (ID)
);
CREATE TABLE DM_DEVICE_CERTIFICATE (
ID INTEGER IDENTITY(1,1) NOT NULL,
SERIAL_NUMBER VARCHAR(50) DEFAULT NULL,
CERTIFICATE VARBINARY(255) DEFAULT NULL,
PRIMARY KEY (ID)
);
CREATE INDEX IDX_DEVICE_TYPE ON DM_DEVICE_TYPE (NAME);
CREATE TABLE DM_DEVICE (
ID INTEGER IDENTITY(1,1) NOT NULL,
DESCRIPTION TEXT DEFAULT NULL,
NAME VARCHAR(50) DEFAULT NULL,
DESCRIPTION VARBINARY(255) DEFAULT NULL,
NAME VARCHAR(100) DEFAULT NULL,
DEVICE_TYPE_ID INTEGER DEFAULT NULL,
DEVICE_IDENTIFICATION VARCHAR(50) DEFAULT NULL,
DEVICE_IDENTIFICATION VARCHAR(300) DEFAULT NULL,
LAST_UPDATED_TIMESTAMP TIMESTAMP NOT NULL,
TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (ID),
CONSTRAINT FK_DM_DEVICE_DM_DEVICE_TYPE2 FOREIGN KEY (DEVICE_TYPE_ID)
REFERENCES DM_DEVICE_TYPE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX IDX_DM_DEVICE ON DM_DEVICE(TENANT_ID, DEVICE_TYPE_ID);
CREATE TABLE DM_OPERATION (
ID INTEGER IDENTITY(1,1) NOT NULL,
TYPE VARCHAR(50) NOT NULL,
TYPE VARCHAR(20) NOT NULL,
CREATED_TIMESTAMP DATETIME2 NOT NULL,
RECEIVED_TIMESTAMP DATETIME2 NULL,
OPERATION_CODE VARCHAR(50) NOT NULL,
@ -80,11 +80,16 @@ CREATE TABLE DM_ENROLMENT (
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX IDX_ENROLMENT_FK_DEVICE_ID ON DM_ENROLMENT(DEVICE_ID);
CREATE INDEX IDX_ENROLMENT_DEVICE_ID_TENANT_ID ON DM_ENROLMENT(DEVICE_ID, TENANT_ID);
CREATE TABLE DM_ENROLMENT_OP_MAPPING (
ID INTEGER IDENTITY(1,1) NOT NULL,
ENROLMENT_ID INTEGER NOT NULL,
OPERATION_ID INTEGER NOT NULL,
STATUS VARCHAR(50) NULL,
CREATED_TIMESTAMP INTEGER NOT NULL,
UPDATED_TIMESTAMP INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT FK_DM_DEVICE_OPERATION_MAPPING_DEVICE FOREIGN KEY (ENROLMENT_ID) REFERENCES
DM_ENROLMENT (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -92,11 +97,16 @@ CREATE TABLE DM_ENROLMENT_OP_MAPPING (
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX IDX_ENROLMENT_OP_MAPPING ON DM_ENROLMENT_OP_MAPPING (UPDATED_TIMESTAMP);
CREATE INDEX IDX_EN_OP_MAPPING_EN_ID ON DM_ENROLMENT_OP_MAPPING(ENROLMENT_ID);
CREATE INDEX IDX_EN_OP_MAPPING_OP_ID ON DM_ENROLMENT_OP_MAPPING(OPERATION_ID);
CREATE TABLE DM_DEVICE_OPERATION_RESPONSE (
ID INTEGER IDENTITY(1,1) NOT NULL,
ENROLMENT_ID INTEGER NOT NULL,
OPERATION_ID INTEGER NOT NULL,
OPERATION_RESPONSE VARBINARY(255) DEFAULT NULL,
RECEIVED_TIMESTAMP DATETIME2 DEFAULT NULL
PRIMARY KEY (ID),
CONSTRAINT FK_DM_DEVICE_OPERATION_RESP_ENROLMENT FOREIGN KEY (ENROLMENT_ID) REFERENCES
DM_ENROLMENT (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
@ -104,10 +114,12 @@ CREATE TABLE DM_DEVICE_OPERATION_RESPONSE (
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX IDX_ENID_OPID ON DM_DEVICE_OPERATION_RESPONSE(OPERATION_ID, ENROLMENT_ID);
-- POLICY RELATED TABLES --
CREATE TABLE DM_PROFILE (
ID INTEGER NOT NULL IDENTITY(1,1) ,
ID INTEGER IDENTITY(1,1) NOT NULL,
PROFILE_NAME VARCHAR(45) NOT NULL ,
TENANT_ID INTEGER NOT NULL ,
DEVICE_TYPE_ID INTEGER NOT NULL ,
@ -119,7 +131,7 @@ CREATE TABLE DM_PROFILE (
);
CREATE TABLE DM_POLICY (
ID INTEGER NOT NULL IDENTITY(1,1) ,
ID INTEGER IDENTITY(1,1) NOT NULL,
NAME VARCHAR(45) DEFAULT NULL ,
DESCRIPTION VARCHAR(1000) NULL,
TENANT_ID INTEGER NOT NULL ,
@ -135,7 +147,7 @@ CREATE TABLE DM_POLICY (
);
CREATE TABLE DM_DEVICE_POLICY (
ID INTEGER NOT NULL IDENTITY(1,1) ,
ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_ID INTEGER NOT NULL ,
ENROLMENT_ID INTEGER NOT NULL,
DEVICE VARBINARY(255) NOT NULL,
@ -148,7 +160,7 @@ CREATE TABLE DM_DEVICE_POLICY (
);
CREATE TABLE DM_DEVICE_TYPE_POLICY (
ID INTEGER NOT NULL ,
ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_TYPE_ID INTEGER NOT NULL ,
POLICY_ID INTEGER NOT NULL ,
PRIMARY KEY (ID) ,
@ -159,10 +171,10 @@ CREATE TABLE DM_DEVICE_TYPE_POLICY (
);
CREATE TABLE DM_PROFILE_FEATURES (
ID INTEGER NOT NULL IDENTITY(1,1),
ID INTEGER IDENTITY(1,1) NOT NULL,
PROFILE_ID INTEGER NOT NULL,
FEATURE_CODE VARCHAR(30) NOT NULL,
DEVICE_TYPE_ID INTEGER NOT NULL,
FEATURE_CODE VARCHAR(100) NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL,
TENANT_ID INTEGER NOT NULL ,
CONTENT VARBINARY(255) NULL DEFAULT NULL,
PRIMARY KEY (ID),
@ -171,7 +183,7 @@ CREATE TABLE DM_PROFILE_FEATURES (
);
CREATE TABLE DM_ROLE_POLICY (
ID INTEGER NOT NULL IDENTITY(1,1) ,
ID INTEGER IDENTITY(1,1) NOT NULL,
ROLE_NAME VARCHAR(45) NOT NULL ,
POLICY_ID INTEGER NOT NULL ,
PRIMARY KEY (ID) ,
@ -180,7 +192,7 @@ CREATE TABLE DM_ROLE_POLICY (
);
CREATE TABLE DM_USER_POLICY (
ID INTEGER NOT NULL IDENTITY(1,1) ,
ID INTEGER IDENTITY(1,1) NOT NULL,
POLICY_ID INTEGER NOT NULL ,
USERNAME VARCHAR(45) NOT NULL ,
PRIMARY KEY (ID) ,
@ -189,7 +201,7 @@ CREATE TABLE DM_USER_POLICY (
);
CREATE TABLE DM_DEVICE_POLICY_APPLIED (
ID INTEGER NOT NULL IDENTITY(1,1) ,
ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_ID INTEGER NOT NULL ,
ENROLMENT_ID INTEGER NOT NULL,
POLICY_ID INTEGER NOT NULL ,
@ -205,14 +217,14 @@ CREATE TABLE DM_USER_POLICY (
);
CREATE TABLE DM_CRITERIA (
ID INTEGER NOT NULL IDENTITY(1,1),
ID INTEGER IDENTITY(1,1) NOT NULL,
TENANT_ID INTEGER NOT NULL,
NAME VARCHAR(50) NULL,
PRIMARY KEY (ID)
);
CREATE TABLE DM_POLICY_CRITERIA (
ID INTEGER NOT NULL IDENTITY(1,1),
ID INTEGER IDENTITY(1,1) NOT NULL,
CRITERIA_ID INTEGER NOT NULL,
POLICY_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
@ -223,7 +235,7 @@ CREATE TABLE DM_POLICY_CRITERIA (
);
CREATE TABLE DM_POLICY_CRITERIA_PROPERTIES (
ID INTEGER NOT NULL IDENTITY(1,1),
ID INTEGER IDENTITY(1,1) NOT NULL,
POLICY_CRITERION_ID INTEGER NOT NULL,
PROP_KEY VARCHAR(45) NULL,
PROP_VALUE VARCHAR(100) NULL,
@ -234,7 +246,7 @@ CREATE TABLE DM_POLICY_CRITERIA_PROPERTIES (
);
CREATE TABLE DM_POLICY_COMPLIANCE_STATUS (
ID INTEGER NOT NULL IDENTITY(1,1),
ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_ID INTEGER NOT NULL,
ENROLMENT_ID INTEGER NOT NULL,
POLICY_ID INTEGER NOT NULL,
@ -248,18 +260,18 @@ CREATE TABLE DM_POLICY_COMPLIANCE_STATUS (
);
CREATE TABLE DM_POLICY_CHANGE_MGT (
ID INTEGER NOT NULL IDENTITY(1,1),
ID INTEGER IDENTITY(1,1) NOT NULL,
POLICY_ID INTEGER NOT NULL,
DEVICE_TYPE_ID INTEGER NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ID)
);
CREATE TABLE DM_POLICY_COMPLIANCE_FEATURES (
ID INTEGER NOT NULL IDENTITY(1,1),
ID INTEGER IDENTITY(1,1) NOT NULL,
COMPLIANCE_STATUS_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL,
FEATURE_CODE VARCHAR(15) NOT NULL,
FEATURE_CODE VARCHAR(100) NOT NULL,
STATUS INTEGER NULL,
PRIMARY KEY (ID),
CONSTRAINT FK_COMPLIANCE_FEATURES_STATUS FOREIGN KEY (COMPLIANCE_STATUS_ID) REFERENCES DM_POLICY_COMPLIANCE_STATUS (ID)
@ -277,6 +289,8 @@ CREATE TABLE DM_APPLICATION (
LOCATION_URL VARCHAR(100) DEFAULT NULL,
IMAGE_URL VARCHAR(100) DEFAULT NULL,
APP_PROPERTIES VARBINARY(255) NULL,
MEMORY_USAGE INTEGER NULL,
IS_ACTIVE BIT NOT NULL DEFAULT 0,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ID)
);
@ -295,6 +309,56 @@ CREATE TABLE DM_DEVICE_APPLICATION_MAPPING (
-- POLICY RELATED TABLES FINISHED --
-- DEVICE GROUP TABLES --
CREATE TABLE DM_GROUP (
ID INTEGER IDENTITY(1,1) NOT NULL,
GROUP_NAME VARCHAR(100) DEFAULT NULL,
DESCRIPTION VARBINARY(255) NULL,
DATE_OF_CREATE BIGINT DEFAULT NULL,
DATE_OF_LAST_UPDATE BIGINT DEFAULT NULL,
OWNER VARCHAR(45) DEFAULT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ID)
);
CREATE TABLE DM_DEVICE_GROUP_MAP (
ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_ID INTEGER DEFAULT NULL,
GROUP_ID INTEGER DEFAULT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_DM_DEVICE_GROUP_MAP_DM_DEVICE2 FOREIGN KEY (DEVICE_ID)
REFERENCES DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_DM_DEVICE_GROUP_MAP_DM_GROUP2 FOREIGN KEY (GROUP_ID)
REFERENCES DM_GROUP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
-- END OF DEVICE GROUP TABLES --
-- POLICY AND DEVICE GROUP MAPPING --
CREATE TABLE DM_DEVICE_GROUP_POLICY (
ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_GROUP_ID INTEGER NOT NULL,
POLICY_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT FK_DM_DEVICE_GROUP_POLICY
FOREIGN KEY (DEVICE_GROUP_ID)
REFERENCES DM_GROUP (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT FK_DM_DEVICE_GROUP_DM_POLICY
FOREIGN KEY (POLICY_ID)
REFERENCES DM_POLICY (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
-- END OF POLICY AND DEVICE GROUP MAPPING --
-- NOTIFICATION TABLE --
CREATE TABLE DM_NOTIFICATION (
NOTIFICATION_ID INTEGER IDENTITY(1,1) NOT NULL,
@ -311,3 +375,126 @@ CREATE TABLE DM_NOTIFICATION (
);
-- NOTIFICATION TABLE END --
CREATE TABLE DM_DEVICE_INFO (
ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_ID INTEGER NULL,
KEY_FIELD VARCHAR(45) NULL,
VALUE_FIELD VARCHAR(100) NULL,
PRIMARY KEY (ID),
INDEX DM_DEVICE_INFO_DEVICE_idx (DEVICE_ID ASC),
CONSTRAINT DM_DEVICE_INFO_DEVICE FOREIGN KEY (DEVICE_ID) REFERENCES DM_DEVICE (ID) ON DELETE NO ACTION
ON UPDATE NO ACTION
);
CREATE TABLE DM_DEVICE_LOCATION (
ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_ID INTEGER NULL,
LATITUDE FLOAT NULL,
LONGITUDE FLOAT NULL,
STREET1 VARCHAR(45) NULL,
STREET2 VARCHAR(45) NULL,
CITY VARCHAR(45) NULL,
ZIP VARCHAR(10) NULL,
STATE VARCHAR(45) NULL,
COUNTRY VARCHAR(45) NULL,
UPDATE_TIMESTAMP INTEGER NOT NULL,
PRIMARY KEY (ID),
INDEX DM_DEVICE_LOCATION_DEVICE_idx (DEVICE_ID ASC),
CONSTRAINT DM_DEVICE_LOCATION_DEVICE
FOREIGN KEY (DEVICE_ID)
REFERENCES DM_DEVICE (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
CREATE TABLE DM_DEVICE_DETAIL (
ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_ID INTEGER NOT NULL,
DEVICE_MODEL VARCHAR(45) NULL,
VENDOR VARCHAR(45) NULL,
OS_VERSION VARCHAR(45) NULL,
OS_BUILD_DATE VARCHAR(100) NULL,
BATTERY_LEVEL DECIMAL(4) NULL,
INTERNAL_TOTAL_MEMORY DECIMAL(30,3) NULL,
INTERNAL_AVAILABLE_MEMORY DECIMAL(30,3) NULL,
EXTERNAL_TOTAL_MEMORY DECIMAL(30,3) NULL,
EXTERNAL_AVAILABLE_MEMORY DECIMAL(30,3) NULL,
CONNECTION_TYPE VARCHAR(10) NULL,
SSID VARCHAR(45) NULL,
CPU_USAGE DECIMAL(5) NULL,
TOTAL_RAM_MEMORY DECIMAL(30,3) NULL,
AVAILABLE_RAM_MEMORY DECIMAL(30,3) NULL,
PLUGGED_IN INTEGER NULL,
UPDATE_TIMESTAMP INTEGER NOT NULL,
PRIMARY KEY (ID),
INDEX FK_DM_DEVICE_DETAILS_DEVICE_idx (DEVICE_ID ASC),
CONSTRAINT FK_DM_DEVICE_DETAILS_DEVICE
FOREIGN KEY (DEVICE_ID)
REFERENCES DM_DEVICE (ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
-- DASHBOARD RELATED VIEWS --
CREATE VIEW DEVICE_INFO_VIEW AS
SELECT
DM_DEVICE.ID AS DEVICE_ID,
DM_DEVICE.DEVICE_IDENTIFICATION,
DM_DEVICE_TYPE.NAME AS PLATFORM,
DM_ENROLMENT.OWNERSHIP,
DM_ENROLMENT.STATUS AS CONNECTIVITY_STATUS,
DM_DEVICE.TENANT_ID
FROM DM_DEVICE, DM_DEVICE_TYPE, DM_ENROLMENT
WHERE DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID AND DM_DEVICE.ID = DM_ENROLMENT.DEVICE_ID;
CREATE VIEW DEVICE_WITH_POLICY_INFO_VIEW AS
SELECT
DEVICE_ID,
POLICY_ID,
STATUS AS IS_COMPLIANT
FROM DM_POLICY_COMPLIANCE_STATUS;
CREATE VIEW POLICY_COMPLIANCE_INFO AS
SELECT
DEVICE_INFO_VIEW.DEVICE_ID,
DEVICE_INFO_VIEW.DEVICE_IDENTIFICATION,
DEVICE_INFO_VIEW.PLATFORM,
DEVICE_INFO_VIEW.OWNERSHIP,
DEVICE_INFO_VIEW.CONNECTIVITY_STATUS,
IFNULL(DEVICE_WITH_POLICY_INFO_VIEW.POLICY_ID, -1) AS POLICY_ID,
IFNULL(DEVICE_WITH_POLICY_INFO_VIEW.IS_COMPLIANT, -1) AS IS_COMPLIANT,
DEVICE_INFO_VIEW.TENANT_ID
FROM
DEVICE_INFO_VIEW
LEFT JOIN
DEVICE_WITH_POLICY_INFO_VIEW
ON DEVICE_INFO_VIEW.DEVICE_ID = DEVICE_WITH_POLICY_INFO_VIEW.DEVICE_ID
ORDER BY DEVICE_INFO_VIEW.DEVICE_ID;
CREATE VIEW FEATURE_NON_COMPLIANCE_INFO AS
SELECT
DM_DEVICE.ID AS DEVICE_ID,
DM_DEVICE.DEVICE_IDENTIFICATION,
DM_DEVICE_DETAIL.DEVICE_MODEL,
DM_DEVICE_DETAIL.VENDOR,
DM_DEVICE_DETAIL.OS_VERSION,
DM_ENROLMENT.OWNERSHIP,
DM_ENROLMENT.OWNER,
DM_ENROLMENT.STATUS AS CONNECTIVITY_STATUS,
DM_POLICY_COMPLIANCE_STATUS.POLICY_ID,
DM_DEVICE_TYPE.NAME AS PLATFORM,
DM_POLICY_COMPLIANCE_FEATURES.FEATURE_CODE,
DM_POLICY_COMPLIANCE_FEATURES.STATUS AS IS_COMPLAINT,
DM_DEVICE.TENANT_ID
FROM
DM_POLICY_COMPLIANCE_FEATURES, DM_POLICY_COMPLIANCE_STATUS, DM_ENROLMENT, DM_DEVICE, DM_DEVICE_TYPE, DM_DEVICE_DETAIL
WHERE
DM_POLICY_COMPLIANCE_FEATURES.COMPLIANCE_STATUS_ID = DM_POLICY_COMPLIANCE_STATUS.ID AND
DM_POLICY_COMPLIANCE_STATUS.ENROLMENT_ID = DM_ENROLMENT.ID AND
DM_POLICY_COMPLIANCE_STATUS.DEVICE_ID = DM_DEVICE.ID AND
DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID AND
DM_DEVICE.ID = DM_DEVICE_DETAIL.DEVICE_ID
ORDER BY TENANT_ID, DEVICE_ID;
-- END OF DASHBOARD RELATED VIEWS --

@ -336,22 +336,6 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_FEATURES (
ON UPDATE NO ACTION
)ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INTEGER NOT NULL,
OWNER VARCHAR(50) NOT NULL,
OWNERSHIP VARCHAR(45) DEFAULT NULL,
STATUS VARCHAR(50) NULL,
DATE_OF_ENROLMENT TIMESTAMP NULL DEFAULT NULL,
DATE_OF_LAST_UPDATE TIMESTAMP NULL DEFAULT NULL,
TENANT_ID INT NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_dm_device_enrolment FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
)ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS DM_APPLICATION (
ID INTEGER AUTO_INCREMENT NOT NULL,
NAME VARCHAR(150) NOT NULL,
@ -454,9 +438,6 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
-- END NOTIFICATION TABLES --
DROP TABLE IF EXISTS DM_DEVICE_INFO;
CREATE TABLE IF NOT EXISTS DM_DEVICE_INFO (
ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INT NULL,
@ -472,10 +453,6 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_INFO (
)
ENGINE = InnoDB;
DROP TABLE IF EXISTS DM_DEVICE_LOCATION;
CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION (
ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INT NULL,
@ -498,8 +475,6 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION (
)
ENGINE = InnoDB;
DROP TABLE IF EXISTS DM_DEVICE_DETAIL ;
CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
ID INT NOT NULL AUTO_INCREMENT,
DEVICE_ID INT NOT NULL,

@ -764,13 +764,6 @@ WHEN (NEW.ID IS NULL)
END;
/
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE DM_DEVICE_LOCATION';
EXCEPTION
WHEN OTHERS THEN NULL;
END;
/
CREATE TABLE DM_DEVICE_LOCATION (
ID NUMBER(10) NOT NULL,
DEVICE_ID NUMBER(10) NULL,
@ -802,13 +795,6 @@ WHEN (NEW.ID IS NULL)
END;
/
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE DM_DEVICE_DETAIL';
EXCEPTION
WHEN OTHERS THEN NULL;
END;
/
CREATE TABLE DM_DEVICE_DETAIL (
ID NUMBER(10) NOT NULL,
DEVICE_ID NUMBER(10) NOT NULL,

@ -6,6 +6,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE (
UNIQUE(NAME)
);
CREATE INDEX IDX_DEVICE_TYPE ON DM_DEVICE_TYPE (NAME);
CREATE TABLE IF NOT EXISTS DM_DEVICE (
ID BIGSERIAL NOT NULL PRIMARY KEY,
DESCRIPTION TEXT DEFAULT NULL,
@ -18,6 +20,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE (
REFERENCES DM_DEVICE_TYPE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX IDX_DM_DEVICE ON DM_DEVICE(TENANT_ID, DEVICE_TYPE_ID);
CREATE TABLE IF NOT EXISTS DM_OPERATION (
ID BIGSERIAL NOT NULL PRIMARY KEY,
TYPE VARCHAR(50) NOT NULL,
@ -73,6 +77,9 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX IDX_ENROLMENT_FK_DEVICE_ID ON DM_ENROLMENT(DEVICE_ID);
CREATE INDEX IDX_ENROLMENT_DEVICE_ID_TENANT_ID ON DM_ENROLMENT(DEVICE_ID, TENANT_ID);
CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING (
ID BIGSERIAL NOT NULL PRIMARY KEY,
ENROLMENT_ID INTEGER NOT NULL,
@ -86,6 +93,10 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING (
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX IDX_ENROLMENT_OP_MAPPING ON DM_ENROLMENT_OP_MAPPING (UPDATED_TIMESTAMP);
CREATE INDEX IDX_EN_OP_MAPPING_EN_ID ON DM_ENROLMENT_OP_MAPPING(ENROLMENT_ID);
CREATE INDEX IDX_EN_OP_MAPPING_OP_ID ON DM_ENROLMENT_OP_MAPPING(OPERATION_ID);
CREATE TABLE IF NOT EXISTS DM_DEVICE_OPERATION_RESPONSE (
ID BIGSERIAL NOT NULL PRIMARY KEY,
ENROLMENT_ID INTEGER NOT NULL,
@ -98,6 +109,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_OPERATION_RESPONSE (
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX IDX_ENID_OPID ON DM_DEVICE_OPERATION_RESPONSE(OPERATION_ID, ENROLMENT_ID);
-- POLICY RELATED TABLES ---
CREATE TABLE IF NOT EXISTS DM_PROFILE (

Loading…
Cancel
Save