lib/splash/webadmin/portal/controllers/logs.rb in prometheus-splash-0.8.3 vs lib/splash/webadmin/portal/controllers/logs.rb in prometheus-splash-0.8.4

- old
+ new

@@ -19,21 +19,34 @@ WebAdminApp.get '/add_modify_log/?:label?' do get_menu 0 log = get_logger - log.call "WEB : logs, verb : POST, controller : /add_modify_log/?:label?" + log.call "WEB : logs, verb : GET, controller : /add_modify_log/?:label?" @data = {} if params[:label] then url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/logs/show/#{params[:label].to_s}.yml" raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10) res = YAML::load(raw) @data = res[:data] if res[:status] == :success @data[:old_label] = params[:label].to_s end - slim :logs_form, :format => :html + slim :log_form, :format => :html end + +WebAdminApp.get '/get_log_history/:label' do + get_menu 0 + log = get_logger + log.call "WEB : logs, verb : GET, controller : /get_log_history/:label" + @data = {} + url = "http://#{get_config.webadmin_ip}:#{get_config.webadmin_port}/api/logs/history/#{params[:label].to_s}.yml" + raw = RestClient::Request.execute(method: 'GET', url: url,timeout: 10) + res = YAML::load(raw) + @data = res[:data] if res[:status] == :success + @label = params[:label].to_s + slim :log_history, :format => :html +end WebAdminApp.post '/save_log' do get_menu 0 log = get_logger log.call "WEB : logs, verb : POST, controller : /save_log/?:label?"