diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 88e801600e2..45e099a3a4a 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -112,6 +112,9 @@ Optimizations * SOLR-4306: Utilize indexInfo=false when gathering core names in UI (steffkes) +* SOLR-4284: Admin UI - make core list scrollable separate from the rest of + the UI (steffkes) + Other Changes ---------------------- diff --git a/solr/webapp/web/admin.html b/solr/webapp/web/admin.html index 3634baf6470..5a073e09fa9 100644 --- a/solr/webapp/web/admin.html +++ b/solr/webapp/web/admin.html @@ -111,8 +111,12 @@ limitations under the License. - +
+ +
+
+ +
diff --git a/solr/webapp/web/css/styles/common.css b/solr/webapp/web/css/styles/common.css index 47ee571b806..960834e8912 100644 --- a/solr/webapp/web/css/styles/common.css +++ b/solr/webapp/web/css/styles/common.css @@ -172,7 +172,7 @@ ul #header { padding-bottom: 10px; - position: absolute; + position: fixed; z-index: 42; } @@ -340,12 +340,6 @@ ul width: 100%; } -#content > pre -{ - max-height: 600px; - overflow: auto; -} - #content .block { margin-bottom: 10px; diff --git a/solr/webapp/web/css/styles/menu.css b/solr/webapp/web/css/styles/menu.css index f77c54bf366..dfa54b296fe 100644 --- a/solr/webapp/web/css/styles/menu.css +++ b/solr/webapp/web/css/styles/menu.css @@ -1,13 +1,13 @@ #menu-wrapper { - position: absolute; - top: 90px; + position: fixed; + top: 120px; width: 150px; } .has-environment #menu-wrapper { - top: 130px; + top: 160px; } #menu-wrapper a @@ -18,6 +18,23 @@ text-overflow: ellipsis; } +#core-selector +{ + margin-top: 20px; + padding-right: 10px; +} + +#core-selector a +{ + padding: 0; + padding-left: 8px; +} + +#core-selector select +{ + width: 100%; +} + #menu-wrapper .active p { background-color: #fafafa; @@ -121,32 +138,27 @@ display: none; } -#menu-selector -{ - margin-top: 20px; -} - -#menu-selector p +#core-menu p { border-top: 1px solid #f0f0f0; } -#menu-selector li:first-child p +#core-menu li:first-child p { border-top: 0; } -#menu-selector p a +#core-menu p a { background-image: url( ../../img/ico/status-offline.png ); } -#menu-selector .active p a +#core-menu .active p a { background-image: url( ../../img/ico/box.png ); } -#menu-selector ul, +#core-menu ul, #menu ul { display: none; @@ -154,7 +166,7 @@ padding-bottom: 10px; } -#menu-selector .active ul, +#core-menu .active ul, #menu .active ul { display: block; @@ -165,7 +177,7 @@ border-bottom: 0; } -#menu-selector ul li a, +#core-menu ul li a, #menu ul li a { background-position: 7px 50%; @@ -175,20 +187,20 @@ padding-left: 26px; } -#menu-selector ul li:last-child a, +#core-menu ul li:last-child a, #menu ul li:last-child a { border-bottom: 0; } -#menu-selector ul li a:hover, +#core-menu ul li a:hover, #menu ul li a:hover { background-color: #f0f0f0; color: #333; } -#menu-selector ul li.active a, +#core-menu ul li.active a, #menu ul li.active a { background-color: #d0d0d0; @@ -213,7 +225,7 @@ #menu #cloud.global .rgraph a { background-image: url( ../../img/ico/asterisk.png ); } #menu #cloud.global .dump a { background-image: url( ../../img/ico/download-cloud.png ); } -#menu-selector .ping.error a +#core-menu .ping.error a { background-color: #ffcccc; @@ -222,17 +234,18 @@ cursor: help; } -#menu-selector .query a { background-image: url( ../../img/ico/magnifier.png ); } -#menu-selector .schema a { background-image: url( ../../img/ico/table.png ); } -#menu-selector .config a { background-image: url( ../../img/ico/gear.png ); } -#menu-selector .analysis a { background-image: url( ../../img/ico/funnel.png ); } -#menu-selector .schema-browser a { background-image: url( ../../img/ico/book-open-text.png ); } -#menu-selector .replication a { background-image: url( ../../img/ico/node.png ); } -#menu-selector .distribution a { background-image: url( ../../img/ico/node-select.png ); } -#menu-selector .ping a { background-image: url( ../../img/ico/system-monitor.png ); } -#menu-selector .logging a { background-image: url( ../../img/ico/inbox-document-text.png ); } -#menu-selector .plugins a { background-image: url( ../../img/ico/block.png ); } -#menu-selector .dataimport a { background-image: url( ../../img/ico/document-import.png ); } +#core-menu .overview a { background-image: url( ../../img/ico/home.png ); } +#core-menu .query a { background-image: url( ../../img/ico/magnifier.png ); } +#core-menu .schema a { background-image: url( ../../img/ico/table.png ); } +#core-menu .config a { background-image: url( ../../img/ico/gear.png ); } +#core-menu .analysis a { background-image: url( ../../img/ico/funnel.png ); } +#core-menu .schema-browser a { background-image: url( ../../img/ico/book-open-text.png ); } +#core-menu .replication a { background-image: url( ../../img/ico/node.png ); } +#core-menu .distribution a { background-image: url( ../../img/ico/node-select.png ); } +#core-menu .ping a { background-image: url( ../../img/ico/system-monitor.png ); } +#core-menu .logging a { background-image: url( ../../img/ico/inbox-document-text.png ); } +#core-menu .plugins a { background-image: url( ../../img/ico/block.png ); } +#core-menu .dataimport a { background-image: url( ../../img/ico/document-import.png ); } #content #navigation diff --git a/solr/webapp/web/img/ico/home.png b/solr/webapp/web/img/ico/home.png new file mode 100755 index 00000000000..622a2b736d1 Binary files /dev/null and b/solr/webapp/web/img/ico/home.png differ diff --git a/solr/webapp/web/js/scripts/app.js b/solr/webapp/web/js/scripts/app.js index adbabadb366..7c2ad094527 100644 --- a/solr/webapp/web/js/scripts/app.js +++ b/solr/webapp/web/js/scripts/app.js @@ -92,20 +92,26 @@ var sammy = $.sammy $( 'li.active', menu_wrapper ) .removeClass( 'active' ); - if( this.params.splat ) + // global dashboard doesn't have params.splat + if( !this.params.splat ) { - var selector = '~' === this.params.splat[0][0] - ? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global' - : '#menu-selector #' + this.params.splat[0].replace( /\./g, '__' ); + this.params.splat = [ '~index' ]; + } - var active_element = $( selector, menu_wrapper ); - - if( 0 === active_element.size() ) - { - this.app.error( 'There exists no core with name "' + this.params.splat[0] + '"' ); - return false; - } + var selector = '~' === this.params.splat[0][0] + ? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global' + : '#core-selector #' + this.params.splat[0].replace( /\./g, '__' ); + var active_element = $( selector, menu_wrapper ); + + if( 0 === active_element.size() ) + { + this.app.error( 'There exists no core with name "' + this.params.splat[0] + '"' ); + return false; + } + + if( active_element.hasClass( 'global' ) ) + { active_element .addClass( 'active' ); @@ -115,10 +121,28 @@ var sammy = $.sammy .addClass( 'active' ); } - if( !active_element.hasClass( 'global' ) ) + $( '#core-selector option[selected]' ) + .removeAttr( 'selected' ) + .trigger( 'liszt:updated' ); + + $( '#core-selector .chzn-container > a' ) + .addClass( 'chzn-default' ); + } + else + { + active_element + .attr( 'selected', 'selected' ) + .trigger( 'liszt:updated' ); + + if( !this.params.splat[1] ) { - this.active_core = active_element; + this.params.splat[1] = 'overview'; } + + $( '#core-menu .' + this.params.splat[1] ) + .addClass( 'active' ); + + this.active_core = active_element; } } ); @@ -143,9 +167,10 @@ var solr_admin = function( app_config ) plugin_data = null, - this.menu_element = $( '#menu-selector' ); - this.config = config; + this.menu_element = $( '#core-selector select' ); + this.core_menu = $( '#core-menu ul' ); + this.config = config; this.timeout = null; this.core_regex_base = '^#\\/([\\w\\d-\\.]+)'; @@ -197,6 +222,9 @@ var solr_admin = function( app_config ) that.menu_element .empty(); + var core_list = []; + core_list.push( '' ); + var core_count = 0; for( var core_name in that.cores_data ) { @@ -214,32 +242,24 @@ var solr_admin = function( app_config ) classes.push( 'default' ); } - var core_tpl = '
  • ' + "\n" - + '

    ' + core_name + '

    ' + "\n" - + ' ' + "\n" - + '
  • '; - - that.menu_element - .append( core_tpl ); + core_list.push( core_tpl ); } + that.menu_element + .append( core_list.join( "\n" ) ); + if( cores.initFailures ) { var failures = []; @@ -288,6 +308,52 @@ var solr_admin = function( app_config ) { that.set_cores_data( response ); + that.menu_element + .chosen() + .off( 'change' ) + .on + ( + 'change', + function( event ) + { + location.href = $( 'option:selected', this ).val(); + return false; + } + ) + .on + ( + 'liszt:updated', + function( event ) + { + var core_name = $( 'option:selected', this ).text(); + + if( core_name ) + { + that.core_menu + .html + ( + '
  • Overview
  • ' + "\n" + + '
  • Ping
  • ' + "\n" + + '
  • Query
  • ' + "\n" + + '
  • Schema
  • ' + "\n" + + '
  • Config
  • ' + "\n" + + '
  • Replication
  • ' + "\n" + + '
  • Analysis
  • ' + "\n" + + '
  • Schema Browser
  • ' + "\n" + + '
  • Plugins / Stats
  • ' + "\n" + + '
  • Dataimport
  • ' + "\n" + ) + .show(); + } + else + { + that.core_menu + .hide() + .empty(); + } + } + ); + for( var core_name in response.status ) { var core_path = config.solr_path + '/' + core_name; diff --git a/solr/webapp/web/js/scripts/index.js b/solr/webapp/web/js/scripts/index.js index 33143dd5bac..fa8fef53f15 100644 --- a/solr/webapp/web/js/scripts/index.js +++ b/solr/webapp/web/js/scripts/index.js @@ -208,9 +208,6 @@ sammy.get { var content_element = $( '#content' ); - $( '#menu-wrapper #index' ) - .addClass( 'active' ); - content_element .html( '
    ' ); diff --git a/solr/webapp/web/js/scripts/java-properties.js b/solr/webapp/web/js/scripts/java-properties.js index af33195d0c5..2bef821b593 100644 --- a/solr/webapp/web/js/scripts/java-properties.js +++ b/solr/webapp/web/js/scripts/java-properties.js @@ -21,7 +21,7 @@ sammy.get /^#\/(~java-properties)$/, function( context ) { - var core_basepath = $( 'li[data-basepath]', app.menu_element ).attr( 'data-basepath' ); + var core_basepath = $( '[data-basepath]', app.menu_element ).attr( 'data-basepath' ); var content_element = $( '#content' ); content_element diff --git a/solr/webapp/web/js/scripts/logging.js b/solr/webapp/web/js/scripts/logging.js index ec1e03c687a..654967635c7 100644 --- a/solr/webapp/web/js/scripts/logging.js +++ b/solr/webapp/web/js/scripts/logging.js @@ -406,7 +406,7 @@ sammy.get /^#\/(~logging)$/, function( context ) { - var core_basepath = $( 'li[data-basepath]', app.menu_element ).attr( 'data-basepath' ); + var core_basepath = $( '[data-basepath]', app.menu_element ).attr( 'data-basepath' ); loglevel_path = core_basepath + '/admin/logging'; var content_element = $( '#content' ); @@ -492,7 +492,7 @@ sammy.get /^#\/(~logging)\/level$/, function( context ) { - var core_basepath = $( 'li[data-basepath]', app.menu_element ).attr( 'data-basepath' ); + var core_basepath = $( '[data-basepath]', app.menu_element ).attr( 'data-basepath' ); loglevel_path = core_basepath + '/admin/logging'; var content_element = $( '#content' ); diff --git a/solr/webapp/web/js/scripts/ping.js b/solr/webapp/web/js/scripts/ping.js index b83b8ac71c3..537724afe64 100644 --- a/solr/webapp/web/js/scripts/ping.js +++ b/solr/webapp/web/js/scripts/ping.js @@ -15,7 +15,7 @@ limitations under the License. */ -$( '.ping a', app.menu_element ) +$( '.ping a', app.core_menu ) .live ( 'click', diff --git a/solr/webapp/web/js/scripts/schema-browser.js b/solr/webapp/web/js/scripts/schema-browser.js index 58a5ce8b0a4..ab7fdbbb9e8 100644 --- a/solr/webapp/web/js/scripts/schema-browser.js +++ b/solr/webapp/web/js/scripts/schema-browser.js @@ -228,7 +228,7 @@ sammy.bind var related_select_element = $( '#related select', params.schema_browser_element ) var type = 'index'; - var sammy_basepath = '#/' + $( 'p a', params.active_core ).html() + '/schema-browser'; + var sammy_basepath = app.core_menu.find( '.active a' ).attr( 'href' ); if( !related_navigation_meta.hasClass( 'done' ) ) { @@ -640,7 +640,7 @@ sammy.bind } related_select_element - .attr( 'rel', '#/' + $( 'p a', params.active_core ).html() + '/schema-browser' ) + .attr( 'rel', app.core_menu.find( '.active a' ).attr( 'href' ) ) .append( related_options ) .chosen(); diff --git a/solr/webapp/web/js/scripts/threads.js b/solr/webapp/web/js/scripts/threads.js index f0291b4d8bf..16992de8efc 100644 --- a/solr/webapp/web/js/scripts/threads.js +++ b/solr/webapp/web/js/scripts/threads.js @@ -21,7 +21,7 @@ sammy.get /^#\/(~threads)$/, function( context ) { - var core_basepath = $( 'li[data-basepath]', app.menu_element ).attr( 'data-basepath' ); + var core_basepath = $( '[data-basepath]', app.menu_element ).attr( 'data-basepath' ); var content_element = $( '#content' ); $.get