diff --git a/backend/btrixcloud/models.py b/backend/btrixcloud/models.py index 85372a61..99cfadca 100644 --- a/backend/btrixcloud/models.py +++ b/backend/btrixcloud/models.py @@ -224,6 +224,7 @@ TYPE_SUCCESSFUL_STATES = Literal[ "stopped_by_user", "stopped_storage_quota_reached", "stopped_time_quota_reached", + "stopped_org_readonly", ] SUCCESSFUL_STATES = get_args(TYPE_SUCCESSFUL_STATES) diff --git a/backend/btrixcloud/operator/crawls.py b/backend/btrixcloud/operator/crawls.py index 2eaf876e..0327717f 100644 --- a/backend/btrixcloud/operator/crawls.py +++ b/backend/btrixcloud/operator/crawls.py @@ -1242,6 +1242,9 @@ class CrawlOperator(BaseOperator): # gracefully stop crawl if current running crawl sizes reach storage quota org = await self.org_ops.get_org_by_id(crawl.oid) + if org.readOnly: + return "stopped_org_readonly" + if org.quotas.storageQuota: running_crawls_total_size = status.size for crawl_job in data.related[CJS].values(): @@ -1366,6 +1369,8 @@ class CrawlOperator(BaseOperator): state = "stopped_storage_quota_reached" elif status.stopReason == "stopped_time_quota_reached": state = "stopped_time_quota_reached" + elif status.stopReason == "stopped_org_readonly": + state = "stopped_org_readonly" else: state = "complete" diff --git a/backend/btrixcloud/operator/models.py b/backend/btrixcloud/operator/models.py index 13a04918..92edaa34 100644 --- a/backend/btrixcloud/operator/models.py +++ b/backend/btrixcloud/operator/models.py @@ -21,6 +21,7 @@ StopReason = Literal[ "size-limit", "stopped_storage_quota_reached", "stopped_time_quota_reached", + "stopped_org_readonly", ] diff --git a/frontend/src/features/archived-items/crawl-status.ts b/frontend/src/features/archived-items/crawl-status.ts index a99a92e4..2d2f3d20 100644 --- a/frontend/src/features/archived-items/crawl-status.ts +++ b/frontend/src/features/archived-items/crawl-status.ts @@ -228,6 +228,16 @@ export class CrawlStatus extends TailwindElement { label = msg("Stopped: Time Quota Reached"); break; + case "stopped_org_readonly": + color = "var(--warning)"; + icon = html``; + label = msg("Stopped: Crawling Disabled"); + break; + case "canceled": color = "var(--sl-color-orange-600)"; icon = html`