keycloak-uncached

Merge pull request #701 from stianst/master KEYCLOAK-696

9/18/2014 8:24:38 AM

Details

diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/index.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/index.html
index 3e50295..8ec75f4 100755
--- a/forms/common-themes/src/main/resources/theme/admin/base/resources/index.html
+++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/index.html
@@ -71,6 +71,7 @@
             <span>Loading...</span>
         </div>
     </div>
+    <div id="serverInfo">Keycloak {{serverInfo.version}}</div>
 </div>
 
 </body>
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 4412441..1a0adcb 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
@@ -1,10 +1,11 @@
-module.controller('GlobalCtrl', function($scope, $http, Auth, WhoAmI, Current, $location, Notifications) {
+module.controller('GlobalCtrl', function($scope, $http, Auth, WhoAmI, Current, $location, Notifications, ServerInfo) {
     $scope.addMessage = function() {
         Notifications.success("test");
     };
 
     $scope.authUrl = authUrl;
     $scope.auth = Auth;
+    $scope.serverInfo = ServerInfo.get();
 
     WhoAmI.get(function (data) {
         Auth.user = data;
diff --git a/forms/common-themes/src/main/resources/theme/admin/keycloak/resources/css/admin-console.css b/forms/common-themes/src/main/resources/theme/admin/keycloak/resources/css/admin-console.css
index e0e2450..e72d4d6 100644
--- a/forms/common-themes/src/main/resources/theme/admin/keycloak/resources/css/admin-console.css
+++ b/forms/common-themes/src/main/resources/theme/admin/keycloak/resources/css/admin-console.css
@@ -836,4 +836,11 @@ legend .kc-icon-collapse {
 
 table table {
     margin-bottom: 0 !important;
+}
+
+#serverInfo {
+    color: #666;
+    position: absolute;
+    bottom: 10px;
+    right: 10px;
 }
\ No newline at end of file
diff --git a/services/src/main/java/org/keycloak/services/resources/admin/ServerInfoAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/ServerInfoAdminResource.java
index 391ffbb..42f3264 100755
--- a/services/src/main/java/org/keycloak/services/resources/admin/ServerInfoAdminResource.java
+++ b/services/src/main/java/org/keycloak/services/resources/admin/ServerInfoAdminResource.java
@@ -1,6 +1,6 @@
 package org.keycloak.services.resources.admin;
 
-import org.jboss.resteasy.annotations.cache.NoCache;
+import org.keycloak.Version;
 import org.keycloak.events.EventListenerProvider;
 import org.keycloak.freemarker.Theme;
 import org.keycloak.freemarker.ThemeProvider;
@@ -31,9 +31,9 @@ public class ServerInfoAdminResource {
      * @return
      */
     @GET
-    @NoCache
     public ServerInfoRepresentation getInfo() {
         ServerInfoRepresentation info = new ServerInfoRepresentation();
+        info.setVersion(Version.VERSION);
         setSocialProviders(info);
         setThemes(info);
         setEventListeners(info);
@@ -71,6 +71,8 @@ public class ServerInfoAdminResource {
 
     public static class ServerInfoRepresentation {
 
+        private String version;
+
         private Map<String, List<String>> themes;
 
         private List<String> socialProviders;
@@ -81,6 +83,14 @@ public class ServerInfoAdminResource {
         public ServerInfoRepresentation() {
         }
 
+        public String getVersion() {
+            return version;
+        }
+
+        public void setVersion(String version) {
+            this.version = version;
+        }
+
         public Map<String, List<String>> getThemes() {
             return themes;
         }