Copy extra hops value when duplicating crawl config (#184)

closes #158
This commit is contained in:
sua yoo 2022-03-04 16:17:37 -08:00 committed by GitHub
parent 4383c5e8d8
commit f2f67c34af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 10 deletions

View File

@ -580,11 +580,15 @@ export class CrawlTemplatesDetail extends LiteElement {
: ""}
</div>
<div class="mb-5">
<div class="text-sm text-0-600">${msg("Include External Links")}</div>
${this.crawlTemplate?.config.extraHops ? msg("Yes") : msg("No")}
</div>
<sl-details style="--sl-spacing-medium: var(--sl-spacing-small)">
<span slot="summary" class="text-sm">
<span class="font-medium">${msg("Advanced configuration")}</span>
<sl-tag size="small" type="neutral">${msg("JSON")}</sl-tag></span
>
<span class="font-medium">${msg("JSON Configuration")}</span>
</span>
<div class="relative">
<pre
class="language-json bg-gray-800 text-gray-50 p-4 rounded font-mono text-xs"
@ -1068,9 +1072,7 @@ export class CrawlTemplatesDetail extends LiteElement {
if (!this.crawlTemplate) return;
const config: CrawlTemplate["config"] = {
seeds: this.crawlTemplate.config.seeds,
scopeType: this.crawlTemplate.config.scopeType,
limit: this.crawlTemplate.config.limit,
...this.crawlTemplate.config,
};
this.navTo(`/archives/${this.archiveId}/crawl-templates/new`, {

View File

@ -405,9 +405,7 @@ export class CrawlTemplatesList extends LiteElement {
*/
private async duplicateConfig(template: CrawlTemplate) {
const config: CrawlTemplate["config"] = {
seeds: template.config.seeds,
scopeType: template.config.scopeType,
limit: template.config.limit,
...template.config,
};
this.navTo(`/archives/${this.archiveId}/crawl-templates/new`, {

View File

@ -411,7 +411,9 @@ export class CrawlTemplatesNew extends LiteElement {
<sl-menu-item value="any">Any</sl-menu-item>
</sl-select>
<sl-checkbox name="extraHopsOne"
<sl-checkbox
name="extraHopsOne"
?checked=${this.initialCrawlTemplate!.config.extraHops === 1}
>${msg("Include External Links (“one hop out”)")}
</sl-checkbox>
<sl-input