Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
icyleaf committed Apr 3, 2024
2 parents fb79080 + 2c9ed76 commit 80ffd9f
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"workspaceFolder": "/workspace",
"remoteUser": "vscode",
"mounts": [
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
"source=${localEnv:HOME}/Downloads,target=/home/vscode/downloads,type=bind,consistency=cached"
],

"customizations": {
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ARG BUILD_DATE
ARG VCS_REF
ARG TAG

ARG ZEALOT_VERSION="5.2.1"
ARG ZEALOT_VERSION="5.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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ group :development do
gem 'binding_of_caller'

# 在线查看 Action Mailer 内容
gem 'letter_opener', '~> 1.9'
gem 'letter_opener', '~> 1.10'
gem 'letter_opener_web', '~> 2.0'
end

Expand Down
12 changes: 7 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ GEM
activesupport
chef-utils (18.0.185)
concurrent-ruby
childprocess (5.0.0)
chunky_png (1.4.0)
coderay (1.1.3)
concurrent-ruby (1.2.3)
Expand Down Expand Up @@ -238,10 +239,11 @@ GEM
kaminari-core (1.2.2)
kramdown (2.4.0)
rexml
launchy (2.5.2)
launchy (3.0.0)
addressable (~> 2.8)
letter_opener (1.9.0)
launchy (>= 2.2, < 3)
childprocess (~> 5.0)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
letter_opener_web (2.0.0)
actionmailer (>= 5.2)
letter_opener (~> 1.7)
Expand Down Expand Up @@ -370,7 +372,7 @@ GEM
pry (>= 0.12.0)
psych (5.1.2)
stringio
public_suffix (5.0.4)
public_suffix (5.0.5)
puma (6.4.2)
nio4r (~> 2.0)
pundit (2.3.1)
Expand Down Expand Up @@ -607,7 +609,7 @@ DEPENDENCIES
jsbundling-rails (~> 1.3)
kaminari (~> 1.2.2)
kramdown (~> 2.4)
letter_opener (~> 1.9)
letter_opener (~> 1.10)
letter_opener_web (~> 2.0)
listen (>= 3.0.5, < 3.10)
lograge (~> 0.14.0)
Expand Down
2 changes: 2 additions & 0 deletions app/models/setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ class Setting < RailsSettings::Base

# 统计
scope :analytics do
field :umami_website_id, default: ENV['UMAMI_WEBSITE_ID'], type: :string, display: true
field :clarity_analytics_id, default: ENV['CLARITY_ANALYTICS_ID'], type: :string, display: true
field :google_analytics_id, default: ENV['GOOGLE_ANALYTICS_ID'], type: :string, display: true
end
end
19 changes: 19 additions & 0 deletions app/views/layouts/_analytics.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- if Setting.google_analytics_id.present?
script async=true src="//www.googletagmanager.com/gtag/js?id=#{Setting.google_analytics_id}"
javascript:
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '#{Setting.google_analytics_id}');
- if Setting.umami_website_id.present?
script defer=true src="https://analytics.us.umami.is/script.js" data-website-id="#{Setting.umami_website_id}"

- if Setting.clarity_analytics_id.present?
javascript:
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "#{Setting.clarity_analytics_id}");
7 changes: 0 additions & 7 deletions app/views/layouts/_google_analytics.html.slim

This file was deleted.

3 changes: 1 addition & 2 deletions app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ html lang="#{I18n.locale}"

== render 'layouts/footer'

- if Setting.google_analytics_id.present?
== render 'layouts/google_analytics'
== render 'layouts/analytics'
2 changes: 1 addition & 1 deletion config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
issuer = URI.parse(Setting.oidc[:issuer_url])
scopes = Setting.oidc[:scope]&.split(',').map { |v| v.chomp.to_sym }
url_options = Setting.url_options
site_host = "#{url_options[:protocol]}://#{url_options[:host]}"
site_host = "#{url_options[:protocol]}#{url_options[:host]}"

env['omniauth.strategy'].options[:name] = Setting.oidc[:name]
env['omniauth.strategy'].options[:issuer] = Setting.oidc[:issuer_url]
Expand Down
1 change: 1 addition & 0 deletions config/locales/zealot/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ en:
mailer_options: Options
analytics: Analytics
google_analytics_id: Google Analytics ID
umami_website_id: Umami Website ID
archives: Archive uploaded binaries
keep_uploads: Keep all builds
empty_value: Empty
Expand Down
1 change: 1 addition & 0 deletions config/locales/zealot/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ zh-CN:
mailer_options: 发件服务器配置
analytics: 统计
google_analytics_id: Google 统计
umami_website_id: Umami 统计
archives: 上传文件
keep_uploads: 永久保存上传应用版本
empty_value: 空值
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zealot",
"version": "5.2.1",
"version": "5.2.2",
"private": true,
"license": "MIT",
"dependencies": {
Expand Down

0 comments on commit 80ffd9f

Please sign in to comment.