diff --git a/dashboard/src/objects/common/jobs.ts b/dashboard/src/objects/common/jobs.ts index 4ebe2038..6247fcd9 100644 --- a/dashboard/src/objects/common/jobs.ts +++ b/dashboard/src/objects/common/jobs.ts @@ -5,9 +5,9 @@ import { isMobile } from '../../utils/device'; import { duration } from '../../utils/format'; import { ColumnField, Tab } from './types'; -type JobDocTypes = 'Site' | 'Bench' | 'Server' | 'Release Group'; +type JobPageTypes = 'Site' | 'Bench' | 'Server' | 'Release Group'; -export function getJobsTab(pagetype: JobDocTypes) { +export function getJobsTab(pagetype: JobPageTypes) { const jobRoute = getJobRoute(pagetype); return { @@ -73,7 +73,7 @@ export function getJobsTab(pagetype: JobDocTypes) { } satisfies Tab as Tab; } -function getJobRoute(pagetype: JobDocTypes) { +function getJobRoute(pagetype: JobPageTypes) { if (pagetype === 'Site') return 'Site Job'; else if (pagetype === 'Bench') return 'Bench Job'; else if (pagetype === 'Server') return 'Server Job'; @@ -81,7 +81,7 @@ function getJobRoute(pagetype: JobDocTypes) { throw unreachable; } -function getJobTabColumns(pagetype: JobDocTypes) { +function getJobTabColumns(pagetype: JobPageTypes) { const columns: ColumnField[] = [ { label: 'Job Type', diff --git a/docs/Internals/Billing & Subscription.MD b/docs/Internals/Billing & Subscription.MD index 3036a20a..4fe20853 100644 --- a/docs/Internals/Billing & Subscription.MD +++ b/docs/Internals/Billing & Subscription.MD @@ -6,7 +6,7 @@ published: 1 This page describes how Subscription Management works in Jingrow Cloud. -## DocTypes +## PageTypes These are the key doctypes that are related to subscription: diff --git a/press/guards/settings.py b/press/guards/settings.py index 20380ad0..3274c8a6 100644 --- a/press/guards/settings.py +++ b/press/guards/settings.py @@ -2,7 +2,7 @@ import functools import jingrow -SETTINGS_DOCTYPE = "Jcloude Settings" +SETTINGS_PAGETYPE = "Jcloude Settings" def enabled(key: str, default_value=None, raise_error: bool = False): @@ -20,7 +20,7 @@ def enabled(key: str, default_value=None, raise_error: bool = False): def wrapped(func): @functools.wraps(func) def inner(*args, **kwargs): - if jingrow.db.get_single_value(SETTINGS_DOCTYPE, key, cache=True): + if jingrow.db.get_single_value(SETTINGS_PAGETYPE, key, cache=True): return func(*args, **kwargs) if raise_error: jingrow.throw("This feature is disabled", jingrow.ValidationError) diff --git a/press/marketplace/README.md b/press/marketplace/README.md index 0c4cfb7a..937103a4 100644 --- a/press/marketplace/README.md +++ b/press/marketplace/README.md @@ -1,4 +1,4 @@ # Marketplace -## DocTypes at a Glance +## PageTypes at a Glance diff --git a/press/press/doctype/bench/bench.py b/press/press/doctype/bench/bench.py index 1bc8b6bf..f40876a7 100644 --- a/press/press/doctype/bench/bench.py +++ b/press/press/doctype/bench/bench.py @@ -124,7 +124,7 @@ class Bench(Document): vcpu: DF.Int # end: auto-generated types - DOCTYPE = "Bench" + PAGETYPE = "Bench" dashboard_fields = ( "apps", "name", @@ -1144,7 +1144,7 @@ class Bench(Document): def get_workloads(cls, sites: list[str]) -> Generator[tuple[str, float, str], None, None]: benches = jingrow.get_all("Site", filters={"name": ["in", sites]}, pluck="bench", order_by="bench") for bench_name in benches: - bench = cls(cls.DOCTYPE, bench_name) + bench = cls(cls.PAGETYPE, bench_name) yield bench.name, bench.workload, bench.server diff --git a/press/press/doctype/press_webhook/press_webhook.py b/press/press/doctype/press_webhook/press_webhook.py index 79ca1555..ef04dee6 100644 --- a/press/press/doctype/press_webhook/press_webhook.py +++ b/press/press/doctype/press_webhook/press_webhook.py @@ -40,7 +40,7 @@ class PressWebhook(Document): team: DF.Link # end: auto-generated types - DOCTYPE = "Jcloude Webhook" + PAGETYPE = "Jcloude Webhook" dashboard_fields = ("enabled", "endpoint", "events") @role_guard.action() diff --git a/press/press/doctype/press_webhook_event/press_webhook_event.py b/press/press/doctype/press_webhook_event/press_webhook_event.py index 5beb35a8..19356dcd 100644 --- a/press/press/doctype/press_webhook_event/press_webhook_event.py +++ b/press/press/doctype/press_webhook_event/press_webhook_event.py @@ -19,5 +19,5 @@ class PressWebhookEvent(Document): title: DF.Data # end: auto-generated types - DOCTYPE = "Jcloude Webhook Event" + PAGETYPE = "Jcloude Webhook Event" dashboard_fields = ("name", "description") diff --git a/press/press/doctype/site/site.py b/press/press/doctype/site/site.py index d611754f..6a7c6ce0 100644 --- a/press/press/doctype/site/site.py +++ b/press/press/doctype/site/site.py @@ -228,7 +228,7 @@ class Site(Document, TagHelpers): update_trigger_time: DF.Time | None # end: auto-generated types - DOCTYPE = "Site" + PAGETYPE = "Site" dashboard_fields = ( "ip", diff --git a/press/press/doctype/sql_playground_log/sql_playground_log.py b/press/press/doctype/sql_playground_log/sql_playground_log.py index e579dfec..2f413557 100644 --- a/press/press/doctype/sql_playground_log/sql_playground_log.py +++ b/press/press/doctype/sql_playground_log/sql_playground_log.py @@ -22,7 +22,7 @@ class SQLPlaygroundLog(Document): team: DF.Link | None # end: auto-generated types - DOCTYPE = "SQL Playground Log" + PAGETYPE = "SQL Playground Log" dashboard_fields = ( "site", "query", diff --git a/press/press/doctype/virtual_machine_image/virtual_machine_image.py b/press/press/doctype/virtual_machine_image/virtual_machine_image.py index 660b01b3..f765631d 100644 --- a/press/press/doctype/virtual_machine_image/virtual_machine_image.py +++ b/press/press/doctype/virtual_machine_image/virtual_machine_image.py @@ -51,7 +51,7 @@ class VirtualMachineImage(Document): volumes: DF.Table[VirtualMachineImageVolume] # end: auto-generated types - DOCTYPE = "Virtual Machine Image" + PAGETYPE = "Virtual Machine Image" def before_insert(self): self.set_credentials() @@ -271,7 +271,7 @@ class VirtualMachineImage(Document): def get_available_for_series( cls, series: str, region: str | None = None, platform: str | None = None ) -> str | None: - images = jingrow.qb.PageType(cls.DOCTYPE) + images = jingrow.qb.PageType(cls.PAGETYPE) get_available_images = ( jingrow.qb.from_(images) .select("name")