lib/rest-ftp-daemon/api/dashboard.rb in rest-ftp-daemon-0.242.1 vs lib/rest-ftp-daemon/api/dashboard.rb in rest-ftp-daemon-0.242.2

- old
+ new

@@ -3,32 +3,36 @@ require "sys/cpu" require "facter" module RestFtpDaemon module API + + # Offers an HTML dashboard through the Grape API (hum...) class Dashbaord < Grape::API -####### HELPERS + ### HELPERS helpers do def logger Root.logger end + def render name, values={} template = File.read("#{APP_LIBS}/views/#{name}.haml") haml_engine = Haml::Engine.new(template) haml_engine.render(binding, values) end end -####### Common request logging - before do - log_info "HTTP #{request.request_method} #{request.fullpath}", params - end + ### Common request logging + before do + log_info "HTTP #{request.request_method} #{request.fullpath}", params + end -####### DASHBOARD + + ### DASHBOARD get "/" do # Initialize Facter Facter.loadfacts