Merge branch 'main' into dependabot/bundler/httparty-0.21.0
This commit is contained in:
commit
c857ecd2ef
@ -1,4 +1,4 @@
|
||||
FROM ruby:2.7.4
|
||||
FROM ruby:3.2
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
|
25
Gemfile.lock
25
Gemfile.lock
@ -1,12 +1,12 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activemodel (6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
activerecord (6.1.6.1)
|
||||
activemodel (= 6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
activesupport (6.1.6.1)
|
||||
activemodel (6.1.7.1)
|
||||
activesupport (= 6.1.7.1)
|
||||
activerecord (6.1.7.1)
|
||||
activemodel (= 6.1.7.1)
|
||||
activesupport (= 6.1.7.1)
|
||||
activesupport (6.1.7.1)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
@ -19,20 +19,23 @@ GEM
|
||||
httparty (0.21.0)
|
||||
mini_mime (>= 1.0.0)
|
||||
multi_xml (>= 0.5.2)
|
||||
i18n (1.11.0)
|
||||
i18n (1.12.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
listen (3.7.0)
|
||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||
rb-inotify (~> 0.9, >= 0.9.10)
|
||||
mini_mime (1.1.2)
|
||||
minitest (5.16.2)
|
||||
mime-types (3.3.1)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2021.0901)
|
||||
minitest (5.17.0)
|
||||
multi_xml (0.6.0)
|
||||
mustermann (1.1.1)
|
||||
ruby2_keywords (~> 0.0.1)
|
||||
nio4r (2.5.8)
|
||||
puma (5.6.4)
|
||||
nio4r (~> 2.0)
|
||||
rack (2.2.3.1)
|
||||
rack (2.2.6.4)
|
||||
rack-protection (2.2.0)
|
||||
rack
|
||||
rake (13.0.6)
|
||||
@ -54,11 +57,11 @@ GEM
|
||||
httparty (~> 0.13)
|
||||
sqlite3 (1.4.2)
|
||||
tilt (2.0.10)
|
||||
tzinfo (2.0.4)
|
||||
tzinfo (2.0.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
whenever (1.0.0)
|
||||
chronic (>= 0.6.3)
|
||||
zeitwerk (2.6.0)
|
||||
zeitwerk (2.6.6)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
@ -21,6 +21,14 @@ class Rate < ActiveRecord::Base
|
||||
where(created_at: Date.today.all_day)
|
||||
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
|
||||
test = Speedtest::Test.new(debug: false)
|
||||
result = test.run
|
||||
|
@ -23,3 +23,7 @@ section {
|
||||
canvas {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.lastcheck {
|
||||
margin-right: 20px !important;
|
||||
}
|
@ -1,5 +1,12 @@
|
||||
<div class="container">
|
||||
<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="col">
|
||||
<h2 class="text-center">Transfer Rate</h2>
|
||||
|
Loading…
Reference in New Issue
Block a user