mirror of https://github.com/apache/lucene.git
SOLR-3679: admin ui shows error message if creating a new core fails
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1381655 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a4cf4bd859
commit
a778718872
|
@ -129,6 +129,7 @@ Bug Fixes
|
|||
later when a filter of the same term was specified.
|
||||
(Günter Hipler, hossman, yonik)
|
||||
|
||||
* SOLR-3679: Core Admin UI gives no feedback if "Add Core" fails (steffkes, hossman)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
|
|
@ -442,9 +442,13 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
|||
* @throws SolrException in case of a configuration error.
|
||||
*/
|
||||
protected boolean handleCreateAction(SolrQueryRequest req, SolrQueryResponse rsp) throws SolrException {
|
||||
SolrParams params = req.getParams();
|
||||
String name = params.get(CoreAdminParams.NAME);
|
||||
if (null == name || "".equals(name)) {
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
|
||||
"Core name is mandatory to CREATE a SolrCore");
|
||||
}
|
||||
try {
|
||||
SolrParams params = req.getParams();
|
||||
String name = params.get(CoreAdminParams.NAME);
|
||||
|
||||
//for now, do not allow creating new core with same name when in cloud mode
|
||||
//XXX perhaps it should just be unregistered from cloud before readding it?,
|
||||
|
@ -518,7 +522,8 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
|||
return coreContainer.isPersistent();
|
||||
} catch (Exception ex) {
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
|
||||
"Error executing default implementation of CREATE", ex);
|
||||
"Error CREATEing SolrCore '" + name + "': " +
|
||||
ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,12 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
#content #cores .actions form .error
|
||||
{
|
||||
color: #800;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#content #cores .actions form p
|
||||
{
|
||||
padding-bottom: 8px;
|
||||
|
@ -62,7 +68,8 @@
|
|||
|
||||
#content #cores .actions form input,
|
||||
#content #cores .actions form select,
|
||||
#content #cores .actions form .buttons
|
||||
#content #cores .actions form .buttons,
|
||||
#content #cores .actions form .error span
|
||||
{
|
||||
float: right;
|
||||
width: 73%;
|
||||
|
|
|
@ -365,6 +365,12 @@ sammy.get
|
|||
},
|
||||
error : function( xhr, text_status, error_thrown )
|
||||
{
|
||||
var response = null;
|
||||
eval( 'response = ' + xhr.responseText + ';' );
|
||||
|
||||
var error_elem = $( '.error', div_action.filter( ':visible' ) );
|
||||
error_elem.show();
|
||||
$( 'span', error_elem ).text( response.error.msg );
|
||||
},
|
||||
complete : function()
|
||||
{
|
||||
|
|
|
@ -36,19 +36,19 @@ limitations under the License.
|
|||
<input type="hidden" name="action" value="CREATE">
|
||||
|
||||
<p class="clearfix"><label for="add_name">name:</label>
|
||||
<input type="text" name="name" id="add_name" placeholder="new_core"></p>
|
||||
<input type="text" name="name" id="add_name" value="new_core"></p>
|
||||
|
||||
<p class="clearfix"><label for="add_instanceDir">instanceDir:</label>
|
||||
<input type="text" name="instanceDir" id="add_instanceDir" placeholder="new_core"></p>
|
||||
<input type="text" name="instanceDir" id="add_instanceDir" value="new_core"></p>
|
||||
|
||||
<p class="clearfix"><label for="add_dataDir">dataDir:</label>
|
||||
<input type="text" name="dataDir" id="dataDir" placeholder="data"></p>
|
||||
<input type="text" name="dataDir" id="dataDir" value="data"></p>
|
||||
|
||||
<p class="clearfix"><label for="add_config">config:</label>
|
||||
<input type="text" name="config" id="add_config" placeholder="solrconfig.xml"></p>
|
||||
<input type="text" name="config" id="add_config" value="solrconfig.xml"></p>
|
||||
|
||||
<p class="clearfix"><label for="add_schema">schema:</label>
|
||||
<input type="text" name="schema" id="add_schema" placeholder="schema.xml"></p>
|
||||
<input type="text" name="schema" id="add_schema" value="schema.xml"></p>
|
||||
|
||||
<div class="cloud">
|
||||
|
||||
|
@ -60,6 +60,12 @@ limitations under the License.
|
|||
|
||||
</div>
|
||||
|
||||
<p class="clearfix error">
|
||||
|
||||
<span></span>
|
||||
|
||||
</p>
|
||||
|
||||
<p class="clearfix buttons">
|
||||
<button type="submit" class="submit"><span>Add Core</span></button>
|
||||
<button type="reset" class="reset"><span>Cancel</span></button>
|
||||
|
|
Loading…
Reference in New Issue