mirror of https://github.com/apache/lucene.git
SOLR-5446: Admin UI - Allow changing Schema and Config
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1542720 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
496f27ad66
commit
2aec8731a4
|
@ -87,6 +87,8 @@ New Features
|
||||||
* SOLR-5447: Add a QParserPlugin for Lucene's SimpleQueryParser.
|
* SOLR-5447: Add a QParserPlugin for Lucene's SimpleQueryParser.
|
||||||
(Jack Conradson via shalin)
|
(Jack Conradson via shalin)
|
||||||
|
|
||||||
|
* SOLR-5446: Admin UI - Allow changing Schema and Config (steffkes)
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ limitations under the License.
|
||||||
<link rel="stylesheet" type="text/css" href="css/styles/cores.css?_=${version}">
|
<link rel="stylesheet" type="text/css" href="css/styles/cores.css?_=${version}">
|
||||||
<link rel="stylesheet" type="text/css" href="css/styles/dashboard.css?_=${version}">
|
<link rel="stylesheet" type="text/css" href="css/styles/dashboard.css?_=${version}">
|
||||||
<link rel="stylesheet" type="text/css" href="css/styles/dataimport.css?_=${version}">
|
<link rel="stylesheet" type="text/css" href="css/styles/dataimport.css?_=${version}">
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/styles/files.css?_=${version}">
|
||||||
<link rel="stylesheet" type="text/css" href="css/styles/index.css?_=${version}">
|
<link rel="stylesheet" type="text/css" href="css/styles/index.css?_=${version}">
|
||||||
<link rel="stylesheet" type="text/css" href="css/styles/java-properties.css?_=${version}">
|
<link rel="stylesheet" type="text/css" href="css/styles/java-properties.css?_=${version}">
|
||||||
<link rel="stylesheet" type="text/css" href="css/styles/logging.css?_=${version}">
|
<link rel="stylesheet" type="text/css" href="css/styles/logging.css?_=${version}">
|
||||||
|
|
|
@ -244,12 +244,6 @@ limitations under the License.
|
||||||
|
|
||||||
/* tree */
|
/* tree */
|
||||||
|
|
||||||
#content #cloud .tree a.active
|
|
||||||
{
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
color: #00f;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content #cloud #legend
|
#content #cloud #legend
|
||||||
{
|
{
|
||||||
border: 1px solid #f0f0f0;
|
border: 1px solid #f0f0f0;
|
||||||
|
|
|
@ -606,6 +606,12 @@ pre.syntax .tex .formula
|
||||||
background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px;
|
background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#content .tree a.active
|
||||||
|
{
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
color: #00f;
|
||||||
|
}
|
||||||
|
|
||||||
#content .tree a .jstree-icon
|
#content .tree a .jstree-icon
|
||||||
{
|
{
|
||||||
background-image: url( ../../img/ico/folder.png );
|
background-image: url( ../../img/ico/folder.png );
|
||||||
|
|
|
@ -0,0 +1,102 @@
|
||||||
|
/*
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content #files #file-content form .buttons button
|
||||||
|
{
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content #files #file-content textarea
|
||||||
|
{
|
||||||
|
display: block;
|
||||||
|
height: 500px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
width: 99%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content #files #file-content button span
|
||||||
|
{
|
||||||
|
background-image: url( ../../img/ico/disk-black.png );
|
||||||
|
}
|
||||||
|
|
||||||
|
#content #files #file-content form.upload
|
||||||
|
{
|
||||||
|
border-top: 1px solid #c0c0c0;
|
||||||
|
margin-top: 20px;
|
||||||
|
padding-top: 20px;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content #files #file-content .upload input
|
||||||
|
{
|
||||||
|
border: 0;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content #files #file-content .upload button span
|
||||||
|
{
|
||||||
|
background-image: url( ../../img/ico/drive-upload.png );
|
||||||
|
}
|
|
@ -275,6 +275,7 @@ limitations under the License.
|
||||||
#core-menu .config a { background-image: url( ../../img/ico/gear.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 .analysis a { background-image: url( ../../img/ico/funnel.png ); }
|
||||||
#core-menu .documents a { background-image: url( ../../img/ico/documents-stack.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 .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 .replication a { background-image: url( ../../img/ico/node.png ); }
|
||||||
#core-menu .distribution a { background-image: url( ../../img/ico/node-select.png ); }
|
#core-menu .distribution a { background-image: url( ../../img/ico/node-select.png ); }
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 746 B |
|
@ -149,6 +149,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||||
// with uninit() later, to allow updating that settings
|
// with uninit() later, to allow updating that settings
|
||||||
if ($element.data('ajaxUploader-setup') === true) return;
|
if ($element.data('ajaxUploader-setup') === true) return;
|
||||||
|
|
||||||
|
/*
|
||||||
$element.change(function () {
|
$element.change(function () {
|
||||||
// since a new image was selected, reset the marker
|
// since a new image was selected, reset the marker
|
||||||
uploading_file = false;
|
uploading_file = false;
|
||||||
|
@ -159,6 +160,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||||
upload_file();
|
upload_file();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//*/
|
||||||
|
|
||||||
if (settings.submit_button == null) {
|
if (settings.submit_button == null) {
|
||||||
// do nothing
|
// do nothing
|
||||||
|
|
|
@ -41,6 +41,7 @@ require
|
||||||
'lib/order!scripts/dataimport',
|
'lib/order!scripts/dataimport',
|
||||||
'lib/order!scripts/dashboard',
|
'lib/order!scripts/dashboard',
|
||||||
'lib/order!scripts/file',
|
'lib/order!scripts/file',
|
||||||
|
'lib/order!scripts/files',
|
||||||
'lib/order!scripts/index',
|
'lib/order!scripts/index',
|
||||||
'lib/order!scripts/java-properties',
|
'lib/order!scripts/java-properties',
|
||||||
'lib/order!scripts/logging',
|
'lib/order!scripts/logging',
|
||||||
|
|
|
@ -9388,7 +9388,8 @@ jQuery.extend({
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
url : s.url
|
url : s.url,
|
||||||
|
data : s.data
|
||||||
};
|
};
|
||||||
|
|
||||||
// Callback for when everything is done
|
// Callback for when everything is done
|
||||||
|
|
|
@ -367,6 +367,7 @@ var solr_admin = function( app_config )
|
||||||
'<li class="config"><a href="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n" +
|
'<li class="config"><a href="#/' + core_name + '/config"><span>Config</span></a></li>' + "\n" +
|
||||||
'<li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n" +
|
'<li class="dataimport"><a href="#/' + core_name + '/dataimport"><span>Dataimport</span></a></li>' + "\n" +
|
||||||
'<li class="documents"><a href="#/' + core_name + '/documents"><span>Documents</span></a></li>' + "\n" +
|
'<li class="documents"><a href="#/' + core_name + '/documents"><span>Documents</span></a></li>' + "\n" +
|
||||||
|
'<li class="files"><a href="#/' + core_name + '/files"><span>Files</span></a></li>' + "\n" +
|
||||||
'<li class="ping"><a rel="' + that.config.solr_path + '/' + core_name + '/admin/ping"><span>Ping</span></a></li>' + "\n" +
|
'<li class="ping"><a rel="' + that.config.solr_path + '/' + core_name + '/admin/ping"><span>Ping</span></a></li>' + "\n" +
|
||||||
'<li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n" +
|
'<li class="plugins"><a href="#/' + core_name + '/plugins"><span>Plugins / Stats</span></a></li>' + "\n" +
|
||||||
'<li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n" +
|
'<li class="query"><a href="#/' + core_name + '/query"><span>Query</span></a></li>' + "\n" +
|
||||||
|
|
|
@ -0,0 +1,254 @@
|
||||||
|
/*
|
||||||
|
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' );
|
||||||
|
|
||||||
|
var file_endpoint = core_basepath + '/admin/file';
|
||||||
|
|
||||||
|
var path = context.path.split( '?' );
|
||||||
|
var selected_file = null;
|
||||||
|
if( path && path[1] )
|
||||||
|
{
|
||||||
|
selected_file = path[1].split( '=' ).pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
$.get
|
||||||
|
(
|
||||||
|
'tpl/files.html',
|
||||||
|
function( template )
|
||||||
|
{
|
||||||
|
content_element
|
||||||
|
.html( template );
|
||||||
|
|
||||||
|
var frame_element = $( '#frame', content_element );
|
||||||
|
|
||||||
|
var tree_callback = function( event, data )
|
||||||
|
{
|
||||||
|
$( 'li[data-file].jstree-closed', event.currentTarget )
|
||||||
|
.filter
|
||||||
|
(
|
||||||
|
function( index, element )
|
||||||
|
{
|
||||||
|
return selected_file && 0 === selected_file.indexOf( $( element ).data( 'file' ) );
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.each
|
||||||
|
(
|
||||||
|
function( index, element )
|
||||||
|
{
|
||||||
|
data.inst.open_node( element );
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if( selected_file )
|
||||||
|
{
|
||||||
|
$( 'li[data-file="' + selected_file.replace( /\/$/, '' ) + '"] > a', event.currentTarget )
|
||||||
|
.addClass( 'active' );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$( '#tree', frame_element )
|
||||||
|
.jstree
|
||||||
|
(
|
||||||
|
{
|
||||||
|
plugins : [ 'json_data', 'sort' ],
|
||||||
|
json_data : {
|
||||||
|
ajax: {
|
||||||
|
url : file_endpoint + '?wt=json',
|
||||||
|
data : function( n )
|
||||||
|
{
|
||||||
|
if( -1 === n )
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return {
|
||||||
|
file : n.attr( 'data-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 : {
|
||||||
|
'data-file' : prefix + file
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if( is_directory )
|
||||||
|
{
|
||||||
|
item.state = 'closed';
|
||||||
|
item.data.attr.href += '/';
|
||||||
|
}
|
||||||
|
|
||||||
|
files.push( item );
|
||||||
|
}
|
||||||
|
|
||||||
|
return files;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
progressive_render : true
|
||||||
|
},
|
||||||
|
core : {
|
||||||
|
animation : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.on
|
||||||
|
(
|
||||||
|
'loaded.jstree',
|
||||||
|
tree_callback
|
||||||
|
)
|
||||||
|
.on
|
||||||
|
(
|
||||||
|
'open_node.jstree',
|
||||||
|
tree_callback
|
||||||
|
);
|
||||||
|
|
||||||
|
if( selected_file && '/' !== selected_file.substr( -1 ) )
|
||||||
|
{
|
||||||
|
frame_element
|
||||||
|
.addClass( 'show' );
|
||||||
|
|
||||||
|
var endpoint = file_endpoint + '?file=' + selected_file;
|
||||||
|
var public_url = window.location.protocol + '//' + window.location.host + endpoint;
|
||||||
|
|
||||||
|
$( '#url', frame_element )
|
||||||
|
.text( public_url )
|
||||||
|
.attr( 'href', public_url );
|
||||||
|
|
||||||
|
var form = $( 'form.modify', frame_element );
|
||||||
|
|
||||||
|
form
|
||||||
|
.attr( 'action', file_endpoint + '?wt=json&op=write&file=' + selected_file )
|
||||||
|
.ajaxForm
|
||||||
|
(
|
||||||
|
{
|
||||||
|
context : form,
|
||||||
|
beforeSubmit: function( arr, form, options )
|
||||||
|
{
|
||||||
|
$( 'button span', form )
|
||||||
|
.addClass( 'loader' );
|
||||||
|
},
|
||||||
|
success : function( response, status, xhr )
|
||||||
|
{
|
||||||
|
$( 'button span', this )
|
||||||
|
.removeClass( 'loader' );
|
||||||
|
|
||||||
|
var button = $( 'button', this );
|
||||||
|
|
||||||
|
button
|
||||||
|
.addClass( 'success' );
|
||||||
|
|
||||||
|
window.setTimeout
|
||||||
|
(
|
||||||
|
function()
|
||||||
|
{
|
||||||
|
button
|
||||||
|
.removeClass( 'success' );
|
||||||
|
},
|
||||||
|
1000
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
var load_file = function()
|
||||||
|
{
|
||||||
|
$( 'form textarea', frame_element )
|
||||||
|
.load( endpoint );
|
||||||
|
}
|
||||||
|
load_file();
|
||||||
|
|
||||||
|
$( 'form.upload', frame_element )
|
||||||
|
.on
|
||||||
|
(
|
||||||
|
'submit',
|
||||||
|
function( event )
|
||||||
|
{
|
||||||
|
$( 'form input', frame_element )
|
||||||
|
.ajaxfileupload
|
||||||
|
(
|
||||||
|
{
|
||||||
|
action: endpoint + '&op=write&wt=json',
|
||||||
|
validate_extensions: false,
|
||||||
|
upload_now: true,
|
||||||
|
onStart: function ()
|
||||||
|
{
|
||||||
|
$( 'form.upload button span', frame_element )
|
||||||
|
.addClass( 'loader' );
|
||||||
|
},
|
||||||
|
onCancel: function ()
|
||||||
|
{
|
||||||
|
$( 'form.upload button span', frame_element )
|
||||||
|
.removeClass( 'loader' );
|
||||||
|
},
|
||||||
|
onComplete: function( response )
|
||||||
|
{
|
||||||
|
$( 'form.upload button span', frame_element )
|
||||||
|
.removeClass( 'loader' );
|
||||||
|
|
||||||
|
var button = $( 'form.upload button', frame_element );
|
||||||
|
|
||||||
|
button
|
||||||
|
.addClass( 'success' );
|
||||||
|
|
||||||
|
load_file();
|
||||||
|
|
||||||
|
$( 'body' )
|
||||||
|
.animate( { scrollTop: 0 }, 500 );
|
||||||
|
|
||||||
|
window.setTimeout
|
||||||
|
(
|
||||||
|
function()
|
||||||
|
{
|
||||||
|
button
|
||||||
|
.removeClass( 'success' );
|
||||||
|
},
|
||||||
|
1000
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
|
@ -0,0 +1,50 @@
|
||||||
|
<!--
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<div id="files" class="clearfix">
|
||||||
|
|
||||||
|
<div id="frame">
|
||||||
|
|
||||||
|
<div id="tree" class="tree">#tree</div>
|
||||||
|
<div id="file-content" class="clearfix">
|
||||||
|
|
||||||
|
<a id="url" class="address-bar" href="#"></a>
|
||||||
|
|
||||||
|
<form method="post" class="modify">
|
||||||
|
|
||||||
|
<textarea name="stream.body"></textarea>
|
||||||
|
|
||||||
|
<div class="buttons clearfix">
|
||||||
|
<button type="submit"><span>Save file</span></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form method="post" class="upload">
|
||||||
|
|
||||||
|
<input type="file" name="fileupload">
|
||||||
|
|
||||||
|
<div class="buttons clearfix">
|
||||||
|
<button><span>Replace current file</span></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
Loading…
Reference in New Issue