Skip to content

Commit 80ffd9f

Browse files
committed
Merge branch 'develop'
2 parents fb79080 + 2c9ed76 commit 80ffd9f

File tree

12 files changed

+37
-19
lines changed

12 files changed

+37
-19
lines changed

.devcontainer/devcontainer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"workspaceFolder": "/workspace",
66
"remoteUser": "vscode",
77
"mounts": [
8-
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
8+
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
9+
"source=${localEnv:HOME}/Downloads,target=/home/vscode/downloads,type=bind,consistency=cached"
910
],
1011

1112
"customizations": {

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ ARG BUILD_DATE
6464
ARG VCS_REF
6565
ARG TAG
6666

67-
ARG ZEALOT_VERSION="5.2.1"
67+
ARG ZEALOT_VERSION="5.2.2"
6868
ARG REPLACE_CHINA_MIRROR="true"
6969
ARG ORIGINAL_REPO_URL="dl-cdn.alpinelinux.org"
7070
ARG MIRROR_REPO_URL="mirrors.ustc.edu.cn"

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ group :development do
118118
gem 'binding_of_caller'
119119

120120
# 在线查看 Action Mailer 内容
121-
gem 'letter_opener', '~> 1.9'
121+
gem 'letter_opener', '~> 1.10'
122122
gem 'letter_opener_web', '~> 2.0'
123123
end
124124

Gemfile.lock

+7-5
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ GEM
129129
activesupport
130130
chef-utils (18.0.185)
131131
concurrent-ruby
132+
childprocess (5.0.0)
132133
chunky_png (1.4.0)
133134
coderay (1.1.3)
134135
concurrent-ruby (1.2.3)
@@ -238,10 +239,11 @@ GEM
238239
kaminari-core (1.2.2)
239240
kramdown (2.4.0)
240241
rexml
241-
launchy (2.5.2)
242+
launchy (3.0.0)
242243
addressable (~> 2.8)
243-
letter_opener (1.9.0)
244-
launchy (>= 2.2, < 3)
244+
childprocess (~> 5.0)
245+
letter_opener (1.10.0)
246+
launchy (>= 2.2, < 4)
245247
letter_opener_web (2.0.0)
246248
actionmailer (>= 5.2)
247249
letter_opener (~> 1.7)
@@ -370,7 +372,7 @@ GEM
370372
pry (>= 0.12.0)
371373
psych (5.1.2)
372374
stringio
373-
public_suffix (5.0.4)
375+
public_suffix (5.0.5)
374376
puma (6.4.2)
375377
nio4r (~> 2.0)
376378
pundit (2.3.1)
@@ -607,7 +609,7 @@ DEPENDENCIES
607609
jsbundling-rails (~> 1.3)
608610
kaminari (~> 1.2.2)
609611
kramdown (~> 2.4)
610-
letter_opener (~> 1.9)
612+
letter_opener (~> 1.10)
611613
letter_opener_web (~> 2.0)
612614
listen (>= 3.0.5, < 3.10)
613615
lograge (~> 0.14.0)

app/models/setting.rb

+2
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ class Setting < RailsSettings::Base
138138

139139
# 统计
140140
scope :analytics do
141+
field :umami_website_id, default: ENV['UMAMI_WEBSITE_ID'], type: :string, display: true
142+
field :clarity_analytics_id, default: ENV['CLARITY_ANALYTICS_ID'], type: :string, display: true
141143
field :google_analytics_id, default: ENV['GOOGLE_ANALYTICS_ID'], type: :string, display: true
142144
end
143145
end
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- if Setting.google_analytics_id.present?
2+
script async=true src="//www.googletagmanager.com/gtag/js?id=#{Setting.google_analytics_id}"
3+
javascript:
4+
window.dataLayer = window.dataLayer || [];
5+
function gtag(){dataLayer.push(arguments);}
6+
gtag('js', new Date());
7+
8+
gtag('config', '#{Setting.google_analytics_id}');
9+
10+
- if Setting.umami_website_id.present?
11+
script defer=true src="https://analytics.us.umami.is/script.js" data-website-id="#{Setting.umami_website_id}"
12+
13+
- if Setting.clarity_analytics_id.present?
14+
javascript:
15+
(function(c,l,a,r,i,t,y){
16+
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
17+
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
18+
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
19+
})(window, document, "clarity", "script", "#{Setting.clarity_analytics_id}");

app/views/layouts/_google_analytics.html.slim

-7
This file was deleted.

app/views/layouts/application.html.slim

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,4 @@ html lang="#{I18n.locale}"
3838

3939
== render 'layouts/footer'
4040

41-
- if Setting.google_analytics_id.present?
42-
== render 'layouts/google_analytics'
41+
== render 'layouts/analytics'

config/initializers/devise.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
issuer = URI.parse(Setting.oidc[:issuer_url])
4545
scopes = Setting.oidc[:scope]&.split(',').map { |v| v.chomp.to_sym }
4646
url_options = Setting.url_options
47-
site_host = "#{url_options[:protocol]}://#{url_options[:host]}"
47+
site_host = "#{url_options[:protocol]}#{url_options[:host]}"
4848

4949
env['omniauth.strategy'].options[:name] = Setting.oidc[:name]
5050
env['omniauth.strategy'].options[:issuer] = Setting.oidc[:issuer_url]

config/locales/zealot/en.yml

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ en:
141141
mailer_options: Options
142142
analytics: Analytics
143143
google_analytics_id: Google Analytics ID
144+
umami_website_id: Umami Website ID
144145
archives: Archive uploaded binaries
145146
keep_uploads: Keep all builds
146147
empty_value: Empty

config/locales/zealot/zh-CN.yml

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ zh-CN:
141141
mailer_options: 发件服务器配置
142142
analytics: 统计
143143
google_analytics_id: Google 统计
144+
umami_website_id: Umami 统计
144145
archives: 上传文件
145146
keep_uploads: 永久保存上传应用版本
146147
empty_value: 空值

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zealot",
3-
"version": "5.2.1",
3+
"version": "5.2.2",
44
"private": true,
55
"license": "MIT",
66
"dependencies": {

0 commit comments

Comments
 (0)