You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2013/01/18 19:31:23 UTC
svn commit: r1435287 [41/41] - in /lucene/dev/branches/LUCENE-2878: ./
dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/libraries/
dev-tools/idea/lucene/analysis/icu/ dev-tools/maven/
dev-tools/maven/lucene/benchmark/ dev-tools/maven/solr/ dev-tools/...
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/app.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/app.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/app.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/app.js Fri Jan 18 18:30:54 2013
@@ -82,11 +82,7 @@ var sammy = $.sammy
{},
function( context )
{
- if( app.timeout )
- {
- console.debug( 'Clearing Timeout #' + app.timeout );
- clearTimeout( app.timeout );
- }
+ app.clear_timeout();
var menu_wrapper = $( '#menu-wrapper' );
@@ -100,7 +96,7 @@ var sammy = $.sammy
{
var selector = '~' === this.params.splat[0][0]
? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global'
- : '#menu-selector #' + this.params.splat[0];
+ : '#menu-selector #' + this.params.splat[0].replace( /\./g, '__' );
var active_element = $( selector, menu_wrapper );
@@ -131,7 +127,7 @@ var sammy = $.sammy
var solr_admin = function( app_config )
{
- self = this,
+ that = this,
menu_element = null,
@@ -152,6 +148,8 @@ var solr_admin = function( app_config )
this.timeout = null;
+ this.core_regex_base = '^#\\/([\\w\\d-\\.]+)';
+
show_global_error = function( error )
{
var main = $( '#main' );
@@ -170,6 +168,110 @@ var solr_admin = function( app_config )
}
};
+ sort_cores_data = function sort_cores_data( cores_status )
+ {
+ // build array of core-names for sorting
+ var core_names = [];
+ for( var core_name in cores_status )
+ {
+ core_names.push( core_name );
+ }
+ core_names.sort();
+
+ var core_count = core_names.length;
+ var cores = {};
+
+ for( var i = 0; i < core_count; i++ )
+ {
+ var core_name = core_names[i];
+ cores[core_name] = cores_status[core_name];
+ }
+
+ return cores;
+ };
+
+ this.set_cores_data = function set_cores_data( cores )
+ {
+ that.cores_data = sort_cores_data( cores.status );
+
+ that.menu_element
+ .empty();
+
+ var core_count = 0;
+ for( var core_name in that.cores_data )
+ {
+ core_count++;
+ var core_path = config.solr_path + '/' + core_name;
+ var classes = [];
+
+ if( !environment_basepath )
+ {
+ environment_basepath = core_path;
+ }
+
+ if( cores.status[core_name]['isDefaultCore'] )
+ {
+ classes.push( 'default' );
+ }
+
+ var core_tpl = '<li id="' + core_name.replace( /\./g, '__' ) + '" '
+ + ' class="' + classes.join( ' ' ) + '"'
+ + ' data-basepath="' + core_path + '"'
+ + ' schema="' + cores.status[core_name]['schema'] + '"'
+ + ' config="' + cores.status[core_name]['config'] + '"'
+ + '>' + "\n"
+ + ' <p><a href="#/' + core_name + '" title="' + core_name + '">' + core_name + '</a></p>' + "\n"
+ + ' <ul>' + "\n"
+
+ + ' <li class="ping"><a rel="' + core_path + '/admin/ping"><span>Ping</span></a></li>' + "\n"
+ + ' <li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n"
+ + ' <li class="schema"><a href="#/' + core_name + '/schema"><span>Schema</span></a></li>' + "\n"
+ + ' <li class="config"><a href="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n"
+ + ' <li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n"
+ + ' <li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n"
+ + ' <li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' + "\n"
+ + ' <li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n"
+ + ' <li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n"
+
+ + ' </ul>' + "\n"
+ + '</li>';
+
+ that.menu_element
+ .append( core_tpl );
+ }
+
+ 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" ) );
+ }
+ }
+
+ if( 0 === core_count )
+ {
+ show_global_error
+ (
+ '<div class="message">There are no SolrCores running. <br/> Using the Solr Admin UI currently requires at least one SolrCore.</div>'
+ );
+ } // else: we have at least one core....
+ };
+
this.run = function()
{
$.ajax
@@ -184,85 +286,17 @@ var solr_admin = function( app_config )
},
success : function( response )
{
- self.cores_data = response.status;
- var core_count = 0;
+ that.set_cores_data( response );
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'];
- var classes = [];
-
if( !environment_basepath )
{
environment_basepath = core_path;
}
-
- if( response['status'][core_name]['isDefaultCore'] )
- {
- classes.push( 'default' );
- }
-
- var core_tpl = '<li id="' + core_name + '" '
- + ' class="' + classes.join( ' ' ) + '"'
- + ' data-basepath="' + core_path + '"'
- + ' schema="' + schema + '"'
- + ' config="' + solrconfig + '"'
- + '>' + "\n"
- + ' <p><a href="#/' + core_name + '">' + core_name + '</a></p>' + "\n"
- + ' <ul>' + "\n"
-
- + ' <li class="ping"><a rel="' + core_path + '/admin/ping"><span>Ping</span></a></li>' + "\n"
- + ' <li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n"
- + ' <li class="schema"><a href="#/' + core_name + '/schema"><span>Schema</span></a></li>' + "\n"
- + ' <li class="config"><a href="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n"
- + ' <li class="replication"><a href="#/' + core_name + '/replication"><span>Replication</span></a></li>' + "\n"
- + ' <li class="analysis"><a href="#/' + core_name + '/analysis"><span>Analysis</span></a></li>' + "\n"
- + ' <li class="schema-browser"><a href="#/' + core_name + '/schema-browser"><span>Schema Browser</span></a></li>' + "\n"
- + ' <li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n"
- + ' <li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n"
-
- + ' </ul>' + "\n"
- + '</li>';
-
- self.menu_element
- .append( core_tpl );
}
- if( response.initFailures )
- {
- var failures = [];
- for( var core_name in response.initFailures )
- {
- failures.push
- (
- '<li>' +
- '<strong>' + core_name.esc() + ':</strong>' + "\n" +
- response.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" ) );
- }
- }
-
- if( 0 === core_count )
- {
- show_global_error
- (
- '<div class="message">There are no SolrCores running. <br/> Using the Solr Admin UI currently requires at least one SolrCore.</div>'
- );
- return;
- } // else: we have at least one core....
-
var system_url = environment_basepath + '/admin/system?wt=json';
$.ajax
(
@@ -274,7 +308,7 @@ var solr_admin = function( app_config )
},
success : function( response )
{
- self.dashboard_values = response;
+ that.dashboard_values = response;
var environment_args = null;
var cloud_args = null;
@@ -361,7 +395,78 @@ var solr_admin = function( app_config )
}
}
);
- }
+ };
+
+ this.convert_duration_to_seconds = function convert_duration_to_seconds( str )
+ {
+ var seconds = 0;
+ var arr = new String( str || '' ).split( '.' );
+ var parts = arr[0].split( ':' ).reverse();
+ var parts_count = parts.length;
+
+ for( var i = 0; i < parts_count; i++ )
+ {
+ seconds += ( parseInt( parts[i], 10 ) || 0 ) * Math.pow( 60, i );
+ }
+
+ // treat more or equal than .5 as additional second
+ if( arr[1] && 5 <= parseInt( arr[1][0], 10 ) )
+ {
+ seconds++;
+ }
+
+ return seconds;
+ };
+
+ this.convert_seconds_to_readable_time = function convert_seconds_to_readable_time( seconds )
+ {
+ seconds = parseInt( seconds || 0, 10 );
+ var minutes = Math.floor( seconds / 60 );
+ var hours = Math.floor( minutes / 60 );
+
+ var text = [];
+ if( 0 !== hours )
+ {
+ text.push( hours + 'h' );
+ seconds -= hours * 60 * 60;
+ minutes -= hours * 60;
+ }
+
+ if( 0 !== minutes )
+ {
+ text.push( minutes + 'm' );
+ seconds -= minutes * 60;
+ }
+
+ if( 0 !== seconds )
+ {
+ text.push( ( '0' + seconds ).substr( -2 ) + 's' );
+ }
+
+ return text.join( ' ' );
+ };
+
+ this.clear_timeout = function clear_timeout()
+ {
+ if( !app.timeout )
+ {
+ return false;
+ }
+
+ console.debug( 'Clearing Timeout #' + this.timeout );
+ clearTimeout( this.timeout );
+ this.timeout = null;
+ };
+
+ this.format_json = function format_json( json_str )
+ {
+ if( JSON.stringify && JSON.parse )
+ {
+ json_str = JSON.stringify( JSON.parse( json_str ), undefined, 2 );
+ }
+
+ return json_str;
+ };
};
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/cloud.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/cloud.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/cloud.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/cloud.js Fri Jan 18 18:30:54 2013
@@ -15,6 +15,27 @@
limitations under the License.
*/
+var zk_error = function zk_error( xhr, text_status, error_thrown )
+{
+ var zk = null;
+ try
+ {
+ eval( 'zk = ' + xhr.responseText + ';' );
+ }
+ catch( e ) {}
+
+ var message = '<p class="txt">Loading of "<code>' + xhr.url + '</code>" '
+ + 'failed (HTTP-Status <code>' + xhr.status + '</code>)</p>' + "\n";
+
+ if( zk.error )
+ {
+ message += '<p class="msg">"' + zk.error.esc() + '"</p>' + "\n";
+ }
+
+ this.closest( '#cloud' )
+ .html( '<div class="block" id="error">' + message + '</div>' );
+};
+
var init_debug = function( cloud_element )
{
var debug_element = $( '#debug', cloud_element );
@@ -369,13 +390,13 @@ var prepare_graph = function( graph_elem
for( var c in state )
{
var shards = [];
- for( var s in state[c] )
+ for( var s in state[c].shards )
{
var nodes = [];
- for( var n in state[c][s].replicas )
+ for( var n in state[c].shards[s].replicas )
{
leaf_count++;
- var replica = state[c][s].replicas[n]
+ var replica = state[c].shards[s].replicas[n]
var uri = replica.base_url;
var parts = uri.match( /^(\w+:)\/\/(([\w\d\.-]+)(:(\d+))?)(.+)$/ );
@@ -415,7 +436,7 @@ var prepare_graph = function( graph_elem
var shard = {
name: s,
data: {
- type : 'shard',
+ type : 'shard'
},
children: nodes
};
@@ -425,7 +446,7 @@ var prepare_graph = function( graph_elem
var collection = {
name: c,
data: {
- type : 'collection',
+ type : 'collection'
},
children: shards
};
@@ -633,19 +654,7 @@ var init_tree = function( tree_element )
}
);
},
- error : function( xhr, text_status, error_thrown )
- {
- var message = 'Loading of <code>' + app.config.zookeeper_path + '</code> failed with "' + text_status + '" '
- + '(<code>' + error_thrown.message + '</code>)';
-
- if( 200 !== xhr.status )
- {
- message = 'Loading of <code>' + app.config.zookeeper_path + '</code> failed with HTTP-Status ' + xhr.status + ' ';
- }
-
- this
- .html( '<div class="block" id="error">' + message + '</div>' );
- },
+ error : zk_error,
complete : function( xhr, text_status )
{
}
@@ -710,8 +719,20 @@ sammy.get
}
);
- $( 'a[href="' + context.path + '"]', navigation_element )
- .trigger( 'activate' );
+ $.ajax
+ (
+ {
+ url : app.config.solr_path + '/zookeeper?wt=json',
+ dataType : 'json',
+ context : cloud_element,
+ success : function( response, text_status, xhr )
+ {
+ $( 'a[href="' + context.path + '"]', navigation_element )
+ .trigger( 'activate' );
+ },
+ error : zk_error
+ }
+ );
}
);
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/cores.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/cores.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/cores.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/cores.js Fri Jan 18 18:30:54 2013
@@ -36,7 +36,7 @@ sammy.bind
},
success : function( response, text_status, xhr )
{
- app.cores_data = response.status;
+ app.set_cores_data( response );
params.callback( app.cores_data );
},
error : function( xhr, text_status, error_thrown)
@@ -189,7 +189,7 @@ sammy.get
// index-data
$( '.lastModified dd', index_data_element )
- .html( core_data.index.lastModified );
+ .html( core_data.index.lastModified || '-' );
$( '.version dd', index_data_element )
.html( core_data.index.version );
@@ -199,6 +199,9 @@ sammy.get
$( '.maxDoc dd', index_data_element )
.html( core_data.index.maxDoc );
+
+ $( '.deletedDocs dd', index_data_element )
+ .html( core_data.index.deletedDocs || '-' );
$( '.optimized dd', index_data_element )
.addClass( !core_data.index.hasDeletions ? 'ico-1' : 'ico-0' );
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/dashboard.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/dashboard.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/dashboard.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/dashboard.js Fri Jan 18 18:30:54 2013
@@ -39,7 +39,7 @@ var set_healthcheck_status = function( s
// #/:core
sammy.get
(
- /^#\/([\w\d-]+)$/,
+ new RegExp( app.core_regex_base + '$' ),
function( context )
{
var core_basepath = this.active_core.attr( 'data-basepath' );
@@ -114,6 +114,7 @@ sammy.get
var data = {
'index_num-docs' : response['index']['numDocs'],
'index_max-doc' : response['index']['maxDoc'],
+ 'index_deleted-docs' : response['index']['deletedDocs'],
'index_version' : response['index']['version'],
'index_segmentCount' : response['index']['segmentCount'],
'index_last-modified' : response['index']['lastModified']
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/dataimport.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/dataimport.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/dataimport.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/dataimport.js Fri Jan 18 18:30:54 2013
@@ -15,48 +15,8 @@
limitations under the License.
*/
-var convert_duration_to_seconds = function( str )
-{
- var ret = 0;
- var parts = new String( str ).split( '.' ).shift().split( ':' ).reverse();
- var parts_count = parts.length;
-
- for( var i = 0; i < parts_count; i++ )
- {
- ret += parseInt( parts[i], 10 ) * Math.pow( 60, i );
- }
-
- return ret;
-}
-
-var convert_seconds_to_readable_time = function( value )
-{
- var text = [];
- value = parseInt( value );
-
- var minutes = Math.floor( value / 60 );
- var hours = Math.floor( minutes / 60 );
-
- if( 0 !== hours )
- {
- text.push( hours + 'h' );
- value -= hours * 60 * 60;
- minutes -= hours * 60;
- }
-
- if( 0 !== minutes )
- {
- text.push( minutes + 'm' );
- value -= minutes * 60;
- }
-
- if( 0 !== value )
- {
- text.push( value + 's' );
- }
-
- return text.join( ' ' );
-}
+var dataimport_timeout = 2000;
+var cookie_dataimport_autorefresh = 'dataimport_autorefresh';
sammy.bind
(
@@ -101,7 +61,7 @@ sammy.bind
// #/:core/dataimport
sammy.get
(
- /^#\/([\w\d-]+)\/(dataimport)$/,
+ new RegExp( app.core_regex_base + '\\/(dataimport)$' ),
function( context )
{
sammy.trigger
@@ -129,7 +89,7 @@ sammy.get
// #/:core/dataimport
sammy.get
(
- /^#\/([\w\d-]+)\/(dataimport)\//,
+ new RegExp( app.core_regex_base + '\\/(dataimport)\\/' ),
function( context )
{
var core_basepath = this.active_core.attr( 'data-basepath' );
@@ -152,7 +112,11 @@ sammy.get
var dataimport_element = $( '#dataimport', content_element );
var form_element = $( '#form', dataimport_element );
var config_element = $( '#config', dataimport_element );
- var config_error_element = $( '#config-error', dataimport_element );
+ var error_element = $( '#error', dataimport_element );
+ var debug_response_element = $( '#debug_response', dataimport_element );
+
+ var autorefresh_status = false;
+ var debug_mode = false;
// handler
@@ -195,24 +159,23 @@ sammy.get
$.ajax
(
{
- url : handler_url + '?command=show-config',
+ url : handler_url + '?command=show-config&indent=true',
dataType : 'xml',
context : $( '#dataimport_config', config_element ),
beforeSend : function( xhr, settings )
{
+ error_element
+ .empty()
+ .hide();
},
success : function( config, text_status, xhr )
{
dataimport_element
.removeClass( 'error' );
-
- config_error_element
- .hide();
config_element
.addClass( 'hidden' );
-
var entities = [ '<option value=""></option>' ];
$( 'document > entity', config )
@@ -226,6 +189,9 @@ sammy.get
$( '#entity', form_element )
.html( entities.join( "\n" ) );
+
+ $( '.editable textarea', this )
+ .val( xhr.responseText.replace( /\n+$/, '' ) );
},
error : function( xhr, text_status, error_thrown )
{
@@ -234,7 +200,8 @@ sammy.get
dataimport_element
.addClass( 'error' );
- config_error_element
+ error_element
+ .text( 'Dataimport XML-Configuration is not valid' )
.show();
config_element
@@ -248,7 +215,7 @@ sammy.get
xhr.responseText.esc() +
'</code></pre>'
);
- this.html( code );
+ $( '.formatted', this ).html( code );
if( 'success' === text_status )
{
@@ -260,7 +227,7 @@ sammy.get
}
dataimport_fetch_config();
- $( '.toggle', config_element )
+ $( '.block .toggle', dataimport_element )
.die( 'click' )
.live
(
@@ -325,159 +292,353 @@ sammy.get
);
return false;
}
- )
+ );
+
+ var debug_mode_element = $( '.debug_mode', config_element );
+ debug_mode_element
+ .die( 'click' )
+ .live
+ (
+ 'click',
+ function( event )
+ {
+ var self = $( this );
+ var block = self.closest( '.block' )
+
+ var debug_checkbox = $( 'input[name="debug"]', form_element );
+ var submit_span = $( 'button[type="submit"] span', form_element );
+
+ debug_mode = !debug_mode;
+
+ block.toggleClass( 'debug_mode', debug_mode );
+
+ if( debug_mode )
+ {
+ block.removeClass( 'hidden' );
+
+ debug_checkbox
+ .attr( 'checked', 'checked' )
+ .trigger( 'change' );
+
+ submit_span
+ .data( 'original', submit_span.text() )
+ .text( submit_span.data( 'debugmode' ) );
+
+ $( 'textarea', block )
+ .autogrow()
+ }
+ else
+ {
+ submit_span
+ .text( submit_span.data( 'original' ) )
+ .removeData( 'original' );
+ }
+ }
+ );
+
+ // abort
+
+ var abort_import_element = $( '.abort-import', dataimport_element );
+ abort_import_element
+ .off( 'click' )
+ .on
+ (
+ 'click',
+ function( event )
+ {
+ var span_element = $( 'span', this );
+
+ $.ajax
+ (
+ {
+ url : handler_url + '?command=abort&wt=json',
+ dataType : 'json',
+ type: 'POST',
+ context: $( this ),
+ beforeSend : function( xhr, settings )
+ {
+ span_element
+ .addClass( 'loader' );
+ },
+ success : function( response, text_status, xhr )
+ {
+ span_element
+ .data( 'original', span_element.text() )
+ .text( span_element.data( 'aborting' ) );
+
+ this
+ .removeClass( 'warn' )
+ .addClass( 'success' );
+
+ window.setTimeout
+ (
+ function()
+ {
+ $( 'span', abort_import_element )
+ .removeClass( 'loader' )
+ .text( span_element.data( 'original' ) )
+ .removeData( 'original' );
+
+ abort_import_element
+ .removeClass( 'success' )
+ .addClass( 'warn' );
+ },
+ dataimport_timeout * 2
+ );
+
+ dataimport_fetch_status();
+ }
+ }
+ );
+ return false;
+ }
+ );
// state
+
+ var status_button = $( 'form button.refresh-status', form_element );
+
+ status_button
+ .off( 'click' )
+ .on
+ (
+ 'click',
+ function( event )
+ {
+ dataimport_fetch_status();
+ return false;
+ }
+ )
+ .trigger( 'click' );
- function dataimport_fetch_status()
+ function dataimport_fetch_status( clear_timeout )
{
+ if( clear_timeout )
+ {
+ app.clear_timeout();
+ }
+
$.ajax
(
{
- url : handler_url + '?command=status',
- dataType : 'xml',
+ url : handler_url + '?command=status&indent=true&wt=json',
+ dataType : 'json',
beforeSend : function( xhr, settings )
{
+ $( 'span', status_button )
+ .addClass( 'loader' );
},
success : function( response, text_status, xhr )
{
var state_element = $( '#current_state', content_element );
- var status = $( 'str[name="status"]', response ).text();
- var rollback_element = $( 'str[name="Rolledback"]', response );
- var messages_count = $( 'lst[name="statusMessages"] str', response ).size();
+ var status = response.status;
+ var rollback_time = response.statusMessages.Rolledback || null;
+ var abort_time = response.statusMessages.Aborted || null;
+
+ var messages = response.statusMessages;
+ var messages_count = 0;
+ for( var key in messages ) { messages_count++; }
- var started_at = $( 'str[name="Full Dump Started"]', response ).text();
- if( !started_at )
+ var format_number = function format_number( number )
{
- started_at = (new Date()).toGMTString();
- }
+ return ( number || 0 ).toString().replace( /\B(?=(\d{3})+(?!\d))/g, '\'' );
+ };
- function dataimport_compute_details( response, details_element )
+ function dataimport_compute_details( response, details_element, elapsed_seconds )
{
- var details = [];
-
- var requests = parseInt( $( 'str[name="Total Requests made to DataSource"]', response ).text(), 10 );
- if( requests )
- {
- details.push
- (
- '<abbr title="Total Requests made to DataSource">Requests</abbr>: ' +
- requests
- );
- }
+ details_element
+ .show();
- var fetched = parseInt( $( 'str[name="Total Rows Fetched"]', response ).text(), 10 );
- if( fetched )
+ // --
+
+ var document_config = {
+ 'Requests' : 'Total Requests made to DataSource',
+ 'Fetched' : 'Total Rows Fetched',
+ 'Skipped' : 'Total Documents Skipped',
+ 'Processed' : 'Total Documents Processed'
+ };
+
+ var document_details = [];
+ for( var key in document_config )
{
- details.push
- (
- '<abbr title="Total Rows Fetched">Fetched</abbr>: ' +
- fetched
- );
- }
+ var value = parseInt( response.statusMessages[document_config[key]], 10 );
+
+ var detail = '<abbr title="' + document_config[key].esc() + '">' + key.esc() + '</abbr>: ' + format_number( value ).esc();
+ if( elapsed_seconds && 'skipped' !== key.toLowerCase() )
+ {
+ detail += ' <span>(' + format_number( Math.round( value / elapsed_seconds ) ).esc() + '/s)</span>'
+ }
+
+ document_details.push( detail );
+ };
+
+ $( '.docs', details_element )
+ .html( document_details.join( ', ' ) );
- var skipped = parseInt( $( 'str[name="Total Documents Skipped"]', response ).text(), 10 );
- if( requests )
+ // --
+
+ var dates_config = {
+ 'Started' : 'Full Dump Started',
+ 'Aborted' : 'Aborted',
+ 'Rolledback' : 'Rolledback'
+ };
+
+ var dates_details = [];
+ for( var key in dates_config )
{
- details.push
- (
- '<abbr title="Total Documents Skipped">Skipped</abbr>: ' +
- skipped
- );
- }
+ var value = response.statusMessages[dates_config[key]];
+
+ if( value )
+ {
+ var detail = '<abbr title="' + dates_config[key].esc() + '">' + key.esc() + '</abbr>: '
+ + '<abbr class="time">' + value.esc() + '</abbr>';
+ dates_details.push( detail );
+ }
+ };
+
+ var dates_element = $( '.dates', details_element );
+
+ dates_element
+ .html( dates_details.join( ', ' ) );
+
+ $( '.time', dates_element )
+ .removeData( 'timeago' )
+ .timeago();
+ };
+
+ var get_time_taken = function get_default_time_taken()
+ {
+ var time_taken_text = response.statusMessages['Time taken'];
+ return app.convert_duration_to_seconds( time_taken_text );
+ };
+
+ var get_default_info_text = function default_info_text()
+ {
+ var info_text = response.statusMessages[''] || '';
- var processed = parseInt( $( 'str[name="Total Documents Processed"]', response ).text(), 10 );
- if( processed )
+ // format numbers included in status nicely
+ info_text = info_text.replace
+ (
+ /\d{4,}/g,
+ function( match, position, string )
+ {
+ return format_number( parseInt( match, 10 ) );
+ }
+ );
+
+ var time_taken_text = app.convert_seconds_to_readable_time( get_time_taken() );
+ if( time_taken_text )
{
- details.push
- (
- '<abbr title="Total Documents Processed">Processed</abbr>: ' +
- processed
- );
+ info_text += ' (Duration: ' + time_taken_text.esc() + ')';
}
- details_element
- .html( details.join( ', ' ) )
- .show();
- }
+ return info_text;
+ };
+
+ var show_info = function show_info( info_text, elapsed_seconds )
+ {
+ $( '.info strong', state_element )
+ .text( info_text || get_default_info_text() );
+
+ $( '.info .details', state_element )
+ .hide();
+ };
+
+ var show_full_info = function show_full_info( info_text, elapsed_seconds )
+ {
+ show_info( info_text, elapsed_seconds );
+
+ dataimport_compute_details
+ (
+ response,
+ $( '.info .details', state_element ),
+ elapsed_seconds || get_time_taken()
+ );
+ };
state_element
- .removeClass( 'indexing' )
- .removeClass( 'success' )
- .removeClass( 'failure' );
-
+ .removeAttr( 'class' );
+
+ var current_time = new Date();
+ $( '.last_update abbr', state_element )
+ .text( current_time.toTimeString().split( ' ' ).shift() )
+ .attr( 'title', current_time.toUTCString() );
+
$( '.info', state_element )
.removeClass( 'loader' );
- if( 0 !== rollback_element.size() )
+ if( 'busy' === status )
{
state_element
- .addClass( 'failure' )
- .show();
+ .addClass( 'indexing' );
- $( '.time', state_element )
- .text( rollback_element.text() )
- .timeago()
- .show();
+ if( autorefresh_status )
+ {
+ $( '.info', state_element )
+ .addClass( 'loader' );
+ }
- $( '.info strong', state_element )
- .text( $( 'str[name=""]', response ).text() );
+ var time_elapsed_text = response.statusMessages['Time Elapsed'];
+ var elapsed_seconds = app.convert_duration_to_seconds( time_elapsed_text );
+ time_elapsed_text = app.convert_seconds_to_readable_time( elapsed_seconds );
- $( '.info .details', state_element )
- .hide();
-
- console.debug( 'rollback @ ', rollback_element.text() );
+ var info_text = time_elapsed_text
+ ? 'Indexing since ' + time_elapsed_text
+ : 'Indexing ...';
+
+ show_full_info( info_text, elapsed_seconds );
}
- else if( 'idle' === status && 0 !== messages_count )
+ else if( rollback_time )
{
state_element
- .addClass( 'success' )
- .show();
+ .addClass( 'failure' );
- $( '.time', state_element )
- .text( started_at )
- .timeago()
- .show();
-
- $( '.info strong', state_element )
- .text( $( 'str[name=""]', response ).text() );
+ show_full_info();
+ }
+ else if( abort_time )
+ {
+ state_element
+ .addClass( 'aborted' );
- dataimport_compute_details( response, $( '.info .details', state_element ) );
+ show_full_info( 'Aborting current Import ...' );
}
- else if( 'busy' === status )
+ else if( 'idle' === status && 0 !== messages_count )
{
state_element
- .addClass( 'indexing' )
- .show();
+ .addClass( 'success' );
- $( '.time', state_element )
- .text( started_at )
- .timeago()
- .show();
+ show_full_info();
+ }
+ else
+ {
+ state_element
+ .addClass( 'idle' );
- $( '.info', state_element )
- .addClass( 'loader' );
+ show_info( 'No information available (idle)' );
+ }
- var indexing_text = 'Indexing ...';
+ // show raw status
- var time_elapsed_text = $( 'str[name="Time Elapsed"]', response ).text();
- time_elapsed_text = convert_seconds_to_readable_time( convert_duration_to_seconds( time_elapsed_text ) );
- if( time_elapsed_text.length )
- {
- indexing_text = 'Indexing since ' + time_elapsed_text
- }
+ var code = $(
+ '<pre class="syntax language-json"><code>' +
+ app.format_json( xhr.responseText ).esc() +
+ '</code></pre>'
+ );
- $( '.info strong', state_element )
- .text( indexing_text );
-
- dataimport_compute_details( response, $( '.info .details', state_element ) );
+ $( '#raw_output_container', content_element ).html( code );
+ hljs.highlightBlock( code.get(0) );
- window.setTimeout( dataimport_fetch_status, 2000 );
- }
- else
+ if( !app.timeout && autorefresh_status )
{
- state_element.hide();
+ app.timeout = window.setTimeout
+ (
+ function()
+ {
+ dataimport_fetch_status( true )
+ },
+ dataimport_timeout
+ );
}
},
error : function( xhr, text_status, error_thrown )
@@ -489,24 +650,47 @@ sammy.get
},
complete : function( xhr, text_status )
{
+ $( 'span', status_button )
+ .removeClass( 'loader' )
+ .addClass( 'success' );
+
+ window.setTimeout
+ (
+ function()
+ {
+ $( 'span', status_button )
+ .removeClass( 'success' );
+ },
+ dataimport_timeout / 2
+ );
}
}
);
}
- dataimport_fetch_status();
// form
- $( 'form', form_element )
+ var form = $( 'form', form_element );
+
+ form
.ajaxForm
(
{
url : handler_url,
- dataType : 'xml',
+ data : {
+ wt : 'json',
+ indent : 'true'
+ },
+ dataType : 'json',
+ type: 'POST',
beforeSend : function( xhr, settings )
{
- $( 'form button', form_element )
+ $( 'button[type="submit"] span', form_element )
.addClass( 'loader' );
+
+ error_element
+ .empty()
+ .hide();
},
beforeSubmit : function( array, form, options )
{
@@ -545,22 +729,91 @@ sammy.get
array.push( { name : tmp[0], value: tmp[1] } );
}
}
+
+ if( debug_mode )
+ {
+ array.push( { name: 'dataConfig', value: $( '#dataimport_config .editable textarea' ).val() } );
+ }
},
success : function( response, text_status, xhr )
{
- dataimport_fetch_status();
},
error : function( xhr, text_status, error_thrown )
{
- console.debug( arguments );
+ var response = null;
+ try
+ {
+ eval( 'response = ' + xhr.responseText + ';' );
+ }
+ catch( e ){}
+
+ error_element
+ .text( response.error.msg || 'Unknown Error (Exception w/o Message)' )
+ .show();
},
complete : function( xhr, text_status )
{
- $( 'form button', form_element )
+ $( 'button[type="submit"] span', form_element )
.removeClass( 'loader' );
+
+ var debug = $( 'input[name="debug"]:checked', form );
+ if( 0 !== debug.size() )
+ {
+ var code = $(
+ '<pre class="syntax language-json"><code>' +
+ app.format_json( xhr.responseText ).esc() +
+ '</code></pre>'
+ );
+
+ $( '.content', debug_response_element ).html( code );
+ hljs.highlightBlock( code.get(0) );
+ }
+
+ dataimport_fetch_status();
}
}
);
+
+ $( 'input[name="debug"]', form )
+ .off( 'change' )
+ .on
+ (
+ 'change',
+ function( event )
+ {
+ debug_response_element.toggle( this.checked );
+ }
+ );
+
+ $( '#auto-refresh-status a', form_element )
+ .off( 'click' )
+ .on
+ (
+ 'click',
+ function( event )
+ {
+ $.cookie( cookie_dataimport_autorefresh, $.cookie( cookie_dataimport_autorefresh ) ? null : true );
+ $( this ).trigger( 'state' );
+
+ dataimport_fetch_status();
+
+ return false;
+ }
+ )
+ .off( 'state' )
+ .on
+ (
+ 'state',
+ function( event )
+ {
+ autorefresh_status = !!$.cookie( cookie_dataimport_autorefresh );
+
+ $.cookie( cookie_dataimport_autorefresh )
+ ? $( this ).addClass( 'on' )
+ : $( this ).removeClass( 'on' );
+ }
+ )
+ .trigger( 'state' );
}
);
}
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/file.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/file.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/file.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/file.js Fri Jan 18 18:30:54 2013
@@ -18,7 +18,7 @@
// #/:core/schema, #/:core/config
sammy.get
(
- /^#\/([\w\d-]+)\/(schema|config)$/,
+ new RegExp( app.core_regex_base + '\\/(schema|config)$' ),
function( context )
{
var core_basepath = this.active_core.attr( 'data-basepath' );
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/index.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/index.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/index.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/index.js Fri Jan 18 18:30:54 2013
@@ -36,15 +36,13 @@ var generate_bar = function( bar_contain
$( '.bar-max.val', bar_holder ).text( bar_data['max'] );
bar_level++;
- var total_width = Math.round( ( bar_data['total'] * max_width ) / bar_data['max'] );
- $( '.bar-total.bar', bar_holder ).width( Math.max( total_width, 1 ) );
+ $( '.bar-total.bar', bar_holder ).width( new String( (bar_data['total']/bar_data['max'])*100 ) + '%' );
$( '.bar-total.val', bar_holder ).text( bar_data['total'] );
if( bar_data['used'] )
{
bar_level++;
- var used_width = Math.round( ( bar_data['used'] * max_width ) / bar_data['max'] );
- $( '.bar-used.bar', bar_holder ).width( Math.min( used_width, total_width - 1 ) );
+ $( '.bar-used.bar', bar_holder ).width( new String( (bar_data['used']/bar_data['total'])*100 ) + '%' );
$( '.bar-used.val', bar_holder ).text( bar_data['used'] );
}
@@ -233,7 +231,7 @@ sammy.get
var data = {
'start_time' : app.dashboard_values['jvm']['jmx']['startTime'],
- 'host' : app.dashboard_values['core']['host'],
+ 'host' : app.dashboard_values['core']['host'] || '-',
'dir_instance' : app.dashboard_values['core']['directory']['instance'],
'dir_data' : app.dashboard_values['core']['directory']['data'],
'dir_index' : app.dashboard_values['core']['directory']['index'],
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/logging.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/logging.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/logging.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/logging.js Fri Jan 18 18:30:54 2013
@@ -318,6 +318,14 @@ var load_logging_viewer = function()
{
var doc = docs[i];
+ if( 1 === doc.time.length )
+ {
+ for( var key in doc )
+ {
+ doc[key] = doc[key][0];
+ }
+ }
+
if( !doc.trace )
{
var lines = doc.message.split( "\n" );
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/plugins.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/plugins.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/plugins.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/plugins.js Fri Jan 18 18:30:54 2013
@@ -206,7 +206,7 @@ var render_plugin_data = function( plugi
}
content += '<li class="' + classes.join( ' ' ) + '">' + "\n";
- content += '<a href="' + context_path + '?entry=' + bean.esc() + '">';
+ content += '<a href="' + context_path + '?entry=' + bean.esc() + '" data-bean="' + bean.esc() + '">';
content += '<span>' + bean.esc() + '</span>';
content += '</a>' + "\n";
content += '<ul class="detail">' + "\n";
@@ -279,15 +279,55 @@ var render_plugin_data = function( plugi
frame_element
.html( content );
- $( 'a[href="' + decodeURIComponent( active_context.path ) + '"]', frame_element )
- .parent().addClass( 'expanded' );
+
+ var path = active_context.path.split( '?entry=' );
+ var entries = ( path[1] || '' ).split( ',' );
+
+ var entry_count = entries.length;
+ for( var i = 0; i < entry_count; i++ )
+ {
+ $( 'a[data-bean="' + entries[i] + '"]', frame_element )
+ .parent().addClass( 'expanded' );
+ }
+
+ $( 'a', frame_element )
+ .off( 'click' )
+ .on
+ (
+ 'click',
+ function( event )
+ {
+ var self = $( this );
+ var bean = self.data( 'bean' );
+
+ var split = '?entry=';
+ var path = active_context.path.split( split );
+ var entry = ( path[1] || '' );
+
+ var regex = new RegExp( bean.replace( /\//g, '\\/' ) + '(,|$)' );
+ var match = regex.test( entry );
+
+ var url = path[0] + split;
+
+ url += match
+ ? entry.replace( regex, '' )
+ : entry + ',' + bean;
+
+ url = url.replace( /=,/, '=' );
+ url = url.replace( /,$/, '' );
+ url = url.replace( /\?entry=$/, '' );
+
+ active_context.redirect( url );
+ return false;
+ }
+ );
// Try to make links for anything with http (but leave the rest alone)
$( '.detail dd' ).each(function(index) {
var txt = $(this).html();
if(txt.indexOf("http") >= 0) {
$(this).linker({
- className : 'linker',
+ className : 'linker'
});
}
});
@@ -382,7 +422,7 @@ sammy.bind
// #/:core/plugins/$type
sammy.get
(
- /^#\/([\w\d-]+)\/(plugins)\/(\w+)$/,
+ new RegExp( app.core_regex_base + '\\/(plugins)\\/(\\w+)$' ),
function( context )
{
core_basepath = this.active_core.attr( 'data-basepath' );
@@ -405,7 +445,7 @@ sammy.get
// #/:core/plugins
sammy.get
(
- /^#\/([\w\d-]+)\/(plugins)$/,
+ new RegExp( app.core_regex_base + '\\/(plugins)$' ),
function( context )
{
core_basepath = this.active_core.attr( 'data-basepath' );
@@ -423,4 +463,4 @@ sammy.get
}
);
}
-);
\ No newline at end of file
+);
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/query.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/query.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/query.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/query.js Fri Jan 18 18:30:54 2013
@@ -18,7 +18,7 @@
// #/:core/query
sammy.get
(
- /^#\/([\w\d-]+)\/(query)$/,
+ new RegExp( app.core_regex_base + '\\/(query)$' ),
function( context )
{
var core_basepath = this.active_core.attr( 'data-basepath' );
@@ -36,7 +36,7 @@ sammy.get
var query_form = $( '#form form', query_element );
var url_element = $( '#url', query_element );
var result_element = $( '#result', query_element );
- var response_element = $( '#response iframe', result_element );
+ var response_element = $( '#response', result_element );
url_element
.die( 'change' )
@@ -45,40 +45,49 @@ sammy.get
'change',
function( event )
{
- var check_iframe_ready_state = function()
- {
- var iframe_element = response_element.get(0).contentWindow.document || response_element.get(0).document;
+ var wt = $( '[name="wt"]', query_form ).val();
- if( !iframe_element )
- {
- console.debug( 'no iframe_element found', response_element );
- return false;
- }
+ var content_generator = {
- url_element
- .addClass( 'loader' );
+ _default : function( xhr )
+ {
+ return xhr.responseText.esc();
+ },
- if( 'complete' === iframe_element.readyState )
+ json : function( xhr )
{
- url_element
- .removeClass( 'loader' );
+ return app.format_json( xhr.responseText );
}
- else
+
+ };
+
+ $.ajax
+ (
{
- window.setTimeout( check_iframe_ready_state, 100 );
+ url : this.href,
+ dataType : wt,
+ context : response_element,
+ beforeSend : function( xhr, settings )
+ {
+ this
+ .html( '<div class="loader">Loading ...</div>' );
+ },
+ complete : function( xhr, text_status )
+ {
+ var code = $(
+ '<pre class="syntax language-' + wt + '"><code>' +
+ ( content_generator[wt] || content_generator['_default'] )( xhr ) +
+ '</code></pre>'
+ );
+ this.html( code );
+
+ if( 'success' === text_status )
+ {
+ hljs.highlightBlock( code.get(0) );
+ }
+ }
}
- }
- check_iframe_ready_state();
-
- response_element
- .attr( 'src', this.href );
-
- if( !response_element.hasClass( 'resized' ) )
- {
- response_element
- .addClass( 'resized' )
- .css( 'height', $( '#main' ).height() - 60 );
- }
+ );
}
)
@@ -104,27 +113,38 @@ sammy.get
'submit',
function( event )
{
- var form_map = {};
var form_values = [];
- var all_form_values = query_form.formToArray();
-
- for( var i = 0; i < all_form_values.length; i++ )
+
+ var add_to_form_values = function add_to_form_values( fields )
{
- if( !all_form_values[i].value || 0 === all_form_values[i].value.length )
- {
- continue;
- }
-
- var name_parts = all_form_values[i].name.split( '.' );
- if( 1 < name_parts.length && !form_map[name_parts[0]] )
- {
- console.debug( 'skip "' + all_form_values[i].name + '", parent missing' );
- continue;
- }
-
- form_map[all_form_values[i].name] = all_form_values[i].value;
- form_values.push( all_form_values[i] );
- }
+ for( var i in fields )
+ {
+ if( !fields[i].value || 0 === fields[i].value.length )
+ {
+ continue;
+ }
+
+ form_values.push( fields[i] );
+ }
+ };
+
+ var fieldsets = $( '> fieldset', query_form );
+
+ var fields = fieldsets.first().formToArray();
+ add_to_form_values( fields );
+
+ fieldsets.not( '.common' )
+ .each
+ (
+ function( i, set )
+ {
+ if( $( 'legend input', set ).is( ':checked' ) )
+ {
+ var fields = $( set ).formToArray();
+ add_to_form_values( fields );
+ }
+ }
+ );
var handler_path = $( '#qt', query_form ).val();
if( '/' !== handler_path[0] )
@@ -135,7 +155,13 @@ sammy.get
var query_url = window.location.protocol + '//' + window.location.host
+ core_basepath + handler_path + '?' + $.param( form_values );
-
+
+ var custom_parameters = $( '#custom_parameters', query_form ).val();
+ if( custom_parameters && 0 !== custom_parameters.length )
+ {
+ query_url += '&' + custom_parameters.replace( /^&/, '' );
+ }
+
url_element
.attr( 'href', query_url )
.text( query_url )
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/replication.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/replication.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/replication.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/replication.js Fri Jan 18 18:30:54 2013
@@ -22,49 +22,6 @@ var core_basepath = null;
var navigation_element = null;
var replication_element = null;
-var convert_duration_to_seconds = function( str )
-{
- var ret = 0;
- var parts = new String( str ).split( ':' ).reverse();
- var parts_count = parts.length;
-
- for( var i = 0; i < parts_count; i++ )
- {
- ret += parseInt( parts[i], 10 ) * Math.pow( 60, i );
- }
-
- return ret;
-}
-
-var convert_seconds_to_readable_time = function( value )
-{
- var text = [];
- value = parseInt( value );
-
- var minutes = Math.floor( value / 60 );
- var hours = Math.floor( minutes / 60 );
-
- if( 0 !== hours )
- {
- text.push( hours + 'h' );
- value -= hours * 60 * 60;
- minutes -= hours * 60;
- }
-
- if( 0 !== minutes )
- {
- text.push( minutes + 'm' );
- value -= minutes * 60;
- }
-
- if( 0 !== value )
- {
- text.push( value + 's' );
- }
-
- return text.join( ' ' );
-}
-
var init_timer = function( next_tick )
{
if( timer_timeout )
@@ -83,7 +40,7 @@ var update_timer = function( next_tick )
}
$( 'p .tick', timer_element )
- .text( convert_seconds_to_readable_time( next_tick ) );
+ .text( app.convert_seconds_to_readable_time( next_tick ) );
timer_timeout = window.setTimeout
(
@@ -151,7 +108,7 @@ var replication_fetch_status = function(
var eta_element = $( '#eta', progress_element );
$( 'span', eta_element )
- .text( convert_seconds_to_readable_time( data.slave.timeRemaining ) );
+ .text( app.convert_seconds_to_readable_time( data.slave.timeRemaining ) );
var bar_element = $( '#bar', progress_element );
$( '.files span', bar_element )
@@ -394,7 +351,7 @@ var replication_fetch_status = function(
timer_element = $( '.timer', navigation_element );
approx_element = $( '.approx', timer_element );
- var next_tick = convert_duration_to_seconds( data.slave.pollInterval );
+ var next_tick = app.convert_duration_to_seconds( data.slave.pollInterval );
approx_element.show();
if( data.slave.nextExecutionAt )
@@ -490,7 +447,7 @@ var replication_fetch_status = function(
// #/:core/replication
sammy.get
(
- /^#\/([\w\d-]+)\/(replication)$/,
+ new RegExp( app.core_regex_base + '\\/(replication)$' ),
function( context )
{
core_basepath = this.active_core.attr( 'data-basepath' );
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/schema-browser.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/schema-browser.js?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/schema-browser.js (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/js/scripts/schema-browser.js Fri Jan 18 18:30:54 2013
@@ -115,7 +115,7 @@ var load_terminfo = function( trigger_el
+ '<ul>' + "\n";
}
- var target = '#/' + current_core + '/query?q=' + field.esc() + ':' + encodeURIComponent( topterms[i] );
+ var target = '#/' + current_core + '/query?q=' + field.esc() + ':' + encodeURIComponent( '"' + topterms[i] + '"' );
topterms_content += '<li><a href="' + target + '">' + topterms[i].esc() + '</a></li>' + "\n";
}
@@ -678,7 +678,7 @@ sammy.bind
// #/:core/schema-browser
sammy.get
(
- /^#\/([\w\d-]+)\/(schema-browser)$/,
+ new RegExp( app.core_regex_base + '\\/(schema-browser)$' ),
function( context )
{
var core_basepath = this.active_core.attr( 'data-basepath' );
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/cores.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/cores.html?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/cores.html (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/cores.html Fri Jan 18 18:30:54 2013
@@ -184,6 +184,11 @@ limitations under the License.
<dd></dd>
</dl></li>
+ <li class="deletedDocs"><dl class="clearfix">
+ <dt><span>deletedDocs:</span></dt>
+ <dd></dd>
+ </dl></li>
+
<li class="optimized"><dl class="clearfix">
<dt><span>optimized:</span></dt>
<dd class="ico"><span></span></dd>
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/dashboard.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/dashboard.html?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/dashboard.html (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/dashboard.html Fri Jan 18 18:30:54 2013
@@ -39,6 +39,9 @@ limitations under the License.
<dt class="index_max-doc">Max Doc:</dt>
<dd class="index_max-doc value"></dd>
+ <dt class="index_deleted-docs">Deleted Docs:</dt>
+ <dd class="index_deleted-docs value"></dd>
+
<dt class="index_version">Version:</dt>
<dd class="index_version value"></dd>
@@ -161,4 +164,4 @@ limitations under the License.
</div>
-</div>
\ No newline at end of file
+</div>
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/dataimport.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/dataimport.html?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/dataimport.html (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/dataimport.html Fri Jan 18 18:30:54 2013
@@ -18,27 +18,49 @@ limitations under the License.
<div id="frame">
+ <div id="error"></div>
+
<div id="current_state">
- <span class="time"></span>
+ <p class="last_update">Last Update: <abbr>Unknown</abbr></p>
<div class="info">
+
<strong></strong>
- <div class="details"></div>
+ <div class="details">
+ <div class="docs"></div>
+ <div class="dates"></div>
+ </div>
+
+ <button class="abort-import warn"><span data-aborting="Aborting Import">Abort Import</span></button>
+
</div>
</div>
- <div id="config-error">
+ <div class="block hidden" id="raw_output">
- Dataimport XML-Configuration is not valid
+ <h2>
+ <a class="toggle"><span>Raw Status-Output</span></a>
+ </h2>
+
+ <div class="message-container">
+ <div class="message"></div>
+ </div>
+ <div class="content">
+
+ <div id="raw_output_container"></div>
+
+ </div>
+
</div>
<div class="block hidden" id="config">
- <h2>
- <a class="toggle"><span>Dataimport Configuration</span></a>
- <a class="reload_config" title="Reload Configuration">Reload</a>
+ <h2 class="clearfix">
+ <a class="toggle"><span>Configuration</span></a>
+ <a class="r reload_config" title="Reload Configuration">Reload</a>
+ <a class="r debug_mode">Debug-Mode</a>
</h2>
<div class="message-container">
@@ -49,13 +71,41 @@ limitations under the License.
<div id="dataimport_config">
- <div class="loader">Loading ...</div>
-
+ <div class="formatted">
+
+ <div class="loader">Loading ...</div>
+
+ </div>
+
+ <div class="editable">
+
+ <textarea></textarea>
+
+ </div>
+
</div>
</div>
</div>
+
+ <div class="block hidden" id="debug_response">
+
+ <h2>
+ <a class="toggle"><span>Raw Debug-Response</span></a>
+ </h2>
+
+ <div class="message-container">
+ <div class="message"></div>
+ </div>
+
+ <div class="content">
+
+ <em>No Request executed</em>
+
+ </div>
+
+ </div>
</div>
@@ -97,6 +147,11 @@ limitations under the License.
<a rel="help">Optimize</a>
</label>
+ <label for="debug" class="checkbox">
+ <input type="checkbox" name="debug" id="debug" value="true">
+ <a rel="help">Debug</a>
+ </label>
+
<label for="entity">
<a rel="help">Entity</a>
</label>
@@ -106,17 +161,22 @@ limitations under the License.
<a rel="help">Start</a>,
<a rel="help">Rows</a>
</label>
- <input type="text" id="start" placeholder="0">
- <input type="text" id="rows" placeholder="10">
+ <div class="clearfix">
+ <input type="text" id="start" placeholder="0">
+ <input type="text" id="rows" placeholder="10">
+ </div>
<label for="custom_parameters">
<a rel="help">Custom Parameters</a>
</label>
<input type="text" id="custom_parameters" value="" placeholder="key1=val1&key2=val2">
- <button type="submit">Execute Import</button>
+ <button class="execute" type="submit"><span data-debugmode="Execute with this Configuration â">Execute</span></button>
+ <button class="refresh-status"><span>Refresh Status</span></button>
</form>
+
+ <p id="auto-refresh-status"><a>Auto-Refresh Status</a></p>
</div>
Modified: lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/query.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/query.html?rev=1435287&r1=1435286&r2=1435287&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/query.html (original)
+++ lucene/dev/branches/LUCENE-2878/solr/webapp/web/tpl/query.html Fri Jan 18 18:30:54 2013
@@ -48,8 +48,10 @@ limitations under the License.
<a rel="help">start</a>,
<a rel="help">rows</a>
</label>
- <input type="text" name="start" id="start" placeholder="0" pattern="[0-9]+" title="Number of leading documents to skip. (Integer)">
- <input type="text" name="rows" id="rows" placeholder="10" pattern="[0-9]+" title="Number of documents to return after 'start'. (Integer)">
+ <div class="clearfix">
+ <input type="text" name="start" id="start" placeholder="0" pattern="[0-9]+" title="Number of leading documents to skip. (Integer)">
+ <input type="text" name="rows" id="rows" placeholder="10" pattern="[0-9]+" title="Number of documents to return after 'start'. (Integer)">
+ </div>
<label for="fl">
<a rel="help">fl</a>
@@ -61,6 +63,11 @@ limitations under the License.
</label>
<input type="text" name="df" id="df" value="" title="Default search field">
+ <label for="custom_parameters">
+ <a rel="help">Raw Query Parameters</a>
+ </label>
+ <input type="text" id="custom_parameters" value="" placeholder="key1=val1&key2=val2">
+
<label for="wt">
<a rel="help">wt</a>
</label>
@@ -74,7 +81,7 @@ limitations under the License.
</select>
<label for="indent" class="checkbox">
- <input type="checkbox" name="indent" id="indent" value="true" title="Indent results.">
+ <input type="checkbox" name="indent" id="indent" value="true" title="Indent results." checked="checked">
<a rel="help">indent</a>
</label>
@@ -160,6 +167,34 @@ limitations under the License.
<label for="edismax_bf">bf</label>
<input type="text" name="bf" id="edismax_bf" title="Boost function (added).">
+
+ <label for="edismax_uf" title="User Fields">uf</label>
+ <input type="text" name="uf" id="edismax_uf">
+
+ <label for="edismax_pf2" title="bigram phrase boost fields">pf2</label>
+ <input type="text" name="pf2" id="edismax_pf2">
+
+ <label for="edismax_pf3" title="trigram phrase boost fields">pf3</label>
+ <input type="text" name="pf3" id="edismax_pf3">
+
+ <label for="edismax_ps2" title="phrase slop for bigram phrases">ps2</label>
+ <input type="text" name="ps2" id="edismax_ps2">
+
+ <label for="edismax_ps3" title="phrase slop for trigram phrases">ps3</label>
+ <input type="text" name="ps3" id="edismax_ps3">
+
+ <label for="edismax_boost" title="multiplicative boost function">boost</label>
+ <input type="text" name="boost" id="edismax_boost">
+
+ <label for="edismax_stopwords" class="checkbox" title="remove stopwords from mandatory 'matching' component">
+ <input type="checkbox" name="stopwords" id="edismax_stopwords" value="true" checked="checked">
+ stopwords
+ </label>
+
+ <label for="edismax_lowercaseOperators" class="checkbox" title="Enable lower-case 'and' and 'or' as operators">
+ <input type="checkbox" name="lowercaseOperators" id="edismax_lowercaseOperators" value="true" checked="checked">
+ lowercaseOperators
+ </label>
</div>
</fieldset>