Project

General

Profile

« Previous | Next » 

Revision acfbc458

Added by Marek Hulán about 10 years ago

fixes #812 - new permissions model, user group role and nest support, role filters for better granularity

Contributions from:

View differences:

app/controllers/statistics_controller.rb
class StatisticsController < ApplicationController
def index
@os_count = Host.my_hosts.count_distribution :operatingsystem
@arch_count = Host.my_hosts.count_distribution :architecture
@env_count = Host.my_hosts.count_distribution :environment
@klass_count = Host.my_hosts.count_habtm "puppetclass"
@cpu_count = FactValue.my_facts.count_each "processorcount"
@model_count = FactValue.my_facts.count_each "manufacturer"
@mem_size = FactValue.my_facts.mem_average "memorysize"
@mem_free = FactValue.my_facts.mem_average "memoryfree"
@swap_size = FactValue.my_facts.mem_average "swapsize"
@swap_free = FactValue.my_facts.mem_average "swapfree"
@mem_totsize = FactValue.my_facts.mem_sum "memorysize"
@mem_totfree = FactValue.my_facts.mem_sum "memoryfree"
@os_count = Host.authorized(:view_hosts, Host).count_distribution :operatingsystem
@arch_count = Host.authorized(:view_hosts, Host).count_distribution :architecture
@env_count = Host.authorized(:view_hosts, Host).count_distribution :environment
@klass_count = Host.authorized(:view_hosts, Host).count_habtm "puppetclass"
@cpu_count = FactValue.authorized(:view_facts).my_facts.count_each "processorcount"
@model_count = FactValue.authorized(:view_facts).my_facts.count_each "manufacturer"
@mem_size = FactValue.authorized(:view_facts).my_facts.mem_average "memorysize"
@mem_free = FactValue.authorized(:view_facts).my_facts.mem_average "memoryfree"
@swap_size = FactValue.authorized(:view_facts).my_facts.mem_average "swapsize"
@swap_free = FactValue.authorized(:view_facts).my_facts.mem_average "swapfree"
@mem_totsize = FactValue.authorized(:view_facts).my_facts.mem_sum "memorysize"
@mem_totfree = FactValue.authorized(:view_facts).my_facts.mem_sum "memoryfree"
respond_to do |format|
format.html
format.json do

Also available in: Unified diff