diff --git a/app.rb b/app.rb index b0eb111..c6fe0a8 100644 --- a/app.rb +++ b/app.rb @@ -8,23 +8,15 @@ set :database_file, 'config/database.yml' Time.now.utc.localtime("-04:00") get '/' do - @down_everage = Rate.average(:download) - @up_everage = Rate.average(:upload) - - @max_download = Rate.extremes(:maximum, :download) - @min_download = Rate.extremes(:minimum, :download) - @max_upload = Rate.extremes(:maximum, :upload) - @min_upload = Rate.extremes(:minimum, :upload) - - @data = [ - { - 'name': 'Download Rate', - 'data': Rate.transfer('download') - }, - { - 'name': 'Upload Rate', - 'data': Rate.transfer('upload') - }, + @transfer_rate = [ + {'name': 'Download Rate', 'data': Rate.transfer('download')}, + {'name': 'Upload Rate', 'data': Rate.transfer('upload')} + ] + + @download_rate = [ + {'name': 'Max Download Rate', 'data': Rate.extremes(:maximum, :download)}, + {'name': 'Min Download Rate', 'data': Rate.extremes(:minimum, :download)}, + {'name': 'Everage Download Rate', 'data': Rate.extremes(:average, :download)} ] erb :home diff --git a/views/home.erb b/views/home.erb index 789bdc2..85c9061 100644 --- a/views/home.erb +++ b/views/home.erb @@ -1,17 +1,3 @@