VIVO-869 The display should not barf if no IndexHistory is present.
This commit is contained in:
parent
83a5523ace
commit
fcfd2e7be6
2 changed files with 13 additions and 6 deletions
|
@ -144,7 +144,8 @@ public class IndexController extends FreemarkerHttpServlet {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
if (!PolicyHelper.isAuthorizedForActions(req, REQUIRED_ACTIONS)) {
|
if (!PolicyHelper.isAuthorizedForActions(req, REQUIRED_ACTIONS)) {
|
||||||
resp.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
resp.setStatus(HttpServletResponse.SC_FORBIDDEN);
|
||||||
resp.getWriter().write("You are not authorized to access this page.");
|
resp.getWriter().write(
|
||||||
|
"You are not authorized to access this page.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +155,9 @@ public class IndexController extends FreemarkerHttpServlet {
|
||||||
body.put("rebuildUrl",
|
body.put("rebuildUrl",
|
||||||
UrlBuilder.getUrl(PAGE_URL, "rebuild", "true"));
|
UrlBuilder.getUrl(PAGE_URL, "rebuild", "true"));
|
||||||
body.put("status", buildStatusMap(indexer.getStatus()));
|
body.put("status", buildStatusMap(indexer.getStatus()));
|
||||||
|
if (history != null) {
|
||||||
body.put("history", history.toMaps());
|
body.put("history", history.toMaps());
|
||||||
|
}
|
||||||
|
|
||||||
String rendered = FreemarkerProcessingServiceSetup.getService(
|
String rendered = FreemarkerProcessingServiceSetup.getService(
|
||||||
getServletContext()).renderTemplate(STATUS_TEMPLATE_NAME,
|
getServletContext()).renderTemplate(STATUS_TEMPLATE_NAME,
|
||||||
|
|
|
@ -40,9 +40,13 @@
|
||||||
<h3>History</h3>
|
<h3>History</h3>
|
||||||
<table class="history">
|
<table class="history">
|
||||||
<tr> <th>Event</th> <th>Status</th> <th>Since</th> <th>Counts</th> </tr>
|
<tr> <th>Event</th> <th>Status</th> <th>Since</th> <th>Counts</th> </tr>
|
||||||
|
<#if history?has_content >
|
||||||
<#list history as ie>
|
<#list history as ie>
|
||||||
<@showIndexerEvent ie />
|
<@showIndexerEvent ie />
|
||||||
</#list>
|
</#list>
|
||||||
|
<#else>
|
||||||
|
<tr><td colspan="4">Search indexer history is not available.</td></tr>
|
||||||
|
</#if>
|
||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue