Merge branch 'main' into dependabot/bundler/sinatra-2.2.3

This commit is contained in:
Luiz F Picolo 2023-09-09 20:30:43 -04:00 committed by GitHub
commit 09a3fa093e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 14 deletions

View File

@ -1,4 +1,4 @@
FROM ruby:2.7.4 FROM ruby:3.2
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
curl \ curl \

View File

@ -1,12 +1,12 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
activemodel (6.1.6.1) activemodel (6.1.7.1)
activesupport (= 6.1.6.1) activesupport (= 6.1.7.1)
activerecord (6.1.6.1) activerecord (6.1.7.1)
activemodel (= 6.1.6.1) activemodel (= 6.1.7.1)
activesupport (= 6.1.6.1) activesupport (= 6.1.7.1)
activesupport (6.1.6.1) activesupport (6.1.7.1)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
minitest (>= 5.1) minitest (>= 5.1)
@ -16,26 +16,27 @@ GEM
chronic (0.10.2) chronic (0.10.2)
concurrent-ruby (1.1.10) concurrent-ruby (1.1.10)
ffi (1.15.4) ffi (1.15.4)
httparty (0.20.0) httparty (0.21.0)
mime-types (~> 3.0) mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
i18n (1.11.0) i18n (1.12.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
listen (3.7.0) listen (3.7.0)
rb-fsevent (~> 0.10, >= 0.10.3) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10) rb-inotify (~> 0.9, >= 0.9.10)
mini_mime (1.1.2)
mime-types (3.3.1) mime-types (3.3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2021.0901) mime-types-data (3.2021.0901)
minitest (5.16.2) minitest (5.17.0)
multi_xml (0.6.0) multi_xml (0.6.0)
mustermann (2.0.2) mustermann (2.0.2)
ruby2_keywords (~> 0.0.1) ruby2_keywords (~> 0.0.1)
nio4r (2.5.8) nio4r (2.5.8)
puma (5.6.4) puma (5.6.4)
nio4r (~> 2.0) nio4r (~> 2.0)
rack (2.2.4)
rack-protection (2.2.3) rack-protection (2.2.3)
rack (2.2.6.4)
rack rack
rake (13.0.6) rake (13.0.6)
rb-fsevent (0.11.0) rb-fsevent (0.11.0)
@ -56,11 +57,11 @@ GEM
httparty (~> 0.13) httparty (~> 0.13)
sqlite3 (1.4.2) sqlite3 (1.4.2)
tilt (2.0.11) tilt (2.0.11)
tzinfo (2.0.4) tzinfo (2.0.5)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
whenever (1.0.0) whenever (1.0.0)
chronic (>= 0.6.3) chronic (>= 0.6.3)
zeitwerk (2.6.0) zeitwerk (2.6.6)
PLATFORMS PLATFORMS
ruby ruby

View File

@ -21,6 +21,14 @@ class Rate < ActiveRecord::Base
where(created_at: Date.today.all_day) where(created_at: Date.today.all_day)
end end
def self.last_time
self.transfer('download').last.first
end
def self.last_value(type)
self.transfer(type).last.last
end
def self.save def self.save
test = Speedtest::Test.new(debug: false) test = Speedtest::Test.new(debug: false)
result = test.run result = test.run

View File

@ -23,3 +23,7 @@ section {
canvas { canvas {
margin-top: 15px; margin-top: 15px;
} }
.lastcheck {
margin-right: 20px !important;
}

View File

@ -1,5 +1,12 @@
<div class="container"> <div class="container">
<h1>Data Transfer Test</h1> <h1>Data Transfer Test</h1>
<div class="text-center">
<h2>Last Check</h2>
<div><%= Rate.last_time %></div>
Download: <%= Rate.last_value('download') %>
Upload: <%= Rate.last_value('upload') %>
</div>
<br />
<div class="row row-cols-1 row-cols-sm-1 row-cols-md-3"> <div class="row row-cols-1 row-cols-sm-1 row-cols-md-3">
<div class="col"> <div class="col">
<h2 class="text-center">Transfer Rate</h2> <h2 class="text-center">Transfer Rate</h2>