mirror of https://github.com/apache/lucene.git
SOLR-3677: Fixed missleading error message in web ui to distinguish between no SolrCores loaded vs. no /admin/ handler available.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1367358 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ce85e4303e
commit
f0e5314f22
|
@ -166,6 +166,10 @@ Bug Fixes
|
|||
For the example configuration, this means /browse now works with SolrCloud.
|
||||
(janhoy, ehatcher)
|
||||
|
||||
* SOLR-3677: Fixed missleading error message in web ui to distinguish between
|
||||
no SolrCores loaded vs. no /admin/ handler available.
|
||||
(hossman, steffkes)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -152,6 +152,24 @@ var solr_admin = function( app_config )
|
|||
|
||||
this.timeout = null;
|
||||
|
||||
show_global_error = function( error )
|
||||
{
|
||||
var main = $( '#main' );
|
||||
|
||||
$( 'div[id$="-wrapper"]', main )
|
||||
.remove();
|
||||
|
||||
main
|
||||
.addClass( 'error' )
|
||||
.append( error );
|
||||
|
||||
var pre_tags = $( 'pre', main );
|
||||
if( 0 !== pre_tags.size() )
|
||||
{
|
||||
hljs.highlightBlock( pre_tags.get(0) );
|
||||
}
|
||||
};
|
||||
|
||||
this.run = function()
|
||||
{
|
||||
$.ajax
|
||||
|
@ -167,9 +185,11 @@ var solr_admin = function( app_config )
|
|||
success : function( response )
|
||||
{
|
||||
self.cores_data = response.status;
|
||||
var core_count = 0;
|
||||
|
||||
for( var core_name in response.status )
|
||||
{
|
||||
core_count++;
|
||||
var core_path = config.solr_path + '/' + core_name;
|
||||
var schema = response['status'][core_name]['schema'];
|
||||
var solrconfig = response['status'][core_name]['config'];
|
||||
|
@ -211,10 +231,21 @@ var solr_admin = function( app_config )
|
|||
.append( core_tpl );
|
||||
}
|
||||
|
||||
if( 0 === core_count )
|
||||
{
|
||||
show_global_error
|
||||
(
|
||||
'<div class="message">There are no SolrCores running — for the currenct functionality ' +
|
||||
'we require at least one SolrCore, sorry :)</div>'
|
||||
);
|
||||
return;
|
||||
} // else: we have at least one core....
|
||||
|
||||
var system_url = environment_basepath + '/admin/system?wt=json';
|
||||
$.ajax
|
||||
(
|
||||
{
|
||||
url : environment_basepath + '/admin/system?wt=json',
|
||||
url : system_url,
|
||||
dataType : 'json',
|
||||
beforeSend : function( arr, form, options )
|
||||
{
|
||||
|
@ -280,23 +311,17 @@ var solr_admin = function( app_config )
|
|||
},
|
||||
error : function()
|
||||
{
|
||||
var main = $( '#main' );
|
||||
|
||||
$( 'div[id$="-wrapper"]', main )
|
||||
.remove();
|
||||
|
||||
main
|
||||
.addClass( 'error' )
|
||||
.append
|
||||
show_global_error
|
||||
(
|
||||
'<div class="message">This interface requires that you activate the admin request handlers, add the following configuration to your <code>solrconfig.xml:</code></div>' +
|
||||
'<div class="message"><p>Unable to load environment info from <code>' + system_url.esc() + '</code>.</p>' +
|
||||
'<p>This interface requires that you activate the admin request handlers in all SolrCores by adding the ' +
|
||||
'following configuration to your <code>solrconfig.xml</code>:</p></div>' + "\n" +
|
||||
|
||||
'<div class="code"><pre class="syntax language-xml"><code>' +
|
||||
'<!-- Admin Handlers - This will register all the standard admin RequestHandlers. -->'.esc() + "\n" +
|
||||
'<requestHandler name="/admin/" class="solr.admin.AdminHandlers" />'.esc() +
|
||||
'</code></pre></div>'
|
||||
);
|
||||
|
||||
hljs.highlightBlock( $( 'pre', main ).get(0) );
|
||||
},
|
||||
complete : function()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue