SOLR-6740: Admin UI - improve Files View

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1639511 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Matheis 2014-11-13 20:31:13 +00:00
parent 7b9c366913
commit b5e9539954
3 changed files with 17 additions and 1 deletions

View File

@ -395,6 +395,8 @@ Other Changes
* SOLR-6739: Admin UI - Sort list of command line args (steffkes)
* SOLR-6740: Admin UI - improve Files View (steffkes)
================== 4.10.3 ==================
Bug Fixes

View File

@ -23,6 +23,11 @@ limitations under the License.
width: 20%;
}
#content #files #tree-holder li
{
overflow: hidden;
}
#content #files form .buttons button
{
float: right;

View File

@ -103,6 +103,7 @@ sammy.get
data: {
title : file,
attr : {
title : file,
href : '#/' + current_core + '/files?file=' + prefix + file
}
},
@ -161,7 +162,7 @@ sammy.get
var endpoint = file_endpoint + '?file=' + selected_file;
var content_type_map = { xml : 'text/xml', html : 'text/html', js : 'text/javascript' };
var content_type_map = { xml : 'text/xml', html : 'text/html', js : 'text/javascript', json : 'application/json', 'css' : 'text/css' };
var file_ext = selected_file.match( /\.(\w+)$/ );
endpoint += '&contentType=' + ( content_type_map[ file_ext[1] || '' ] || 'text/plain' ) + ';charset=utf-8';
@ -209,6 +210,14 @@ sammy.get
{
highlight = 'javascript';
}
else if( 0 === content_type.indexOf( 'text/css' ) )
{
highlight = 'css';
}
else if( 0 === content_type.indexOf( 'application/json' ) )
{
highlight = 'json';
}
var code = $(
'<pre class="syntax' + ( highlight ? ' language-' + highlight : '' )+ '"><code>' +