mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
操作记录记录显示调整
This commit is contained in:
@@ -39,14 +39,6 @@ class UserAction < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def action_data
|
||||
case action_type
|
||||
when "DestroyUser" then build_mode("User")
|
||||
when "DestroyProject" then build_mode("Project")
|
||||
else nil
|
||||
end
|
||||
end
|
||||
|
||||
def opt_user_name
|
||||
if user&.id == user_id
|
||||
"--"
|
||||
@@ -55,6 +47,14 @@ class UserAction < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def action_info
|
||||
case action_type
|
||||
when "DestroyUser" then "账号:#{user&.login}<br/>邮箱:#{user&.mail}<br/>手机号:#{user&.phone}<br/>昵称:#{user&.nickname}<br/>"
|
||||
when "DestroyProject" then "项目名称:#{project&.name}<br/>项目标识:#{project&.identifier}<br/>"
|
||||
else "--"
|
||||
end
|
||||
end
|
||||
|
||||
def user
|
||||
action_user = if action_type == "DestroyUser" && data_bank.present?
|
||||
build_mode("User")
|
||||
@@ -63,6 +63,15 @@ class UserAction < ApplicationRecord
|
||||
end
|
||||
action_user
|
||||
end
|
||||
|
||||
def project
|
||||
action_project = if action_type == "DestroyProject" && data_bank.present?
|
||||
build_mode("Project")
|
||||
else
|
||||
Project.find_by(id: self.action_id)
|
||||
end
|
||||
action_project
|
||||
end
|
||||
def build_mode(model_name)
|
||||
model = model_name.constantize.new
|
||||
model_name.constantize.column_names.each do |col|
|
||||
|
||||
Reference in New Issue
Block a user