feat(offline): persisted query cache + unreachable banner (web + mobile) (#70)

* feat(offline): persisted query cache + unreachable banner (web + mobile)

- Web: PersistQueryClientProvider on localStorage (24h maxAge); mobile:
  AsyncStorage persister (7d). Both exclude high-churn keys (logs,
  notifications, metrics) — stale tails are worse than none.
- networkMode 'offlineFirst' so cached data serves while the refetch
  attempt fails.
- Web: ConnectivityBanner in PlatformShell pings public /health every
  15s + listens to online/offline events — slim "last-known data" bar
  so persisted state can't masquerade as live.
- Mobile: same banner in the tabs layout — /health ping plus
  expo-network's local signal distinguishes "no connection" from
  "instance down".

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(mobile): cron jobs screen — schedules, run-now, execution history

- /service/cron lists the service's jobs with schedule, timezone,
  last/next run, and last status; "Run now" triggers via the existing
  POST /cron-jobs/:id/trigger and "History" expands recent executions
  with status + output/error.
- Manage row on the service detail + Stack registration.

Verified live: created */5 job on a running service, triggered it —
execution recorded with status success and captured stdout.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomáš DvořákandDevin authored and GitHub committed 2026-10-10 01:55:34 +02:00
1 parent 9243d020cc
commit 26f495ac8e
13 files changed
+510 -22

No files matched your search

+42
View File
@@ -102,6 +102,30 @@ export interface NotificationChannel {
created_at?: string;
}
export interface CronJob {
id: string;
service_id?: string;
name: string;
schedule: string;
command: string;
timezone?: string;
enabled?: boolean;
last_run_at?: string;
next_run_at?: string;
last_status?: string;
last_output?: string;
}
export interface CronExecution {
id: string;
cron_job_id: string;
started_at?: string;
finished_at?: string;
status?: string;
output?: string;
error?: string;
}
// Masked value the API returns for secret variables; echoing it back on
// update preserves the stored ciphertext.
export const MASKED_SECRET = '********';
@@ -273,6 +297,24 @@ export class Api {
return this.req<unknown>('POST', `/notifications/channels/${id}/test`, {});
}
cronJobs(serviceId: string) {
return this.req<{ cron_jobs: CronJob[] }>(
'GET',
`/cron-jobs?service_id=${serviceId}`,
).then((r) => r.cron_jobs ?? []);
}
cronExecutions(jobId: string) {
return this.req<{ executions: CronExecution[] }>(
'GET',
`/cron-jobs/${jobId}/executions`,
).then((r) => r.executions ?? []);
}
triggerCronJob(jobId: string) {
return this.req<unknown>('POST', `/cron-jobs/${jobId}/trigger`, {});
}
serviceDeployments(id: string) {
return this.req<{ deployments: Deployment[] }>(
'GET',