Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-5870: Admin UI - Reload on Core Admin doesn't show errors

Stefan Matheis718b91659c1e
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e95b4b9d8dc..dd94c34dbcc 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -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
diff --git a/solr/webapp/web/js/scripts/app.js b/solr/webapp/web/js/scripts/app.js
index 1267e7cb4c4..8714ad46198 100644
--- a/solr/webapp/web/js/scripts/app.js
+++ b/solr/webapp/web/js/scripts/app.js
@@ -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()
{
diff --git a/solr/webapp/web/js/scripts/cores.js b/solr/webapp/web/js/scripts/cores.js
index 18973988378..54f6cfab7b2 100644
--- a/solr/webapp/web/js/scripts/cores.js
+++ b/solr/webapp/web/js/scripts/cores.js
@@ -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 )
{