${msg("A crawl will start immediately on save.")}
` : ""} ${this.scheduleInterval ? html`${msg( html`Scheduled crawl will run ${this.formattededNextCrawlDate}.` )}
` : ""}import { state, property } from "lit/decorators.js";
import { ifDefined } from "lit/directives/if-defined.js";
import { msg, localized, str } from "@lit/localize";
import cronParser from "cron-parser";
import type { AuthState } from "../../utils/AuthService";
import LiteElement, { html } from "../../utils/LiteElement";
import { getLocaleTimeZone } from "../../utils/localization";
import type { CrawlConfig } from "./types";
import { getUTCSchedule } from "./utils";
export type NewCrawlTemplate = {
id?: string;
name: string;
schedule: string;
runNow: boolean;
crawlTimeout?: number;
config: CrawlConfig;
};
const initialValues = {
name: "",
runNow: true,
config: {
seeds: [],
scopeType: "prefix",
},
};
const hours = Array.from({ length: 12 }).map((x, i) => ({
value: i + 1,
label: `${i + 1}`,
}));
const minutes = Array.from({ length: 60 }).map((x, i) => ({
value: i,
label: `${i}`.padStart(2, "0"),
}));
/**
* Usage:
* ```ts
*
${msg( "Configure a new crawl template. You can choose to run a crawl immediately upon saving this template." )}
${msg("A crawl will start immediately on save.")}
` : ""} ${this.scheduleInterval ? html`${msg( html`Scheduled crawl will run ${this.formattededNextCrawlDate}.` )}
` : ""}
${msg(
html`See
Browsertrix Crawler docs