Skip to content

Commit

Permalink
warcs: Show state name
Browse files Browse the repository at this point in the history
  • Loading branch information
ato committed Apr 19, 2024
1 parent 9daeab7 commit d0c5cba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/resources/templates/tasks/warcs.ftlh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<td>Filename</td>
<td>Records</td>
<td>Size</td>
<td>State</td>
</tr>
</thead>
<tbody>
Expand All @@ -16,6 +17,7 @@
<td><a href="warcs/${warc.id?c}/details">${warc.filename}</a></td>
<td>${warc.records}</td>
<td>${warc.displaySize}</td>
<td>${warc.stateName}</td>
</tr>
[/#list]
</tbody>
Expand Down
14 changes: 14 additions & 0 deletions ui/src/bamboo/crawl/Warc.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ public void setStateId(int stateId) {
this.stateId = stateId;
}

public String getStateName() {
return switch (stateId) {
case Warc.DELETED -> "deleted";
case Warc.SOLR_ERROR -> "solr_error";
case Warc.CDX_ERROR -> "cdx_error";
case Warc.IMPORT_ERROR -> "import_error";
case Warc.OPEN -> "open";
case Warc.IMPORTED -> "imported";
case Warc.CDX_INDEXED -> "cdx_indexed";
case Warc.SOLR_INDEXED -> "solr_indexed";
default -> "unknown_" + stateId;
};
}

public Path getPath() {
return path;
}
Expand Down

0 comments on commit d0c5cba

Please sign in to comment.