Sha256: 6c9ad5c82d98c53f08ca76e3154f665bd3ba98ebcb1ebfd720bad24e0696c1af

Contents?: true

Size: 753 Bytes

Versions: 2

Compression:

Stored size: 753 Bytes

Contents

WebAdminApp.get '/' do
  get_menu -1
  url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/config/full.yml"
  @raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10)
  @data = YAML::load(@raw)[:data]
  @status = get_processes({ :pattern => get_config.daemon_process_name}).empty?
  slim :home, :format => :html
end

WebAdminApp.get '/home' do
  get_menu 0
  slim :home, :format => :html
end

WebAdminApp.get '/daemon/:action' do
  content_type :text

  case params[:action]
  when 'start'
    startdaemon scheduling: true, purge: false
    return 'start'
  when 'stop'
    stopdaemon
    return 'stop'
  when 'restart'
    stopdaemon
    startdaemon scheduling: true, purge: false
    return 'start'
  else
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
prometheus-splash-0.8.1 lib/splash/webadmin/portal/controllers/home.rb
prometheus-splash-0.8.0 lib/splash/webadmin/portal/controllers/home.rb