Skip to content

Commit

Permalink
Merge branch 'release/4.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
icyleaf committed Oct 15, 2021
2 parents 96ae5b2 + c97497a commit fce92a9
Show file tree
Hide file tree
Showing 162 changed files with 2,901 additions and 1,492 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 变更日志
# 变更日志 Changelog

请移步https://zealot.ews.im/#/changelog
请移步(Detail): https://zealot.ews.im/#/changelog
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ARG BUILD_DATE
ARG VCS_REF
ARG TAG

ARG ZEALOT_VERSION="4.2.1"
ARG ZEALOT_VERSION="4.2.2"
ARG REPLACE_CHINA_MIRROR="true"
ARG ORIGINAL_REPO_URL="dl-cdn.alpinelinux.org"
ARG MIRROR_REPO_URL="mirrors.ustc.edu.cn"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source 'https://rubygems.org'

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gem 'puma', '~> 5.4.0'
gem 'puma', '~> 5.5.2'
gem 'rails', '~> 6.1.4'
gem 'rails-i18n', '~> 6.0.0'
gem 'rake', '~> 13.0.4'
Expand Down Expand Up @@ -37,7 +37,7 @@ gem 'carrierwave', '~> 2.2.2'

# Helper
## HTTP 请求
gem 'http', '~> 5.0.2'
gem 'http', '~> 5.0.4'
## 用户认证
gem 'pundit', '~> 2.1.0'
gem 'devise', '~> 4.8.0'
Expand Down Expand Up @@ -83,7 +83,7 @@ gem 'webpacker', '~> 5.4'
gem 'app-info', '~> 2.6.5'

# Mobile config
gem 'rails-settings-cached', '~> 2.7.1'
gem 'rails-settings-cached', '~> 2.8.1'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.7', require: false
Expand Down
42 changes: 21 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ GEM
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_analytics (0.2.0)
active_analytics (0.2.1)
rails (>= 5.2.0)
active_model_serializers (0.10.12)
actionpack (>= 4.1, < 6.2)
Expand All @@ -50,7 +50,7 @@ GEM
activejob (6.1.4.1)
activesupport (= 6.1.4.1)
globalid (>= 0.3.6)
activejob-status (0.1.6)
activejob-status (0.2.2)
activejob (>= 4.2)
activesupport (>= 4.2)
activemodel (6.1.4.1)
Expand Down Expand Up @@ -93,7 +93,7 @@ GEM
bindex (0.8.1)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bootsnap (1.8.1)
bootsnap (1.9.1)
msgpack (~> 1.0)
builder (3.2.4)
byebug (11.1.3)
Expand Down Expand Up @@ -136,7 +136,7 @@ GEM
erubi (1.10.0)
et-orbi (1.2.4)
tzinfo
faraday (1.7.1)
faraday (1.8.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand Down Expand Up @@ -203,7 +203,7 @@ GEM
hashie (4.1.0)
health_check (3.1.0)
railties (>= 5.0)
http (5.0.2)
http (5.0.4)
addressable (~> 2.8)
http-cookie (~> 1.0)
http-form_data (~> 2.2)
Expand Down Expand Up @@ -246,7 +246,7 @@ GEM
addressable (~> 2.7)
letter_opener (1.7.0)
launchy (~> 2.2)
letter_opener_web (1.4.0)
letter_opener_web (1.4.1)
actionmailer (>= 3.2)
letter_opener (~> 1.0)
railties (>= 3.2)
Expand All @@ -262,10 +262,10 @@ GEM
lumberjack (1.2.8)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.1)
marcel (1.0.2)
method_source (1.0.0)
mini_magick (4.11.0)
mini_mime (1.1.0)
mini_mime (1.1.1)
mini_portile2 (2.6.1)
minitest (5.14.4)
mixlib-shellout (3.2.5)
Expand All @@ -277,7 +277,7 @@ GEM
nenv (0.3.0)
net-ldap (0.17.0)
nio4r (2.5.8)
nokogiri (1.12.4)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
notiffany (0.1.3)
Expand Down Expand Up @@ -326,7 +326,7 @@ GEM
interception (>= 0.5)
pry (>= 0.12.0)
public_suffix (4.0.6)
puma (5.4.0)
puma (5.5.2)
nio4r (~> 2.0)
pundit (2.1.0)
activesupport (>= 3.0.0)
Expand Down Expand Up @@ -363,7 +363,7 @@ GEM
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
rails-settings-cached (2.7.1)
rails-settings-cached (2.8.1)
rails (>= 5.0.0)
railties (6.1.4.1)
actionpack (= 6.1.4.1)
Expand Down Expand Up @@ -401,7 +401,7 @@ GEM
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
ruby-debug-ide (0.7.2)
ruby-debug-ide (0.7.3)
rake (>= 0.8.1)
ruby-macho (2.5.1)
ruby-progressbar (1.11.0)
Expand All @@ -413,17 +413,17 @@ GEM
rufus-scheduler (3.7.0)
fugit (~> 1.1, >= 1.1.6)
semantic_range (3.0.0)
sentry-rails (4.7.2)
sentry-rails (4.7.3)
railties (>= 5.0)
sentry-ruby-core (~> 4.7.0)
sentry-ruby (4.7.2)
sentry-ruby (4.7.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
faraday (>= 1.0)
sentry-ruby-core (= 4.7.2)
sentry-ruby-core (4.7.2)
sentry-ruby-core (= 4.7.3)
sentry-ruby-core (4.7.3)
concurrent-ruby
faraday
sentry-sidekiq (4.7.2)
sentry-sidekiq (4.7.3)
sentry-ruby-core (~> 4.7.0)
sidekiq (>= 3.0)
shellany (0.0.1)
Expand Down Expand Up @@ -479,7 +479,7 @@ GEM
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unf_ext (0.0.8)
unicode-display_width (2.0.0)
uuidtools (2.2.0)
vmstat (2.3.1)
Expand Down Expand Up @@ -528,7 +528,7 @@ DEPENDENCIES
guard-sidekiq
guard-webpacker
health_check (~> 3.1.0)
http (~> 5.0.2)
http (~> 5.0.4)
jb (~> 0.8.0)
jenkins_api_client
kaminari
Expand All @@ -546,12 +546,12 @@ DEPENDENCIES
pry-byebug
pry-rails
pry-rescue
puma (~> 5.4.0)
puma (~> 5.5.2)
pundit (~> 2.1.0)
rack-cors (~> 1.1.1)
rails (~> 6.1.4)
rails-i18n (~> 6.0.0)
rails-settings-cached (~> 2.7.1)
rails-settings-cached (~> 2.8.1)
rake (~> 13.0.4)
redis (~> 4.4.0)
rqrcode
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/background_jobs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
class Admin::BackgroundJobsController < ApplicationController
# GET /admin/background_jobs
def index
@title = '后台任务'
@title = t('background_jobs.title')
end
end
2 changes: 1 addition & 1 deletion app/controllers/admin/database_analytics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

class Admin::DatabaseAnalyticsController < ApplicationController
def index
@title = '数据库分析'
@title = t('database_analytics.title')
end
end
2 changes: 1 addition & 1 deletion app/controllers/admin/page_analytics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

class Admin::PageAnalyticsController < ApplicationController
def index
@title = '页面统计'
@title = t('page_analytics.title')
end
end
17 changes: 13 additions & 4 deletions app/controllers/admin/settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,31 @@ class Admin::SettingsController < ApplicationController
before_action :verify_editable_setting, only: %i[edit]

def index
@title = '系统配置'
@title = t('.title')
@settings = Setting.site_configs
end

def edit
@title = '编辑设置'
@title = t('.title')
@value = @setting.value || @setting.default_value

# FIXME: RailsSettings::Base 初始化会缓存造成 i18n 第一时间拿不到
# 以至于 index, edit 好些地方都需要兼容
if @setting.var == 'default_schemes' && (@setting.value.blank? || @setting.value.empty?)
@value = Setting.present_schemes
end
end

def update
@title = t('.title')
new_value = setting_param[:value]
new_value = JSON.parse(new_value) if setting_param[:type] == 'hash' || setting_param[:type] == 'array'
if @setting.value != new_value
@setting.value = new_value
return render :edit unless @setting.save

redirect_to admin_settings_path, notice: "保存成功."
message = t('activerecord.success.update', key: t("admin.settings.#{@setting.var}"))
redirect_to admin_settings_path, notice: message
else
redirect_to admin_settings_path
end
Expand All @@ -37,6 +46,6 @@ def setting_param
end

def verify_editable_setting
raise Pundit::NotAuthorizedError, '当前设置为可读,无法修改' if @setting.readonly? === true
raise Pundit::NotAuthorizedError, t('admin.settings.no_editable_key') if @setting.readonly? === true
end
end
Loading

0 comments on commit fce92a9

Please sign in to comment.