${this.renderPanel(msg("Overview"), this.renderOverview())}
${this.renderPanel(
html`
${msg("Metadata")}
${when(
this.isCrawler,
() => html`
`
)}
`,
this.renderMetadata()
)}
`;
break;
}
return html`
- ${msg("Status")}
-
${this.crawl
? html`
`
: html``}
- ${msg("Pages Crawled")}
-
${this.crawl?.stats
? html`
${this.numberFormatter.format(+this.crawl.stats.done)}
/
${this.numberFormatter.format(+this.crawl.stats.found)}
`
: this.crawl
? html` ${msg("Unknown")} `
: html``}
- ${msg("Run Duration")}
-
${this.crawl
? html`
${this.crawl.finished
? html`${RelativeDuration.humanize(
new Date(`${this.crawl.finished}Z`).valueOf() -
new Date(`${this.crawl.started}Z`).valueOf()
)}`
: html`
`}
`
: html``}
- ${msg("Crawler Instances")}
-
${this.crawl
? this.crawl?.scale
: html``}
`;
}
private renderWatch() {
if (!this.authState || !this.crawl) return "";
const isStarting = this.crawl.state === "starting";
const isRunning = this.crawl.state === "running";
const isStopping = this.crawl.state === "stopping";
const authToken = this.authState.headers.Authorization.split(" ")[1];
return html`
${isStarting
? html`
${this.isActive
? msg("No files yet.")
: msg("No files to replay.")}
`
}
`;
}
private renderOverview() {
return html`
${this.isActive
? msg("No files yet.")
: msg("No files to download.")}
`}
`;
}
private renderLogs() {
return html`TODO`;
}
private renderConfig() {
if (!this.crawl?.config) return "";
return html`