Skip to content

Commit

Permalink
Some mobile UI polish, fixes #4840
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Mar 13, 2021
1 parent 2693996 commit 9aeba31
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions Changes.md
Expand Up @@ -7,6 +7,7 @@ HEAD

- Store Redis RTT and log if poor [#4824]
- Add process/thread stats to Busy page [#4806]
- Improve Web UI on mobile devices [#4840]
- Refactor Web UI session usage. [#4804]
Numerous people have hit "Forbidden" errors and struggled with Sidekiq's
Web UI session requirement. If you have code in your initializer for
Expand Down
14 changes: 7 additions & 7 deletions lib/sidekiq/web.rb
Expand Up @@ -14,7 +14,7 @@

require "rack/content_length"
require "rack/builder"
require "rack/file"
require "rack/static"

module Sidekiq
class Web
Expand Down Expand Up @@ -144,12 +144,12 @@ def build
m = middlewares

::Rack::Builder.new do
%w[stylesheets javascripts images].each do |asset_dir|
map "/#{asset_dir}" do
run ::Rack::File.new("#{ASSETS}/#{asset_dir}", {"Cache-Control" => "public, max-age=86400"})
end
end

use Rack::Static, :urls => ["/stylesheets", "/images", "/javascripts"],
:root => ASSETS,
:cascade => true,
:header_rules => [
[:all, {'Cache-Control' => 'public, max-age=86400'}],
]
m.each { |middleware, block| use(*middleware, &block) }
use Sidekiq::Web::CsrfProtection unless $TESTING
run WebApplication.new(klass)
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/web/helpers.rb
Expand Up @@ -266,7 +266,7 @@ def retry_extra_items(retry_job)
end

def format_memory(rss_kb)
return "" if rss_kb.nil? || rss_kb == 0
return "0" if rss_kb.nil? || rss_kb == 0

if rss_kb < 100_000
"#{number_with_delimiter(rss_kb)} KB"
Expand Down
Binary file added web/assets/images/apple-touch-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion web/assets/stylesheets/application.css
Expand Up @@ -127,6 +127,10 @@ header.row .pagination {
width: 14%;
}
@media (max-width: 767px) and (min-width: 200px) {
.summary_bar {
font-size: 1.5em;
}

.summary_bar ul li {
width: 100%;
}
Expand Down Expand Up @@ -438,7 +442,7 @@ img.smallogo {
margin: 5px 10px 5px 5px;
}
.stat p{
font-size: 1em;
font-size: 1.5em;
margin: 5px 5px 5px 10px;
}
}
Expand Down
1 change: 1 addition & 0 deletions web/views/layout.erb
Expand Up @@ -16,6 +16,7 @@
<link href="<%= root_path %>stylesheets/application-rtl.css" media="screen" rel="stylesheet" type="text/css" />
<% end %>

<link rel="apple-touch-icon" href="<%= root_path %>images/apple-touch-icon.png">
<link rel="shortcut icon" type="image/ico" href="<%= root_path %>images/favicon.ico" />
<script type="text/javascript" src="<%= root_path %>javascripts/application.js"></script>
<meta name="google" content="notranslate" />
Expand Down

0 comments on commit 9aeba31

Please sign in to comment.