adjust no files message (#250)

Change 'no files yet' -> 'no files to replay' when there are no files available for replay.
This commit is contained in:
sua yoo 2022-06-07 22:59:34 -07:00 committed by GitHub
parent fa4b71288c
commit 710639365b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = `/api/archives/${this.crawl?.aid}/crawls/${this.crawlId}.json?auth_bearer=${bearer}`;
//const replaySource = this.crawl?.resources?.[0]?.path; //const replaySource = this.crawl?.resources?.[0]?.path;
const canReplay = replaySource && this.hasFiles;
return html` return html`
<header class="flex justify-between"> <header class="flex justify-between">
<h3 class="text-lg font-medium mb-2">${msg("Replay Crawl")}</h3> <h3 class="text-lg font-medium my-2">${msg("Replay Crawl")}</h3>
${document.fullscreenEnabled ${
? html` document.fullscreenEnabled && canReplay
<sl-icon-button ? html`
name="arrows-fullscreen" <sl-icon-button
label=${msg("Fullscreen")} name="arrows-fullscreen"
@click=${() => this.enterFullscreen("replay-crawl")} label=${msg("Fullscreen")}
></sl-icon-button> @click=${() => this.enterFullscreen("replay-crawl")}
` ></sl-icon-button>
: ""} `
: ""
}
</header> </header>
<div id="replay-crawl" class="aspect-4/3 rounded border overflow-hidden"> <!-- https://github.com/webrecorder/browsertrix-crawler/blob/9f541ab011e8e4bccf8de5bd7dc59b632c694bab/screencast/index.html -->
<!-- https://github.com/webrecorder/browsertrix-crawler/blob/9f541ab011e8e4bccf8de5bd7dc59b632c694bab/screencast/index.html --> ${
${replaySource && this.hasFiles canReplay
? html`<replay-web-page ? html`<div
source="${replaySource}" id="replay-crawl"
coll="${ifDefined(this.crawl?.id)}" class="aspect-4/3 rounded border overflow-hidden"
replayBase="/replay/" >
noSandbox="true" <replay-web-page
></replay-web-page>` source="${replaySource}"
: this.renderNoFilesMessage()} coll="${ifDefined(this.crawl?.id)}"
replayBase="/replay/"
noSandbox="true"
></replay-web-page>
</div>`
: html`
<p class="text-sm text-neutral-400">
${this.isRunning
? msg("No files yet.")
: msg("No files to replay.")}
</p>
`
}
</div> </div>
`; `;
} }
@ -653,13 +669,13 @@ export class CrawlDetail extends LiteElement {
)} )}
</ul> </ul>
` `
: this.renderNoFilesMessage()} : html`
`; <p class="text-sm text-neutral-400">
} ${this.isRunning
? msg("No files yet.")
private renderNoFilesMessage() { : msg("No files to download.")}
return html` </p>
<p class="text-sm text-neutral-400">${msg("No files yet.")}</p> `}
`; `;
} }