From c9b3500fcf4d987953a1f7e4d5b3f153b3ac5251 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 10 Oct 2025 10:36:37 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fixed=20=E8=B0=83=E6=95=B4=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E6=95=8F=E6=84=9F=E8=AF=8D=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chinese_dictionary.txt | 2 -- config/harmonious_dictionary/harmonious.hash | Bin 39633 -> 39615 bytes 2 files changed, 2 deletions(-) diff --git a/config/harmonious_dictionary/chinese_dictionary.txt b/config/harmonious_dictionary/chinese_dictionary.txt index 6e72e88d5..1fc96dcef 100644 --- a/config/harmonious_dictionary/chinese_dictionary.txt +++ b/config/harmonious_dictionary/chinese_dictionary.txt @@ -497,8 +497,6 @@ a级情片 迷药 强迫 色情 -三級 -三级 A片 喷精 偷窥 diff --git a/config/harmonious_dictionary/harmonious.hash b/config/harmonious_dictionary/harmonious.hash index 7087665a9e120b72678e922550616558adcb0d58..b1bd2ebc831070fd06d26601cf75d2439970a1c6 100644 GIT binary patch delta 26 icmcb(m1+N0rVUBVjGU8`nbjECCwDPxZ9c}#Jskjm4+yOQ delta 40 ycmV+@0N4M&wF1$#02|ET Date: Wed, 15 Oct 2025 15:04:30 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=97=A5=E5=BF=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user_action.rb | 21 +++++++++++++++++++- app/views/admins/user_actions/index.html.erb | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/models/user_action.rb b/app/models/user_action.rb index 0dba93da4..d0a5a6605 100644 --- a/app/models/user_action.rb +++ b/app/models/user_action.rb @@ -25,6 +25,8 @@ class UserAction < ApplicationRecord + belongs_to :user, optional: true + after_save :add_user_info serialize :data_bank, JSON @@ -36,6 +38,7 @@ class UserAction < ApplicationRecord when "Login" then "登录" when "Logout" then "退出登录" when "DestroyOrganization" then "删除组织" + when "Attachment" then "上传附件" else self.action_type end end @@ -43,7 +46,7 @@ class UserAction < ApplicationRecord def opt_user_name user = User.find_by(id: self.user_id) if user.present? - user&.login + user&.real_name else del_user = UserAction.find_by(action_type: "DestroyUser", action_id: self.user_id) del_user.present? ? del_user.user.login : "不存在用户:#{user_id}" @@ -55,6 +58,13 @@ class UserAction < ApplicationRecord when "DestroyUser" then "账号:#{user&.login}
邮箱:#{user&.mail}
手机号:#{user&.phone}
昵称:#{user&.nickname}
" when "DestroyProject" then "项目名称:#{project&.name}
项目标识:#{project&.identifier}
" when "DestroyOrganization" then "组织名称:#{organization&.nickname}
组织标识:#{organization&.login}
" + when 'Attachment' + issue = Issue.find_by_id(attachment.container_id) + if attachment.container_type == "Issue" && issue&.issue_classify == "issue" + return "上传附件issue地址:#{issue&.subject}" + else + return "上传附件地址:#{attachment.title}" + end else "--" end end @@ -86,6 +96,15 @@ class UserAction < ApplicationRecord action_organization end + def attachment + action_attachment = if action_type == "Attachment" && data_bank.present? + build_mode("Attachment") + else + Attachment.find_by(id: self.action_id) + end + action_attachment + end + def build_mode(model_name) model = model_name.constantize.new diff --git a/app/views/admins/user_actions/index.html.erb b/app/views/admins/user_actions/index.html.erb index 3be99282a..3d4c4034b 100644 --- a/app/views/admins/user_actions/index.html.erb +++ b/app/views/admins/user_actions/index.html.erb @@ -5,7 +5,7 @@
<%= form_tag(admins_user_actions_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %> 操作类型: - <% action_type_options = [['自定义',''],['删除用户','DestroyUser'], ['删除项目', 'DestroyProject'], ['删除组织', 'DestroyOrganization']] %> + <% action_type_options = [['Attachment', '上传附件'], ['Login','登录'], ['Logout', '退出登录'],['删除用户','DestroyUser'], ['删除项目', 'DestroyProject'], ['删除组织', 'DestroyOrganization']] %> <%= select_tag(:action_type_select, options_for_select(action_type_options), class: 'form-control') %> <%= text_field_tag(:action_type, params[:action_type], class: 'form-control col-sm-2 ml-3',style: 'display:;', placeholder: '自定义操作类型检索') %> <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '操作人用户名/邮箱/手机号检索') %> From 8111c13417357d218b2e60c96c55469c4c830650 Mon Sep 17 00:00:00 2001 From: yystopf Date: Wed, 15 Oct 2025 15:08:18 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fixed:=20=E4=BC=A0=E5=80=BC=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/user_actions/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admins/user_actions/index.html.erb b/app/views/admins/user_actions/index.html.erb index 3d4c4034b..39a54569a 100644 --- a/app/views/admins/user_actions/index.html.erb +++ b/app/views/admins/user_actions/index.html.erb @@ -5,9 +5,9 @@
<%= form_tag(admins_user_actions_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %> 操作类型: - <% action_type_options = [['Attachment', '上传附件'], ['Login','登录'], ['Logout', '退出登录'],['删除用户','DestroyUser'], ['删除项目', 'DestroyProject'], ['删除组织', 'DestroyOrganization']] %> + <% action_type_options = [['上传附件', 'Attachment'], ['登录', 'Login'], ['退出登录', 'Logout'],['删除用户','DestroyUser'], ['删除项目', 'DestroyProject'], ['删除组织', 'DestroyOrganization']] %> <%= select_tag(:action_type_select, options_for_select(action_type_options), class: 'form-control') %> - <%= text_field_tag(:action_type, params[:action_type], class: 'form-control col-sm-2 ml-3',style: 'display:;', placeholder: '自定义操作类型检索') %> + <%#= text_field_tag(:action_type, params[:action_type], class: 'form-control col-sm-2 ml-3',style: 'display:;', placeholder: '自定义操作类型检索') %> <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '操作人用户名/邮箱/手机号检索') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %> <% end %> From 2905da7b14de30ed6fa67b775dd94a8dfb54364d Mon Sep 17 00:00:00 2001 From: yystopf Date: Wed, 15 Oct 2025 15:11:05 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fixed:=20=E4=BC=A0=E5=80=BC=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/user_actions/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admins/user_actions/index.html.erb b/app/views/admins/user_actions/index.html.erb index 39a54569a..7cc0a3346 100644 --- a/app/views/admins/user_actions/index.html.erb +++ b/app/views/admins/user_actions/index.html.erb @@ -7,7 +7,7 @@ 操作类型: <% action_type_options = [['上传附件', 'Attachment'], ['登录', 'Login'], ['退出登录', 'Logout'],['删除用户','DestroyUser'], ['删除项目', 'DestroyProject'], ['删除组织', 'DestroyOrganization']] %> <%= select_tag(:action_type_select, options_for_select(action_type_options), class: 'form-control') %> - <%#= text_field_tag(:action_type, params[:action_type], class: 'form-control col-sm-2 ml-3',style: 'display:;', placeholder: '自定义操作类型检索') %> + <%= text_field_tag(:action_type, params[:action_type], class: 'form-control col-sm-2 ml-3',style: 'display:;', placeholder: '自定义操作类型检索') %> <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '操作人用户名/邮箱/手机号检索') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %> <% end %> From 4e48bdb34f20f66b710e5f007be23f30f0cce429 Mon Sep 17 00:00:00 2001 From: yystopf Date: Wed, 15 Oct 2025 15:18:31 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fixed:=20=E9=BB=98=E8=AE=A4=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=87=AA=E5=AE=9A=E4=B9=89=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/user_actions/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admins/user_actions/index.html.erb b/app/views/admins/user_actions/index.html.erb index 7cc0a3346..371633b58 100644 --- a/app/views/admins/user_actions/index.html.erb +++ b/app/views/admins/user_actions/index.html.erb @@ -7,7 +7,7 @@ 操作类型: <% action_type_options = [['上传附件', 'Attachment'], ['登录', 'Login'], ['退出登录', 'Logout'],['删除用户','DestroyUser'], ['删除项目', 'DestroyProject'], ['删除组织', 'DestroyOrganization']] %> <%= select_tag(:action_type_select, options_for_select(action_type_options), class: 'form-control') %> - <%= text_field_tag(:action_type, params[:action_type], class: 'form-control col-sm-2 ml-3',style: 'display:;', placeholder: '自定义操作类型检索') %> + <%= text_field_tag(:action_type, params[:action_type], class: 'form-control col-sm-2 ml-3',style: 'display: none;', placeholder: '自定义操作类型检索') %> <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '操作人用户名/邮箱/手机号检索') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %> <% end %> From f044ad705d9fed90e61b97f781c005c7abf6b481 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Thu, 16 Oct 2025 09:26:31 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fixed=20pr=E6=B5=81=E6=B0=B4=E7=BA=BF?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/api/v1/projects/pipelines/build_pipeline.yaml.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/api/v1/projects/pipelines/build_pipeline.yaml.erb b/app/views/api/v1/projects/pipelines/build_pipeline.yaml.erb index 41908c8f5..02b40f71d 100644 --- a/app/views/api/v1/projects/pipelines/build_pipeline.yaml.erb +++ b/app/views/api/v1/projects/pipelines/build_pipeline.yaml.erb @@ -19,6 +19,7 @@ on: <% end %> <%if node.name.to_s.include?("on-pull_request") %> pull_request: + types: [opened, reopened] <% end %> <%if node.name.to_s.include?("on-fork") %> fork: From 2bd58d2ad70bc60852ee054ccb8bf514215528e5 Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 17 Oct 2025 14:01:51 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20action=20=E6=95=B0=E6=8D=AE=E5=9F=8B?= =?UTF-8?q?=E7=82=B9=E9=95=BF=E4=BF=A1=E6=81=AF=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/project_actions/fork_event.rb | 2 +- app/models/project_actions/issue_comment_event.rb | 2 +- app/models/project_actions/issues_event.rb | 2 +- app/models/project_actions/pull_request_event.rb | 6 +++--- .../project_actions/pull_request_review_comment_event.rb | 2 +- app/models/project_actions/release_event.rb | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/project_actions/fork_event.rb b/app/models/project_actions/fork_event.rb index 0d9bb99b0..c6815533a 100644 --- a/app/models/project_actions/fork_event.rb +++ b/app/models/project_actions/fork_event.rb @@ -24,7 +24,7 @@ class ProjectActions::ForkEvent < ProjectAction forkee_name: fork_project.identifier, forkee_owner_id: fork_project.owner.id, forkee_owner_login: fork_project.owner.login - } + }.as_json project_action.save! end end diff --git a/app/models/project_actions/issue_comment_event.rb b/app/models/project_actions/issue_comment_event.rb index 2a5a73fdd..46e2bbe63 100644 --- a/app/models/project_actions/issue_comment_event.rb +++ b/app/models/project_actions/issue_comment_event.rb @@ -23,7 +23,7 @@ class ProjectActions::IssueCommentEvent < ProjectAction issue_id: issue.id, issue_number: issue.project_issues_index, body: journal.notes - } + }.as_json project_action.save! end end diff --git a/app/models/project_actions/issues_event.rb b/app/models/project_actions/issues_event.rb index a51536a35..fba70e798 100644 --- a/app/models/project_actions/issues_event.rb +++ b/app/models/project_actions/issues_event.rb @@ -27,7 +27,7 @@ class ProjectActions::IssuesEvent < ProjectAction title: issue.subject, body: issue.description, action: action - } + }.as_json project_action.save! end end diff --git a/app/models/project_actions/pull_request_event.rb b/app/models/project_actions/pull_request_event.rb index b27e43c41..b7846e723 100644 --- a/app/models/project_actions/pull_request_event.rb +++ b/app/models/project_actions/pull_request_event.rb @@ -25,8 +25,8 @@ class ProjectActions::PullRequestEvent < ProjectAction pull_id: pull_request.id, pull_number: pull_request.gitea_number, title: pull_request.title, - body: pull_request.body, - git_diff: gitea_pull_request, + # body: pull_request.body, + # git_diff: gitea_pull_request, additions: gitea_pull_request['TotalAddition'], deletions: gitea_pull_request['TotalDeletion'], changed_files: gitea_pull_request['NumFiles'], @@ -35,7 +35,7 @@ class ProjectActions::PullRequestEvent < ProjectAction head_repo_id: pull_request.is_original ? pull_request.fork_project_id : pull_request.project_id, head_repo_name: pull_request.project&.identifier, head_ref: pull_request.head - } + }.as_json project_action.save! end end diff --git a/app/models/project_actions/pull_request_review_comment_event.rb b/app/models/project_actions/pull_request_review_comment_event.rb index a1a2fa0f6..22a6677a4 100644 --- a/app/models/project_actions/pull_request_review_comment_event.rb +++ b/app/models/project_actions/pull_request_review_comment_event.rb @@ -23,7 +23,7 @@ class ProjectActions::PullRequestReviewCommentEvent < ProjectAction pull_id: pull_request.id, pull_number: pull_request.gitea_number, body: journal.notes - } + }.as_json project_action.save! end end diff --git a/app/models/project_actions/release_event.rb b/app/models/project_actions/release_event.rb index 2505d1603..9a46f94c3 100644 --- a/app/models/project_actions/release_event.rb +++ b/app/models/project_actions/release_event.rb @@ -23,7 +23,7 @@ class ProjectActions::ReleaseEvent < ProjectAction tag_name: version_release.tag_name, name: version_release.name, body: version_release.body - } + }.as_json project_action.save! end end