+
${msg(
str`in ${RelativeDuration.humanize(
new Date(`${crawl.finished}Z`).valueOf() -
- new Date(`${crawl.started}Z`).valueOf()
+ new Date(`${crawl.started}Z`).valueOf(),
+ { compact: true }
)}`
)}
@@ -438,7 +449,9 @@ export class CrawlsList extends LiteElement {
/
${this.numberFormatter.format(+crawl.stats.found)}
-
+
${msg("pages crawled")}
`
@@ -453,7 +466,9 @@ export class CrawlsList extends LiteElement {
>${msg("Manual Start")}
-
+
${msg(str`by ${crawl.userName || crawl.userid}`)}
`
@@ -470,6 +485,37 @@ export class CrawlsList extends LiteElement {
`;
};
+ private renderActiveDuration(crawl: Crawl) {
+ const endTime = this.lastFetched || Date.now();
+ const duration = endTime - new Date(`${crawl.started}Z`).valueOf();
+ let unitCount: number;
+ let tickSeconds: number | undefined = undefined;
+
+ // Show second unit if showing seconds or greater than 1 hr
+ const showSeconds = duration < 60 * 2 * 1000;
+ if (showSeconds || duration > 60 * 60 * 1000) {
+ unitCount = 2;
+ } else {
+ unitCount = 1;
+ }
+ // Tick if seconds are showing
+ if (showSeconds) {
+ tickSeconds = 1;
+ } else {
+ tickSeconds = undefined;
+ }
+
+ return html`
+
+ `;
+ }
+
private onSearchInput = debounce(200)((e: any) => {
this.filterBy = e.target.value;
}) as any;
diff --git a/frontend/src/pages/archive/types.ts b/frontend/src/pages/archive/types.ts
index f3890e75..43921db5 100644
--- a/frontend/src/pages/archive/types.ts
+++ b/frontend/src/pages/archive/types.ts
@@ -5,7 +5,8 @@ type CrawlState =
| "failed"
| "partial_complete"
| "timed_out"
- | "stopping";
+ | "stopping"
+ | "canceled";
export type Crawl = {
id: string;