Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
source 'https://rubygems.org'

gem 'rails', '4.0.6'
gem 'mysql2', '0.3.17'
gem 'syslogger', git: 'https://github.com/jbussdieker/syslogger.git', :branch => 'implement_log_formatter'
gem 'rails', '4.2.5'
gem 'mysql2', '0.3.18'
gem 'puppet'
gem 'mcollective-client'
gem 'chartkick'
Expand All @@ -15,20 +15,23 @@ gem 'sass-rails', '~> 4.0.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.0.3'
gem 'jquery-rails'
gem 'awesome_print', require:"ap"
gem 'awesome_print'

# attr_accessible` is extracted out of Rails into a gem.
# Please use new recommended protection model for params(strong_parameters)
# or add `protected_attributes` to your Gemfile to use old one
gem 'protected_attributes'

gem 'responders', '~> 2.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby

group :development, :test do
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'coveralls', require: false
gem 'web-console', '~> 2.0'
end

group :test do
Expand Down
171 changes: 109 additions & 62 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,47 @@ GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.2.8)
actionmailer (4.0.6)
actionpack (= 4.0.6)
mail (~> 2.5.4)
actionpack (4.0.6)
activesupport (= 4.0.6)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
actionmailer (4.2.5)
actionpack (= 4.2.5)
actionview (= 4.2.5)
activejob (= 4.2.5)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.5)
actionview (= 4.2.5)
activesupport (= 4.2.5)
rack (~> 1.6)
rack-test (~> 0.6.2)
activemodel (4.0.6)
activesupport (= 4.0.6)
builder (~> 3.1.0)
activerecord (4.0.6)
activemodel (= 4.0.6)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.6)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.4)
activesupport (4.0.6)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.5)
activesupport (= 4.2.5)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.5)
activesupport (= 4.2.5)
globalid (>= 0.3.0)
activemodel (4.2.5)
activesupport (= 4.2.5)
builder (~> 3.1)
activerecord (4.2.5)
activemodel (= 4.2.5)
activesupport (= 4.2.5)
arel (~> 6.0)
activesupport (4.2.5)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
arel (4.0.2)
awesome_print (1.7.0)
builder (3.1.4)
arel (6.0.4)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.3)
capybara (2.11.0)
addressable
mime-types (>= 1.16)
Expand All @@ -62,6 +74,7 @@ GEM
thor (~> 0.19.1)
tins (~> 1.6)
database_cleaner (1.5.3)
debug_inspector (0.0.2)
diff-lcs (1.2.5)
docile (1.1.5)
erubis (2.7.0)
Expand All @@ -73,38 +86,52 @@ GEM
factory_girl_rails (4.8.0)
factory_girl (~> 4.8.0)
railties (>= 3.0.0)
faker (1.7.2)
faker (1.7.3)
i18n (~> 0.5)
ffi (1.9.17)
groupdate (3.1.1)
globalid (0.3.7)
activesupport (>= 4.1.0)
groupdate (3.2.0)
activesupport (>= 3)
hiera (3.2.2)
hiera (3.3.1)
hike (1.2.3)
i18n (0.7.0)
jquery-rails (3.1.4)
railties (>= 3.0, < 5.0)
i18n (0.8.1)
jquery-rails (4.2.2)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.0.3)
json (1.8.6)
json_pure (1.8.6)
kaminari (0.17.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kaminari (1.0.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.0.1)
kaminari-activerecord (= 1.0.1)
kaminari-core (= 1.0.1)
kaminari-actionview (1.0.1)
actionview
kaminari-core (= 1.0.1)
kaminari-activerecord (1.0.1)
activerecord
kaminari-core (= 1.0.1)
kaminari-core (1.0.1)
kgio (2.11.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mcollective-client (2.9.1)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
mcollective-client (2.10.2)
json
stomp
systemu
mime-types (1.25.1)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (4.7.5)
minitest (5.10.1)
multi_json (1.12.1)
mysql2 (0.3.17)
nokogiri (1.7.0.1)
mysql2 (0.3.18)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
polyglot (0.3.5)
protected_attributes (1.1.3)
activemodel (>= 4.0.1, < 5.0)
public_suffix (2.0.5)
Expand All @@ -113,25 +140,38 @@ GEM
facter (> 2.0, < 4)
hiera (>= 2.0, < 4)
json_pure (~> 1.8)
rack (1.5.5)
rack (1.6.5)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.0.6)
actionmailer (= 4.0.6)
actionpack (= 4.0.6)
activerecord (= 4.0.6)
activesupport (= 4.0.6)
rails (4.2.5)
actionmailer (= 4.2.5)
actionpack (= 4.2.5)
actionview (= 4.2.5)
activejob (= 4.2.5)
activemodel (= 4.2.5)
activerecord (= 4.2.5)
activesupport (= 4.2.5)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.6)
sprockets-rails (~> 2.0)
railties (= 4.2.5)
sprockets-rails
rails-bootstrap (3.0.0.4)
railties (4.0.6)
actionpack (= 4.0.6)
activesupport (= 4.0.6)
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.8)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (4.2.5)
actionpack (= 4.2.5)
activesupport (= 4.2.5)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.17.0)
rake (12.0.0)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
Expand Down Expand Up @@ -182,16 +222,18 @@ GEM
thread_safe (0.3.5)
tilt (1.4.1)
tins (1.13.0)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.52)
uglifier (3.0.4)
execjs (>= 0.3.0, < 3)
unicorn (5.2.0)
kgio (~> 2.6)
raindrops (~> 0.7)
websocket (1.2.3)
web-console (2.3.0)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
websocket (1.2.4)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand All @@ -211,14 +253,19 @@ DEPENDENCIES
jquery-rails
kaminari
mcollective-client
mysql2 (= 0.3.17)
mysql2 (= 0.3.18)
protected_attributes
puppet
rails (= 4.0.6)
rails (= 4.2.5)
rails-bootstrap (~> 3.0.0)
responders (~> 2.0)
rspec-rails
sass-rails (~> 4.0.0)
selenium-webdriver
syslogger!
uglifier (>= 1.0.3)
unicorn
web-console (~> 2.0)

BUNDLED WITH
1.13.6
2 changes: 1 addition & 1 deletion app/controllers/nodes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def status_history
def resource_times
@report = @node.reports.order("time DESC").first
if @report
@metrics = @report.metrics.where(:category => "Time")
@metrics = @report.metrics.where(:category => "Time").to_a
@metrics.reject! {|n| n.name == "Total"}
@metrics = @metrics.collect {|n| [n.name, n.value]}
else
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/parameters_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class ParametersController < ApplicationController
helper_method :sort_column, :sort_direction

def index
@parameters = Parameter.where(parameterable_id: nil).order(sort_column + " " + sort_direction)
@parameters = Parameter.where(parameterable_id: nil).order(sort_column + " " + sort_direction).to_a
render_collection(@parameters)
end

Expand Down
10 changes: 10 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,14 @@ def current_url(new_params)
string = options.map{ |k,v| "#{k}=#{v}" }.join("&")
request.fullpath.split("?")[0] + "?" + string
end

def link_to_function(name, *args, &block)
html_options = args.extract_options!.symbolize_keys

function = block_given? ? update_page(&block) : args[0] || ''
onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function}; return false;"
href = html_options[:href] || '#'

content_tag(:a, name, html_options.merge(:href => href, :onclick => onclick))
end
end
10 changes: 10 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
<li><%= link_to "Parameters", parameters_path %></li>
<li><%= link_to "Reports", reports_path %></li>
</ul>

<ul class="nav navbar-nav navbar-right">
<li>
<a>Rails <%= Rails::VERSION::STRING %></a>
</li>

<li>
<a>Ruby <%= RUBY_VERSION%></a>
</li>
</ul>
</div>
</div>

Expand Down
20 changes: 3 additions & 17 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups)
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
Bundler.require(:default, Rails.env)
end

module Enc
Expand Down Expand Up @@ -42,21 +40,9 @@ class Application < Rails::Application
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true

# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql

# Enforce whitelist mode for mass assignment.
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
config.active_record.whitelist_attributes = true

# Enable the asset pipeline
config.assets.enabled = true

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'

config.active_record.raise_in_transactional_callbacks = true
end
end
11 changes: 9 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,22 @@
config.consider_all_requests_local = true
config.action_controller.perform_caching = false

# Compress JavaScripts and CSS
config.assets.js_compressor = :uglifier

# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false

# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log

# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load

# Expands the lines which load the assets
config.assets.debug = true

config.logger = Logger.new(STDOUT)
config.logger.level = :debug
config.log_level = :debug
end
Loading