From 7b052b539cf61aa1778e0c7b1f67303febe38d37 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Fri, 20 Sep 2024 18:02:56 -0700 Subject: [PATCH] add proxy selector to org defaults display 'Using Proxy' on profile selector, if proxyId is set --- backend/btrixcloud/models.py | 1 + .../src/features/browser-profiles/select-browser-profile.ts | 6 ++++++ .../src/pages/org/settings/components/crawling-defaults.ts | 5 +++++ frontend/src/types/org.ts | 1 + frontend/xliff/es.xlf | 3 +++ 5 files changed, 16 insertions(+) diff --git a/backend/btrixcloud/models.py b/backend/btrixcloud/models.py index 938eee29f..e5d2e4594 100644 --- a/backend/btrixcloud/models.py +++ b/backend/btrixcloud/models.py @@ -527,6 +527,7 @@ class CrawlConfigDefaults(BaseModel): profileid: Optional[UUID] = None crawlerChannel: Optional[str] = None + proxyId: Optional[str] = None lang: Optional[str] = None diff --git a/frontend/src/features/browser-profiles/select-browser-profile.ts b/frontend/src/features/browser-profiles/select-browser-profile.ts index 443c3e49b..af13c17cb 100644 --- a/frontend/src/features/browser-profiles/select-browser-profile.ts +++ b/frontend/src/features/browser-profiles/select-browser-profile.ts @@ -114,6 +114,12 @@ export class SelectBrowserProfile extends LiteElement { minute="2-digit" > + ${this.selectedProfile.proxyId + ? html` + ${msg("Using proxy: ")} + ${this.selectedProfile.proxyId} + ` + : ``} ${msg("Language")} `, + proxyId: html` `, }; return { @@ -287,6 +291,7 @@ export class OrgSettingsCrawlWorkflows extends BtrixElement { blockAds: values.blockAds === "on", profileid: values.profileid, crawlerChannel: values.crawlerChannel, + proxyId: values.proxyId, userAgent: values.userAgent, lang: this.languageSelect?.value || undefined, exclude: this.exclusionTable?.exclusions?.filter((v) => v) || [], diff --git a/frontend/src/types/org.ts b/frontend/src/types/org.ts index 93bb8d099..44e134e8b 100644 --- a/frontend/src/types/org.ts +++ b/frontend/src/types/org.ts @@ -42,6 +42,7 @@ export const crawlingDefaultsSchema = z.object({ blockAds: z.boolean().optional(), profileid: z.string().optional(), crawlerChannel: z.string().optional(), + proxyId: z.string().optional(), lang: z.string().optional(), userAgent: z.string().optional(), exclude: z.array(z.string()), diff --git a/frontend/xliff/es.xlf b/frontend/xliff/es.xlf index 4e85bfae1..afc4643bc 100644 --- a/frontend/xliff/es.xlf +++ b/frontend/xliff/es.xlf @@ -3838,6 +3838,9 @@ Proxy + + Using proxy: +