revert-70aa11f8
kamidu 8 years ago
commit 0fdcbae817

@ -288,12 +288,12 @@ public interface UserManagementService {
httpMethod = "GET", httpMethod = "GET",
value = "Get user list", value = "Get user list",
notes = "If you wish to get the details of all the users registered with EMM, you can do so " notes = "If you wish to get the details of all the users registered with EMM, you can do so "
+ "using the REST API", + "using this REST API",
tags = "User Management") tags = "User Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
message = "OK. \n Successfully fetched the requested role.", message = "OK. \n Successfully fetched the requested users.",
response = BasicUserInfoList.class, response = BasicUserInfoList.class,
responseHeaders = { responseHeaders = {
@ResponseHeader( @ResponseHeader(
@ -343,6 +343,36 @@ public interface UserManagementService {
required = false) required = false)
@QueryParam("limit") int limit); @QueryParam("limit") int limit);
@GET
@Path("/count")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
httpMethod = "GET",
value = "Get user count",
notes = "If you wish to get the user count registered with EMM, you can do so using this REST API",
tags = "User Management")
@ApiResponses(value = {
@ApiResponse(
code = 200,
message = "OK. \n Successfully fetched the user count.",
response = BasicUserInfoList.class,
responseHeaders = {
@ResponseHeader(
name = "Content-Type",
description = "The content type of the body")
}),
@ApiResponse(
code = 406,
message = "Not Acceptable.\n The requested media type is not supported",
response = ErrorResponse.class),
@ApiResponse(
code = 500,
message = "Internal Server Error. \n Server error occurred while fetching the user list.",
response = ErrorResponse.class)
})
@Permission(name = "View Users", permission = "/device-mgt/users/view")
Response getUserCount();
@GET @GET
@Path("/search/usernames") @Path("/search/usernames")
@ApiOperation( @ApiOperation(

@ -316,6 +316,26 @@ public class UserManagementServiceImpl implements UserManagementService {
} }
} }
@GET
@Path("/count")
@Override
public Response getUserCount() {
if (log.isDebugEnabled()) {
log.debug("Getting the user count");
}
try {
UserStoreManager userStoreManager = DeviceMgtAPIUtils.getUserStoreManager();
int userCount = userStoreManager.listUsers("*", -1).length;
return Response.status(Response.Status.OK).entity(userCount).build();
} catch (UserStoreException e) {
String msg = "Error occurred while retrieving the user count.";
log.error(msg, e);
return Response.serverError().entity(
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
}
}
@GET @GET
@Path("/search/usernames") @Path("/search/usernames")
@Override @Override

@ -273,6 +273,9 @@ deviceModule = function () {
deviceObject[constants["DEVICE_PROPERTIES"]] = properties; deviceObject[constants["DEVICE_PROPERTIES"]] = properties;
response["content"] = deviceObject; response["content"] = deviceObject;
return response; return response;
} else if (backendResponse.status == 401) {
response["status"] = "unauthorized";
return response;
} else { } else {
response["status"] = "error"; response["status"] = "error";
return response; return response;

@ -131,48 +131,49 @@
</div> </div>
<div id="remove-certificate-success-content" class="hide"> <div id="remove-certificate-success-content" class="hide">
<div class="content"> <div class="modal-header">
<div class="row"> <h3 class="pull-left modal-title">Done. Certificate was successfully removed.</h3>
<div class="col-lg-5 col-md-6 col-centered"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
<h3>Done. Certificate was successfully removed.</h3>
<div class="buttons">
<a href="#" id="remove-certificate-success-link" class="btn-operations">
Ok
</a>
</div> </div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
</div> </div>
<div class="modal-footer">
<div class="buttons">
</div> </div>
</div> </div>
</div> </div>
<div id="remove-certificate-error-content" class="hide"> <div id="remove-certificate-error-content" class="hide">
<div class="content"> <div class="modal-header">
<div class="row"> <h3 class="pull-left modal-title">An unexpected error occurred. Please try again later.</h3>
<div class="col-lg-5 col-md-6 col-centered"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
<h3>An unexpected error occurred. Please try again later.</h3>
<div class="buttons">
<a href="#" id="remove-certificate-error-link" class="btn-operations">
Ok
</a>
</div> </div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
</div> </div>
<div class="modal-footer">
<div class="buttons">
</div> </div>
</div> </div>
</div> </div>
<div id="errorCertificateView" class="hide"> <div id="errorCertificateView" class="hide">
<div class="content"> <div class="modal-header">
<div class="row"> <h3 class="pull-left modal-title">
<div class="col-lg-5 col-md-6 col-centered">
<h3>
<span class="fw-stack"> <span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-error fw-stack-1x"></i> <i class="fw fw-error fw-stack-1x"></i>
</span> </span>
Unauthorized action! Unauthorized action!
</h3> </h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div> </div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
</div>
<div class="modal-footer">
<div class="buttons">
</div> </div>
</div> </div>
</div> </div>

@ -3042,14 +3042,7 @@ a.list-group-item:hover {
left: 0; left: 0;
} }
@media (min-width: 768px) {
.tab-content > .tab-pane {
display: none !important;
}
.tab-content > .active {
display: block !important;
}
}
.wr-content { .wr-content {
padding-top: 10px; padding-top: 10px;
} }
@ -4313,6 +4306,13 @@ a.wr-side-panel-toggle-btn.selected {
height: 110px; height: 110px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.device-detail-body .wr-stats-board-tile {
background: #e2e2e2;
color: #333;
padding: 15px;
height: 110px;
margin-bottom: 10px;
}
.wr-stats-board .tiles .row { .wr-stats-board .tiles .row {
margin: 0 -5px; margin: 0 -5px;
@ -6905,15 +6905,19 @@ ul.tiles .icon {
.media .panel-group.tab-content{ .media .panel-group.tab-content{
position: relative; position: relative;
background: #f4f4f4; border: none;
border: 1px solid #ddd; margin-bottom:0px;
} }
.media .panel-group .panel-heading{ .media .panel-group .panel-heading{
padding:0px;
margin-bottom:0px;
}
.media .panel-group .panel-heading.display-none-xs{
padding:10px; padding:10px;
margin-bottom:0px; margin-bottom:0px;
} }
.media .panel.active .panel-heading.visible-xs{ .media .panel.active .panel-heading.visible-xs{
background:#2c313b; background:#11375b;
color:#fff; color:#fff;
} }
.media .panel-heading{ .media .panel-heading{
@ -6930,11 +6934,13 @@ ul.tiles .icon {
height: 0px; height: 0px;
border-top: 10px solid transparent; border-top: 10px solid transparent;
border-bottom: 10px solid transparent; border-bottom: 10px solid transparent;
border-right: 10px solid #f4f4f4; border-right: 10px solid #ddd;
} }
.media .panel-group.tab-content .panel{ .media .panel-group.tab-content .panel{
background:none; background: #f4f4f4;
border:1px solid #ddd;
margin-bottom:10px;
} }
.media .list-group-item a, .media .list-group-item a{ .media .list-group-item a, .media .list-group-item a{
background:#f4f4f4; background:#f4f4f4;
@ -6947,7 +6953,7 @@ ul.tiles .icon {
margin-top:0px; margin-top:0px;
} }
.media .panel-group .panel-body{ .media .panel-group .panel-body{
margin-bottom:40px; /*margin-bottom:40px;*/
} }
.media .panel-group .panel-body .thumbnail.icon{ .media .panel-group .panel-body .thumbnail.icon{
margin-bottom:10px; margin-bottom:10px;

@ -3525,13 +3525,6 @@ tbody.collapse.in {
} }
} }
.tab-content > .tab-pane {
display: none;
}
.tab-content > .active {
display: block;
}
.nav-tabs .dropdown-menu { .nav-tabs .dropdown-menu {
margin-top: -1px; margin-top: -1px;
border-top-right-radius: 0; border-top-right-radius: 0;
@ -8295,15 +8288,7 @@ a.list-group-item:hover {
left: 0; left: 0;
} }
@media (min-width: 768px) {
.tab-content > .tab-pane {
display: none !important;
}
.tab-content > .active {
display: block !important;
}
}
/* ======================================================================== /* ========================================================================
* Misc customizations * Misc customizations
* ======================================================================== */ * ======================================================================== */

@ -3,7 +3,8 @@ CREATE TABLE DM_DEVICE_TYPE (
NAME VARCHAR(300) DEFAULT NULL, NAME VARCHAR(300) DEFAULT NULL,
PROVIDER_TENANT_ID INTEGER NULL, PROVIDER_TENANT_ID INTEGER NULL,
SHARED_WITH_ALL_TENANTS BIT NOT NULL DEFAULT 0, SHARED_WITH_ALL_TENANTS BIT NOT NULL DEFAULT 0,
PRIMARY KEY (ID) PRIMARY KEY (ID),
CONSTRAINT DEVICE_TYPE_NAME UNIQUE(NAME)
); );
CREATE INDEX IDX_DEVICE_TYPE ON DM_DEVICE_TYPE (NAME); CREATE INDEX IDX_DEVICE_TYPE ON DM_DEVICE_TYPE (NAME);
@ -122,12 +123,12 @@ CREATE TABLE DM_PROFILE (
ID INTEGER IDENTITY(1,1) NOT NULL, ID INTEGER IDENTITY(1,1) NOT NULL,
PROFILE_NAME VARCHAR(45) NOT NULL , PROFILE_NAME VARCHAR(45) NOT NULL ,
TENANT_ID INTEGER NOT NULL , TENANT_ID INTEGER NOT NULL ,
DEVICE_TYPE_ID INTEGER NOT NULL , DEVICE_TYPE VARCHAR(300) NOT NULL ,
CREATED_TIME DATETIME NOT NULL , CREATED_TIME DATETIME NOT NULL ,
UPDATED_TIME DATETIME NOT NULL , UPDATED_TIME DATETIME NOT NULL ,
PRIMARY KEY (ID) , PRIMARY KEY (ID) ,
CONSTRAINT DM_PROFILE_DEVICE_TYPE FOREIGN KEY (DEVICE_TYPE_ID) REFERENCES CONSTRAINT DM_PROFILE_DEVICE_TYPE FOREIGN KEY (DEVICE_TYPE) REFERENCES
DM_DEVICE_TYPE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION DM_DEVICE_TYPE (NAME) ON DELETE NO ACTION ON UPDATE NO ACTION
); );
CREATE TABLE DM_POLICY ( CREATE TABLE DM_POLICY (

Loading…
Cancel
Save