You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sirona.apache.org by ol...@apache.org on 2014/08/20 07:54:27 UTC

svn commit: r1619034 - in /incubator/sirona/trunk/server/reporting: reporting-api/src/main/java/org/apache/sirona/reporting/web/threads/ reporting-ui/src/main/webapp/js/ reporting-ui/src/main/webapp/js/app/controllers/ reporting-ui/src/main/webapp/js/a...

Author: olamy
Date: Wed Aug 20 05:54:27 2014
New Revision: 1619034

URL: http://svn.apache.org/r1619034
Log:
finish thread detail display

Modified:
    incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/threads/ThreadsReports.java
    incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/app/controllers/controllers-threads.js
    incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/app/services/services.js
    incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/sirona.js
    incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/partials/threads.html

Modified: incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/threads/ThreadsReports.java
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/threads/ThreadsReports.java?rev=1619034&r1=1619033&r2=1619034&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/threads/ThreadsReports.java (original)
+++ incubator/sirona/trunk/server/reporting/reporting-api/src/main/java/org/apache/sirona/reporting/web/threads/ThreadsReports.java Wed Aug 20 05:54:27 2014
@@ -44,11 +44,11 @@ public class ThreadsReports
     }
 
     @GET
-    @Path( "/{threadName}" )
+    @Path( "/{threadencodedName}" )
     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
-    public ThreadDump getThread( @PathParam( "threadName" ) String name )
+    public ThreadDump getThread( @PathParam( "threadencodedName" ) String threadencodedName )
     {
-        Thread thread = findThread( name );
+        Thread thread = findThread( threadencodedName );
         if ( thread == null )
         {
             return null;
@@ -58,7 +58,7 @@ public class ThreadsReports
 
     }
 
-    private static Thread findThread( final String name )
+    private static Thread findThread( final String threadencodedName )
     {
         int count = Thread.activeCount();
         final Thread[] threads = new Thread[count];
@@ -66,7 +66,7 @@ public class ThreadsReports
 
         for ( int i = 0; i < count; i++ )
         {
-            if ( threads[i].getName().equals( name ) )
+            if ( Base64.encodeBase64URLSafeString( threads[i].getName().getBytes() ).equals( threadencodedName ) )
             {
                 return threads[i];
             }

Modified: incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/app/controllers/controllers-threads.js
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/app/controllers/controllers-threads.js?rev=1619034&r1=1619033&r2=1619034&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/app/controllers/controllers-threads.js (original)
+++ incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/app/controllers/controllers-threads.js Wed Aug 20 05:54:27 2014
@@ -22,17 +22,25 @@ define(['jquery','angular','bootstrap','
 
   var jvmControllers = angular.module('threadsControllers', ['sironaJvmServices','ui.bootstrap','ui.bootstrap.datetimepicker']);
 
-  jvmControllers.controller( 'ThreadsHomeCtrl', ['$scope','threads',
-    function ( $scope,threads){
+  jvmControllers.controller( 'ThreadsHomeCtrl', ['$scope','$routeParams','threads',
+    function ($scope,$routeParams,threads){
 
       $scope.data={};
-      console.log("ThreadsHomeCtrl");
+
+      var threadName=$routeParams.threadName;
+
+      console.log("ThreadsHomeCtrl:"+threadName);
 
       threads.query().$promise.then(function(result){
         $scope.data.threadInfos=result;
 
       });
 
+      if (angular.isDefined(threadName)){
+        $scope.data.currentThread = threads.get({threadName:threadName});
+      }
+
+
   }]);
 
 

Modified: incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/app/services/services.js
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/app/services/services.js?rev=1619034&r1=1619033&r2=1619034&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/app/services/services.js (original)
+++ incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/app/services/services.js Wed Aug 20 05:54:27 2014
@@ -71,9 +71,9 @@ define(['angular','angular-resource'], f
 
   sironaServices.factory('threads', ['$resource',
     function($resource){
-      return $resource('restServices/sironaServices/threads',
+      return $resource('restServices/sironaServices/threads/:threadName',
                        {},
-                       {query: {method:'GET', params:{},isArray:true}});
+                       {query: {method:'GET', params:{threadName:'@threadName'},isArray:true}});
     }
   ]);
 

Modified: incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/sirona.js
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/sirona.js?rev=1619034&r1=1619033&r2=1619034&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/sirona.js (original)
+++ incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/js/sirona.js Wed Aug 20 05:54:27 2014
@@ -49,6 +49,12 @@ define(['jquery','controllers','controll
                controller: 'ThreadsHomeCtrl'
              }
         ).
+        when('/threads/:threadName',
+             {
+               templateUrl: 'partials/threads.html',
+               controller: 'ThreadsHomeCtrl'
+             }
+        ).
         otherwise({
           redirectTo: '/home'
         });

Modified: incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/partials/threads.html
URL: http://svn.apache.org/viewvc/incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/partials/threads.html?rev=1619034&r1=1619033&r2=1619034&view=diff
==============================================================================
--- incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/partials/threads.html (original)
+++ incubator/sirona/trunk/server/reporting/reporting-ui/src/main/webapp/partials/threads.html Wed Aug 20 05:54:27 2014
@@ -18,11 +18,16 @@
   <div class="col-lg-2" style="word-break: break-all; word-wrap: break-word;">
     <ul>
       <li ng-repeat="threadInfo in data.threadInfos">
-        {{threadInfo.name}}
+        <a href="#threads/{{::threadInfo.encodedName}}">{{::threadInfo.name}}</a>
       </li>
     </ul>
   </div>
   <div class="col-lg-10">
-    content
+    <p>
+      State: {{::data.currentThread.state}}
+    </p>
+    <p>
+      <pre>{{::data.currentThread.dump}}</pre>
+    </p>
   </div>
 </div>
\ No newline at end of file