@rebasepro/studio 0.35.1 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{ApiExplorer-C61w8gCc.js → ApiExplorer-BVQHAjHB.js} +3 -2
- package/dist/{ApiExplorer-C61w8gCc.js.map → ApiExplorer-BVQHAjHB.js.map} +1 -1
- package/dist/{useRunAsUsers-CF7tkGzj.js → AuthSimulationSelector-XogpkeXC.js} +4 -68
- package/dist/AuthSimulationSelector-XogpkeXC.js.map +1 -0
- package/dist/{CronJobsView-DUuyzkJK.js → CronJobsView-DyX9MINh.js} +2 -2
- package/dist/{CronJobsView-DUuyzkJK.js.map → CronJobsView-DyX9MINh.js.map} +1 -1
- package/dist/DatabaseView-Bi0NZS90.js +1897 -0
- package/dist/DatabaseView-Bi0NZS90.js.map +1 -0
- package/dist/{JSEditor-Bi2Aol-Y.js → JSEditor-B4Lazm-z.js} +4 -3
- package/dist/{JSEditor-Bi2Aol-Y.js.map → JSEditor-B4Lazm-z.js.map} +1 -1
- package/dist/RLSEditor-CcHkWFNg.js +973 -0
- package/dist/RLSEditor-CcHkWFNg.js.map +1 -0
- package/dist/{SQLEditor-DRo5kW1h.js → SQLEditorRoute-f5j_ZKdj.js} +1472 -320
- package/dist/SQLEditorRoute-f5j_ZKdj.js.map +1 -0
- package/dist/SchemaDiagramView-CckQobIZ.js +98 -0
- package/dist/SchemaDiagramView-CckQobIZ.js.map +1 -0
- package/dist/{StorageView-D0D8z4lI.js → StorageView-DQEIDFvO.js} +592 -447
- package/dist/StorageView-DQEIDFvO.js.map +1 -0
- package/dist/TableEditorView-BRZNvD6U.js +3615 -0
- package/dist/TableEditorView-BRZNvD6U.js.map +1 -0
- package/dist/TablePolicies-C1-tbC8x.js +1740 -0
- package/dist/TablePolicies-C1-tbC8x.js.map +1 -0
- package/dist/{SchemaVisualizer-Dy4kWKT5.js → TablesDiagram-RTJfwVEN.js} +651 -489
- package/dist/TablesDiagram-RTJfwVEN.js.map +1 -0
- package/dist/{UsersAndRolesView-CKw4SJPj.js → UsersAndRolesView-Cx6xtMVH.js} +2 -2
- package/dist/{UsersAndRolesView-CKw4SJPj.js.map → UsersAndRolesView-Cx6xtMVH.js.map} +1 -1
- package/dist/{WebhooksView-CFPY-N9h.js → WebhooksView-Bn9KB7xG.js} +2 -2
- package/dist/{WebhooksView-CFPY-N9h.js.map → WebhooksView-Bn9KB7xG.js.map} +1 -1
- package/dist/{adminFetch-BfOnfRgU.js → adminFetch-C7Ra8rpP.js} +26 -1
- package/dist/{adminFetch-BfOnfRgU.js.map → adminFetch-C7Ra8rpP.js.map} +1 -1
- package/dist/components/Database/ActivitySection.d.ts +9 -0
- package/dist/components/Database/AdvisorsSection.d.ts +17 -0
- package/dist/components/Database/DatabaseView.d.ts +13 -0
- package/dist/components/Database/ExtensionsSection.d.ts +2 -0
- package/dist/components/Database/FunctionsSection.d.ts +2 -0
- package/dist/components/Database/QueriesSection.d.ts +3 -0
- package/dist/components/Database/TriggersSection.d.ts +2 -0
- package/dist/components/Database/TypesSection.d.ts +2 -0
- package/dist/components/Database/format.d.ts +6 -0
- package/dist/components/Database/links.d.ts +11 -0
- package/dist/components/Database/shared.d.ts +35 -0
- package/dist/components/Database/source.d.ts +12 -0
- package/dist/components/Database/useCatalogList.d.ts +13 -0
- package/dist/components/RLSEditor/RLSEditor.d.ts +2 -0
- package/dist/components/RLSEditor/TablePolicies.d.ts +54 -0
- package/dist/components/SQLEditor/ExplainVisualizer.d.ts +8 -20
- package/dist/components/SQLEditor/ResultChart.d.ts +18 -0
- package/dist/components/SQLEditor/SQLEditor.d.ts +13 -1
- package/dist/components/SQLEditor/SQLEditorRoute.d.ts +13 -0
- package/dist/components/SQLEditor/SQLEditorSidebar.d.ts +7 -1
- package/dist/components/SQLEditor/SqlParamsPanel.d.ts +16 -0
- package/dist/components/SQLEditor/useSqlSnippets.d.ts +47 -0
- package/dist/components/SchemaVisualizer/SchemaDiagramView.d.ts +12 -0
- package/dist/components/SchemaVisualizer/TablesDiagram.d.ts +23 -0
- package/dist/components/SchemaVisualizer/useSchemaGraph.d.ts +32 -1
- package/dist/components/StorageView/StorageView.d.ts +5 -0
- package/dist/components/TableEditor/CreateTableDialog.d.ts +8 -0
- package/dist/components/TableEditor/DdlConfirm.d.ts +23 -0
- package/dist/components/TableEditor/SqlBlock.d.ts +7 -0
- package/dist/components/TableEditor/TableDdlSheet.d.ts +9 -0
- package/dist/components/TableEditor/TableEditorView.d.ts +7 -0
- package/dist/components/TableEditor/tableModel.d.ts +210 -0
- package/dist/components/TableEditor/tabs/DataTab.d.ts +12 -0
- package/dist/components/TableEditor/tabs/PoliciesTab.d.ts +8 -0
- package/dist/components/TableEditor/tabs/RelationsTab.d.ts +8 -0
- package/dist/components/TableEditor/tabs/SettingsTab.d.ts +11 -0
- package/dist/components/TableEditor/tabs/StatsTab.d.ts +8 -0
- package/dist/components/TableEditor/tabs/StructureTab.d.ts +12 -0
- package/dist/index.es.js +29 -15
- package/dist/index.es.js.map +1 -1
- package/dist/{sql_utils-CYcgpgam.js → sql_utils-DkMYltfq.js} +27 -3
- package/dist/sql_utils-DkMYltfq.js.map +1 -0
- package/dist/useRunAsUsers-GPFCxcBC.js +69 -0
- package/dist/useRunAsUsers-GPFCxcBC.js.map +1 -0
- package/dist/utils/adminFetch.d.ts +1 -0
- package/dist/utils/csv_parse.d.ts +11 -0
- package/dist/utils/explain_plan.d.ts +70 -0
- package/dist/utils/sql_params.d.ts +51 -0
- package/dist/utils/sql_utils.d.ts +16 -0
- package/package.json +11 -9
- package/dist/RLSEditor-CTG3jLE7.js +0 -2572
- package/dist/RLSEditor-CTG3jLE7.js.map +0 -1
- package/dist/SQLEditor-DRo5kW1h.js.map +0 -1
- package/dist/SchemaVisualizer-Dy4kWKT5.js.map +0 -1
- package/dist/StorageView-D0D8z4lI.js.map +0 -1
- package/dist/TableEditorView-BKhSBG-K.js +0 -1694
- package/dist/TableEditorView-BKhSBG-K.js.map +0 -1
- package/dist/components/SchemaVisualizer/SchemaVisualizer.d.ts +0 -3
- package/dist/policy-presets-CJKzAvQp.js +0 -167
- package/dist/policy-presets-CJKzAvQp.js.map +0 -1
- package/dist/sql_utils-CYcgpgam.js.map +0 -1
- package/dist/useRunAsUsers-CF7tkGzj.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CronJobsView-DUuyzkJK.js","names":[],"sources":["../src/components/CronJobs/DbCronJobsPanel.tsx","../src/components/CronJobs/CronJobsView.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport {\n Alert,\n BooleanSwitch,\n BooleanSwitchWithLabel,\n Button,\n Card,\n Chip,\n CircularProgress,\n cls,\n defaultBorderMixin,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n PencilIcon,\n IconButton,\n iconSize,\n PlusIcon,\n RefreshCwIcon,\n Select,\n SelectItem,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n TextField,\n Tooltip,\n Trash2Icon,\n Typography\n} from \"@rebasepro/ui\";\nimport { useSnackbarController, useTranslation } from \"@rebasepro/app\";\nimport {\n asBoolean,\n asString,\n isRecord,\n useAdminFetch\n} from \"../../utils/adminFetch\";\n\ninterface StoredCronJobRow {\n id: string;\n name: string;\n schedule: string;\n kind: \"http\" | \"sql\";\n config: Record<string, unknown>;\n enabled: boolean;\n}\n\nconst SCHEDULE_PRESETS = [\n { labelKey: \"studio_cron_db_preset_minute\", value: \"* * * * *\" },\n { labelKey: \"studio_cron_db_preset_5_minutes\", value: \"*/5 * * * *\" },\n { labelKey: \"studio_cron_db_preset_hour\", value: \"0 * * * *\" },\n { labelKey: \"studio_cron_db_preset_midnight\", value: \"0 0 * * *\" }\n] as const;\n\nfunction parseJob(raw: unknown): StoredCronJobRow | null {\n if (!isRecord(raw) || typeof raw.id !== \"string\") return null;\n const kind = raw.kind === \"sql\" ? \"sql\" : \"http\";\n return {\n id: raw.id,\n name: asString(raw.name),\n schedule: asString(raw.schedule),\n kind,\n config: isRecord(raw.config) ? raw.config : {},\n enabled: asBoolean(raw.enabled, true)\n };\n}\n\nexport function DbCronJobsPanel() {\n const { requestJson } = useAdminFetch();\n const snackbar = useSnackbarController();\n const { t } = useTranslation();\n\n const [jobs, setJobs] = useState<StoredCronJobRow[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n\n const [dialogOpen, setDialogOpen] = useState(false);\n const [editing, setEditing] = useState<StoredCronJobRow | null>(null);\n const [name, setName] = useState(\"\");\n const [schedule, setSchedule] = useState(\"*/5 * * * *\");\n const [kind, setKind] = useState<\"http\" | \"sql\">(\"sql\");\n const [sqlText, setSqlText] = useState(\"DELETE FROM sessions WHERE expires_at < NOW();\");\n const [httpUrl, setHttpUrl] = useState(\"https://\");\n const [enabled, setEnabled] = useState(true);\n const [saving, setSaving] = useState(false);\n\n const load = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const raw = await requestJson(\"/admin/cron/jobs\");\n const arr = isRecord(raw) && Array.isArray(raw.jobs) ? raw.jobs : [];\n setJobs(arr.map(parseJob).filter((j): j is StoredCronJobRow => j !== null));\n } catch (err: unknown) {\n setError(err instanceof Error ? err.message : t(\"studio_cron_db_load_failed\"));\n } finally {\n setLoading(false);\n }\n }, [requestJson, t]);\n\n useEffect(() => {\n void load();\n }, [load]);\n\n const openCreate = () => {\n setEditing(null);\n setName(\"\");\n setSchedule(\"*/5 * * * *\");\n setKind(\"sql\");\n setSqlText(\"\");\n setHttpUrl(\"https://\");\n setEnabled(true);\n setDialogOpen(true);\n };\n\n const openEdit = (j: StoredCronJobRow) => {\n setEditing(j);\n setName(j.name);\n setSchedule(j.schedule);\n setKind(j.kind);\n setSqlText(asString(j.config.sql));\n setHttpUrl(asString(j.config.url, \"https://\"));\n setEnabled(j.enabled);\n setDialogOpen(true);\n };\n\n const handleSave = async () => {\n setSaving(true);\n try {\n const config = kind === \"sql\"\n ? { sql: sqlText.trim() }\n : { url: httpUrl.trim() };\n const payload = { name: name.trim(), schedule: schedule.trim(), kind, config, enabled };\n if (editing) {\n await requestJson(`/admin/cron/jobs/${encodeURIComponent(editing.id)}`, {\n method: \"PATCH\",\n body: payload\n });\n snackbar.open({ type: \"success\", message: t(\"studio_cron_db_updated\", { name: payload.name }) });\n } else {\n await requestJson(\"/admin/cron/jobs\", {\n method: \"POST\",\n body: payload\n });\n snackbar.open({ type: \"success\", message: t(\"studio_cron_db_created\", { name: payload.name }) });\n }\n setDialogOpen(false);\n await load();\n } catch (err: unknown) {\n snackbar.open({ type: \"error\", message: err instanceof Error ? err.message : t(\"studio_cron_db_save_failed\") });\n } finally {\n setSaving(false);\n }\n };\n\n const handleToggle = async (j: StoredCronJobRow, next: boolean) => {\n try {\n await requestJson(`/admin/cron/jobs/${encodeURIComponent(j.id)}`, {\n method: \"PATCH\",\n body: { enabled: next }\n });\n await load();\n } catch (err: unknown) {\n snackbar.open({ type: \"error\", message: err instanceof Error ? err.message : t(\"studio_cron_db_toggle_failed\") });\n }\n };\n\n const handleDelete = async (j: StoredCronJobRow) => {\n try {\n await requestJson(`/admin/cron/jobs/${encodeURIComponent(j.id)}`, { method: \"DELETE\" });\n snackbar.open({ type: \"success\", message: t(\"studio_cron_db_deleted\", { name: j.name }) });\n await load();\n } catch (err: unknown) {\n snackbar.open({ type: \"error\", message: err instanceof Error ? err.message : t(\"studio_cron_db_delete_failed\") });\n }\n };\n\n return (\n <div className=\"flex flex-col gap-4 p-5 h-full overflow-auto bg-surface-card\">\n <div className=\"flex items-center justify-between gap-4\">\n <div>\n <Typography variant=\"subtitle1\" className=\"font-semibold\">\n {t(\"studio_cron_db_title\")}\n </Typography>\n <Typography variant=\"caption\" color=\"secondary\">\n {t(\"studio_cron_db_subtitle\")}\n </Typography>\n </div>\n <div className=\"flex items-center gap-2\">\n <Tooltip title={t(\"refresh\")}>\n <IconButton size=\"small\" aria-label={t(\"studio_cron_db_refresh_aria\")} onClick={() => void load()}>\n <RefreshCwIcon size={iconSize.small} />\n </IconButton>\n </Tooltip>\n <Button size=\"small\" color=\"primary\" variant=\"filled\" onClick={openCreate}>\n <PlusIcon size={iconSize.small} />\n {t(\"studio_cron_db_new\")}\n </Button>\n </div>\n </div>\n\n {error && <Alert color=\"error\">{error}</Alert>}\n\n {loading ? (\n <div className=\"flex justify-center py-12\"><CircularProgress size=\"small\" /></div>\n ) : jobs.length === 0 ? (\n <Card className=\"p-8 text-center flex flex-col items-center gap-3\">\n <Typography variant=\"body2\" color=\"secondary\">\n {t(\"studio_cron_db_empty\")}\n </Typography>\n <Button size=\"small\" variant=\"filled\" onClick={openCreate}>\n <PlusIcon size={iconSize.small} />\n {t(\"studio_cron_db_create\")}\n </Button>\n </Card>\n ) : (\n <div className={cls(\"overflow-x-auto rounded-lg border\", defaultBorderMixin)}>\n <Table className=\"w-full\">\n <TableHeader>\n <TableCell header>{t(\"name\")}</TableCell>\n <TableCell header>{t(\"studio_cron_schedule\")}</TableCell>\n <TableCell header>{t(\"studio_api_keys_stat_kind\")}</TableCell>\n <TableCell header>{t(\"studio_cron_db_target\")}</TableCell>\n <TableCell header>{t(\"studio_enabled\")}</TableCell>\n <TableCell header className=\"text-right\">{t(\"actions\")}</TableCell>\n </TableHeader>\n <TableBody>\n {jobs.map((j) => (\n <TableRow key={j.id}>\n <TableCell className=\"font-medium text-sm\">{j.name}</TableCell>\n <TableCell className=\"font-mono text-xs\">{j.schedule}</TableCell>\n <TableCell>\n <Chip size=\"small\" colorScheme={j.kind === \"sql\" ? \"blueLight\" : \"purpleLight\"}>\n {j.kind.toUpperCase()}\n </Chip>\n </TableCell>\n <TableCell className=\"font-mono text-xs text-text-secondary max-w-md truncate\">\n {j.kind === \"sql\" ? asString(j.config.sql) : `POST ${asString(j.config.url)}`}\n </TableCell>\n <TableCell>\n <BooleanSwitch size=\"small\" value={j.enabled} onValueChange={(v) => void handleToggle(j, v)} />\n </TableCell>\n <TableCell className=\"text-right whitespace-nowrap\">\n <IconButton size=\"small\" aria-label={t(\"studio_cron_db_edit_aria\", { name: j.name })} onClick={() => openEdit(j)}>\n <PencilIcon size={iconSize.small} />\n </IconButton>\n <IconButton size=\"small\" aria-label={t(\"studio_cron_db_delete_aria\", { name: j.name })} onClick={() => void handleDelete(j)}>\n <Trash2Icon size={iconSize.small} className={\"text-red-500\"} />\n </IconButton>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n )}\n\n <Dialog open={dialogOpen} onOpenChange={setDialogOpen} maxWidth=\"md\" fullWidth>\n <DialogTitle>{editing ? t(\"studio_cron_db_edit_title\", { name: editing.name }) : t(\"studio_cron_db_new\")}</DialogTitle>\n <DialogContent className=\"flex flex-col gap-3\">\n <TextField label={t(\"studio_cron_db_job_name\")} value={name} onChange={(e) => setName(e.target.value)} placeholder=\"cleanup_expired_tokens\" />\n <TextField label={t(\"studio_cron_db_schedule_label\")} value={schedule} onChange={(e) => setSchedule(e.target.value)} placeholder=\"*/5 * * * *\" />\n <div className=\"flex items-center gap-1.5 flex-wrap\">\n {SCHEDULE_PRESETS.map((p) => (\n <Chip key={p.value} size=\"small\" colorScheme={schedule === p.value ? \"blueLight\" : \"grayLight\"} onClick={() => setSchedule(p.value)}>\n {t(p.labelKey)}\n </Chip>\n ))}\n </div>\n <Select\n label={t(\"studio_cron_db_job_type\")}\n value={kind}\n onValueChange={(v) => { if (v === \"sql\" || v === \"http\") setKind(v); }}\n >\n <SelectItem value=\"sql\">{t(\"studio_cron_db_kind_sql\")}</SelectItem>\n <SelectItem value=\"http\">{t(\"studio_cron_db_kind_http\")}</SelectItem>\n </Select>\n {kind === \"sql\" ? (\n <TextField\n label={t(\"studio_cron_db_kind_sql\")}\n value={sqlText}\n onChange={(e) => setSqlText(e.target.value)}\n multiline\n minRows={4}\n placeholder=\"DELETE FROM audit_logs WHERE created_at < NOW() - INTERVAL '30 days';\"\n />\n ) : (\n <TextField label={t(\"studio_cron_db_http_url\")} value={httpUrl} onChange={(e) => setHttpUrl(e.target.value)} placeholder=\"https://example.com/cron/sync\" />\n )}\n <BooleanSwitchWithLabel label={t(\"studio_enabled\")} value={enabled} onValueChange={setEnabled} />\n </DialogContent>\n <DialogActions>\n <Button variant=\"text\" onClick={() => setDialogOpen(false)}>{t(\"cancel\")}</Button>\n <Button\n variant=\"filled\"\n disabled={saving || !name.trim() || !schedule.trim() || (kind === \"sql\" ? !sqlText.trim() : !httpUrl.trim())}\n onClick={() => void handleSave()}\n >\n {saving ? t(\"saving\") : t(\"studio_cron_db_save\")}\n </Button>\n </DialogActions>\n </Dialog>\n </div>\n );\n}\n","\nimport React, { useState, useEffect, useRef } from \"react\";\nimport {\n Alert,\n AlertCircleIcon,\n Button,\n ClockIcon,\n Card,\n CheckCircleIcon,\n ChevronDownIcon,\n Chip,\n CircularProgress,\n cls,\n defaultBorderMixin,\n HistoryIcon,\n IconButton,\n iconSize,\n Paper,\n PauseIcon,\n PlayIcon,\n RefreshCwIcon,\n Tab,\n Tabs,\n Typography\n} from \"@rebasepro/ui\";\nimport { DbCronJobsPanel } from \"./DbCronJobsPanel\";\nimport { useRebaseClient, useSnackbarController, useTranslation } from \"@rebasepro/app\";\nimport type { CronJobListing, CronJobStatus, CronJobLogEntry, RejectedCronJob } from \"@rebasepro/types\";\nimport type { RebaseClient } from \"@rebasepro/types\";\n\nimport { classifyLoadFailure, type LoadFailure } from \"../load-failure\";\nimport { LoadFailureView } from \"../load-failure-view\";\n\nfunction formatDuration(ms: number): string {\n if (ms < 1000) return `${ms}ms`;\n if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;\n return `${(ms / 60000).toFixed(1)}m`;\n}\n\n/** `iso` relative to now, in `language`: \"in 5 min\", \"2 hr. ago\"; a date past a day. */\nfunction formatRelative(iso: string | undefined, language: string): string {\n if (!iso) return \"—\";\n const d = new Date(iso);\n const diff = d.getTime() - Date.now();\n const abs = Math.abs(diff);\n if (abs >= 86400000) return d.toLocaleString(language);\n const relative = new Intl.RelativeTimeFormat(language, { style: \"short\", numeric: \"auto\" });\n return abs < 3600000\n ? relative.format(Math.round(diff / 60000), \"minute\")\n : relative.format(Math.round(diff / 3600000), \"hour\");\n}\n\n/** What the listing says did not become a job — see {@link CronLoadProblems}. */\ninterface CronProblems {\n rejected: RejectedCronJob[];\n /** Cron files that failed to load: `skipped` counts these and the refused jobs together. */\n filesFailed: number;\n}\n\nfunction problemsOf(listing: CronJobListing): CronProblems {\n const rejected = listing.rejected ?? [];\n return { rejected, filesFailed: Math.max(0, (listing.skipped ?? 0) - rejected.length) };\n}\n\n/**\n * The cron files that failed to load and the jobs the scheduler refused. None\n * of them is scheduled, and none is in the list: without this a refused job\n * was simply absent, and a project whose only job was refused read \"No cron\n * jobs registered\".\n */\nfunction CronLoadProblems({ problems }: { problems: CronProblems }) {\n const { t } = useTranslation();\n if (problems.rejected.length === 0 && problems.filesFailed === 0) return null;\n return (\n <Alert color=\"error\">\n <div className=\"flex flex-col gap-2\">\n {problems.rejected.map(job => (\n <div key={job.id} className=\"flex flex-col\">\n <Typography variant=\"body2\" className=\"text-[13px] font-semibold\">\n {t(\"studio_cron_job_refused\", { job: job.name })}\n </Typography>\n <Typography variant=\"caption\" className=\"font-mono text-[12px] break-words\">\n {job.schedule} — {job.reason}\n </Typography>\n </div>\n ))}\n {problems.filesFailed > 0 && (\n <Typography variant=\"body2\" className=\"text-[13px]\">\n {t(\"studio_cron_files_failed\", { count: problems.filesFailed })}\n </Typography>\n )}\n </div>\n </Alert>\n );\n}\n\nconst stateColors: Record<string, string> = {\n idle: \"bg-emerald-500\",\nrunning: \"bg-blue-500\",\nsuccess: \"bg-emerald-500\",\n error: \"bg-red-500\",\ndisabled: \"bg-surface-400\"\n};\n\nexport function CronJobsView() {\n const [tab, setTab] = useState<\"scheduler\" | \"zero-code\">(\"scheduler\");\n const { t } = useTranslation();\n return (\n <div className=\"flex flex-col h-full w-full overflow-hidden\">\n <Tabs\n value={tab}\n onValueChange={(v) => { if (v === \"scheduler\" || v === \"zero-code\") setTab(v); }}\n variant=\"boxy\"\n className=\"border-b border-hairline px-4 bg-surface-sheet shrink-0\"\n >\n <Tab value=\"scheduler\">{t(\"studio_cron_tab_scheduler\")}</Tab>\n <Tab value=\"zero-code\">{t(\"studio_cron_tab_db\")}</Tab>\n </Tabs>\n <div className=\"flex-1 min-h-0 overflow-hidden\">\n {tab === \"scheduler\" ? <CronSchedulerMonitorView /> : <DbCronJobsPanel />}\n </div>\n </div>\n );\n}\n\nfunction CronSchedulerMonitorView() {\n const client = useRebaseClient<RebaseClient>();\n const snackbar = useSnackbarController();\n const { t, i18n } = useTranslation();\n const language = i18n?.language ?? \"en\";\n const [jobs, setJobs] = useState<CronJobStatus[]>([]);\n const [problems, setProblems] = useState<CronProblems>({ rejected: [], filesFailed: 0 });\n const [loading, setLoading] = useState(true);\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [logs, setLogs] = useState<CronJobLogEntry[]>([]);\n const [logsLoading, setLogsLoading] = useState(false);\n /**\n * Why the selected job's executions could not be read. Shown where the\n * list would be: an empty list reads as \"this job has never run\", and the\n * snackbar that used to carry the reason was gone in four seconds.\n */\n const [logsFailure, setLogsFailure] = useState<LoadFailure | null>(null);\n const [triggering, setTriggering] = useState<string | null>(null);\n /** Why the job listing failed, classified — see `load-failure.ts`. */\n const [failure, setFailure] = useState<LoadFailure | null>(null);\n\n // Refs so effects never re-fire due to identity changes\n const clientRef = useRef(client);\n clientRef.current = client;\n const snackbarRef = useRef(snackbar);\n snackbarRef.current = snackbar;\n // The job on screen now, for a read that ends after the selection moved:\n // its answer belongs to the job it was made for, not to the one shown.\n const selectedIdRef = useRef(selectedId);\n selectedIdRef.current = selectedId;\n\n // ── Fetch jobs on mount + poll every 15s ──\n useEffect(() => {\n let cancelled = false;\n\n async function load() {\n const c = clientRef.current;\n if (!c?.cron) {\n setLoading(false);\n return;\n }\n try {\n const res = await c.cron.listJobs();\n if (!cancelled) {\n setJobs(res.jobs);\n setProblems(problemsOf(res));\n setFailure(null);\n }\n } catch (e: unknown) {\n // A snackbar over an empty list said \"No Cron Jobs Registered\"\n // about a project whose crons the caller may not read. This\n // view polls every 15s, so the toast is also gone long before\n // anyone looks.\n if (!cancelled) setFailure(classifyLoadFailure(e));\n } finally {\n if (!cancelled) setLoading(false);\n }\n }\n\n load();\n\n let timeoutId: ReturnType<typeof setTimeout> | null = null;\n\n const scheduleNext = () => {\n if (cancelled) return;\n timeoutId = setTimeout(async () => {\n if (document.visibilityState === \"visible\") {\n await load();\n }\n scheduleNext();\n }, 15_000);\n };\n\n scheduleNext();\n\n const handleVisibility = () => {\n if (document.visibilityState === \"visible\") {\n load();\n }\n };\n document.addEventListener(\"visibilitychange\", handleVisibility);\n\n return () => {\n cancelled = true;\n if (timeoutId) clearTimeout(timeoutId);\n document.removeEventListener(\"visibilitychange\", handleVisibility);\n };\n }, []); // runs once\n\n // ── Fetch logs when selection changes ──\n useEffect(() => {\n if (!selectedId) {\n setLogs([]);\n setLogsFailure(null);\n return;\n }\n let cancelled = false;\n const c = clientRef.current;\n if (!c?.cron) return;\n\n setLogsLoading(true);\n setLogsFailure(null);\n c.cron.getJobLogs(selectedId, { limit: 25 })\n .then(res => { if (!cancelled) setLogs(res.logs); })\n .catch((e: unknown) => {\n if (cancelled) return;\n // Same reasoning as `refreshLogs`: an empty log list is a claim.\n setLogs([]);\n setLogsFailure(classifyLoadFailure(e));\n })\n .finally(() => { if (!cancelled) setLogsLoading(false); });\n\n return () => { cancelled = true; };\n }, [selectedId]);\n\n // ── Imperative helpers (not in any dep array) ──\n async function refreshJobs() {\n const c = clientRef.current;\n if (!c?.cron) return;\n try {\n const res = await c.cron.listJobs();\n setJobs(res.jobs);\n setProblems(problemsOf(res));\n setFailure(null);\n } catch (e: unknown) {\n // Swallowed before, which left the list showing whatever it last\n // held — or nothing — after a failed refresh. \"No cron jobs\" and\n // \"could not read the cron jobs\" are not the same statement, so the\n // reason stays on screen rather than passing through a snackbar.\n setFailure(classifyLoadFailure(e));\n }\n }\n\n async function refreshLogs(id: string) {\n const c = clientRef.current;\n if (!c?.cron) return;\n setLogsLoading(true);\n setLogsFailure(null);\n try {\n const res = await c.cron.getJobLogs(id, { limit: 25 });\n if (selectedIdRef.current !== id) return;\n setLogs(res.logs);\n } catch (e: unknown) {\n if (selectedIdRef.current !== id) return;\n // Clearing the list silently reads as \"this job has never run\".\n setLogs([]);\n setLogsFailure(classifyLoadFailure(e));\n }\n finally {\n if (selectedIdRef.current === id) setLogsLoading(false);\n }\n }\n\n const handleTrigger = async (id: string) => {\n const c = clientRef.current;\n if (!c?.cron) return;\n setTriggering(id);\n try {\n // The request returns when the run has ended, with how it went: a\n // run that threw is still a 200, so the log decides the toast.\n const { log } = await c.cron.triggerJob(id);\n const job = jobs.find(j => j.id === id)?.name ?? id;\n snackbarRef.current.open(log.success\n ? { type: \"success\", message: t(\"studio_cron_run_succeeded\", { job }) }\n : { type: \"error\", message: t(\"studio_cron_run_failed\", { job, error: log.error ?? \"—\" }) });\n await refreshJobs();\n if (selectedIdRef.current === id) refreshLogs(id);\n } catch (e: unknown) {\n snackbarRef.current.open({ type: \"error\",\nmessage: e instanceof Error ? e.message : String(e) });\n } finally { setTriggering(null); }\n };\n\n const handleToggle = async (id: string, enabled: boolean) => {\n const c = clientRef.current;\n if (!c?.cron) return;\n try {\n await c.cron.toggleJob(id, enabled);\n snackbarRef.current.open({ type: \"success\",\nmessage: enabled ? t(\"studio_cron_job_enabled\") : t(\"studio_cron_job_paused\") });\n await refreshJobs();\n } catch (e: unknown) {\n snackbarRef.current.open({ type: \"error\",\nmessage: e instanceof Error ? e.message : String(e) });\n }\n };\n\n const selectedJob = jobs.find(j => j.id === selectedId);\n\n if (loading) return <div className=\"flex items-center justify-center h-full\"><CircularProgress/></div>;\n\n if (failure) return (\n <LoadFailureView\n failure={failure}\n title={t(\"studio_cron_read_failed\")}\n deniedTitle={t(\"studio_cron_denied_title\")}\n deniedHint={t(\"studio_cron_denied_hint\")}\n onRetry={refreshJobs}\n />\n );\n\n const hasProblems = problems.rejected.length > 0 || problems.filesFailed > 0;\n\n if (jobs.length === 0) return (\n <div className=\"flex flex-col items-center justify-center h-full gap-4 text-center p-8\">\n <ClockIcon size={iconSize.medium} className=\"text-surface-300 dark:text-surface-600\"/>\n {hasProblems ? (\n <div className=\"max-w-lg text-left\">\n <CronLoadProblems problems={problems}/>\n </div>\n ) : (\n <>\n <Typography variant=\"h6\" color=\"secondary\">{t(\"studio_cron_empty_title\")}</Typography>\n <Typography variant=\"body2\" color=\"disabled\" className=\"max-w-md\">\n {t(\"studio_cron_empty_body\")}\n </Typography>\n </>\n )}\n <a\n href=\"https://rebase.pro/docs/backend/cron-jobs\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-primary text-sm underline\"\n >\n {t(\"studio_read_the_docs\")}\n </a>\n </div>\n );\n\n return (\n <div className=\"flex h-full w-full overflow-hidden bg-surface-card\">\n {/* ── Job List ── */}\n <div className={cls(\"flex flex-col w-[340px] min-w-[280px] border-r h-full\", defaultBorderMixin)}>\n <div className={cls(\"flex items-center justify-between px-4 h-14 shrink-0 border-b bg-surface-sheet\", defaultBorderMixin)}>\n <div className=\"flex items-center gap-2\">\n <ClockIcon size={iconSize.smallest} className=\"text-primary\"/>\n <Typography variant=\"subtitle2\" className=\"font-semibold\">{t(\"studio_tool_cron\")}</Typography>\n <Chip size=\"smallest\" className=\"bg-surface-raised text-surface-600 dark:text-surface-300\">{jobs.length}</Chip>\n </div>\n <IconButton aria-label={t(\"studio_cron_refresh\")} size=\"small\" onClick={refreshJobs} title={t(\"studio_cron_refresh\")}><RefreshCwIcon size={iconSize.smallest}/></IconButton>\n </div>\n {hasProblems && (\n <div className=\"p-2\">\n <CronLoadProblems problems={problems}/>\n </div>\n )}\n <div className=\"flex-1 overflow-y-auto p-2 space-y-1\">\n {jobs.map(job => (\n <div\n key={job.id}\n onClick={() => setSelectedId(job.id)}\n className={cls(\n \"flex items-center gap-3 px-3 py-2.5 rounded-lg cursor-pointer transition-all\",\n selectedId === job.id\n ? \"bg-primary/10 dark:bg-primary/15 ring-1 ring-primary/30\"\n : \"hover:bg-surface-hover\"\n )}\n >\n <div className={cls(\"w-2 h-2 rounded-full shrink-0\", stateColors[job.state] || \"bg-surface-400\")}/>\n <div className=\"flex-1 min-w-0\">\n <Typography variant=\"body2\" className=\"truncate font-medium text-[13px]\">{job.name}</Typography>\n <Typography variant=\"caption\" color=\"secondary\" className=\"truncate text-xs font-mono\">{job.schedule}</Typography>\n </div>\n {job.state === \"running\" && <CircularProgress size=\"smallest\"/>}\n </div>\n ))}\n </div>\n </div>\n\n {/* ── Detail Panel ── */}\n <div className=\"flex-1 flex flex-col min-w-0 h-full overflow-hidden\">\n {!selectedJob ? (\n <div className=\"flex items-center justify-center h-full\">\n <Typography variant=\"body2\" color=\"disabled\">{t(\"studio_cron_select_job\")}</Typography>\n </div>\n ) : (\n <>\n {/* Header */}\n <div className={cls(\"flex items-center justify-between px-5 h-14 shrink-0 border-b bg-surface-sheet\", defaultBorderMixin)}>\n <div className=\"flex items-center gap-3 min-w-0\">\n <div className={cls(\"w-2.5 h-2.5 rounded-full\", stateColors[selectedJob.state])}/>\n <div className=\"min-w-0\">\n <Typography variant=\"subtitle1\" className=\"font-semibold truncate\">{selectedJob.name}</Typography>\n {selectedJob.description && <Typography variant=\"caption\" color=\"secondary\" className=\"truncate\">{selectedJob.description}</Typography>}\n </div>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <IconButton aria-label={selectedJob.enabled ? t(\"studio_cron_pause_job\") : t(\"studio_cron_enable_job\")} title={selectedJob.enabled ? t(\"studio_cron_pause_job\") : t(\"studio_cron_enable_job\")} size=\"small\" onClick={() => handleToggle(selectedJob.id, !selectedJob.enabled)}>\n {selectedJob.enabled ? <PauseIcon size={iconSize.small}/> : <PlayIcon size={iconSize.smallest}/>}\n </IconButton>\n <Button\n size=\"small\"\n color=\"primary\"\n onClick={() => handleTrigger(selectedJob.id)}\n disabled={triggering === selectedJob.id}\n startIcon={triggering === selectedJob.id ? <CircularProgress size=\"smallest\"/> : <PlayIcon size={iconSize.smallest}/>}\n >\n {t(\"studio_cron_run_now\")}\n </Button>\n </div>\n </div>\n\n {/* Stats Cards */}\n <div className=\"px-5 py-4 bg-surface-sheet\">\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-3\">\n <StatCard label={t(\"studio_cron_schedule\")} value={selectedJob.schedule} mono/>\n <StatCard label={t(\"studio_cron_last_run\")} value={formatRelative(selectedJob.lastRunAt, language)}/>\n <StatCard label={t(\"studio_cron_next_run\")} value={selectedJob.enabled ? formatRelative(selectedJob.nextRunAt, language) : t(\"studio_cron_paused\")}/>\n <StatCard label={t(\"studio_cron_duration\")} value={selectedJob.lastDurationMs !== undefined ? formatDuration(selectedJob.lastDurationMs) : \"—\"}/>\n </div>\n <div className=\"grid grid-cols-3 gap-3 mt-3\">\n <StatCard label={t(\"studio_cron_status\")} value={selectedJob.state.toUpperCase()} chipColor={selectedJob.state === \"error\" ? \"red\" : selectedJob.state === \"disabled\" ? \"gray\" : \"green\"}/>\n <StatCard label={t(\"studio_cron_total_runs\")} value={String(selectedJob.totalRuns)}/>\n <StatCard label={t(\"studio_cron_failures\")} value={String(selectedJob.totalFailures)} highlight={selectedJob.totalFailures > 0}/>\n </div>\n {selectedJob.lastError && (\n <Alert color=\"error\" outerClassName=\"mt-3\">\n <Typography variant=\"caption\" className=\"font-medium block\">{t(\"studio_cron_last_error\")}</Typography>\n <Typography variant=\"mono\" className=\"text-xs break-all\">{selectedJob.lastError}</Typography>\n </Alert>\n )}\n </div>\n\n {/* Logs Section */}\n <div className={cls(\"flex items-center justify-between px-5 py-2 border-y bg-surface-card\", defaultBorderMixin)}>\n <div className=\"flex items-center gap-2\">\n <HistoryIcon size={iconSize.smallest} className=\"text-surface-400\"/>\n <Typography variant=\"subtitle2\" className=\"font-semibold text-[13px]\">{t(\"studio_cron_execution_history\")}</Typography>\n </div>\n <IconButton aria-label={t(\"studio_cron_refresh_logs\")} size=\"small\" onClick={() => refreshLogs(selectedJob.id)} title={t(\"studio_cron_refresh_logs\")}><RefreshCwIcon size={iconSize.smallest}/></IconButton>\n </div>\n <div className=\"flex-1 overflow-y-auto\">\n {logsLoading ? (\n <div className=\"flex justify-center p-8\"><CircularProgress size=\"small\"/></div>\n ) : logsFailure ? (\n <LoadFailureView\n failure={logsFailure}\n title={t(\"studio_cron_logs_read_failed\")}\n deniedTitle={t(\"studio_cron_logs_denied_title\")}\n deniedHint={t(\"studio_cron_denied_hint\")}\n onRetry={() => refreshLogs(selectedJob.id)}\n />\n ) : logs.length === 0 ? (\n <div className=\"flex items-center justify-center h-32\">\n <Typography variant=\"body2\" color=\"disabled\">{t(\"studio_cron_no_executions\")}</Typography>\n </div>\n ) : (\n <div className=\"divide-y divide-hairline\">\n {logs.map((log, idx) => (\n <LogRow key={idx} log={log}/>\n ))}\n </div>\n )}\n </div>\n </>\n )}\n </div>\n </div>\n );\n}\n\nfunction StatCard({ label, value, mono, chipColor, highlight }: {\n label: string; value: string; mono?: boolean; chipColor?: string; highlight?: boolean;\n}) {\n return (\n <div className={cls(\"px-3 py-2 rounded-lg border bg-surface-card\", defaultBorderMixin)}>\n <Typography variant=\"caption\" color=\"secondary\">{label}</Typography>\n <Typography variant=\"body2\" className={cls(\n \"mt-0.5 font-semibold text-[13px]\",\n mono && \"font-mono\",\n highlight && \"text-red-500 dark:text-red-400\",\n chipColor === \"red\" && \"text-red-500\",\n chipColor === \"green\" && \"text-emerald-500\",\n chipColor === \"gray\" && \"text-surface-400\"\n )}>{value}</Typography>\n </div>\n );\n}\n\nfunction LogRow({ log }: { log: CronJobLogEntry }) {\n const { t } = useTranslation();\n const [expanded, setExpanded] = useState(false);\n return (\n <div className=\"px-5 py-2.5 hover:bg-surface-hover transition-colors\">\n <div className=\"flex items-center gap-3 cursor-pointer\" onClick={() => setExpanded(!expanded)}>\n {log.success\n ? <CheckCircleIcon size={iconSize.smallest} className=\"text-emerald-500 shrink-0\"/>\n : <AlertCircleIcon size={iconSize.smallest} className=\"text-red-500 shrink-0\"/>}\n <div className=\"flex-1 min-w-0\">\n <Typography variant=\"caption\" className=\"font-mono text-xs text-surface-500\">{new Date(log.startedAt).toLocaleString()}</Typography>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n {log.manual && <Chip size=\"smallest\">{t(\"studio_cron_manual_run\")}</Chip>}\n <Typography variant=\"caption\" className=\"font-mono text-xs\">{formatDuration(log.durationMs)}</Typography>\n <ChevronDownIcon size={iconSize.smallest} className={cls(\"transition-transform text-text-secondary dark:text-text-secondary-dark\", expanded && \"rotate-180\")}/>\n </div>\n </div>\n {expanded && (\n <div className=\"mt-2 ml-6 space-y-2\">\n {log.error && (\n <Alert color=\"error\" size=\"small\">\n <Typography variant=\"mono\" className=\"text-xs break-all\">{log.error}</Typography>\n </Alert>\n )}\n {log.logs.length > 0 && (\n <div className=\"p-2 rounded bg-surface-sheet border border-hairline-strong max-h-40 overflow-auto\">\n {log.logs.map((line, i) => (\n <div key={i} className=\"font-mono text-xs text-surface-600 dark:text-surface-400 leading-relaxed\">{line}</div>\n ))}\n </div>\n )}\n {log.result !== undefined && (\n <div className=\"p-2 rounded bg-surface-sheet border border-hairline-strong\">\n <Typography variant=\"caption\" className=\"text-[10px] uppercase tracking-wider text-surface-400 mb-1 block\">Result</Typography>\n <pre className=\"font-mono text-xs text-surface-600 dark:text-surface-400 whitespace-pre-wrap break-all\">{JSON.stringify(log.result, null, 2)}</pre>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAiDA,IAAM,mBAAmB;CACrB;EAAE,UAAU;EAAgC,OAAO;CAAY;CAC/D;EAAE,UAAU;EAAmC,OAAO;CAAc;CACpE;EAAE,UAAU;EAA8B,OAAO;CAAY;CAC7D;EAAE,UAAU;EAAkC,OAAO;CAAY;AACrE;AAEA,SAAS,SAAS,KAAuC;CACrD,IAAI,CAAC,SAAS,GAAG,KAAK,OAAO,IAAI,OAAO,UAAU,OA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AAEb"}
|
|
1
|
+
{"version":3,"file":"CronJobsView-DyX9MINh.js","names":[],"sources":["../src/components/CronJobs/DbCronJobsPanel.tsx","../src/components/CronJobs/CronJobsView.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport {\n Alert,\n BooleanSwitch,\n BooleanSwitchWithLabel,\n Button,\n Card,\n Chip,\n CircularProgress,\n cls,\n defaultBorderMixin,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n PencilIcon,\n IconButton,\n iconSize,\n PlusIcon,\n RefreshCwIcon,\n Select,\n SelectItem,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n TextField,\n Tooltip,\n Trash2Icon,\n Typography\n} from \"@rebasepro/ui\";\nimport { useSnackbarController, useTranslation } from \"@rebasepro/app\";\nimport {\n asBoolean,\n asString,\n isRecord,\n useAdminFetch\n} from \"../../utils/adminFetch\";\n\ninterface StoredCronJobRow {\n id: string;\n name: string;\n schedule: string;\n kind: \"http\" | \"sql\";\n config: Record<string, unknown>;\n enabled: boolean;\n}\n\nconst SCHEDULE_PRESETS = [\n { labelKey: \"studio_cron_db_preset_minute\", value: \"* * * * *\" },\n { labelKey: \"studio_cron_db_preset_5_minutes\", value: \"*/5 * * * *\" },\n { labelKey: \"studio_cron_db_preset_hour\", value: \"0 * * * *\" },\n { labelKey: \"studio_cron_db_preset_midnight\", value: \"0 0 * * *\" }\n] as const;\n\nfunction parseJob(raw: unknown): StoredCronJobRow | null {\n if (!isRecord(raw) || typeof raw.id !== \"string\") return null;\n const kind = raw.kind === \"sql\" ? \"sql\" : \"http\";\n return {\n id: raw.id,\n name: asString(raw.name),\n schedule: asString(raw.schedule),\n kind,\n config: isRecord(raw.config) ? raw.config : {},\n enabled: asBoolean(raw.enabled, true)\n };\n}\n\nexport function DbCronJobsPanel() {\n const { requestJson } = useAdminFetch();\n const snackbar = useSnackbarController();\n const { t } = useTranslation();\n\n const [jobs, setJobs] = useState<StoredCronJobRow[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n\n const [dialogOpen, setDialogOpen] = useState(false);\n const [editing, setEditing] = useState<StoredCronJobRow | null>(null);\n const [name, setName] = useState(\"\");\n const [schedule, setSchedule] = useState(\"*/5 * * * *\");\n const [kind, setKind] = useState<\"http\" | \"sql\">(\"sql\");\n const [sqlText, setSqlText] = useState(\"DELETE FROM sessions WHERE expires_at < NOW();\");\n const [httpUrl, setHttpUrl] = useState(\"https://\");\n const [enabled, setEnabled] = useState(true);\n const [saving, setSaving] = useState(false);\n\n const load = useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const raw = await requestJson(\"/admin/cron/jobs\");\n const arr = isRecord(raw) && Array.isArray(raw.jobs) ? raw.jobs : [];\n setJobs(arr.map(parseJob).filter((j): j is StoredCronJobRow => j !== null));\n } catch (err: unknown) {\n setError(err instanceof Error ? err.message : t(\"studio_cron_db_load_failed\"));\n } finally {\n setLoading(false);\n }\n }, [requestJson, t]);\n\n useEffect(() => {\n void load();\n }, [load]);\n\n const openCreate = () => {\n setEditing(null);\n setName(\"\");\n setSchedule(\"*/5 * * * *\");\n setKind(\"sql\");\n setSqlText(\"\");\n setHttpUrl(\"https://\");\n setEnabled(true);\n setDialogOpen(true);\n };\n\n const openEdit = (j: StoredCronJobRow) => {\n setEditing(j);\n setName(j.name);\n setSchedule(j.schedule);\n setKind(j.kind);\n setSqlText(asString(j.config.sql));\n setHttpUrl(asString(j.config.url, \"https://\"));\n setEnabled(j.enabled);\n setDialogOpen(true);\n };\n\n const handleSave = async () => {\n setSaving(true);\n try {\n const config = kind === \"sql\"\n ? { sql: sqlText.trim() }\n : { url: httpUrl.trim() };\n const payload = { name: name.trim(), schedule: schedule.trim(), kind, config, enabled };\n if (editing) {\n await requestJson(`/admin/cron/jobs/${encodeURIComponent(editing.id)}`, {\n method: \"PATCH\",\n body: payload\n });\n snackbar.open({ type: \"success\", message: t(\"studio_cron_db_updated\", { name: payload.name }) });\n } else {\n await requestJson(\"/admin/cron/jobs\", {\n method: \"POST\",\n body: payload\n });\n snackbar.open({ type: \"success\", message: t(\"studio_cron_db_created\", { name: payload.name }) });\n }\n setDialogOpen(false);\n await load();\n } catch (err: unknown) {\n snackbar.open({ type: \"error\", message: err instanceof Error ? err.message : t(\"studio_cron_db_save_failed\") });\n } finally {\n setSaving(false);\n }\n };\n\n const handleToggle = async (j: StoredCronJobRow, next: boolean) => {\n try {\n await requestJson(`/admin/cron/jobs/${encodeURIComponent(j.id)}`, {\n method: \"PATCH\",\n body: { enabled: next }\n });\n await load();\n } catch (err: unknown) {\n snackbar.open({ type: \"error\", message: err instanceof Error ? err.message : t(\"studio_cron_db_toggle_failed\") });\n }\n };\n\n const handleDelete = async (j: StoredCronJobRow) => {\n try {\n await requestJson(`/admin/cron/jobs/${encodeURIComponent(j.id)}`, { method: \"DELETE\" });\n snackbar.open({ type: \"success\", message: t(\"studio_cron_db_deleted\", { name: j.name }) });\n await load();\n } catch (err: unknown) {\n snackbar.open({ type: \"error\", message: err instanceof Error ? err.message : t(\"studio_cron_db_delete_failed\") });\n }\n };\n\n return (\n <div className=\"flex flex-col gap-4 p-5 h-full overflow-auto bg-surface-card\">\n <div className=\"flex items-center justify-between gap-4\">\n <div>\n <Typography variant=\"subtitle1\" className=\"font-semibold\">\n {t(\"studio_cron_db_title\")}\n </Typography>\n <Typography variant=\"caption\" color=\"secondary\">\n {t(\"studio_cron_db_subtitle\")}\n </Typography>\n </div>\n <div className=\"flex items-center gap-2\">\n <Tooltip title={t(\"refresh\")}>\n <IconButton size=\"small\" aria-label={t(\"studio_cron_db_refresh_aria\")} onClick={() => void load()}>\n <RefreshCwIcon size={iconSize.small} />\n </IconButton>\n </Tooltip>\n <Button size=\"small\" color=\"primary\" variant=\"filled\" onClick={openCreate}>\n <PlusIcon size={iconSize.small} />\n {t(\"studio_cron_db_new\")}\n </Button>\n </div>\n </div>\n\n {error && <Alert color=\"error\">{error}</Alert>}\n\n {loading ? (\n <div className=\"flex justify-center py-12\"><CircularProgress size=\"small\" /></div>\n ) : jobs.length === 0 ? (\n <Card className=\"p-8 text-center flex flex-col items-center gap-3\">\n <Typography variant=\"body2\" color=\"secondary\">\n {t(\"studio_cron_db_empty\")}\n </Typography>\n <Button size=\"small\" variant=\"filled\" onClick={openCreate}>\n <PlusIcon size={iconSize.small} />\n {t(\"studio_cron_db_create\")}\n </Button>\n </Card>\n ) : (\n <div className={cls(\"overflow-x-auto rounded-lg border\", defaultBorderMixin)}>\n <Table className=\"w-full\">\n <TableHeader>\n <TableCell header>{t(\"name\")}</TableCell>\n <TableCell header>{t(\"studio_cron_schedule\")}</TableCell>\n <TableCell header>{t(\"studio_api_keys_stat_kind\")}</TableCell>\n <TableCell header>{t(\"studio_cron_db_target\")}</TableCell>\n <TableCell header>{t(\"studio_enabled\")}</TableCell>\n <TableCell header className=\"text-right\">{t(\"actions\")}</TableCell>\n </TableHeader>\n <TableBody>\n {jobs.map((j) => (\n <TableRow key={j.id}>\n <TableCell className=\"font-medium text-sm\">{j.name}</TableCell>\n <TableCell className=\"font-mono text-xs\">{j.schedule}</TableCell>\n <TableCell>\n <Chip size=\"small\" colorScheme={j.kind === \"sql\" ? \"blueLight\" : \"purpleLight\"}>\n {j.kind.toUpperCase()}\n </Chip>\n </TableCell>\n <TableCell className=\"font-mono text-xs text-text-secondary max-w-md truncate\">\n {j.kind === \"sql\" ? asString(j.config.sql) : `POST ${asString(j.config.url)}`}\n </TableCell>\n <TableCell>\n <BooleanSwitch size=\"small\" value={j.enabled} onValueChange={(v) => void handleToggle(j, v)} />\n </TableCell>\n <TableCell className=\"text-right whitespace-nowrap\">\n <IconButton size=\"small\" aria-label={t(\"studio_cron_db_edit_aria\", { name: j.name })} onClick={() => openEdit(j)}>\n <PencilIcon size={iconSize.small} />\n </IconButton>\n <IconButton size=\"small\" aria-label={t(\"studio_cron_db_delete_aria\", { name: j.name })} onClick={() => void handleDelete(j)}>\n <Trash2Icon size={iconSize.small} className={\"text-red-500\"} />\n </IconButton>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n )}\n\n <Dialog open={dialogOpen} onOpenChange={setDialogOpen} maxWidth=\"md\" fullWidth>\n <DialogTitle>{editing ? t(\"studio_cron_db_edit_title\", { name: editing.name }) : t(\"studio_cron_db_new\")}</DialogTitle>\n <DialogContent className=\"flex flex-col gap-3\">\n <TextField label={t(\"studio_cron_db_job_name\")} value={name} onChange={(e) => setName(e.target.value)} placeholder=\"cleanup_expired_tokens\" />\n <TextField label={t(\"studio_cron_db_schedule_label\")} value={schedule} onChange={(e) => setSchedule(e.target.value)} placeholder=\"*/5 * * * *\" />\n <div className=\"flex items-center gap-1.5 flex-wrap\">\n {SCHEDULE_PRESETS.map((p) => (\n <Chip key={p.value} size=\"small\" colorScheme={schedule === p.value ? \"blueLight\" : \"grayLight\"} onClick={() => setSchedule(p.value)}>\n {t(p.labelKey)}\n </Chip>\n ))}\n </div>\n <Select\n label={t(\"studio_cron_db_job_type\")}\n value={kind}\n onValueChange={(v) => { if (v === \"sql\" || v === \"http\") setKind(v); }}\n >\n <SelectItem value=\"sql\">{t(\"studio_cron_db_kind_sql\")}</SelectItem>\n <SelectItem value=\"http\">{t(\"studio_cron_db_kind_http\")}</SelectItem>\n </Select>\n {kind === \"sql\" ? (\n <TextField\n label={t(\"studio_cron_db_kind_sql\")}\n value={sqlText}\n onChange={(e) => setSqlText(e.target.value)}\n multiline\n minRows={4}\n placeholder=\"DELETE FROM audit_logs WHERE created_at < NOW() - INTERVAL '30 days';\"\n />\n ) : (\n <TextField label={t(\"studio_cron_db_http_url\")} value={httpUrl} onChange={(e) => setHttpUrl(e.target.value)} placeholder=\"https://example.com/cron/sync\" />\n )}\n <BooleanSwitchWithLabel label={t(\"studio_enabled\")} value={enabled} onValueChange={setEnabled} />\n </DialogContent>\n <DialogActions>\n <Button variant=\"text\" onClick={() => setDialogOpen(false)}>{t(\"cancel\")}</Button>\n <Button\n variant=\"filled\"\n disabled={saving || !name.trim() || !schedule.trim() || (kind === \"sql\" ? !sqlText.trim() : !httpUrl.trim())}\n onClick={() => void handleSave()}\n >\n {saving ? t(\"saving\") : t(\"studio_cron_db_save\")}\n </Button>\n </DialogActions>\n </Dialog>\n </div>\n );\n}\n","\nimport React, { useState, useEffect, useRef } from \"react\";\nimport {\n Alert,\n AlertCircleIcon,\n Button,\n ClockIcon,\n Card,\n CheckCircleIcon,\n ChevronDownIcon,\n Chip,\n CircularProgress,\n cls,\n defaultBorderMixin,\n HistoryIcon,\n IconButton,\n iconSize,\n Paper,\n PauseIcon,\n PlayIcon,\n RefreshCwIcon,\n Tab,\n Tabs,\n Typography\n} from \"@rebasepro/ui\";\nimport { DbCronJobsPanel } from \"./DbCronJobsPanel\";\nimport { useRebaseClient, useSnackbarController, useTranslation } from \"@rebasepro/app\";\nimport type { CronJobListing, CronJobStatus, CronJobLogEntry, RejectedCronJob } from \"@rebasepro/types\";\nimport type { RebaseClient } from \"@rebasepro/types\";\n\nimport { classifyLoadFailure, type LoadFailure } from \"../load-failure\";\nimport { LoadFailureView } from \"../load-failure-view\";\n\nfunction formatDuration(ms: number): string {\n if (ms < 1000) return `${ms}ms`;\n if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;\n return `${(ms / 60000).toFixed(1)}m`;\n}\n\n/** `iso` relative to now, in `language`: \"in 5 min\", \"2 hr. ago\"; a date past a day. */\nfunction formatRelative(iso: string | undefined, language: string): string {\n if (!iso) return \"—\";\n const d = new Date(iso);\n const diff = d.getTime() - Date.now();\n const abs = Math.abs(diff);\n if (abs >= 86400000) return d.toLocaleString(language);\n const relative = new Intl.RelativeTimeFormat(language, { style: \"short\", numeric: \"auto\" });\n return abs < 3600000\n ? relative.format(Math.round(diff / 60000), \"minute\")\n : relative.format(Math.round(diff / 3600000), \"hour\");\n}\n\n/** What the listing says did not become a job — see {@link CronLoadProblems}. */\ninterface CronProblems {\n rejected: RejectedCronJob[];\n /** Cron files that failed to load: `skipped` counts these and the refused jobs together. */\n filesFailed: number;\n}\n\nfunction problemsOf(listing: CronJobListing): CronProblems {\n const rejected = listing.rejected ?? [];\n return { rejected, filesFailed: Math.max(0, (listing.skipped ?? 0) - rejected.length) };\n}\n\n/**\n * The cron files that failed to load and the jobs the scheduler refused. None\n * of them is scheduled, and none is in the list: without this a refused job\n * was simply absent, and a project whose only job was refused read \"No cron\n * jobs registered\".\n */\nfunction CronLoadProblems({ problems }: { problems: CronProblems }) {\n const { t } = useTranslation();\n if (problems.rejected.length === 0 && problems.filesFailed === 0) return null;\n return (\n <Alert color=\"error\">\n <div className=\"flex flex-col gap-2\">\n {problems.rejected.map(job => (\n <div key={job.id} className=\"flex flex-col\">\n <Typography variant=\"body2\" className=\"text-[13px] font-semibold\">\n {t(\"studio_cron_job_refused\", { job: job.name })}\n </Typography>\n <Typography variant=\"caption\" className=\"font-mono text-[12px] break-words\">\n {job.schedule} — {job.reason}\n </Typography>\n </div>\n ))}\n {problems.filesFailed > 0 && (\n <Typography variant=\"body2\" className=\"text-[13px]\">\n {t(\"studio_cron_files_failed\", { count: problems.filesFailed })}\n </Typography>\n )}\n </div>\n </Alert>\n );\n}\n\nconst stateColors: Record<string, string> = {\n idle: \"bg-emerald-500\",\nrunning: \"bg-blue-500\",\nsuccess: \"bg-emerald-500\",\n error: \"bg-red-500\",\ndisabled: \"bg-surface-400\"\n};\n\nexport function CronJobsView() {\n const [tab, setTab] = useState<\"scheduler\" | \"zero-code\">(\"scheduler\");\n const { t } = useTranslation();\n return (\n <div className=\"flex flex-col h-full w-full overflow-hidden\">\n <Tabs\n value={tab}\n onValueChange={(v) => { if (v === \"scheduler\" || v === \"zero-code\") setTab(v); }}\n variant=\"boxy\"\n className=\"border-b border-hairline px-4 bg-surface-sheet shrink-0\"\n >\n <Tab value=\"scheduler\">{t(\"studio_cron_tab_scheduler\")}</Tab>\n <Tab value=\"zero-code\">{t(\"studio_cron_tab_db\")}</Tab>\n </Tabs>\n <div className=\"flex-1 min-h-0 overflow-hidden\">\n {tab === \"scheduler\" ? <CronSchedulerMonitorView /> : <DbCronJobsPanel />}\n </div>\n </div>\n );\n}\n\nfunction CronSchedulerMonitorView() {\n const client = useRebaseClient<RebaseClient>();\n const snackbar = useSnackbarController();\n const { t, i18n } = useTranslation();\n const language = i18n?.language ?? \"en\";\n const [jobs, setJobs] = useState<CronJobStatus[]>([]);\n const [problems, setProblems] = useState<CronProblems>({ rejected: [], filesFailed: 0 });\n const [loading, setLoading] = useState(true);\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [logs, setLogs] = useState<CronJobLogEntry[]>([]);\n const [logsLoading, setLogsLoading] = useState(false);\n /**\n * Why the selected job's executions could not be read. Shown where the\n * list would be: an empty list reads as \"this job has never run\", and the\n * snackbar that used to carry the reason was gone in four seconds.\n */\n const [logsFailure, setLogsFailure] = useState<LoadFailure | null>(null);\n const [triggering, setTriggering] = useState<string | null>(null);\n /** Why the job listing failed, classified — see `load-failure.ts`. */\n const [failure, setFailure] = useState<LoadFailure | null>(null);\n\n // Refs so effects never re-fire due to identity changes\n const clientRef = useRef(client);\n clientRef.current = client;\n const snackbarRef = useRef(snackbar);\n snackbarRef.current = snackbar;\n // The job on screen now, for a read that ends after the selection moved:\n // its answer belongs to the job it was made for, not to the one shown.\n const selectedIdRef = useRef(selectedId);\n selectedIdRef.current = selectedId;\n\n // ── Fetch jobs on mount + poll every 15s ──\n useEffect(() => {\n let cancelled = false;\n\n async function load() {\n const c = clientRef.current;\n if (!c?.cron) {\n setLoading(false);\n return;\n }\n try {\n const res = await c.cron.listJobs();\n if (!cancelled) {\n setJobs(res.jobs);\n setProblems(problemsOf(res));\n setFailure(null);\n }\n } catch (e: unknown) {\n // A snackbar over an empty list said \"No Cron Jobs Registered\"\n // about a project whose crons the caller may not read. This\n // view polls every 15s, so the toast is also gone long before\n // anyone looks.\n if (!cancelled) setFailure(classifyLoadFailure(e));\n } finally {\n if (!cancelled) setLoading(false);\n }\n }\n\n load();\n\n let timeoutId: ReturnType<typeof setTimeout> | null = null;\n\n const scheduleNext = () => {\n if (cancelled) return;\n timeoutId = setTimeout(async () => {\n if (document.visibilityState === \"visible\") {\n await load();\n }\n scheduleNext();\n }, 15_000);\n };\n\n scheduleNext();\n\n const handleVisibility = () => {\n if (document.visibilityState === \"visible\") {\n load();\n }\n };\n document.addEventListener(\"visibilitychange\", handleVisibility);\n\n return () => {\n cancelled = true;\n if (timeoutId) clearTimeout(timeoutId);\n document.removeEventListener(\"visibilitychange\", handleVisibility);\n };\n }, []); // runs once\n\n // ── Fetch logs when selection changes ──\n useEffect(() => {\n if (!selectedId) {\n setLogs([]);\n setLogsFailure(null);\n return;\n }\n let cancelled = false;\n const c = clientRef.current;\n if (!c?.cron) return;\n\n setLogsLoading(true);\n setLogsFailure(null);\n c.cron.getJobLogs(selectedId, { limit: 25 })\n .then(res => { if (!cancelled) setLogs(res.logs); })\n .catch((e: unknown) => {\n if (cancelled) return;\n // Same reasoning as `refreshLogs`: an empty log list is a claim.\n setLogs([]);\n setLogsFailure(classifyLoadFailure(e));\n })\n .finally(() => { if (!cancelled) setLogsLoading(false); });\n\n return () => { cancelled = true; };\n }, [selectedId]);\n\n // ── Imperative helpers (not in any dep array) ──\n async function refreshJobs() {\n const c = clientRef.current;\n if (!c?.cron) return;\n try {\n const res = await c.cron.listJobs();\n setJobs(res.jobs);\n setProblems(problemsOf(res));\n setFailure(null);\n } catch (e: unknown) {\n // Swallowed before, which left the list showing whatever it last\n // held — or nothing — after a failed refresh. \"No cron jobs\" and\n // \"could not read the cron jobs\" are not the same statement, so the\n // reason stays on screen rather than passing through a snackbar.\n setFailure(classifyLoadFailure(e));\n }\n }\n\n async function refreshLogs(id: string) {\n const c = clientRef.current;\n if (!c?.cron) return;\n setLogsLoading(true);\n setLogsFailure(null);\n try {\n const res = await c.cron.getJobLogs(id, { limit: 25 });\n if (selectedIdRef.current !== id) return;\n setLogs(res.logs);\n } catch (e: unknown) {\n if (selectedIdRef.current !== id) return;\n // Clearing the list silently reads as \"this job has never run\".\n setLogs([]);\n setLogsFailure(classifyLoadFailure(e));\n }\n finally {\n if (selectedIdRef.current === id) setLogsLoading(false);\n }\n }\n\n const handleTrigger = async (id: string) => {\n const c = clientRef.current;\n if (!c?.cron) return;\n setTriggering(id);\n try {\n // The request returns when the run has ended, with how it went: a\n // run that threw is still a 200, so the log decides the toast.\n const { log } = await c.cron.triggerJob(id);\n const job = jobs.find(j => j.id === id)?.name ?? id;\n snackbarRef.current.open(log.success\n ? { type: \"success\", message: t(\"studio_cron_run_succeeded\", { job }) }\n : { type: \"error\", message: t(\"studio_cron_run_failed\", { job, error: log.error ?? \"—\" }) });\n await refreshJobs();\n if (selectedIdRef.current === id) refreshLogs(id);\n } catch (e: unknown) {\n snackbarRef.current.open({ type: \"error\",\nmessage: e instanceof Error ? e.message : String(e) });\n } finally { setTriggering(null); }\n };\n\n const handleToggle = async (id: string, enabled: boolean) => {\n const c = clientRef.current;\n if (!c?.cron) return;\n try {\n await c.cron.toggleJob(id, enabled);\n snackbarRef.current.open({ type: \"success\",\nmessage: enabled ? t(\"studio_cron_job_enabled\") : t(\"studio_cron_job_paused\") });\n await refreshJobs();\n } catch (e: unknown) {\n snackbarRef.current.open({ type: \"error\",\nmessage: e instanceof Error ? e.message : String(e) });\n }\n };\n\n const selectedJob = jobs.find(j => j.id === selectedId);\n\n if (loading) return <div className=\"flex items-center justify-center h-full\"><CircularProgress/></div>;\n\n if (failure) return (\n <LoadFailureView\n failure={failure}\n title={t(\"studio_cron_read_failed\")}\n deniedTitle={t(\"studio_cron_denied_title\")}\n deniedHint={t(\"studio_cron_denied_hint\")}\n onRetry={refreshJobs}\n />\n );\n\n const hasProblems = problems.rejected.length > 0 || problems.filesFailed > 0;\n\n if (jobs.length === 0) return (\n <div className=\"flex flex-col items-center justify-center h-full gap-4 text-center p-8\">\n <ClockIcon size={iconSize.medium} className=\"text-surface-300 dark:text-surface-600\"/>\n {hasProblems ? (\n <div className=\"max-w-lg text-left\">\n <CronLoadProblems problems={problems}/>\n </div>\n ) : (\n <>\n <Typography variant=\"h6\" color=\"secondary\">{t(\"studio_cron_empty_title\")}</Typography>\n <Typography variant=\"body2\" color=\"disabled\" className=\"max-w-md\">\n {t(\"studio_cron_empty_body\")}\n </Typography>\n </>\n )}\n <a\n href=\"https://rebase.pro/docs/backend/cron-jobs\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"text-primary text-sm underline\"\n >\n {t(\"studio_read_the_docs\")}\n </a>\n </div>\n );\n\n return (\n <div className=\"flex h-full w-full overflow-hidden bg-surface-card\">\n {/* ── Job List ── */}\n <div className={cls(\"flex flex-col w-[340px] min-w-[280px] border-r h-full\", defaultBorderMixin)}>\n <div className={cls(\"flex items-center justify-between px-4 h-14 shrink-0 border-b bg-surface-sheet\", defaultBorderMixin)}>\n <div className=\"flex items-center gap-2\">\n <ClockIcon size={iconSize.smallest} className=\"text-primary\"/>\n <Typography variant=\"subtitle2\" className=\"font-semibold\">{t(\"studio_tool_cron\")}</Typography>\n <Chip size=\"smallest\" className=\"bg-surface-raised text-surface-600 dark:text-surface-300\">{jobs.length}</Chip>\n </div>\n <IconButton aria-label={t(\"studio_cron_refresh\")} size=\"small\" onClick={refreshJobs} title={t(\"studio_cron_refresh\")}><RefreshCwIcon size={iconSize.smallest}/></IconButton>\n </div>\n {hasProblems && (\n <div className=\"p-2\">\n <CronLoadProblems problems={problems}/>\n </div>\n )}\n <div className=\"flex-1 overflow-y-auto p-2 space-y-1\">\n {jobs.map(job => (\n <div\n key={job.id}\n onClick={() => setSelectedId(job.id)}\n className={cls(\n \"flex items-center gap-3 px-3 py-2.5 rounded-lg cursor-pointer transition-all\",\n selectedId === job.id\n ? \"bg-primary/10 dark:bg-primary/15 ring-1 ring-primary/30\"\n : \"hover:bg-surface-hover\"\n )}\n >\n <div className={cls(\"w-2 h-2 rounded-full shrink-0\", stateColors[job.state] || \"bg-surface-400\")}/>\n <div className=\"flex-1 min-w-0\">\n <Typography variant=\"body2\" className=\"truncate font-medium text-[13px]\">{job.name}</Typography>\n <Typography variant=\"caption\" color=\"secondary\" className=\"truncate text-xs font-mono\">{job.schedule}</Typography>\n </div>\n {job.state === \"running\" && <CircularProgress size=\"smallest\"/>}\n </div>\n ))}\n </div>\n </div>\n\n {/* ── Detail Panel ── */}\n <div className=\"flex-1 flex flex-col min-w-0 h-full overflow-hidden\">\n {!selectedJob ? (\n <div className=\"flex items-center justify-center h-full\">\n <Typography variant=\"body2\" color=\"disabled\">{t(\"studio_cron_select_job\")}</Typography>\n </div>\n ) : (\n <>\n {/* Header */}\n <div className={cls(\"flex items-center justify-between px-5 h-14 shrink-0 border-b bg-surface-sheet\", defaultBorderMixin)}>\n <div className=\"flex items-center gap-3 min-w-0\">\n <div className={cls(\"w-2.5 h-2.5 rounded-full\", stateColors[selectedJob.state])}/>\n <div className=\"min-w-0\">\n <Typography variant=\"subtitle1\" className=\"font-semibold truncate\">{selectedJob.name}</Typography>\n {selectedJob.description && <Typography variant=\"caption\" color=\"secondary\" className=\"truncate\">{selectedJob.description}</Typography>}\n </div>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n <IconButton aria-label={selectedJob.enabled ? t(\"studio_cron_pause_job\") : t(\"studio_cron_enable_job\")} title={selectedJob.enabled ? t(\"studio_cron_pause_job\") : t(\"studio_cron_enable_job\")} size=\"small\" onClick={() => handleToggle(selectedJob.id, !selectedJob.enabled)}>\n {selectedJob.enabled ? <PauseIcon size={iconSize.small}/> : <PlayIcon size={iconSize.smallest}/>}\n </IconButton>\n <Button\n size=\"small\"\n color=\"primary\"\n onClick={() => handleTrigger(selectedJob.id)}\n disabled={triggering === selectedJob.id}\n startIcon={triggering === selectedJob.id ? <CircularProgress size=\"smallest\"/> : <PlayIcon size={iconSize.smallest}/>}\n >\n {t(\"studio_cron_run_now\")}\n </Button>\n </div>\n </div>\n\n {/* Stats Cards */}\n <div className=\"px-5 py-4 bg-surface-sheet\">\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-3\">\n <StatCard label={t(\"studio_cron_schedule\")} value={selectedJob.schedule} mono/>\n <StatCard label={t(\"studio_cron_last_run\")} value={formatRelative(selectedJob.lastRunAt, language)}/>\n <StatCard label={t(\"studio_cron_next_run\")} value={selectedJob.enabled ? formatRelative(selectedJob.nextRunAt, language) : t(\"studio_cron_paused\")}/>\n <StatCard label={t(\"studio_cron_duration\")} value={selectedJob.lastDurationMs !== undefined ? formatDuration(selectedJob.lastDurationMs) : \"—\"}/>\n </div>\n <div className=\"grid grid-cols-3 gap-3 mt-3\">\n <StatCard label={t(\"studio_cron_status\")} value={selectedJob.state.toUpperCase()} chipColor={selectedJob.state === \"error\" ? \"red\" : selectedJob.state === \"disabled\" ? \"gray\" : \"green\"}/>\n <StatCard label={t(\"studio_cron_total_runs\")} value={String(selectedJob.totalRuns)}/>\n <StatCard label={t(\"studio_cron_failures\")} value={String(selectedJob.totalFailures)} highlight={selectedJob.totalFailures > 0}/>\n </div>\n {selectedJob.lastError && (\n <Alert color=\"error\" outerClassName=\"mt-3\">\n <Typography variant=\"caption\" className=\"font-medium block\">{t(\"studio_cron_last_error\")}</Typography>\n <Typography variant=\"mono\" className=\"text-xs break-all\">{selectedJob.lastError}</Typography>\n </Alert>\n )}\n </div>\n\n {/* Logs Section */}\n <div className={cls(\"flex items-center justify-between px-5 py-2 border-y bg-surface-card\", defaultBorderMixin)}>\n <div className=\"flex items-center gap-2\">\n <HistoryIcon size={iconSize.smallest} className=\"text-surface-400\"/>\n <Typography variant=\"subtitle2\" className=\"font-semibold text-[13px]\">{t(\"studio_cron_execution_history\")}</Typography>\n </div>\n <IconButton aria-label={t(\"studio_cron_refresh_logs\")} size=\"small\" onClick={() => refreshLogs(selectedJob.id)} title={t(\"studio_cron_refresh_logs\")}><RefreshCwIcon size={iconSize.smallest}/></IconButton>\n </div>\n <div className=\"flex-1 overflow-y-auto\">\n {logsLoading ? (\n <div className=\"flex justify-center p-8\"><CircularProgress size=\"small\"/></div>\n ) : logsFailure ? (\n <LoadFailureView\n failure={logsFailure}\n title={t(\"studio_cron_logs_read_failed\")}\n deniedTitle={t(\"studio_cron_logs_denied_title\")}\n deniedHint={t(\"studio_cron_denied_hint\")}\n onRetry={() => refreshLogs(selectedJob.id)}\n />\n ) : logs.length === 0 ? (\n <div className=\"flex items-center justify-center h-32\">\n <Typography variant=\"body2\" color=\"disabled\">{t(\"studio_cron_no_executions\")}</Typography>\n </div>\n ) : (\n <div className=\"divide-y divide-hairline\">\n {logs.map((log, idx) => (\n <LogRow key={idx} log={log}/>\n ))}\n </div>\n )}\n </div>\n </>\n )}\n </div>\n </div>\n );\n}\n\nfunction StatCard({ label, value, mono, chipColor, highlight }: {\n label: string; value: string; mono?: boolean; chipColor?: string; highlight?: boolean;\n}) {\n return (\n <div className={cls(\"px-3 py-2 rounded-lg border bg-surface-card\", defaultBorderMixin)}>\n <Typography variant=\"caption\" color=\"secondary\">{label}</Typography>\n <Typography variant=\"body2\" className={cls(\n \"mt-0.5 font-semibold text-[13px]\",\n mono && \"font-mono\",\n highlight && \"text-red-500 dark:text-red-400\",\n chipColor === \"red\" && \"text-red-500\",\n chipColor === \"green\" && \"text-emerald-500\",\n chipColor === \"gray\" && \"text-surface-400\"\n )}>{value}</Typography>\n </div>\n );\n}\n\nfunction LogRow({ log }: { log: CronJobLogEntry }) {\n const { t } = useTranslation();\n const [expanded, setExpanded] = useState(false);\n return (\n <div className=\"px-5 py-2.5 hover:bg-surface-hover transition-colors\">\n <div className=\"flex items-center gap-3 cursor-pointer\" onClick={() => setExpanded(!expanded)}>\n {log.success\n ? <CheckCircleIcon size={iconSize.smallest} className=\"text-emerald-500 shrink-0\"/>\n : <AlertCircleIcon size={iconSize.smallest} className=\"text-red-500 shrink-0\"/>}\n <div className=\"flex-1 min-w-0\">\n <Typography variant=\"caption\" className=\"font-mono text-xs text-surface-500\">{new Date(log.startedAt).toLocaleString()}</Typography>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n {log.manual && <Chip size=\"smallest\">{t(\"studio_cron_manual_run\")}</Chip>}\n <Typography variant=\"caption\" className=\"font-mono text-xs\">{formatDuration(log.durationMs)}</Typography>\n <ChevronDownIcon size={iconSize.smallest} className={cls(\"transition-transform text-text-secondary dark:text-text-secondary-dark\", expanded && \"rotate-180\")}/>\n </div>\n </div>\n {expanded && (\n <div className=\"mt-2 ml-6 space-y-2\">\n {log.error && (\n <Alert color=\"error\" size=\"small\">\n <Typography variant=\"mono\" className=\"text-xs break-all\">{log.error}</Typography>\n </Alert>\n )}\n {log.logs.length > 0 && (\n <div className=\"p-2 rounded bg-surface-sheet border border-hairline-strong max-h-40 overflow-auto\">\n {log.logs.map((line, i) => (\n <div key={i} className=\"font-mono text-xs text-surface-600 dark:text-surface-400 leading-relaxed\">{line}</div>\n ))}\n </div>\n )}\n {log.result !== undefined && (\n <div className=\"p-2 rounded bg-surface-sheet border border-hairline-strong\">\n <Typography variant=\"caption\" className=\"text-[10px] uppercase tracking-wider text-surface-400 mb-1 block\">Result</Typography>\n <pre className=\"font-mono text-xs text-surface-600 dark:text-surface-400 whitespace-pre-wrap break-all\">{JSON.stringify(log.result, null, 2)}</pre>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAiDA,IAAM,mBAAmB;CACrB;EAAE,UAAU;EAAgC,OAAO;CAAY;CAC/D;EAAE,UAAU;EAAmC,OAAO;CAAc;CACpE;EAAE,UAAU;EAA8B,OAAO;CAAY;CAC7D;EAAE,UAAU;EAAkC,OAAO;CAAY;AACrE;AAEA,SAAS,SAAS,KAAuC;CACrD,IAAI,CAAC,SAAS,GAAG,KAAK,OAAO,IAAI,OAAO,UAAU,OAAO;CACzD,MAAM,OAAO,IAAI,SAAS,QAAQ,QAAQ;CAC1C,OAAO;EACH,IAAI,IAAI;EACR,MAAM,SAAS,IAAI,IAAI;EACvB,UAAU,SAAS,IAAI,QAAQ;EAC/B;EACA,QAAQ,SAAS,IAAI,MAAM,IAAI,IAAI,SAAS,CAAC;EAC7C,SAAS,UAAU,IA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