Index: solr/webapp/web/admin.html =================================================================== --- solr/webapp/web/admin.html (revision 1542364) +++ solr/webapp/web/admin.html (working copy) @@ -30,6 +30,7 @@ + Index: solr/webapp/web/css/styles/files.css =================================================================== --- solr/webapp/web/css/styles/files.css (revision 0) +++ solr/webapp/web/css/styles/files.css (working copy) @@ -0,0 +1,65 @@ +/* + +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +*/ + +#content #files #tree +{ + float: left; + width: 20%; +} + +#content #files .show #tree +{ + overflow: hidden; +} + +#content #files #file-content +{ + display: none; + float: right; + position: relative; + width: 78%; + min-height: 100px +} + +#content #files .show #file-content +{ + display: block; +} + +#content #files #file-content .close +{ + background-image: url( ../../img/ico/cross-0.png ); + background-position: 50% 50%; + display: block; + height: 20px; + position: absolute; + right: 0; + top: 0; + width: 20px; +} + +#content #files #file-content .close:hover +{ + background-image: url( ../../img/ico/cross-1.png ); +} + +#content #files #file-content .close span +{ + display: none; +} \ No newline at end of file Index: solr/webapp/web/css/styles/menu.css =================================================================== --- solr/webapp/web/css/styles/menu.css (revision 1542364) +++ solr/webapp/web/css/styles/menu.css (working copy) @@ -275,6 +275,7 @@ #core-menu .config a { background-image: url( ../../img/ico/gear.png ); } #core-menu .analysis a { background-image: url( ../../img/ico/funnel.png ); } #core-menu .documents a { background-image: url( ../../img/ico/documents-stack.png ); } +#core-menu .files a { background-image: url( ../../img/ico/folder.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 ); } Index: solr/webapp/web/js/main.js =================================================================== --- solr/webapp/web/js/main.js (revision 1542364) +++ solr/webapp/web/js/main.js (working copy) @@ -41,6 +41,7 @@ 'lib/order!scripts/dataimport', 'lib/order!scripts/dashboard', 'lib/order!scripts/file', + 'lib/order!scripts/files', 'lib/order!scripts/index', 'lib/order!scripts/java-properties', 'lib/order!scripts/logging', Index: solr/webapp/web/js/require.js =================================================================== --- solr/webapp/web/js/require.js (revision 1542364) +++ solr/webapp/web/js/require.js (working copy) @@ -9388,7 +9388,8 @@ return this; }, - url : s.url + url : s.url, + data : s.data }; // Callback for when everything is done Index: solr/webapp/web/js/scripts/app.js =================================================================== --- solr/webapp/web/js/scripts/app.js (revision 1542364) +++ solr/webapp/web/js/scripts/app.js (working copy) @@ -367,6 +367,7 @@ '
  • Config
  • ' + "\n" + '
  • Dataimport
  • ' + "\n" + '
  • Documents
  • ' + "\n" + + '
  • Files
  • ' + "\n" + '
  • Ping
  • ' + "\n" + '
  • Plugins / Stats
  • ' + "\n" + '
  • Query
  • ' + "\n" + Index: solr/webapp/web/js/scripts/files.js =================================================================== --- solr/webapp/web/js/scripts/files.js (revision 0) +++ solr/webapp/web/js/scripts/files.js (working copy) @@ -0,0 +1,99 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// #/:core/files +sammy.get +( + new RegExp( app.core_regex_base + '\\/(files)$' ), + function( context ) + { + core_basepath = this.active_core.attr( 'data-basepath' ); + current_core = context.params.splat[0]; + + var content_element = $( '#content' ); + + $.get + ( + 'tpl/files.html', + function( template ) + { + content_element + .html( template ); + + var tree_element = $( '#frame', content_element ); + + $( '#tree', tree_element ) + .jstree + ( + { + plugins : [ 'json_data', 'sort' ], + json_data : { + ajax: { + url : core_basepath + '/admin/file?wt=json', + data : function( n ) + { + if( -1 === n ) + return null; + + return { + file : n.attr( 'file' ) + }; + }, + success : function( response, status, xhr ) + { + var files = []; + + for( var file in response.files ) + { + var is_directory = response.files[file].directory; + var prefix = xhr.data ? xhr.data.file + '/' : '' + + var item = { + data: { + title : file, + attr : { + href : '#/' + current_core + '/files?file=' + prefix + file + } + }, + attr : { + file : prefix + file + } + }; + + if( is_directory ) + { + item.state = 'closed'; + item.data.attr.href += '/'; + } + + files.push( item ); + } + + return files; + } + }, + progressive_render : true + }, + core : { + animation : 0 + } + } + ); + } + ); + } +); \ No newline at end of file Index: solr/webapp/web/tpl/files.html =================================================================== --- solr/webapp/web/tpl/files.html (revision 0) +++ solr/webapp/web/tpl/files.html (working copy) @@ -0,0 +1,36 @@ + +
    + +
    + +
    #tree
    +
    + +
    +
      +
      + +
      + + [x] + +
      + +
      + +
      \ No newline at end of file