Class: Solidstats::DashboardController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Solidstats::DashboardController
- Defined in:
- app/controllers/solidstats/dashboard_controller.rb
Constant Summary collapse
- TODO_CACHE_FILE =
Rails.root.join("tmp", "solidstats_todos.json")
- AUDIT_CACHE_HOURS =
Configure how many hours before refreshing
12
Instance Method Summary collapse
Instance Method Details
#dashboard ⇒ Object
9 10 11 12 13 14 |
# File 'app/controllers/solidstats/dashboard_controller.rb', line 9 def dashboard # Load dashboard cards from JSON file @dashboard_cards = load_dashboard_cards @quick_actions = quick_actions_data render "dashboard" end |
#refresh ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/solidstats/dashboard_controller.rb', line 16 def refresh # Refresh all services Solidstats::LogSizeMonitorService.scan_and_cache Solidstats::BundlerAuditService.scan_and_cache Solidstats::MyTodoService.collect_todos Solidstats::StylePatrolService.refresh_cache Solidstats::CoverageCompassService.refresh_cache Solidstats::LoadLensService.scan_and_cache respond_to do |format| format.html { redirect_to solidstats_dashboard_path, notice: "Dashboard data refreshed successfully!" } format.json { render json: { status: "success", message: "Dashboard data refreshed successfully!" } } end end |