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

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1578462 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Matheis 2014-03-17 17:00:41 +00:00
parent 67bc019bd9
commit 718b91659c
3 changed files with 63 additions and 22 deletions

View File

@ -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

View File

@ -281,30 +281,49 @@ var solr_admin = function( app_config )
.css( 'width', ( selector_width - 2 ) + 'px' );
}
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>'
);
}
if( 0 !== failures.length )
{
var init_failures = $( '#init-failures' );
init_failures.show();
$( 'ul', init_failures ).html( failures.join( "\n" ) );
}
}
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 )
{
this.remove_init_failures();
return false;
}
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>'
);
}
if( 0 === failures.length )
{
this.remove_init_failures();
return false;
}
$( '#init-failures' )
.show()
.find( 'ul' )
.html( failures.join( "\n" ) );
}
this.run = function()
{
var navigator_language = navigator.userLanguage || navigator.language;

View File

@ -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 )
{