You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by st...@apache.org on 2014/03/17 18:00:41 UTC

svn commit: r1578462 - in /lucene/dev/trunk/solr: CHANGES.txt webapp/web/js/scripts/app.js webapp/web/js/scripts/cores.js

Author: steffkes
Date: Mon Mar 17 17:00:41 2014
New Revision: 1578462

URL: http://svn.apache.org/r1578462
Log:
SOLR-5870: Admin UI - Reload on Core Admin doesn't show errors

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/webapp/web/js/scripts/app.js
    lucene/dev/trunk/solr/webapp/web/js/scripts/cores.js

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1578462&r1=1578461&r2=1578462&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Mar 17 17:00:41 2014
@@ -190,6 +190,8 @@ Bug Fixes
   per doc instead of once per shard.
   (Alexey Serba, hoss, Martin de Vries via Steve Rowe)
 
+* SOLR-5870: Admin UI - Reload on Core Admin doesn't show errors (steffkes)
+
 Optimizations
 ----------------------
 * SOLR-1880: Distributed Search skips GET_FIELDS stage if EXECUTE_QUERY

Modified: lucene/dev/trunk/solr/webapp/web/js/scripts/app.js
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/scripts/app.js?rev=1578462&r1=1578461&r2=1578462&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/js/scripts/app.js (original)
+++ lucene/dev/trunk/solr/webapp/web/js/scripts/app.js Mon Mar 17 17:00:41 2014
@@ -281,29 +281,48 @@ var solr_admin = function( app_config )
         .css( 'width', ( selector_width - 2 ) + 'px' );
     }
 
-    if( cores.initFailures )
+    this.check_for_init_failures( cores );
+  };
+
+  this.remove_init_failures = function remove_init_failures()
+  {
+    $( '#init-failures' )
+      .hide()
+      .find( 'ul' )
+        .empty();
+  }
+
+  this.check_for_init_failures = function check_for_init_failures( cores )
+  {
+    if( !cores.initFailures )
     {
-      var failures = [];
-      for( var core_name in cores.initFailures )
-      {
-        failures.push
-        (
-          '<li>' +
-            '<strong>' + core_name.esc() + ':</strong>' + "\n" +
-            cores.initFailures[core_name].esc() + "\n" +
-          '</li>'
-        );
-      }
+      this.remove_init_failures();
+      return false;
+    }
 
-      if( 0 !== failures.length )
-      {
-        var init_failures = $( '#init-failures' );
+    var failures = [];
+    for( var core_name in cores.initFailures )
+    {
+      failures.push
+      (
+        '<li>' +
+          '<strong>' + core_name.esc() + ':</strong>' + "\n" +
+          cores.initFailures[core_name].esc() + "\n" +
+        '</li>'
+      );
+    }
 
-        init_failures.show();
-        $( 'ul', init_failures ).html( failures.join( "\n" ) );
-      }
+    if( 0 === failures.length )
+    {
+      this.remove_init_failures();
+      return false;
     }
-  };
+
+    $( '#init-failures' )
+      .show()
+      .find( 'ul' )
+        .html( failures.join( "\n" ) );
+  }
 
   this.run = function()
   {

Modified: lucene/dev/trunk/solr/webapp/web/js/scripts/cores.js
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/web/js/scripts/cores.js?rev=1578462&r1=1578461&r2=1578462&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/web/js/scripts/cores.js (original)
+++ lucene/dev/trunk/solr/webapp/web/js/scripts/cores.js Mon Mar 17 17:00:41 2014
@@ -30,6 +30,12 @@ sammy.bind
         },
         success : function( response, text_status, xhr )
         {
+          if( params.only_failures )
+          {
+            app.check_for_init_failures( response );
+            return true;
+          }
+
           var has_cores = false;
           for( core in response.status )
           {
@@ -572,6 +578,20 @@ sammy.get
                           },
                           error : function( xhr, text_status, error_thrown )
                           {
+                            this
+                              .addClass( 'warn' );
+
+                            sammy.trigger( 'cores_load_data', { only_failures : true } );
+
+                            window.setTimeout
+                            (
+                              function()
+                              {
+                                reload_button
+                                  .removeClass( 'warn' );
+                              },
+                              1000
+                            );
                           },
                           complete : function( xhr, text_status )
                           {