forked from community/device-mgt-core
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt
commit
b2c6bc5453
@ -0,0 +1,345 @@
|
||||
.operation-icon{
|
||||
width: 88px;
|
||||
height: 100px;
|
||||
background-color: #ebebeb;
|
||||
float: left;
|
||||
margin: 0px 10px 10px 0px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.operation-icon i{
|
||||
padding: 15px 0px 0px 0px;
|
||||
display: block;
|
||||
min-height: 65px;
|
||||
font-size: 3em !important;
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.operation-icon span{
|
||||
height: 35px;
|
||||
line-height: 15px;
|
||||
vertical-align: middle;
|
||||
display: table-cell;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.application{
|
||||
width: 250px;
|
||||
height: 100px;
|
||||
background-color: #ebebeb;
|
||||
float: left;
|
||||
margin: 0px 10px 10px 0px;
|
||||
}
|
||||
|
||||
.application img{
|
||||
height: inherit;
|
||||
padding: 10px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.app-info h4{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.application i{
|
||||
float: right;
|
||||
margin: 0px 10px;
|
||||
position: relative;
|
||||
bottom: -20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.nav-tabs>li>a{
|
||||
color: #333;
|
||||
}
|
||||
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover{
|
||||
border-bottom: 2px solid #37474f;
|
||||
border-right: none;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
font-weight: 400;
|
||||
}
|
||||
.nav-tabs-selector{
|
||||
margin: 0px;
|
||||
border: 1px solid #37474f;
|
||||
}
|
||||
|
||||
.tab-pane{
|
||||
padding: 20px 0px;
|
||||
}
|
||||
|
||||
#location{
|
||||
height: calc(100vh - 400px);
|
||||
}
|
||||
|
||||
.page-loader{
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
height: calc(100vh - 160px);
|
||||
z-index: 9999;
|
||||
background: url(images/page-loader.gif) 50% 50% no-repeat rgb(249,249,249);
|
||||
}
|
||||
|
||||
.page-loader .loader{
|
||||
left: 43%;
|
||||
position: absolute;
|
||||
bottom: 50%;
|
||||
width: 13%;
|
||||
}
|
||||
|
||||
.page-loader .loader span{
|
||||
padding: 9px;
|
||||
position: absolute;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.device-info-container{
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.device-type{
|
||||
font-size: 9em;
|
||||
}
|
||||
.device-info h1, .device-info h4:not(:last-child){
|
||||
margin: 0px 0px 9px 0px;
|
||||
position: relative;
|
||||
}
|
||||
.device-id a{
|
||||
font-size: 0.4em;
|
||||
position: absolute;
|
||||
margin: 0px 5px;
|
||||
}
|
||||
.device-info h4:last-child{
|
||||
margin: 0px;
|
||||
}
|
||||
.tab-actions{
|
||||
position: relative;
|
||||
}
|
||||
.tab-actions .action-btn{
|
||||
padding: 10px 15px;
|
||||
background-color: #ebebeb;
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
margin-left: 10px;
|
||||
ma
|
||||
}
|
||||
.tab-actions .action{
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.tab-actions .action-btn.show a{
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
.tab-actions .action-btn a{
|
||||
margin: 0px;
|
||||
}
|
||||
.tab-actions {
|
||||
margin: 0px;
|
||||
}
|
||||
.tab-actions .action-prop{
|
||||
padding: 10px;
|
||||
background: #ebebeb;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.tab-action-active{
|
||||
padding-bottom: 15px !important;
|
||||
}
|
||||
.action-btn-container:after{
|
||||
content: '';
|
||||
display: block;
|
||||
clear:both;
|
||||
}
|
||||
.input-group .fw{
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.vital-strip{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
background-color: #ebebeb;
|
||||
padding: 10px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.vital-strip p{
|
||||
flex-grow: 1;
|
||||
margin: 0px;
|
||||
display: inline-flex;
|
||||
}
|
||||
.vital-strip p i{
|
||||
margin: 0px 10px;
|
||||
}
|
||||
.vital-strip p span{
|
||||
padding: 5px 0px;
|
||||
}
|
||||
.memory-amt{
|
||||
font-size: 0.8em;
|
||||
position: relative;
|
||||
bottom: -3px;
|
||||
padding-left: 2px !important;
|
||||
}
|
||||
|
||||
.policy-item{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 10px;
|
||||
background-color: #ebebeb;
|
||||
}
|
||||
.policy-item .policy-status, .policy-item p{
|
||||
flex-grow: 1;
|
||||
}
|
||||
.policy-item .policy-status{
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
margin-right: 10px;
|
||||
align-self: center;
|
||||
color: #5cb85c;
|
||||
}
|
||||
.policy-name{
|
||||
font-size: 1.5em;
|
||||
display: flex;
|
||||
}
|
||||
.policy-platform{
|
||||
display: flex;
|
||||
}
|
||||
.policy-item p:nth-child(2){
|
||||
margin: 0px;
|
||||
}
|
||||
.policy-item p:nth-child(3){
|
||||
flex-grow: 7;
|
||||
align-self: center;
|
||||
margin: 0px;
|
||||
}
|
||||
.policy-item p:nth-child(3) span{
|
||||
display: flex;
|
||||
}
|
||||
.policy-item .actions{
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
}
|
||||
.policy-item .action-btn{
|
||||
flex-grow: 1;
|
||||
margin: 3px 5px;
|
||||
background-color: #ccc;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
.policy-item .action-btn p{
|
||||
align-self: center;
|
||||
margin: 0px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.policy-item .action-btn p i{
|
||||
padding: 0px 5px;
|
||||
}
|
||||
.policy-item .action-btn span{
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
|
||||
#operation-log tr td{
|
||||
border-bottom: 15px solid #fff !important;
|
||||
}
|
||||
#operation-log tr.shown td{
|
||||
border-bottom: none !important;
|
||||
}
|
||||
.log-data-row td{
|
||||
padding: 0px !important;
|
||||
border-bottom: 15px solid #fff !important;
|
||||
}
|
||||
.log-data{
|
||||
background-color: #f6f6f6;
|
||||
padding: 0px 20px;
|
||||
}
|
||||
.log-data:after{
|
||||
content: '';
|
||||
width: 0;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
border: 1px solid #ced8db;
|
||||
top: 0;
|
||||
left: 50px;
|
||||
}
|
||||
.log-record-status{
|
||||
background-color: #4c4c4c !important;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.log-record-status i:first-child{
|
||||
float: left;
|
||||
line-height: 19px;
|
||||
padding: 0px 10px 0px 0px;
|
||||
}
|
||||
.log-record-status span{
|
||||
float: left;
|
||||
line-height: 17px;
|
||||
}
|
||||
.log-status{
|
||||
padding-left: 14px;
|
||||
z-index: 10;
|
||||
position: relative;
|
||||
}
|
||||
.log-status i{
|
||||
margin: 0px 10px;
|
||||
background-color: #f6f6f6;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.log-entry{
|
||||
padding: 15px 0px;
|
||||
}
|
||||
.log-entry:not(:first-child){
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* custom css fixes
|
||||
*/
|
||||
|
||||
.page-content-wrapper, .page-content-wrapper[data-container-behaviour=static]{
|
||||
min-height: calc(100vh - 123px);
|
||||
}
|
||||
|
||||
.content{
|
||||
/*opacity: 0;*/
|
||||
}
|
||||
|
||||
.content-wrapper{
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dataTablesTop{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.table.list-table:not(.grid-view)>tbody>tr>td, .table.list-table:not(.grid-view)>tbody>tr>th{
|
||||
background-color: #eaeaea;
|
||||
}
|
||||
.table.table-hover>tbody>tr:hover td:not(.dataTables_empty){
|
||||
background-color: inherit !important;
|
||||
}
|
||||
.table-hover>tbody>tr:hover,{
|
||||
background-color:
|
||||
}
|
||||
.table.list-table>tbody>tr:nth-of-type(even), .table.list-table>tbody>tr:nth-of-type(odd){
|
||||
background-color: #eaeaea;
|
||||
}
|
||||
.table.table-hover>tbody>tr:hover td:not(.dataTables_empty){
|
||||
background-color: inherit !important;
|
||||
}
|
||||
.table.table-hover>tbody>tr:hover td.log-record-status{
|
||||
background-color: #4c4c4c !important;
|
||||
}
|
||||
|
||||
.tab-content{
|
||||
border:none;
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*/
|
||||
package org.wso2.carbon.policy.mgt.core.dao.impl.feature;
|
||||
|
||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||
import org.wso2.carbon.device.mgt.common.policy.mgt.ProfileFeature;
|
||||
import org.wso2.carbon.policy.mgt.core.dao.FeatureManagerDAOException;
|
||||
import org.wso2.carbon.policy.mgt.core.dao.PolicyManagementDAOFactory;
|
||||
import org.wso2.carbon.policy.mgt.core.dao.util.PolicyManagementDAOUtil;
|
||||
import org.wso2.carbon.policy.mgt.core.util.PolicyManagerUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
public class OracleServerFeatureDAOImpl extends AbstractFeatureDAO {
|
||||
/**
|
||||
* Batch sizes greater than 10 throws array out of bound exception.
|
||||
*/
|
||||
private static int BATCH_SIZE = 10;
|
||||
|
||||
@Override
|
||||
public List<ProfileFeature> addProfileFeatures(List<ProfileFeature> features, int profileId) throws
|
||||
FeatureManagerDAOException {
|
||||
|
||||
Connection conn;
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet generatedKeys = null;
|
||||
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
|
||||
|
||||
try {
|
||||
conn = this.getConnection();
|
||||
String query = "INSERT INTO DM_PROFILE_FEATURES (PROFILE_ID, FEATURE_CODE, DEVICE_TYPE, CONTENT, " +
|
||||
"TENANT_ID) VALUES (?, ?, ?, ?, ?)";
|
||||
stmt = conn.prepareStatement(query, new String[]{"id"});
|
||||
int noRecords = 0;
|
||||
for (ProfileFeature feature : features) {
|
||||
stmt.setInt(1, profileId);
|
||||
stmt.setString(2, feature.getFeatureCode());
|
||||
stmt.setString(3, feature.getDeviceType());
|
||||
stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent()));
|
||||
stmt.setInt(5, tenantId);
|
||||
stmt.addBatch();
|
||||
noRecords++;
|
||||
if (noRecords >= BATCH_SIZE && noRecords % BATCH_SIZE == 0) {
|
||||
stmt.executeBatch();
|
||||
generatedKeys = stmt.getGeneratedKeys();
|
||||
int i = noRecords - this.BATCH_SIZE;
|
||||
while (generatedKeys.next()) {
|
||||
features.get(i).setId(generatedKeys.getInt(1));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
stmt.executeBatch();
|
||||
generatedKeys = stmt.getGeneratedKeys();
|
||||
int i = 0;
|
||||
if (noRecords > BATCH_SIZE) {
|
||||
i = noRecords - BATCH_SIZE;
|
||||
}
|
||||
while (generatedKeys.next()) {
|
||||
features.get(i).setId(generatedKeys.getInt(1));
|
||||
i++;
|
||||
}
|
||||
} catch (SQLException | IOException e) {
|
||||
throw new FeatureManagerDAOException("Error occurred while adding the feature list to the database.", e);
|
||||
} finally {
|
||||
PolicyManagementDAOUtil.cleanupResources(stmt, generatedKeys);
|
||||
}
|
||||
return features;
|
||||
}
|
||||
|
||||
private Connection getConnection() throws FeatureManagerDAOException {
|
||||
return PolicyManagementDAOFactory.getConnection();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue