aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/welcome_controller.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb
index 48167b2..ee73270 100644
--- a/app/controllers/welcome_controller.rb
+++ b/app/controllers/welcome_controller.rb
@@ -50,6 +50,26 @@ class WelcomeController < ApplicationController
# GET /dashboard
def dashboard
redirect_to '/authenticate' and return unless current_user.present?
+
+ @stats = {
+ counts: {
+ resources: Resource.count,
+ agents: Agent.count,
+ categories: Category.count,
+ sections: Section.count
+ },
+ current_agent: {
+ name: current_agent.name,
+ uuid: current_agent.uuid,
+ counts: {
+ resources: current_agent.resources.count,
+ taxonomies: current_agent.taxonomies.count,
+ categories: current_agent.categories.count,
+ sectiions: current_agent.sections.count
+ }
+ },
+ my_agents: current_user.agents.map { |a| { uuid: a.uuid, name: a.name } }
+ }
end
# GET /logout