diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/public/js/certificate-listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/public/js/certificate-listing.js index 2004b7914a..a7241b9240 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/public/js/certificate-listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/public/js/certificate-listing.js @@ -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(); } /** diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js index 6c1a5ccf46..ce8117634a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js @@ -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(); } /** diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js index 6be6689ccf..ba07b661a9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js @@ -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(); } /** diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/public/js/policy-list.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/public/js/policy-list.js index a8fcf9d022..891a4ae12d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/public/js/policy-list.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/public/js/policy-list.js @@ -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(); } /* diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js index 47a6dc90e0..ca06c183de 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js @@ -1,26 +1,71 @@ /* - * 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 * in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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 + * "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: '
' + defaultContent: "
" + + "" + + "
" }, { - class: "fade-edge remove-padding-top", + class: "fade-edge", data: "name", - defaultContent: '' + render: function (name, type, row, meta) { + return '

  ' + name + ' role

'; + } }, { class: "text-right content-fill text-left-on-grid-view no-wrap", data: null, - render: function ( data, type, row, meta ) { - return '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + render: function (data, type, row, meta) { + return ' ' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + ' ' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + ' ' + + '' + + '' + + '' + + '' + + '' + + ''; } } ]; @@ -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; -}); \ No newline at end of file +}); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs index c74c4870ef..e92c667cab 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/users.hbs @@ -104,23 +104,19 @@
-
-
-
-

- An invitation mail will be sent to the selected user(s) to initiate an enrolment process. - Do you wish to continue ? -

- -
+ + +
@@ -141,163 +137,178 @@
-
-
-
-

An unexpected error occurred. Try again later.

- -
+ + +
-
-
-
-

Do you really want to remove this user ?

- -
+ + +
-
-
-
-

Done. User was successfully removed.

- -
+ + +
-
-
-
-

An unexpected error occurred. Please try again later.

- - -
+ + +
-
-
-
-

- - - - - Operation cannot be performed ! -

-

- Please select a user or a list of users to send invitation emails. -

- -
+ + +
-
-
-
-

- - - - - Unauthorized action! -

-
-
+
-
-
-
-

- - - - - Reset Password -

-
- -

- Enter new password -

- - - -
- Retype new password -

- - -
-

- + + +
-
-
-
-

Password reset is successful.

- -
+ +
@@ -311,4 +322,4 @@ {{js "js/listing.js"}} -{{/zone}} \ No newline at end of file +{{/zone}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.qrcode/qrcode.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.qrcode/qrcode.hbs index 7b52e8cbcc..501248ece8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.qrcode/qrcode.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.qrcode/qrcode.hbs @@ -20,7 +20,7 @@ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.priority/public/js/policy-priority.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.priority/public/js/policy-priority.js index 80ebe1c21a..87c93b949c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.priority/public/js/policy-priority.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.priority/public/js/policy-priority.js @@ -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 () { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/public/js/bottomJs.js index b32d734368..f208c67de2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/public/js/bottomJs.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.role.edit.permission/public/js/bottomJs.js @@ -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); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.hbs index 21b7c28f3e..c4fd938ae5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/user-menu.hbs @@ -25,47 +25,48 @@
-
-
-
-

- - - - - Change Password -

-

- -

- Enter old password * -

-
- -
-
- Enter new password * -

-
- -
-
- Retype new password * -

-
- -
-
-

-
- Update - Cancel -
+ + + +
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css index 3ae90e467d..acdff12e39 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css @@ -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 diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/modal.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/modal.css index 320e313906..77a3bb1502 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/modal.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/modal.css @@ -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; -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/theme.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/theme.hbs index a511639e8f..b298d71d3b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/theme.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/theme.hbs @@ -26,7 +26,7 @@ {{~css "lib/font-wso2_1.2/css/font-wso2.css" combine=false}} {{~css "less/theme.less" combine=false}} - {{~css "css/theme-wso2.css"}} + {{~css "css/theme-wso2.css" combine=false}} {{/zone}} {{~#zone "topJs"}} diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql index cd9560016a..4684ec127c 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -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, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql index 6482fcb776..d230792327 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql @@ -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, - DEVICE_TYPE_ID INTEGER DEFAULT NULL, - DEVICE_IDENTIFICATION VARCHAR(50) DEFAULT NULL, + DESCRIPTION VARBINARY(255) DEFAULT NULL, + NAME VARCHAR(100) DEFAULT NULL, + DEVICE_TYPE_ID INTEGER 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) , +CREATE TABLE DM_PROFILE ( + ID INTEGER IDENTITY(1,1) NOT NULL, PROFILE_NAME VARCHAR(45) NOT NULL , TENANT_ID INTEGER NOT NULL , DEVICE_TYPE_ID INTEGER NOT NULL , @@ -118,8 +130,8 @@ CREATE TABLE DM_PROFILE ( DM_DEVICE_TYPE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); -CREATE TABLE DM_POLICY ( - ID INTEGER NOT NULL IDENTITY(1,1) , +CREATE TABLE DM_POLICY ( + ID INTEGER IDENTITY(1,1) NOT NULL, NAME VARCHAR(45) DEFAULT NULL , DESCRIPTION VARCHAR(1000) NULL, TENANT_ID INTEGER NOT NULL , @@ -134,8 +146,8 @@ CREATE TABLE DM_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION ); -CREATE TABLE DM_DEVICE_POLICY ( - ID INTEGER NOT NULL IDENTITY(1,1) , +CREATE TABLE DM_DEVICE_POLICY ( + ID INTEGER IDENTITY(1,1) NOT NULL, DEVICE_ID INTEGER NOT NULL , ENROLMENT_ID INTEGER NOT NULL, DEVICE VARBINARY(255) NOT NULL, @@ -147,8 +159,8 @@ CREATE TABLE DM_DEVICE_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION ); -CREATE TABLE DM_DEVICE_TYPE_POLICY ( - ID INTEGER NOT NULL , +CREATE TABLE DM_DEVICE_TYPE_POLICY ( + ID INTEGER IDENTITY(1,1) NOT NULL, DEVICE_TYPE_ID INTEGER NOT NULL , POLICY_ID INTEGER NOT NULL , PRIMARY KEY (ID) , @@ -158,11 +170,11 @@ CREATE TABLE DM_DEVICE_TYPE_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION ); -CREATE TABLE DM_PROFILE_FEATURES ( - ID INTEGER NOT NULL IDENTITY(1,1), +CREATE TABLE DM_PROFILE_FEATURES ( + 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), @@ -170,8 +182,8 @@ CREATE TABLE DM_PROFILE_FEATURES ( ON DELETE NO ACTION ON UPDATE NO ACTION ); -CREATE TABLE DM_ROLE_POLICY ( - ID INTEGER NOT NULL IDENTITY(1,1) , +CREATE TABLE DM_ROLE_POLICY ( + ID INTEGER IDENTITY(1,1) NOT NULL, ROLE_NAME VARCHAR(45) NOT NULL , POLICY_ID INTEGER NOT NULL , PRIMARY KEY (ID) , @@ -179,8 +191,8 @@ CREATE TABLE DM_ROLE_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION ); -CREATE TABLE DM_USER_POLICY ( - ID INTEGER NOT NULL IDENTITY(1,1) , +CREATE TABLE DM_USER_POLICY ( + ID INTEGER IDENTITY(1,1) NOT NULL, POLICY_ID INTEGER NOT NULL , USERNAME VARCHAR(45) NOT NULL , PRIMARY KEY (ID) , @@ -188,8 +200,8 @@ CREATE TABLE DM_USER_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION ); - CREATE TABLE DM_DEVICE_POLICY_APPLIED ( - ID INTEGER NOT NULL IDENTITY(1,1) , + CREATE TABLE DM_DEVICE_POLICY_APPLIED ( + 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 -- \ No newline at end of file diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql index 9c122d0764..e8cb6f4f27 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql @@ -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, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql index 8c98587ffe..c49d530140 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql @@ -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, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql index 52083e9d8c..828eca58cb 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql @@ -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 (