Class: ChronoForge::Dashboard::OverviewController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- ChronoForge::Dashboard::OverviewController
- Defined in:
- app/controllers/chrono_forge/dashboard/overview_controller.rb
Overview
Fleet summary. The index is a lightweight shell of turbo-frames; each card and the per-class table loads from its own action below, so the shell paints immediately and the heavy per-class aggregation never blocks the cheap card counts (or the rest of the page). Frame responses render without the layout — Turbo swaps them into the matching frame in the shell.
Constant Summary collapse
- FRAME_TTL =
Frame responses are live aggregates but tolerate a few seconds of staleness. A short private cache lets Turbo's fetch reuse a frame across a back/forward or quick re-visit without re-running the query — private so a shared proxy never serves one viewer's counts to another. It's per-frame (4 independent requests), and does nothing within a single page load; the win is only the repeat visit. A host wanting cross-user dedup can layer Rails.cache fragment caching on top.
5.seconds
Instance Method Summary collapse
- #blocked ⇒ Object
- #classes ⇒ Object
- #in_flight ⇒ Object
-
#index ⇒ Object
The shell opts out of the polling morph: each frame owns its own fetch.
- #processed ⇒ Object
Instance Method Details
#blocked ⇒ Object
34 35 36 37 |
# File 'app/controllers/chrono_forge/dashboard/overview_controller.rb', line 34 def blocked @count = OverviewQuery.blocked_total render layout: false end |
#classes ⇒ Object
39 40 41 42 |
# File 'app/controllers/chrono_forge/dashboard/overview_controller.rb', line 39 def classes @overview = OverviewQuery.new render layout: false end |
#in_flight ⇒ Object
29 30 31 32 |
# File 'app/controllers/chrono_forge/dashboard/overview_controller.rb', line 29 def in_flight @count = OverviewQuery.in_flight_total render layout: false end |
#index ⇒ Object
The shell opts out of the polling morph: each frame owns its own fetch.
20 21 22 |
# File 'app/controllers/chrono_forge/dashboard/overview_controller.rb', line 20 def index @cf_disable_polling = true end |
#processed ⇒ Object
24 25 26 27 |
# File 'app/controllers/chrono_forge/dashboard/overview_controller.rb', line 24 def processed @count = OverviewQuery.processed_total render layout: false end |