Skip to content

Commit

Permalink
Merge branch 'main' into frontend-collection-editing-dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
emma-sg committed Jan 30, 2025
2 parents 8937464 + b0aebb5 commit bcd66e3
Show file tree
Hide file tree
Showing 29 changed files with 1,406 additions and 819 deletions.
2 changes: 1 addition & 1 deletion backend/btrixcloud/auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" auth functions for login """
"""auth functions for login"""

import os
from uuid import UUID, uuid4
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/basecrawls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" base crawl type """
"""base crawl type"""

from datetime import datetime, timedelta
from typing import Optional, List, Union, Dict, Any, Type, TYPE_CHECKING, cast, Tuple
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/crawlmanager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" shared crawl manager implementation """
"""shared crawl manager implementation"""

import os
import secrets
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/crawls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Crawl API """
"""Crawl API"""

# pylint: disable=too-many-lines

Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/emailsender.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Basic Email Sending Support"""
"""Basic Email Sending Support"""

from datetime import datetime
import os
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/invites.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Invite system management """
"""Invite system management"""

from typing import Optional, Any
import os
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/k8sapi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" K8S API Access """
"""K8S API Access"""

import os
import traceback
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/main_bg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" entrypoint module for background jobs """
"""entrypoint module for background jobs"""

import asyncio
import os
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/main_op.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" entrypoint module for operator """
"""entrypoint module for operator"""

import os
import sys
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Migration 0007 - Workflows changes
- Rename colls to autoAddCollections
- Rename colls to autoAddCollections
- Re-calculate workflow crawl stats to populate crawlSuccessfulCount
"""

Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/operator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" operators module """
"""operators module"""

from .profiles import ProfileOperator
from .bgjobs import BgJobOperator
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/operator/baseoperator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Base Operator class for all operators """
"""Base Operator class for all operators"""

import asyncio
import os
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/operator/bgjobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Operator handler for BackgroundJobs """
"""Operator handler for BackgroundJobs"""

from uuid import UUID
import traceback
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/operator/crawls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" CrawlOperator """
"""CrawlOperator"""

import traceback
import os
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/operator/cronjobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Operator handler for crawl CronJobs """
"""Operator handler for crawl CronJobs"""

from uuid import UUID
from typing import Optional
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/operator/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Operator Models """
"""Operator Models"""

from collections import defaultdict
from uuid import UUID
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/operator/profiles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Operator handler for ProfileJobs """
"""Operator handler for ProfileJobs"""

from btrixcloud.utils import str_to_date, dt_now

Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/ops.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" shared helper to initialize ops classes """
"""shared helper to initialize ops classes"""

from typing import Tuple

Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/profiles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Profile Management """
"""Profile Management"""

from typing import Optional, TYPE_CHECKING, Any, cast, Dict, List, Tuple
from uuid import UUID, uuid4
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/uploads.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" handle user uploads into browsertrix """
"""handle user uploads into browsertrix"""

import uuid
from urllib.parse import unquote
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" k8s utils """
"""k8s utils"""

import asyncio
import atexit
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" current version """
"""current version"""

__version__ = "1.14.0-beta.0"
9 changes: 3 additions & 6 deletions frontend/src/components/orgs-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,20 +382,17 @@ export class OrgsList extends BtrixElement {
<ul class="mb-3 text-neutral-600">
<li>
${msg(
html`${msg("Crawls")}:
${this.localize.bytes(org.bytesStoredCrawls)}`,
str`Crawls: ${this.localize.bytes(org.bytesStoredCrawls)}`,
)}
</li>
<li>
${msg(
html`${msg("Uploads")}:
${this.localize.bytes(org.bytesStoredUploads)}`,
str`Uploads: ${this.localize.bytes(org.bytesStoredUploads)}`,
)}
</li>
<li>
${msg(
html`${msg("Profiles")}:
${this.localize.bytes(org.bytesStoredProfiles)}`,
str`Profiles: ${this.localize.bytes(org.bytesStoredProfiles)}`,
)}
</li>
</ul>
Expand Down
60 changes: 31 additions & 29 deletions frontend/src/features/archived-items/crawl-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,37 +115,39 @@ export class CrawlQueue extends BtrixElement {
const getInputWidth = (v: number | string) =>
`${Math.max(v.toString().length, 3) + 2}ch`;

const fromInput = html` <btrix-inline-input
class="mx-1 inline-block"
style="width: ${Math.max(offsetValue.toString().length, 2) + 2}ch"
value="1"
inputmode="numeric"
size="small"
autocomplete="off"
@sl-input=${(e: SlInputEvent) => {
const input = e.target as SlInput;
input.style.width = getInputWidth(input.value);
}}
@sl-change=${async (e: SlChangeEvent) => {
const input = e.target as SlInput;
const int = +input.value.replace(/\D/g, "");
await this.updateComplete;
const value = Math.max(1, Math.min(int, this.queue!.total - 1));
input.value = value.toString();
this.pageOffset = value - 1;
}}
></btrix-inline-input>`;

const max = this.localize.number(countMax);
const total = this.localize.number(this.queue.total);

return html`
<div class="flex items-center text-neutral-500">
${msg(html`
Queued URLs from
<btrix-inline-input
class="mx-1 inline-block"
style="width: ${Math.max(offsetValue.toString().length, 2) + 2}ch"
value="1"
inputmode="numeric"
size="small"
autocomplete="off"
@sl-input=${(e: SlInputEvent) => {
const input = e.target as SlInput;
input.style.width = getInputWidth(input.value);
}}
@sl-change=${async (e: SlChangeEvent) => {
const input = e.target as SlInput;
const int = +input.value.replace(/\D/g, "");
await this.updateComplete;
const value = Math.max(1, Math.min(int, this.queue!.total - 1));
input.value = value.toString();
this.pageOffset = value - 1;
}}
></btrix-inline-input>
to ${this.localize.number(countMax)} of
${this.localize.number(this.queue.total)}
`)}
${msg(html`Queued URLs from ${fromInput} to ${max} of ${total}`, {
id: "h077c8fe82a78c616",
})}
</div>
`;
}
Expand Down
8 changes: 3 additions & 5 deletions frontend/src/features/crawl-workflows/workflow-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,9 @@ export class WorkflowListItem extends BtrixElement {
<div class="desc">
${this.safeRender((workflow) => {
if (workflow.schedule) {
return msg(
str`${humanizeSchedule(workflow.schedule, {
length: "short",
})}`,
);
return humanizeSchedule(workflow.schedule, {
length: "short",
});
}
if (workflow.lastStartedByName) {
return msg(str`Manual run by ${workflow.lastStartedByName}`);
Expand Down
Loading

0 comments on commit bcd66e3

Please sign in to comment.