mirror of https://github.com/apache/lucene.git
SOLR-4311: Admin UI - Optimize Caching Behaviour
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1457099 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8f2294f644
commit
5b6b0776ef
|
@ -129,6 +129,8 @@ Bug Fixes
|
||||||
* SOLR-4585: The Collections API validates numShards with < 0 but should use
|
* SOLR-4585: The Collections API validates numShards with < 0 but should use
|
||||||
<= 0. (Mark Miller)
|
<= 0. (Mark Miller)
|
||||||
|
|
||||||
|
* SOLR-4311: Admin UI - Optimize Caching Behaviour (steffkes)
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.lang.StringEscapeUtils;
|
import org.apache.commons.lang.StringEscapeUtils;
|
||||||
import org.apache.solr.core.CoreContainer;
|
import org.apache.solr.core.CoreContainer;
|
||||||
|
import org.apache.solr.core.SolrCore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple servlet to load the Solr Admin UI
|
* A simple servlet to load the Solr Admin UI
|
||||||
|
@ -53,14 +54,17 @@ public final class LoadAdminUiServlet extends HttpServlet {
|
||||||
Writer out = new OutputStreamWriter(response.getOutputStream(), "UTF-8");
|
Writer out = new OutputStreamWriter(response.getOutputStream(), "UTF-8");
|
||||||
|
|
||||||
String html = IOUtils.toString(in, "UTF-8");
|
String html = IOUtils.toString(in, "UTF-8");
|
||||||
|
Package package = SolrCore.class.getPackage();
|
||||||
|
|
||||||
String[] search = new String[] {
|
String[] search = new String[] {
|
||||||
"${contextPath}",
|
"${contextPath}",
|
||||||
"${adminPath}"
|
"${adminPath}",
|
||||||
|
"${version}"
|
||||||
};
|
};
|
||||||
String[] replace = new String[] {
|
String[] replace = new String[] {
|
||||||
StringEscapeUtils.escapeJavaScript(request.getContextPath()),
|
StringEscapeUtils.escapeJavaScript(request.getContextPath()),
|
||||||
StringEscapeUtils.escapeJavaScript(cores.getAdminPath())
|
StringEscapeUtils.escapeJavaScript(cores.getAdminPath()),
|
||||||
|
StringEscapeUtils.escapeJavaScript(package.getSpecificationVersion())
|
||||||
};
|
};
|
||||||
|
|
||||||
out.write( StringUtils.replaceEach(html, search, replace) );
|
out.write( StringUtils.replaceEach(html, search, replace) );
|
||||||
|
|
|
@ -585,4 +585,5 @@ var solr_admin = function( app_config )
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$.ajaxSetup( { cache: false } );
|
||||||
var app = new solr_admin( app_config );
|
var app = new solr_admin( app_config );
|
||||||
|
|
Loading…
Reference in New Issue