From 710639365ba18e1cf41b8d1f99f2cb938fcda235 Mon Sep 17 00:00:00 2001 From: sua yoo Date: Tue, 7 Jun 2022 22:59:34 -0700 Subject: [PATCH] adjust no files message (#250) Change 'no files yet' -> 'no files to replay' when there are no files available for replay. --- frontend/src/pages/archive/crawl-detail.ts | 70 +++++++++++++--------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/frontend/src/pages/archive/crawl-detail.ts b/frontend/src/pages/archive/crawl-detail.ts index 6d882b10..90adac40 100644 --- a/frontend/src/pages/archive/crawl-detail.ts +++ b/frontend/src/pages/archive/crawl-detail.ts @@ -473,30 +473,46 @@ export class CrawlDetail extends LiteElement { const replaySource = `/api/archives/${this.crawl?.aid}/crawls/${this.crawlId}.json?auth_bearer=${bearer}`; //const replaySource = this.crawl?.resources?.[0]?.path; + const canReplay = replaySource && this.hasFiles; + return html`
-

${msg("Replay Crawl")}

- ${document.fullscreenEnabled - ? html` - this.enterFullscreen("replay-crawl")} - > - ` - : ""} +

${msg("Replay Crawl")}

+ ${ + document.fullscreenEnabled && canReplay + ? html` + this.enterFullscreen("replay-crawl")} + > + ` + : "" + }
-
- - ${replaySource && this.hasFiles - ? html`` - : this.renderNoFilesMessage()} + + ${ + canReplay + ? html`
+ +
` + : html` +

+ ${this.isRunning + ? msg("No files yet.") + : msg("No files to replay.")} +

+ ` + }
`; } @@ -653,13 +669,13 @@ export class CrawlDetail extends LiteElement { )} ` - : this.renderNoFilesMessage()} - `; - } - - private renderNoFilesMessage() { - return html` -

${msg("No files yet.")}

+ : html` +

+ ${this.isRunning + ? msg("No files yet.") + : msg("No files to download.")} +

+ `} `; }