From 05a770c51c04ef165fb7ec8e68c3e431aa21b9f9 Mon Sep 17 00:00:00 2001 From: sua yoo Date: Mon, 16 Jan 2023 09:21:25 -0800 Subject: [PATCH 1/7] fix current time limit #480 --- frontend/src/pages/archive/crawl-config-editor.ts | 6 +++++- frontend/src/pages/archive/types.ts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/archive/crawl-config-editor.ts b/frontend/src/pages/archive/crawl-config-editor.ts index f7f8b88198..e96ff42ff8 100644 --- a/frontend/src/pages/archive/crawl-config-editor.ts +++ b/frontend/src/pages/archive/crawl-config-editor.ts @@ -354,6 +354,9 @@ export class CrawlConfigEditor extends LiteElement { if (this.initialCrawlConfig.tags?.length) { formState.tags = this.initialCrawlConfig.tags; } + if (this.initialCrawlConfig.crawlTimeout) { + formState.crawlTimeoutMinutes = this.initialCrawlConfig.crawlTimeout / 60; + } return { jobName: this.initialCrawlConfig.name, @@ -971,6 +974,7 @@ https://example.net`} @@ -1062,7 +1066,7 @@ https://example.net`} type="number" label=${msg("Page Time Limit")} placeholder=${msg("Unlimited")} - value=${ifDefined(this.formState.pageTimeoutMinutes || undefined)} + value=${ifDefined(this.formState.pageTimeoutMinutes ?? undefined)} > ${msg("minutes")} diff --git a/frontend/src/pages/archive/types.ts b/frontend/src/pages/archive/types.ts index a4c7e020ff..461b8e2d65 100644 --- a/frontend/src/pages/archive/types.ts +++ b/frontend/src/pages/archive/types.ts @@ -60,13 +60,13 @@ export type CrawlConfigParams = { scale: number; profileid: string | null; config: SeedConfig; - crawlTimeout: number | null; + crawlTimeout?: number | null; tags?: string[]; }; export type InitialCrawlConfig = Pick< CrawlConfigParams, - "name" | "profileid" | "schedule" | "tags" + "name" | "profileid" | "schedule" | "tags" | "crawlTimeout" > & { jobType?: JobType; config: Pick< From 68b173687bf676f707dd6477d8c980c94d00b15c Mon Sep 17 00:00:00 2001 From: sua yoo Date: Mon, 16 Jan 2023 09:32:32 -0800 Subject: [PATCH 2/7] fix browser profile name not shown #474 --- frontend/src/pages/archive/crawl-config-editor.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/archive/crawl-config-editor.ts b/frontend/src/pages/archive/crawl-config-editor.ts index e96ff42ff8..90bacae5b5 100644 --- a/frontend/src/pages/archive/crawl-config-editor.ts +++ b/frontend/src/pages/archive/crawl-config-editor.ts @@ -1283,9 +1283,10 @@ https://example.net`} private renderConfirmSettings = () => { const crawlConfig = this.parseConfig(); + const profileName = this.formState.browserProfile?.name; return html`
- +
From 7e35ddedc91415dbe26edb5640e333920c4019ce Mon Sep 17 00:00:00 2001 From: sua yoo Date: Mon, 16 Jan 2023 09:34:54 -0800 Subject: [PATCH 3/7] fix finish setup button label #473 --- frontend/src/pages/archive/crawl-config-editor.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/archive/crawl-config-editor.ts b/frontend/src/pages/archive/crawl-config-editor.ts index 90bacae5b5..15e8b3f8a3 100644 --- a/frontend/src/pages/archive/crawl-config-editor.ts +++ b/frontend/src/pages/archive/crawl-config-editor.ts @@ -576,7 +576,8 @@ export class CrawlConfigEditor extends LiteElement { ?disabled=${this.isSubmitting || this.formHasError} ?loading=${this.isSubmitting} > - ${this.formState.runNow + ${this.formState.scheduleType === "now" || + this.formState.runNow ? msg("Save & Run Crawl") : msg("Save & Schedule Crawl")} ` From ec1f9609d7fc4f356a81c7d57a3ddc6b592b327e Mon Sep 17 00:00:00 2001 From: sua yoo Date: Mon, 16 Jan 2023 10:00:21 -0800 Subject: [PATCH 4/7] fix paginated exclusion #475 --- .../src/components/queue-exclusion-table.ts | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/queue-exclusion-table.ts b/frontend/src/components/queue-exclusion-table.ts index 9c48c69ea1..4ec6062d07 100644 --- a/frontend/src/components/queue-exclusion-table.ts +++ b/frontend/src/components/queue-exclusion-table.ts @@ -75,9 +75,15 @@ export class QueueExclusionTable extends LiteElement { } willUpdate(changedProperties: Map) { - if (changedProperties.has("exclusions") && this.exclusions) { + if (changedProperties.get("exclusions") && this.exclusions) { + if ( + changedProperties.get("exclusions").toString() === + this.exclusions.toString() + ) { + // Check list equality + return; + } this.exclusionToRemove = undefined; - const prevVal = changedProperties.get("exclusions"); if (prevVal) { const prevTotal = prevVal.length; @@ -88,9 +94,14 @@ export class QueueExclusionTable extends LiteElement { this.page = lastPage; } } - this.updatePageResults(); - } else if (changedProperties.has("page")) { + } else if (changedProperties.get("page") && this.page) { + this.updatePageResults(); + } + } + + firstUpdated() { + if (this.exclusions) { this.updatePageResults(); } } @@ -167,9 +178,10 @@ export class QueueExclusionTable extends LiteElement { private renderItem = ( exclusion: Exclusion, - index: number, + pageIndex: number, arr: Exclusion[] ) => { + const index = (this.page - 1) * this.pageSize + pageIndex; const [typeColClass, valueColClass, actionColClass] = this.getColumnClassNames(index + 1, arr.length); From eeb8d0edfc5db385521d2462c541cdd33dc38035 Mon Sep 17 00:00:00 2001 From: sua yoo Date: Mon, 16 Jan 2023 11:13:38 -0800 Subject: [PATCH 5/7] fix border on page --- frontend/src/components/queue-exclusion-table.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/queue-exclusion-table.ts b/frontend/src/components/queue-exclusion-table.ts index 4ec6062d07..e323829d8b 100644 --- a/frontend/src/components/queue-exclusion-table.ts +++ b/frontend/src/components/queue-exclusion-table.ts @@ -183,7 +183,7 @@ export class QueueExclusionTable extends LiteElement { ) => { const index = (this.page - 1) * this.pageSize + pageIndex; const [typeColClass, valueColClass, actionColClass] = - this.getColumnClassNames(index + 1, arr.length); + this.getColumnClassNames(pageIndex + 1, arr.length); return html` Date: Mon, 16 Jan 2023 11:25:17 -0800 Subject: [PATCH 6/7] fix confirmation view rerender --- frontend/src/pages/archive/crawl-config-editor.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/archive/crawl-config-editor.ts b/frontend/src/pages/archive/crawl-config-editor.ts index 15e8b3f8a3..ba2ab0be19 100644 --- a/frontend/src/pages/archive/crawl-config-editor.ts +++ b/frontend/src/pages/archive/crawl-config-editor.ts @@ -1283,12 +1283,18 @@ https://example.net`} } private renderConfirmSettings = () => { - const crawlConfig = this.parseConfig(); - const profileName = this.formState.browserProfile?.name; return html`
- - + ${when(this.progressState.activeTab === "confirmSettings", () => { + // Prevent parsing and rendering tab when not visible + const crawlConfig = this.parseConfig(); + const profileName = this.formState.browserProfile?.name; + + return html` + `; + })}
${when(this.formHasError, () => From 71c0db42de6f2d8fe84ec1d58774fa1936102548 Mon Sep 17 00:00:00 2001 From: sua yoo Date: Mon, 16 Jan 2023 12:07:41 -0800 Subject: [PATCH 7/7] increase page size --- frontend/src/pages/archive/crawl-config-editor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/archive/crawl-config-editor.ts b/frontend/src/pages/archive/crawl-config-editor.ts index ba2ab0be19..8b4ba6c360 100644 --- a/frontend/src/pages/archive/crawl-config-editor.ts +++ b/frontend/src/pages/archive/crawl-config-editor.ts @@ -747,7 +747,7 @@ https://example.com/path`} ${this.renderFormCol(html`