后台项目增加镜像项目查询

This commit is contained in:
xxq250 2026-04-27 12:28:20 +08:00
parent b7f93e3725
commit bf24dc43e1
2 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,8 @@ class Admins::ProjectsController < Admins::BaseController
projects = projects.where.not(forked_from_project_id: nil)
when 'original'
projects = projects.where(forked_from_project_id: nil, project_type: 'common')
when 'mirror'
projects = projects.where(project_type: 'mirror')
end
@projects = paginate projects.includes(:owner, :members, :issues, :versions, :attachments, :project_score)
end

View File

@ -9,7 +9,7 @@
<input type="reset" class="btn btn-secondary clear-btn" value="清空"/>
<div class="form-group mr-2 pull-right" style='margin-left:auto'>
<label for="status">项目类别:</label>
<% type_options = [['全部项目', ''], ['公开项目', 'public'], ['私有项目', 'private'], ['Fork项目', 'fork'], ['原创项目', 'original']] %>
<% type_options = [['全部项目', ''], ['公开项目', 'public'], ['私有项目', 'private'], ['Fork项目', 'fork'], ['原创项目', 'original'], ['镜像项目', 'mirror']] %>
<%= select_tag(:category, options_for_select(type_options, params[:category]), class: 'form-control', id: 'project-category') %>
</div>
<% end %>