Skip to content

Commit

Permalink
add proxy selector to org defaults
Browse files Browse the repository at this point in the history
display 'Using Proxy' on profile selector, if proxyId is set
  • Loading branch information
ikreymer committed Sep 21, 2024
1 parent ae3e909 commit 7b052b5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/btrixcloud/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ class CrawlConfigDefaults(BaseModel):

profileid: Optional[UUID] = None
crawlerChannel: Optional[str] = None
proxyId: Optional[str] = None

lang: Optional[str] = None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ export class SelectBrowserProfile extends LiteElement {
minute="2-digit"
></sl-format-date>
</span>
${this.selectedProfile.proxyId
? html` <span>
${msg("Using proxy: ")}
<b>${this.selectedProfile.proxyId}</b>
</span>`
: ``}
<a
class="flex items-center gap-1 text-blue-500 hover:text-blue-600"
href=${`${this.orgBasePath}/browser-profiles/profile/${this.selectedProfile.id}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ export class OrgSettingsCrawlWorkflows extends BtrixElement {
<span slot="label">${msg("Language")}</span>
</btrix-language-select>
`,
proxyId: html` <btrix-select-crawler-proxy
orgId=${this.orgId}
.proxyId="${orgDefaults.proxyId || null}"
></btrix-select-crawler-proxy>`,
};

return {
Expand Down Expand Up @@ -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) || [],
Expand Down
1 change: 1 addition & 0 deletions frontend/src/types/org.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
3 changes: 3 additions & 0 deletions frontend/xliff/es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -3838,6 +3838,9 @@
<trans-unit id="sb8dd788adf7b907b">
<source>Proxy</source>
</trans-unit>
<trans-unit id="sadfb54de733655c9">
<source>Using proxy: </source>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit 7b052b5

Please sign in to comment.