diff --git a/assets/js/app.ts b/assets/js/app.ts index b532cc6b..527316d7 100644 --- a/assets/js/app.ts +++ b/assets/js/app.ts @@ -350,9 +350,12 @@ if (!csrfToken) { throw new Error('CSRF token meta tag not found') } +// Detect user's timezone +const userTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC" + const liveSocket = new LiveSocket("/live", Socket, { longPollFallbackMs: 2500, - params: { _csrf_token: csrfToken }, + params: { _csrf_token: csrfToken, timezone: userTimezone }, hooks: { ...colocatedHooks, SensorChart, WebAuthnRegister, WebAuthnLogin, CopyToClipboard, ScrollToTop, AutoDismissFlash }, }) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index fd1ab588..0f998f39 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -5,13 +5,13 @@ metadata: name: towerops namespace: towerops spec: - replicas: 4 + replicas: 1 strategy: type: RollingUpdate rollingUpdate: - maxSurge: 1 # Allow 1 extra pod during rollout - maxUnavailable: 0 # Keep all pods running during rollout - minReadySeconds: 10 # Wait 10s after pod is ready before continuing + maxSurge: 1 # Allow 1 extra pod during rollout + maxUnavailable: 0 # Keep all pods running during rollout + minReadySeconds: 10 # Wait 10s after pod is ready before continuing selector: matchLabels: app: towerops @@ -20,7 +20,7 @@ spec: labels: app: towerops spec: - terminationGracePeriodSeconds: 30 # Allow 30s for graceful shutdown + terminationGracePeriodSeconds: 30 # Allow 30s for graceful shutdown imagePullSecrets: - name: gitlab-registry securityContext: @@ -63,7 +63,7 @@ spec: fieldRef: fieldPath: metadata.namespace - name: DEPLOY_TIMESTAMP - value: "1970-01-01T00:00:00Z" # Placeholder, updated by GitLab CI on deploy + value: "1970-01-01T00:00:00Z" # Placeholder, updated by GitLab CI on deploy - name: RELEASE_DISTRIBUTION value: "name" - name: RELEASE_NODE @@ -108,7 +108,7 @@ spec: initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 3 - failureThreshold: 12 # 10s + (12 * 5s) = 70s max startup time + failureThreshold: 12 # 10s + (12 * 5s) = 70s max startup time livenessProbe: httpGet: path: /health diff --git a/lib/towerops_web/live/admin/dashboard_live.html.heex b/lib/towerops_web/live/admin/dashboard_live.html.heex index c903de9b..5670be41 100644 --- a/lib/towerops_web/live/admin/dashboard_live.html.heex +++ b/lib/towerops_web/live/admin/dashboard_live.html.heex @@ -32,7 +32,7 @@ <:col :let={log} label="Superuser">{log.superuser && log.superuser.email} <:col :let={log} label="Target">{log.target_user && log.target_user.email} <:col :let={log} label="Time"> - {Calendar.strftime(log.inserted_at, "%Y-%m-%d %H:%M:%S")} + {ToweropsWeb.TimeHelpers.format_iso8601(log.inserted_at, @timezone)} diff --git a/lib/towerops_web/live/admin/org_live/index.html.heex b/lib/towerops_web/live/admin/org_live/index.html.heex index dc498dfa..9eda00ef 100644 --- a/lib/towerops_web/live/admin/org_live/index.html.heex +++ b/lib/towerops_web/live/admin/org_live/index.html.heex @@ -10,7 +10,9 @@ <:col :let={org} label="Name">{org.name} <:col :let={org} label="Slug">{org.slug} <:col :let={org} label="Members">{length(org.memberships)} - <:col :let={org} label="Created">{Calendar.strftime(org.inserted_at, "%Y-%m-%d")} + <:col :let={org} label="Created"> + {ToweropsWeb.TimeHelpers.format_date(org.inserted_at, @timezone)} + <:col :let={org} label="">