From 2d785b5d5eec3e7bc4879fcdfa9faa1f2c4ccf8a Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Tue, 17 Mar 2015 07:52:55 +0100 Subject: [PATCH] KEYCLOAK-1050 Added support for selecting multiple values --- .../base/resources/js/controllers/realm.js | 4 +- .../resources/partials/realm-detail_mock.html | 116 ------------------ .../base/resources/partials/realm-events.html | 15 +-- .../resources/admin/RealmAdminResource.java | 15 ++- 4 files changed, 19 insertions(+), 131 deletions(-) delete mode 100755 forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-detail_mock.html diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js index 27884c451c..8ca40a8702 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/js/controllers/realm.js @@ -1195,11 +1195,11 @@ module.controller('RealmEventsCtrl', function($scope, RealmEvents, realm) { $scope.realm = realm; $scope.page = 0; - $scope.eventTypes = [{tag:'LOGIN'}, {tag:'REGISTER'}, {tag:'LOGOUT'}, {tag:'CODE_TO_TOKEN'}, {tag:'REFRESH_TOKEN'}, + $scope.eventTypes = [{tag:'LOGIN'}, {tag:'REGISTER'}, {tag:'LOGOUT'}, {tag:'CODE_TO_TOKEN'}, {tag:'REFRESH_TOKEN'}, {tag:'LOGIN_ERROR'}, {tag:'REGISTER_ERROR'}, {tag:'LOGOUT_ERROR'}, {tag:'CODE_TO_TOKEN_ERROR'}, {tag:'REFRESH_TOKEN_ERROR'}, {tag:'VALIDATE_ACCESS_TOKEN'}, {tag:'VALIDATE_ACCESS_TOKEN_ERROR'}, {tag:'SOCIAL_LINK'}, {tag:'SOCIAL_LINK_ERROR'}, {tag:'REMOVE_FEDERATED_IDENTITY'}, {tag:'REMOVE_SOCIAL_LINK_ERROR'}, {tag:'UPDATE_EMAIL'}, {tag:'UPDATE_PROFILE'}, {tag:'UPDATE_PASSWORD'}, {tag:'UPDATE_TOTP'}]; - + $scope.query = { id : realm.realm, max : 5, diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-detail_mock.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-detail_mock.html deleted file mode 100755 index 6338905e64..0000000000 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-detail_mock.html +++ /dev/null @@ -1,116 +0,0 @@ -

Add Realm

-

{{realm.realm}} General Settings

-

* Required fields

-
-
- Required Settings -
- - -
- -
-
-
- -
- -
-
-
-
- Login Options -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- Optional Settings -
- - -
- -
-
-
- - -
- -
-
- -
- - -
- -
-
-
- -
- - -
-
- - - -
-
- diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-events.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-events.html index e8107178d5..27843f3926 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-events.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-events.html @@ -31,16 +31,13 @@
- +
- -
-
+ + +
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java index bb6bedd914..0befaa4c87 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java @@ -382,7 +382,7 @@ public class RealmAdminResource { * Query events. Returns all events, or will query based on URL query parameters listed here * * @param client app or oauth client name - * @param type type type + * @param types type type * @param user user id * @param ipAddress * @param firstResult @@ -393,7 +393,7 @@ public class RealmAdminResource { @GET @NoCache @Produces(MediaType.APPLICATION_JSON) - public List getEvents(@QueryParam("client") String client, @QueryParam("type") String type, + public List getEvents(@QueryParam("client") String client, @QueryParam("user") String user, @QueryParam("dateFrom") String dateFrom, @QueryParam("dateTo") String dateTo, @QueryParam("ipAddress") String ipAddress, @QueryParam("first") Integer firstResult, @QueryParam("max") Integer maxResults) { @@ -405,9 +405,16 @@ public class RealmAdminResource { if (client != null) { query.client(client); } - if (type != null) { - query.type(EventType.valueOf(type)); + + List types = uriInfo.getQueryParameters().get("type"); + if (types != null) { + EventType[] t = new EventType[types.size()]; + for (int i = 0; i < t.length; i++) { + t[i] = EventType.valueOf(types.get(i)); + } + query.type(t); } + if (user != null) { query.user(user); }