crawls.jsp 4.9 KB
Newer Older
1
2
3
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %>
4
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
5
6
7
8

<c:choose>
	<c:when test="${crawls!=null && fn:length(crawls)>0}">
		<div class="previous-crawls">
Gradl, Tobias's avatar
Gradl, Tobias committed
9
			<table class="state-table table-striped">
10
11
				<tbody>
					<c:forEach items="${crawls}" var="crawl" varStatus="status" >
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
						<c:set var="state" value="ok" />
						<c:set var="icon" value="check" />
						<c:set var="state_message" value="~eu.dariah.de.minfba.search.states.ok" />
						<c:choose>
							<c:when test="${crawl.error}">
								<c:set var="state" value="warning" />
								<c:set var="icon" value="exclamation" />
								<c:set var="state_message" value="~eu.dariah.de.minfba.search.states.crawl.error" />
							</c:when>
							<c:when test="${crawl.complete}">
								<c:set var="state" value="ok" />
								<c:set var="icon" value="check" />
								<c:set var="state_message" value="~eu.dariah.de.minfba.search.states.crawl.complete" />
							</c:when>
							<c:when test="${crawl.busy}">
								<c:set var="state" value="info" />
								<c:set var="icon" value="refresh" />
								<c:set var="state_message" value="~eu.dariah.de.minfba.search.states.crawl.busy" />
							</c:when>
							<c:when test="${crawl.waiting}">
								<c:set var="state" value="info" />
								<c:set var="icon" value="clock-o" />
								<c:set var="state_message" value="~eu.dariah.de.minfba.search.states.crawl.waiting" />
							</c:when>
						</c:choose>
					
					
Gradl, Tobias's avatar
Gradl, Tobias committed
39
40
						<tr id="crawl-${crawl.id}" class="state-row-${state}">
							<th class="state-${state}">
41
								<div class="cell-heading no-wrap">
Gradl, Tobias's avatar
Gradl, Tobias committed
42
43
44
									<c:if test="${crawl.online}">
										<i class="fa fa-lg fa-globe" aria-hidden="true"></i>
									</c:if>
45
46
									<i class="fa fa-lg fa-${icon}" aria-hidden="true"></i>
								</div>
Gradl, Tobias's avatar
Gradl, Tobias committed
47
							</th>
48
													
Gradl, Tobias's avatar
Gradl, Tobias committed
49
50
							<td <c:if test="${crawl.offline}">colspan="2"</c:if>>
							
Gradl, Tobias's avatar
Gradl, Tobias committed
51
								<ul class="inner-state-list">
Gradl, Tobias's avatar
Gradl, Tobias committed
52
53
54
55
56
57
58
59
60
61
62
63
64
									<li>
										<span class="state-heading state-${state}">
											<c:choose>
												<c:when test="${crawl.online}">
													<s:message code="~eu.dariah.de.minfba.search.model.crawl.online" />
												</c:when>
												<c:otherwise>
													<s:message code="~eu.dariah.de.minfba.search.model.crawl.offline" />
												</c:otherwise>
											</c:choose>
										</span>
										(<joda:format value="${crawl.timestamp}" style="MM" />)
									</li>
Gradl, Tobias's avatar
Gradl, Tobias committed
65
66
67
68
									<li>
										<span class="state-heading"><s:message code="~eu.dariah.de.minfba.metamodel.common.id" />:</span>
										<span class="no-break-out">${crawl.id}</span>
									</li>
Gradl, Tobias's avatar
Gradl, Tobias committed
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
									<c:if test="${crawl.online}">
										<li>
											<span class="state-heading"><s:message code="~eu.dariah.de.minfba.common.view.label.files" />: </span>
											${crawl.files} 
											<c:if test="${crawl.size !=null && crawl.size != ''}">
												(${crawl.size})
											</c:if>					
										</li>
									</c:if>
									<c:if test="${crawl.logAvailable}">
										<li>
											<span class="state-heading">
												<a href='<s:url value="/logs/${crawl.id}.html"></s:url>' target="_blank">
													<i class="fa fa-external-link" aria-hidden="true"></i> 
													<s:message code="~eu.dariah.de.minfba.common.view.label.open_log" />
												</a>
											</span>
										</li>
									</c:if>
								</ul>
89
							<c:if test="${crawl.online && _auth.level >= 100}">
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
								<td>							
									<c:if test="${state=='ok'}">
										<button type="button" onclick="editor.performOffline('${crawl.id}');" class="btn btn-link"><i class="fa fa-repeat"></i> <s:message code="~eu.dariah.de.minfba.search.actions.crawls.reindex" /></button><br />
									</c:if>
									<c:if test="${state=='error'}">
										<button type="button" onclick="editor.performOffline('${crawl.id}');" class="btn btn-link"><i class="fa fa-play"></i> <s:message code="~eu.dariah.de.minfba.search.actions.crawls.try_continue" /></button><br />
									</c:if>
									<c:if test="${state!='info'}">
										<button type="button" onclick="editor.removeCrawl('${crawl.id}', this);" class="btn btn-link"><i class="fa fa-trash fa-color-danger"></i> <s:message code="~eu.dariah.de.minfba.search.actions.crawls.remove" /></button>
									</c:if>
									<c:if test="${state=='info'}">
										<button type="button" onclick="editor.cancelCrawl('${crawl.id}', this);" class="btn btn-link"><i class="fa fa-ban fa-color-warning"></i> <s:message code="~eu.dariah.de.minfba.search.actions.crawls.cancel" /></button>
									</c:if>
								</td>
							</c:if>
105
106
107
108
109
110
111
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</c:when>
	<c:otherwise>
112
		<s:message code="~eu.dariah.de.minfba.search.view.crawl.notfication.no_crawled_data" />
113
114
	</c:otherwise>
</c:choose>