fix: run yarn format
in frontend dir (#1043)
This commit is contained in:
parent
362afa47bd
commit
9236a07800
@ -98,14 +98,10 @@ export class ConfigDetails extends LiteElement {
|
||||
|
||||
return html`
|
||||
<section id="crawler-settings" class="mb-8">
|
||||
<btrix-section-heading style="--margin: var(--sl-spacing-medium)"
|
||||
>
|
||||
<h4>
|
||||
${msg("Crawler Settings")}
|
||||
</h4>
|
||||
<btrix-section-heading style="--margin: var(--sl-spacing-medium)">
|
||||
<h4>${msg("Crawler Settings")}</h4>
|
||||
${this.renderAnchorLink("crawler-settings")}
|
||||
</btrix-section-heading
|
||||
>
|
||||
</btrix-section-heading>
|
||||
<btrix-desc-list>
|
||||
${when(
|
||||
crawlConfig?.jobType === "seed-crawl",
|
||||
@ -176,14 +172,10 @@ export class ConfigDetails extends LiteElement {
|
||||
</btrix-desc-list>
|
||||
</section>
|
||||
<section id="browser-settings" class="mb-8">
|
||||
<btrix-section-heading style="--margin: var(--sl-spacing-medium)"
|
||||
>
|
||||
<h4>
|
||||
${msg("Browser Settings")}
|
||||
</h4>
|
||||
<btrix-section-heading style="--margin: var(--sl-spacing-medium)">
|
||||
<h4>${msg("Browser Settings")}</h4>
|
||||
${this.renderAnchorLink("browser-settings")}
|
||||
</btrix-section-heading
|
||||
>
|
||||
</btrix-section-heading>
|
||||
<btrix-desc-list>
|
||||
${this.renderSetting(
|
||||
msg("Browser Profile"),
|
||||
@ -212,14 +204,10 @@ export class ConfigDetails extends LiteElement {
|
||||
</btrix-desc-list>
|
||||
</section>
|
||||
<section id="crawl-scheduling" class="mb-8">
|
||||
<btrix-section-heading style="--margin: var(--sl-spacing-medium)"
|
||||
>
|
||||
<h4>
|
||||
${msg("Crawl Scheduling")}
|
||||
</h4>
|
||||
<btrix-section-heading style="--margin: var(--sl-spacing-medium)">
|
||||
<h4>${msg("Crawl Scheduling")}</h4>
|
||||
${this.renderAnchorLink("crawl-scheduling")}
|
||||
</btrix-section-heading
|
||||
>
|
||||
</btrix-section-heading>
|
||||
<btrix-desc-list>
|
||||
${this.renderSetting(
|
||||
msg("Crawl Schedule Type"),
|
||||
@ -238,14 +226,10 @@ export class ConfigDetails extends LiteElement {
|
||||
</btrix-desc-list>
|
||||
</section>
|
||||
<section id="crawl-metadata" class="mb-8">
|
||||
<btrix-section-heading style="--margin: var(--sl-spacing-medium)"
|
||||
>
|
||||
<h4>
|
||||
${msg("Crawl Metadata")}
|
||||
</h4>
|
||||
<btrix-section-heading style="--margin: var(--sl-spacing-medium)">
|
||||
<h4>${msg("Crawl Metadata")}</h4>
|
||||
${this.renderAnchorLink("crawl-metadata")}
|
||||
</btrix-section-heading
|
||||
>
|
||||
</btrix-section-heading>
|
||||
<btrix-desc-list>
|
||||
${this.renderSetting(msg("Name"), crawlConfig?.name)}
|
||||
${this.renderSetting(
|
||||
@ -378,7 +362,7 @@ export class ConfigDetails extends LiteElement {
|
||||
if (!this.anchorLinks) return;
|
||||
const currentUrl = window.location.href;
|
||||
return html`
|
||||
<btrix-copy-button
|
||||
<btrix-copy-button
|
||||
style="font-size: 1rem;"
|
||||
value=${`${currentUrl.replace(window.location.hash, "")}#${id}`}
|
||||
name="link-45deg"
|
||||
@ -415,7 +399,9 @@ export class ConfigDetails extends LiteElement {
|
||||
message:
|
||||
e.statusCode === 404
|
||||
? msg("Collections not found.")
|
||||
: msg("Sorry, couldn't retrieve Collection details at this time."),
|
||||
: msg(
|
||||
"Sorry, couldn't retrieve Collection details at this time."
|
||||
),
|
||||
variant: "danger",
|
||||
icon: "exclamation-octagon",
|
||||
});
|
||||
|
@ -46,13 +46,19 @@ export class CopyButton extends LitElement {
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<sl-tooltip content=${this.isCopied ? msg("Copied to clipboard!") : (this.content ? this.content : msg("Copy"))}>
|
||||
<sl-tooltip
|
||||
content=${this.isCopied
|
||||
? msg("Copied to clipboard!")
|
||||
: this.content
|
||||
? this.content
|
||||
: msg("Copy")}
|
||||
>
|
||||
<sl-icon-button
|
||||
name=${this.isCopied ? "check-lg" : (this.name ? this.name : "files")}
|
||||
name=${this.isCopied ? "check-lg" : this.name ? this.name : "files"}
|
||||
label=${msg("Copy to clipboard")}
|
||||
@click=${this.onClick}
|
||||
?disabled=${!this.value && !this.getValue}
|
||||
></sl-icon-button>
|
||||
></sl-icon-button>
|
||||
</sl-tooltip>
|
||||
`;
|
||||
}
|
||||
@ -67,7 +73,7 @@ export class CopyButton extends LitElement {
|
||||
|
||||
this.timeoutId = window.setTimeout(() => {
|
||||
this.isCopied = false;
|
||||
const button = this.shadowRoot?.querySelector('sl-icon-button');
|
||||
const button = this.shadowRoot?.querySelector("sl-icon-button");
|
||||
button?.blur(); // Remove focus from the button to set it back to its default state
|
||||
}, 3000);
|
||||
}
|
||||
|
@ -61,7 +61,6 @@ export class CrawlLogs extends LitElement {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
`,
|
||||
];
|
||||
|
||||
@ -100,7 +99,11 @@ export class CrawlLogs extends LitElement {
|
||||
<span class="tag">${log.logLevel}</span>
|
||||
</div>
|
||||
<div class="message">${log.message}</div>
|
||||
<div class="url" title="${log.details?.page}"><a target="_blank" href="${log.details?.page}">${log.details?.page}</a></div>
|
||||
<div class="url" title="${log.details?.page}">
|
||||
<a target="_blank" href="${log.details?.page}"
|
||||
>${log.details?.page}</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</btrix-numbered-list-item>
|
||||
`
|
||||
|
@ -72,7 +72,9 @@ export class Input extends LiteElement {
|
||||
? html`
|
||||
<sl-icon-button
|
||||
class="sl-input-icon-button"
|
||||
label=${this.isPasswordVisible ? msg("Hide password") : msg("Show password")}
|
||||
label=${this.isPasswordVisible
|
||||
? msg("Hide password")
|
||||
: msg("Show password")}
|
||||
name=${this.isPasswordVisible ? "eye-slash" : "eye"}
|
||||
@click=${this.onTogglePassword}
|
||||
></sl-icon-button>
|
||||
|
@ -53,7 +53,7 @@ export class MarkdownEditor extends LitElement {
|
||||
?data-invalid=${isInvalid}
|
||||
?data-user-invalid=${isInvalid}
|
||||
>
|
||||
<input name=${this.name} type="hidden" value="${this.value}"/>
|
||||
<input name=${this.name} type="hidden" value="${this.value}" />
|
||||
${guard(
|
||||
[this.initialValue],
|
||||
() => html`
|
||||
|
@ -33,8 +33,7 @@ export class OrgsList extends LiteElement {
|
||||
|
||||
return html`
|
||||
<ul class="border rounded-lg overflow-hidden">
|
||||
${this.orgList?.map(this.renderOrg)}
|
||||
${this.renderOrgQuotas()}
|
||||
${this.orgList?.map(this.renderOrg)} ${this.renderOrgQuotas()}
|
||||
</ul>
|
||||
`;
|
||||
}
|
||||
@ -45,29 +44,29 @@ export class OrgsList extends LiteElement {
|
||||
}
|
||||
|
||||
return html`
|
||||
<btrix-dialog
|
||||
label=${msg(str`Quotas for: ${this.currOrg.name}`)}
|
||||
?open=${!!this.currOrg}
|
||||
@sl-request-close=${() => (this.currOrg = null)}
|
||||
>
|
||||
${Object.entries(this.currOrg.quotas).map(([key, value]) => {
|
||||
return html`
|
||||
<sl-input
|
||||
name=${key}
|
||||
label=${msg("Max Concurrent Crawls")}
|
||||
value=${value}
|
||||
type="number"
|
||||
@sl-input="${this.onUpdateQuota}"
|
||||
></sl-input>`;
|
||||
})}
|
||||
<div slot="footer" class="flex justify-end">
|
||||
<sl-button
|
||||
size="small"
|
||||
@click="${this.onSubmitQuotas}"
|
||||
variant="primary">${msg("Update Quotas")}
|
||||
</sl-button>
|
||||
</div>
|
||||
</btrix-dialog>
|
||||
<btrix-dialog
|
||||
label=${msg(str`Quotas for: ${this.currOrg.name}`)}
|
||||
?open=${!!this.currOrg}
|
||||
@sl-request-close=${() => (this.currOrg = null)}
|
||||
>
|
||||
${Object.entries(this.currOrg.quotas).map(([key, value]) => {
|
||||
return html` <sl-input
|
||||
name=${key}
|
||||
label=${msg("Max Concurrent Crawls")}
|
||||
value=${value}
|
||||
type="number"
|
||||
@sl-input="${this.onUpdateQuota}"
|
||||
></sl-input>`;
|
||||
})}
|
||||
<div slot="footer" class="flex justify-end">
|
||||
<sl-button
|
||||
size="small"
|
||||
@click="${this.onSubmitQuotas}"
|
||||
variant="primary"
|
||||
>${msg("Update Quotas")}
|
||||
</sl-button>
|
||||
</div>
|
||||
</btrix-dialog>
|
||||
`;
|
||||
}
|
||||
|
||||
@ -81,7 +80,9 @@ export class OrgsList extends LiteElement {
|
||||
|
||||
private onSubmitQuotas() {
|
||||
if (this.currOrg) {
|
||||
this.dispatchEvent(new CustomEvent("update-quotas", {detail: this.currOrg}));
|
||||
this.dispatchEvent(
|
||||
new CustomEvent("update-quotas", { detail: this.currOrg })
|
||||
);
|
||||
}
|
||||
this.currOrg = null;
|
||||
}
|
||||
@ -121,7 +122,11 @@ export class OrgsList extends LiteElement {
|
||||
? msg(`1 member`)
|
||||
: msg(str`${memberCount} members`)}
|
||||
</div>
|
||||
<sl-icon-button name="gear" slot="prefix" @click="${this.showQuotas(org)}"></sl-icon-button>
|
||||
<sl-icon-button
|
||||
name="gear"
|
||||
slot="prefix"
|
||||
@click="${this.showQuotas(org)}"
|
||||
></sl-icon-button>
|
||||
</div>
|
||||
</li>
|
||||
`;
|
||||
|
@ -200,7 +200,9 @@ export class ProfileBrowser extends LiteElement {
|
||||
return html`
|
||||
<sl-icon-button
|
||||
name="layout-sidebar-reverse"
|
||||
label=${!this.showOriginSidebar ? msg("Show sidebar") : msg("Hide sidebar")}
|
||||
label=${!this.showOriginSidebar
|
||||
? msg("Show sidebar")
|
||||
: msg("Hide sidebar")}
|
||||
class="${this.showOriginSidebar ? "text-blue-600" : ""}"
|
||||
@click=${() => (this.showOriginSidebar = !this.showOriginSidebar)}
|
||||
></sl-icon-button>
|
||||
|
@ -296,8 +296,7 @@ export class WorkflowListItem extends LitElement {
|
||||
(workflow) =>
|
||||
html`
|
||||
<btrix-crawl-status
|
||||
state=${workflow.lastCrawlState ||
|
||||
msg("No Crawls Yet")}
|
||||
state=${workflow.lastCrawlState || msg("No Crawls Yet")}
|
||||
?stopping=${workflow.lastCrawlStopping}
|
||||
></btrix-crawl-status>
|
||||
`
|
||||
@ -334,7 +333,11 @@ export class WorkflowListItem extends LitElement {
|
||||
<div class="col">
|
||||
<div class="detail">
|
||||
${this.safeRender((workflow) => {
|
||||
if (workflow.isCrawlRunning && workflow.totalSize && workflow.lastCrawlSize) {
|
||||
if (
|
||||
workflow.isCrawlRunning &&
|
||||
workflow.totalSize &&
|
||||
workflow.lastCrawlSize
|
||||
) {
|
||||
return html`<sl-format-bytes
|
||||
value=${workflow.totalSize}
|
||||
display="narrow"
|
||||
@ -349,9 +352,9 @@ export class WorkflowListItem extends LitElement {
|
||||
}
|
||||
if (workflow.totalSize && workflow.lastCrawlSize) {
|
||||
return html`<sl-format-bytes
|
||||
value=${workflow.totalSize}
|
||||
display="narrow"
|
||||
></sl-format-bytes>`;
|
||||
value=${workflow.totalSize}
|
||||
display="narrow"
|
||||
></sl-format-bytes>`;
|
||||
}
|
||||
if (workflow.isCrawlRunning && workflow.lastCrawlSize) {
|
||||
return html`<span class="currCrawlSize">
|
||||
|
@ -269,7 +269,9 @@ export class BrowserProfilesDetail extends LiteElement {
|
||||
private renderMenu() {
|
||||
return html`
|
||||
<sl-dropdown placement="bottom-end" distance="4">
|
||||
<sl-button size="small" slot="trigger" caret>${msg("Actions")}</sl-button>
|
||||
<sl-button size="small" slot="trigger" caret
|
||||
>${msg("Actions")}</sl-button
|
||||
>
|
||||
|
||||
<ul
|
||||
class="text-left text-sm text-neutral-800 bg-white whitespace-nowrap"
|
||||
|
@ -1118,15 +1118,14 @@ https://example.net`}
|
||||
false
|
||||
)}
|
||||
${this.renderFormCol(html`
|
||||
<sl-checkbox
|
||||
name="useSitemap"
|
||||
?checked=${this.formState.useSitemap}
|
||||
>
|
||||
<sl-checkbox name="useSitemap" ?checked=${this.formState.useSitemap}>
|
||||
${msg("Check For Sitemap")}
|
||||
</sl-checkbox>
|
||||
`)}
|
||||
${this.renderHelpTextCol(
|
||||
msg(`If checked, the crawler will check for a sitemap at /sitemap.xml and use it to discover pages to crawl if present.`),
|
||||
msg(
|
||||
`If checked, the crawler will check for a sitemap at /sitemap.xml and use it to discover pages to crawl if present.`
|
||||
),
|
||||
false
|
||||
)}
|
||||
<div class="col-span-5">
|
||||
|
@ -29,7 +29,7 @@ const defaultValue = {
|
||||
crawlTimeout: null,
|
||||
jobType: undefined,
|
||||
scale: 1,
|
||||
autoAddCollections: []
|
||||
autoAddCollections: [],
|
||||
} as WorkflowParams;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user