Compare commits

...

692 Commits

Author SHA1 Message Date
xxq250 35cc2cb735 Merge pull request '20240326版本' (#344) from develop into master 2024-03-26 15:18:26 +08:00
xxq250 f4ddc45d6b Merge pull request '20240326版本' (#343) from Trustie/forgeplus:pre_trustie_server into develop 2024-03-26 15:17:25 +08:00
yystopf 51266553f8 Merge branch 'standalone_develop' into pre_trustie_server 2024-03-22 13:44:14 +08:00
yystopf cb125dc85f Merge branch 'develop' into standalone_develop 2024-03-22 08:49:36 +08:00
yystopf b91358a7fe 新增:查询用户需传type值 2024-03-22 08:49:26 +08:00
yystopf 68348f1fc3 更改:csv写入模式 2024-03-21 17:38:57 +08:00
yystopf c999d37f7e 新增:同步acge用户记录在册 2024-03-21 16:58:27 +08:00
yystopf 6e2816af75 新增:同步acge用户并同时创建平台账号 2024-03-21 14:58:35 +08:00
yystopf bf7289032a 更改:private传值问题 2024-03-21 11:25:05 +08:00
yystopf d6acce86a7 更改:marked.min.js文件替换 2024-03-21 10:28:01 +08:00
yystopf 7bdab0bc53 更改:binduser type类型新增acge 2024-03-21 10:16:04 +08:00
yystopf e891d52c32 新增:acge 第三方登录回调地址 2024-03-21 10:11:58 +08:00
yystopf d78bd895d1 Merge branch 'develop' into standalone_develop 2024-03-20 10:48:21 +08:00
yystopf b8b5828a7c 更改:更新项目private参数默认为项目is_public的值 2024-03-20 10:47:36 +08:00
yystopf 721116467b Merge branch 'develop' into standalone_develop 2024-03-20 09:13:38 +08:00
yystopf fd6f904f7e 新增:最近提交列表message搜索 2024-03-20 09:13:29 +08:00
yystopf 444c57c237 更改:marked.min.js文件替换 2024-03-19 10:03:39 +08:00
yystopf 531611c9df Merge branch 'develop' into standalone_develop 2024-03-18 16:31:22 +08:00
yystopf c88d0c2712 新增:最近提交列表返回距离现在时间 2024-03-18 16:31:05 +08:00
yystopf 62ff6dd1d7 Merge branch 'develop' into standalone_develop 2024-03-16 16:03:43 +08:00
yystopf a0f1679f03 新增:合并请求合并接口冲突文件提示 2024-03-16 16:03:31 +08:00
yystopf b051213278 Merge branch 'develop' into standalone_develop 2024-03-14 14:15:04 +08:00
yystopf c1fbea8453 修复:删除特殊符号分支、标签失败 2024-03-14 14:14:50 +08:00
yystopf 28dfce0247 Merge branch 'develop' into standalone_develop 2024-03-13 16:11:25 +08:00
yystopf 7d769ad118 更改:readme href替换 2024-03-13 16:10:43 +08:00
yystopf ea29f4c673 Merge branch 'develop' into standalone_develop 2024-03-13 15:12:58 +08:00
yystopf 370a565a7c 新增:readme href匹配 2024-03-13 15:10:05 +08:00
yystopf 597d77ba85 Merge branch 'develop' into standalone_develop 2024-03-12 15:23:12 +08:00
yystopf f3f63e3dd3 新增:里程碑提醒配置化 2024-03-12 15:22:24 +08:00
xxq250 780ba6c103 重新计算组织成员数量 2024-03-11 09:45:13 +08:00
xxq250 1e70d93a83 重新计算组织成员数量 2024-03-11 09:22:07 +08:00
yystopf c6152aaca8 Merge branch 'develop' into standalone_develop 2024-03-07 16:00:17 +08:00
yystopf 48c5aa732f 更改:时间取值 2024-03-07 16:00:09 +08:00
yystopf a7b6dbc1a0 Merge branch 'develop' into standalone_develop 2024-03-07 15:49:23 +08:00
yystopf a8997ae160 更改:时间取值 2024-03-07 15:49:14 +08:00
yystopf f422350895 Merge branch 'develop' into standalone_develop 2024-03-07 15:40:50 +08:00
yystopf 69754d5c11 更改:时间取值 2024-03-07 15:40:40 +08:00
yystopf 0f546bc316 Merge branch 'develop' into standalone_develop 2024-03-07 11:19:53 +08:00
yystopf 847e501dee 新增:开启流水线模块接口 2024-03-07 11:18:39 +08:00
yystopf d95fefe589 Merge branch 'develop' into standalone_develop 2024-03-06 16:28:47 +08:00
yystopf 0e31daf9a8 修复:恢复auto_init 2024-03-06 16:27:43 +08:00
yystopf 404abe3b2a Merge branch 'develop' into standalone_develop 2024-03-06 10:47:24 +08:00
yystopf dd96e1e2da 修复:流水线文件不存在报错 2024-03-06 10:46:54 +08:00
yystopf 1894f00a2d Merge branch 'develop' into standalone_develop 2024-03-05 10:26:52 +08:00
yystopf 2d9b97ee78 新增:分页参数 2024-03-05 10:26:36 +08:00
yystopf d2b6f4189a Merge pull request '新版gitea升级同步更改' (#265) from feature_gitea_upgrade into develop 2024-03-05 09:48:28 +08:00
yystopf 5e1c1d8c87 Merge branch 'develop' into standalone_develop 2024-03-05 09:47:48 +08:00
yystopf 8eefb8ca07 新增:流水线接口代码 2024-03-05 09:43:34 +08:00
yystopf f35dddbbf7 fix 2024-03-01 17:36:58 +08:00
yystopf 59e8ce206f merge from develop 2024-03-01 16:58:29 +08:00
xxq250 5aab575b36 Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2024-03-01 15:17:26 +08:00
xxq250 6e41605cbc fixed 删除文件失败,参数sha不匹配提示 2024-03-01 15:17:20 +08:00
yystopf 8760a8234f 更改:获取专区文章使用简要信息接口 2024-03-01 10:36:57 +08:00
yystopf 447429a663 新增:创建项目auto_init参数 2024-01-31 16:47:00 +08:00
yystopf d0bc8e4378 Merge branch 'develop' of https://gitlink.org.cn/Trustie/forgeplus into develop 2024-01-31 15:36:21 +08:00
yystopf 6a4f63d8ea 新增:最新提交列表接口 2024-01-30 14:50:59 +08:00
yystopf feec49d4bd 新增: 查询删除分支与普通分支 2024-01-30 14:50:59 +08:00
yystopf a644a65493 更新:gitea client版本 2024-01-30 14:50:59 +08:00
yystopf d8eeb8f1b7 新增:恢复分支接口
新增:删除者信息
2024-01-30 14:50:59 +08:00
yystopf c94bffd844 更改:重置gitea token规则 2024-01-30 14:50:59 +08:00
yystopf 096941ea9e 更改:重置gitea token规则 2024-01-30 14:50:59 +08:00
yystopf 026d58c347 更改:compare接口 2024-01-30 14:50:59 +08:00
yystopf a0265d4808 更改:tree返回结构体适配以及生成token需新增scopes参数 2024-01-30 14:50:59 +08:00
xxq250 8ca9ced360 fixed 组织成员数取组织内成员和组织所有仓库成员组合,排序加入时间 2024-01-30 08:27:49 +08:00
xxq250 036acfc43d fixed 组织成员数取组织内成员和组织所有仓库成员组合,加入时间 2024-01-29 17:35:08 +08:00
xxq250 627332e93a fixed 组织成员数取组织内成员和组织所有仓库成员组合,加入时间 2024-01-29 17:32:46 +08:00
xxq250 c957617263 fixed 取消仓库增加成员时同时加进组织操作,仅增加 2024-01-29 16:54:52 +08:00
xxq250 6ff89d7929 fixed 取消仓库增加成员时同时加进组织操作 2024-01-29 16:05:22 +08:00
xxq250 d2663eb7b7 fixed 组织成员数取组织内成员和组织所有仓库成员组合 2024-01-29 16:05:04 +08:00
yystopf 0e8a3ddb79 Merge branch 'develop' into standalone_develop 2024-01-27 14:53:12 +08:00
yystopf f61393f34a Merge branch 'develop' of https://gitlink.org.cn/yystopf/forgeplus into develop 2024-01-27 14:52:52 +08:00
yystopf df0ef313f6 更改:仓库无文件跳转404 2024-01-26 16:15:14 +08:00
yystopf 1f07833de9 Merge pull request '里程碑过期相关系统通知' (#255) from yystopf/forgeplus:develop into develop 2024-01-25 16:12:57 +08:00
yystopf dbf41c04b3 Merge branch 'develop' into standalone_develop 2024-01-25 16:11:58 +08:00
yystopf 604e3eeba1 Merge branch 'develop' of https://gitlink.org.cn/Trustie/forgeplus into develop 2024-01-25 16:11:45 +08:00
yystopf 299978833d 新增:里程碑过期相关系统通知 2024-01-25 16:09:52 +08:00
xxq250 99e0d8b128 Merge branch 'standalone_develop' into pre_trustie_server 2024-01-22 13:03:18 +08:00
xxq250 90ea1804e9 后台概览增加缓存,增加上周统计数据,百分号 2024-01-22 13:02:48 +08:00
xxq250 24e4020809 Merge branch 'standalone_develop' into pre_trustie_server 2024-01-22 12:57:48 +08:00
xxq250 f98c044715 后台概览增加缓存,增加上周统计数据 2024-01-22 12:57:04 +08:00
xxq250 9ef255f3b6 接入百度统计部分数据,缓存总数据 2024-01-22 12:07:46 +08:00
xxq250 e4faee134a 接入百度统计部分数据,按天存储,refresh_access_token 2024-01-22 11:39:16 +08:00
yystopf 302e501610 Merge branch 'standalone_develop' into pre_trustie_server 2024-01-18 09:58:49 +08:00
yystopf 354242a290 修复 2024-01-18 09:58:30 +08:00
yystopf db0b47c39e Merge branch 'standalone_develop' into pre_trustie_server 2024-01-17 17:53:25 +08:00
yystopf f468f0cf67 更改:统计issue数量不应该统计pr关联的issue数量 2024-01-17 17:39:51 +08:00
yystopf 4453975b54 Merge branch 'standalone_develop' into pre_trustie_server 2024-01-17 16:38:24 +08:00
yystopf 65abdda8f9 更改:文案修改 2024-01-17 16:37:55 +08:00
yystopf 817b607a54 Merge branch 'standalone_develop' into pre_trustie_server 2024-01-17 16:28:41 +08:00
yystopf 6d2ae4dcf1 Merge branch 'pre_trustie_server' of https://gitlink.org.cn/Trustie/forgeplus into pre_trustie_server 2024-01-17 16:28:20 +08:00
KingChan 3c33ef7709 Merge pull request '拒绝实名认证需要实名理由' (#248) from KingChan/forgeplus:chenjing into standalone_develop 2024-01-17 15:36:58 +08:00
呱呱呱 afe4a66c2b update identity_verifications_controller update 2024-01-17 15:34:08 +08:00
KingChan d6229b62bf Merge pull request '修改文字' (#247) from KingChan/forgeplus:chenjing into standalone_develop 2024-01-17 15:20:12 +08:00
呱呱呱 539bf58e0d update identity_verifications/edit 2024-01-17 15:17:47 +08:00
yystopf ed81ce5927 更改:活跃度查询时间区间 2024-01-16 16:27:18 +08:00
yystopf 1c8811fda6 新增:项目疑修排行榜 2024-01-16 10:19:02 +08:00
yystopf 7d813c0ebe 新增:项目缓存加入关闭issue数量 2024-01-15 16:41:54 +08:00
xxq250 6ca883aedd Merge branch 'standalone_develop' into pre_trustie_server 2024-01-15 11:27:41 +08:00
xxq250 e2374676c3 接入百度统计部分数据,按天存储 2024-01-15 11:23:59 +08:00
xxq250 1e159ec1cf 附件表uuid增加索引 2024-01-11 14:18:53 +08:00
xxq250 bf3f25972e Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2024-01-11 14:15:29 +08:00
xxq250 6756687c07 附件表uuid增加索引 2024-01-11 14:14:56 +08:00
yystopf c89c394374 Merge branch 'develop' into standalone_develop 2024-01-11 13:40:04 +08:00
yystopf 35e6d945dd 更改:组织标识正则 2024-01-11 13:39:13 +08:00
KingChan 3ceefc33f8 Merge pull request '新增身份认证操作日志功能' (#246) from KingChan/forgeplus:chenjing into standalone_develop 2024-01-10 15:00:19 +08:00
呱呱呱 f2b732b8e7 add log for identity_verifications 2024-01-10 14:58:02 +08:00
KingChan 515bf4663d Merge pull request '新增关闭站点时必须填写理由' (#245) from KingChan/forgeplus:chenjing into standalone_develop 2024-01-10 10:23:30 +08:00
呱呱呱 1cd25c188c add page site close description rule 2024-01-10 10:19:45 +08:00
yystopf 2562329a5e Merge branch 'standalone_develop' into pre_trustie_server 2023-12-22 13:47:39 +08:00
yystopf d79213d14f 新增:issue列表column无值查询 2023-12-22 08:42:57 +08:00
KingChan 2f68da74cb Merge pull request '增加page删除后的回调' (#244) from KingChan/forgeplus:standalone_develop into standalone_develop 2023-12-21 15:10:13 +08:00
呱呱呱 5aff334054 add page destroy callback 2023-12-21 15:07:56 +08:00
KingChan 3d0fd28c2a Merge pull request '调整删除建站时的部署指令' (#243) from KingChan/forgeplus:standalone_develop into standalone_develop 2023-12-21 14:39:10 +08:00
呱呱呱 9f60518e3e update page service 2023-12-21 14:35:07 +08:00
KingChan e25f27e488 Merge pull request '调整page返回值' (#242) from KingChan/forgeplus:standalone_develop into standalone_develop 2023-12-21 14:17:44 +08:00
呱呱呱 3a0a95a18f update model page url 2023-12-21 14:13:42 +08:00
KingChan f3376594f1 Merge pull request '仓库新增web_site参数 page服务专用' (#241) from KingChan/forgeplus:chenjing into standalone_develop 2023-12-20 10:45:15 +08:00
呱呱呱 69c4d461a4 update reposit detail 2023-12-20 10:41:39 +08:00
yystopf 3fefc0d7c6 新增:删除项目须同时删除所有的统计数据 2023-12-20 09:58:03 +08:00
yystopf 93ab86e363 Merge branch 'standalone_develop' of https://gitlink.org.cn/Trustie/forgeplus into standalone_develop 2023-12-20 09:52:02 +08:00
yystopf 3f621bd5b5 更改:项目活跃度排行默认统计一周内的数据 2023-12-20 09:51:51 +08:00
yystopf ae8b86ef02 更改:后台管理模块文案 2023-12-20 09:43:57 +08:00
KingChan 1195a7a339 Merge pull request '调整建站服务功能' (#240) from KingChan/forgeplus:chenjing into standalone_develop 2023-12-20 09:38:40 +08:00
呱呱呱 d590e1165e website update 2023-12-20 09:22:10 +08:00
yystopf 6b8749589e 更改:文案为截止日期 2023-12-19 15:45:35 +08:00
yystopf 883542dfe8 Merge pull request '项目名称显示不全' (#239) from gitlink_admin_feature into standalone_develop 2023-12-19 15:39:48 +08:00
yystopf 3b5b78faed 更改:删除数据处理以及昵称获取规则处理 2023-12-19 15:36:57 +08:00
yystopf 1d48af015e Merge pull request '后台管理更新' (#238) from gitlink_admin_feature into standalone_develop 2023-12-19 15:26:05 +08:00
yystopf 26461f3a44 更改:防止sql注入 2023-12-19 15:05:00 +08:00
yystopf 21f559f254 更改:项目排行榜使用数据存储以及数据导出的功能 2023-12-19 14:57:54 +08:00
yystopf 016a2f8cf5 更改:后台管理sidebar 2023-12-18 16:04:14 +08:00
yystopf 75fff13550 更改:项目排行榜查询丰富 2023-12-18 15:49:41 +08:00
xxq250 c8217d8596 Merge branch 'standalone_develop' into pre_trustie_server 2023-12-18 13:44:15 +08:00
xxq250 761021d191 Github issues迁移,更新时间固定 2023-12-18 11:52:37 +08:00
xxq250 326dcc56ab Github issues迁移,更新时间固定 2023-12-18 11:19:20 +08:00
xxq250 3806ddaa17 Github issues迁移,标记 2023-12-18 10:59:24 +08:00
xxq250 5fe9719cc9 Github issues迁移,标记 2023-12-18 10:54:47 +08:00
xxq250 c6a38c06d0 Github issues迁移,标记 2023-12-18 10:54:04 +08:00
xxq250 eaf389ecea Github issues迁移,title 长度处理 2023-12-18 10:33:31 +08:00
xxq250 7b1d0e21ee Github issues迁移,title 长度处理 2023-12-18 10:00:01 +08:00
xxq250 9979ae6d3a Github issues迁移,title 长度处理 2023-12-18 09:49:53 +08:00
xxq250 b80ed537fc Github issues迁移,用户名处理, 限流需要请求等待,token 2023-12-15 17:04:53 +08:00
xxq250 de393148d9 Github issues迁移,用户名处理, 限流需要请求等待,token 2023-12-15 16:48:33 +08:00
xxq250 b7597c3fa7 Github issues迁移,用户名处理, 限流需要请求等待,token 2023-12-15 16:47:22 +08:00
xxq250 505d873ea6 Github issues迁移,用户名处理, 限流需要请求等待 2023-12-15 15:59:27 +08:00
xxq250 1eb18e4036 Github issues迁移,用户名处理 2023-12-15 15:47:41 +08:00
xxq250 0b21d4af41 Github issues迁移 2023-12-15 15:36:31 +08:00
xxq250 d4b46dbf97 Merge branch 'standalone_develop' into pre_trustie_server
# Conflicts:
#	app/controllers/api/v1/issues_controller.rb
#	app/models/identity_verification.rb
#	app/models/issue.rb
#	app/models/journal.rb
#	app/services/api/v1/issues/list_service.rb
2023-12-15 10:40:58 +08:00
yystopf d98ad8a3f4 Merge branch 'develop' into standalone_develop 2023-12-15 09:42:30 +08:00
yystopf ad96991730 更改:提示语逗号为中文逗号 2023-12-15 09:01:11 +08:00
xxq250 4b57e96914 fixed 用户搜索按昵称和登录时间倒排序 2023-12-14 16:49:44 +08:00
yystopf e78f7ab9dd Merge branch 'standalone_develop' of https://gitlink.org.cn/Trustie/forgeplus into standalone_develop 2023-12-14 16:45:49 +08:00
xxq250 835f2db759 Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-12-14 16:45:36 +08:00
yystopf ac601b4b22 Merge branch 'develop' into standalone_develop 2023-12-14 16:45:32 +08:00
xxq250 c972d538ee fixed 用户搜索按昵称和登录时间倒排序 2023-12-14 16:45:29 +08:00
yystopf c75953d343 新增:创建分支已存在分支提示 2023-12-14 16:45:02 +08:00
yystopf a2ca6bd91b Merge branch 'develop' into standalone_develop 2023-12-14 11:47:48 +08:00
yystopf 129970a525 更改:提示语 2023-12-14 11:47:32 +08:00
yystopf 8be254710e Merge branch 'develop' into standalone_develop 2023-12-14 11:44:18 +08:00
yystopf 062e654d45 新增:更改密码须验证两次密码 2023-12-14 11:43:42 +08:00
xxq250 095c83d2d0 Merge pull request '20231213版本' (#342) from Trustie/forgeplus:trustie_server into master 2023-12-13 15:01:17 +08:00
xxq250 b29e500645 fixed 解决安全问题访问附件,id改为uuid,id查询修改 2023-12-13 09:26:49 +08:00
xxq250 60c8b25075 fixed 解决安全问题访问附件,id改为uuid,查看附件 2023-12-12 16:57:39 +08:00
xxq250 247c5a60b1 fixed 解决安全问题访问附件,id改为uuid,关联pages功能修改 2023-12-12 16:47:48 +08:00
xxq250 de1266ba6c fixed 解决安全问题访问附件,id改为uuid,关联功能修改 2023-12-12 16:41:02 +08:00
xxq250 9a0809e45b fixed 发行版附件关联 2023-12-12 15:33:48 +08:00
xxq250 637fcca509 Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-12-12 15:21:02 +08:00
xxq250 8264717017 fixed 解决安全问题访问附件,id改为uuid,migrate 2023-12-12 15:20:52 +08:00
yystopf a423576ffc Merge branch 'develop' into standalone_develop 2023-12-12 15:03:47 +08:00
yystopf 852d430178 更改:获取标签详情特殊符号处理 2023-12-12 15:02:03 +08:00
xxq250 d74901cffa fixed 解决安全问题访问附件,id改为uuid 2023-12-12 14:31:21 +08:00
yystopf 0cb38bce4f 新增:根据id查询疑修 2023-12-11 16:07:24 +08:00
yystopf aac91538aa Merge branch 'develop' into standalone_develop 2023-12-11 09:18:00 +08:00
yystopf 9ac061f2a9 更改:gemfile 2023-12-11 09:17:43 +08:00
yystopf 60359333f8 Merge branch 'develop' into standalone_develop 2023-12-11 09:15:29 +08:00
yystopf b2250db79a 新增:查看标签详情api 2023-12-11 09:14:47 +08:00
xxq250 03277d2ad7 commit_log_to_db.rake trustie all 2023-12-09 12:23:17 +08:00
xxq250 c2a4e62131 commit_log_to_db.rake trustie all 2023-12-09 12:21:37 +08:00
xxq250 f81b3a0b35 commit_log_to_db.rake trustie 2023-12-09 09:40:03 +08:00
yystopf 98770ca47e 新增:代码溯源注册后须重新调用登录接口 2023-12-01 17:04:34 +08:00
xxq250 6fb22d3117 Merge branch 'pre_trustie_server' into trustie_server 2023-12-01 14:59:47 +08:00
xxq250 d0623e4d57 rake copy attachemnt 2023-12-01 14:59:44 +08:00
yystopf c63c0cc636 更改:issue status查询不使用where.not方式 2023-12-01 14:59:13 +08:00
xxq250 32f03abe84 合并开发分支代码 2023-12-01 14:57:01 +08:00
xxq250 24b5c4e672 合并开发分支代码 2023-12-01 14:53:48 +08:00
KingChan f9427f17a3 Merge pull request '调整默认排序' (#235) from KingChan/forgeplus:standalone_develop into standalone_develop 2023-12-01 09:54:45 +08:00
kingchan d797676639 change created on to updated_on for issue list service 2023-12-01 09:52:32 +08:00
yystopf 21640fe5e6 更改:issue status和priority初始化数据 2023-12-01 09:48:08 +08:00
KingChan ba196794a8 Merge pull request '调整 issue 的 order' (#233) from KingChan/forgeplus:standalone_develop into standalone_develop 2023-11-29 15:15:00 +08:00
呱呱呱 3833816a0a update issue order by 2023-11-29 15:11:41 +08:00
yystopf a3df60b185 Merge pull request 'url转义函数由CGI.escape改为URI.escape' (#212) from yystopf/forgeplus:standalone_develop into standalone_develop 2023-11-16 13:54:21 +08:00
yystopf 9e4e30a495 更改:url转义函数 2023-11-16 13:50:49 +08:00
xxq250 33c56e3e79 fixed 评论回复增加parent_id索引,解决性能问题 2023-11-15 08:53:30 +08:00
xxq250 ce7a0e4884 fixed 评论回复增加parent_id索引,解决性能问题 2023-11-15 08:53:04 +08:00
xxq250 27bfeb5fc8 fixed 评论回复增加parent_id索引,解决性能问题 2023-11-15 08:52:23 +08:00
xxq250 5541002dab Merge branch 'pre_trustie_server' into trustie_server 2023-11-15 08:45:17 +08:00
xxq250 228209b52c fixed 容错处理 2023-11-15 08:44:35 +08:00
yystopf 9ee2c8dde3 修复:issue子评论关联查询错误 2023-11-15 08:44:35 +08:00
xxq250 783a2e39ae Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-11-15 08:43:06 +08:00
xxq250 9e91427de0 fixed 容错处理 2023-11-15 08:43:00 +08:00
yystopf 9c02b8ba31 修复:issue子评论关联查询错误 2023-11-14 16:53:29 +08:00
xxq250 6a989f972a Merge branch 'pre_trustie_server' into trustie_server
# Conflicts:
#	app/models/issue.rb
#	app/models/journal.rb
2023-10-24 20:46:02 +08:00
xxq250 2e2f7b2bd5 fixed issue和评论里的附件解析关联,增强附件访问权限控制,切换到 项目保护 2023-10-24 20:43:19 +08:00
xxq250 cf190632a1 fixed issue评论里的附件解析关联,增强附件访问权限控制 2023-10-24 20:43:19 +08:00
xxq250 d4d96759ac fixed issue描述里的附件解析关联,增强附件访问权限控制 2023-10-24 20:43:18 +08:00
xxq250 25df7c02d5 fixed issue和评论里的附件解析关联,增强附件访问权限控制,切换到 项目保护 2023-10-24 20:41:02 +08:00
xxq250 e8b36f33ed fixed issue评论里的附件解析关联,增强附件访问权限控制 2023-10-18 15:34:16 +08:00
xxq250 467a4f0b94 fixed issue描述里的附件解析关联,增强附件访问权限控制 2023-10-18 15:34:16 +08:00
xxq250 abbb033fc7 fixed issue评论里的附件解析关联,增强附件访问权限控制 2023-10-18 15:24:39 +08:00
xxq250 99fe06c788 fixed issue描述里的附件解析关联,增强附件访问权限控制 2023-10-18 15:16:14 +08:00
xxq250 fa1a03e4db Merge branch 'pre_trustie_server' into trustie_server 2023-10-18 14:02:49 +08:00
xxq250 28b8e15fea fixed 设置非公开图片权限 2023-10-18 13:59:54 +08:00
呱呱呱 624e5b150e 设置非public图片查看权限 2023-10-18 13:57:54 +08:00
KingChan 6a057dedd0 Merge pull request '修复问题' (#164) from KingChan/forgeplus:chenjing into standalone_develop 2023-10-18 13:39:45 +08:00
呱呱呱 93dc10b6a5 fix attachment_candown 2023-10-18 13:38:09 +08:00
KingChan fffe776cd5 Merge pull request '图片查看权限调整' (#163) from KingChan/forgeplus:chenjing into standalone_develop 2023-10-18 13:36:13 +08:00
呱呱呱 2c4253b04b 设置非public图片查看权限 2023-10-18 13:27:09 +08:00
呱呱呱 526dac1230 change mp to pm 2023-10-18 13:21:41 +08:00
KingChan ce1d6707b8 Merge pull request 'issue_priorities issue_tags issue_statues 新增 mp_index' (#162) from KingChan/forgeplus:chenjing into standalone_develop 2023-10-17 11:27:20 +08:00
呱呱呱 472499e278 mp_index for issue_priorities issue_tags issue_statues 2023-10-17 11:25:25 +08:00
KingChan 2fde0da442 Merge pull request '通过仓库id拿用户标识和仓库标识' (#161) from KingChan/forgeplus:chenjing into standalone_develop 2023-10-16 10:59:21 +08:00
呱呱呱 d19c94666a 通过仓库id拿用户标识和仓库标识 2023-10-16 10:57:37 +08:00
xxq250 bf232f3518 Merge branch 'pre_trustie_server' into trustie_server 2023-10-13 14:14:46 +08:00
xxq250 50a0ecdbd2 Merge branch 'standalone_develop' into pre_trustie_server 2023-10-13 14:14:07 +08:00
KingChan a27a352dfb Merge pull request '判定用户是否在组织下' (#160) from KingChan/forgeplus:chenjing into standalone_develop 2023-10-12 11:26:57 +08:00
呱呱呱 d60ba95444 OrganizationUsers add pm_check_user 2023-10-12 11:25:23 +08:00
KingChan f5bf0c7a87 Merge pull request '检测用户是否在团队下' (#159) from KingChan/forgeplus:chenjing into standalone_develop 2023-10-12 11:14:41 +08:00
呱呱呱 19d36af37f update 2023-10-12 11:12:53 +08:00
xxq250 bb0bbeb06c fixed 文件增加是否文本判断,可显示多种文本文件 2023-10-11 17:25:24 +08:00
xxq250 1e427a62a6 Merge pull request '20231011版本' (#338) from Trustie/forgeplus:standalone_develop into develop 2023-10-11 10:15:55 +08:00
xxq250 5a28204b12 fixed 文件增加是否文本判断,可显示多种文本文件 2023-10-10 14:17:08 +08:00
KingChan 0357f963ff Merge pull request '新增admins后端删除 用户,组织,项目的日志记录' (#157) from KingChan/forgeplus:chenjing into standalone_develop 2023-10-10 13:52:07 +08:00
呱呱呱 6cb7af0401 add data_bank to user action 2023-10-10 13:49:52 +08:00
KingChan b1736e7aaa Merge pull request '修复:用#引用issue时,输入对应issue的编号无法查询到该issue' (#156) from KingChan/forgeplus:chenjing into standalone_develop 2023-10-08 09:56:34 +08:00
呱呱呱 b92fdb8388 修复输入issue编号无法查询到该issue问题 2023-10-08 09:54:26 +08:00
xxq250 3ccac9192d fixed 组织pr识别 2023-10-07 21:15:20 +08:00
xxq250 ef3472567e fixed 组织pr识别 2023-10-07 21:12:58 +08:00
xxq250 e07af929b2 Merge branch 'pre_trustie_server' into trustie_server 2023-10-07 20:08:08 +08:00
xxq250 31b07e47a9 Merge branch 'standalone_develop' into pre_trustie_server 2023-10-07 20:07:31 +08:00
KingChan b4723a0488 Merge pull request '新增Pr检测的用户范围判定' (#155) from KingChan/forgeplus:chenjing into standalone_develop 2023-10-07 17:31:14 +08:00
呱呱呱 f9f99fea7e fix bug 2023-10-07 17:29:26 +08:00
xxq250 4c354f6841 Merge branch 'pre_trustie_server' into trustie_server 2023-09-28 15:33:37 +08:00
xxq250 9cd148e108 Merge branch 'standalone_develop' into pre_trustie_server 2023-09-28 15:32:43 +08:00
KingChan cf2625b12c Merge pull request '回滚代码' (#152) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-28 09:27:31 +08:00
呱呱呱 cef99e90b3 Revert "add issue search project_issues_index"
This reverts commit b7d6be8b9f.
2023-09-28 09:25:51 +08:00
KingChan f655a7b469 Merge pull request '新增 issue project_issues_index搜索' (#151) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-27 17:01:53 +08:00
呱呱呱 b7d6be8b9f add issue search project_issues_index 2023-09-27 16:59:33 +08:00
KingChan 3cfcd1a671 Merge pull request 'top新增from' (#150) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-27 15:56:53 +08:00
呱呱呱 e1808e0689 add topic from 2023-09-27 15:53:56 +08:00
KingChan f4d6bfc210 Merge pull request 'topic data' (#149) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-27 15:12:34 +08:00
呱呱呱 5592855996 fix topic data 2023-09-27 15:11:09 +08:00
KingChan d663e6b2bc Merge pull request 'fix' (#148) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-27 14:17:34 +08:00
KingChan 0be711e6f0 Merge pull request 'getway对接' (#147) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-27 14:16:20 +08:00
呱呱呱 272b73fa0a update 2023-09-27 14:16:13 +08:00
呱呱呱 9d5c5acfbf getway lib 2023-09-27 14:12:03 +08:00
KingChan 73391911d8 Merge pull request '增加导航条index的输入限制' (#146) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-27 10:30:11 +08:00
呱呱呱 b080b8fca5 增加导航条index的输入限制 2023-09-27 10:28:33 +08:00
KingChan 915481468f Merge pull request '调整导航条排序' (#145) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-27 09:45:11 +08:00
呱呱呱 19c8587723 add setting navbar index for new 2023-09-27 09:43:35 +08:00
KingChan 206b8d25cb Merge pull request '新增设置navbar index' (#144) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-27 09:31:27 +08:00
呱呱呱 3367d748b6 add setting navbar index 2023-09-27 09:29:50 +08:00
xxq250 e6f2e9a798 Merge branch 'pre_trustie_server' into trustie_server 2023-09-26 15:01:07 +08:00
xxq250 0da32d15a9 Merge branch 'standalone_develop' into pre_trustie_server 2023-09-26 15:00:37 +08:00
KingChan 29b6c1a4d2 Merge pull request '调整glcc pj检测和setting接口新增个人建站域名返回' (#143) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-26 14:48:54 +08:00
呱呱呱 412ac22998 check_pr_url add trustie 2023-09-26 14:46:50 +08:00
呱呱呱 0e7ccdf58f setting add site_page_deploy_domain 2023-09-26 14:42:58 +08:00
KingChan 9e650c5f59 Merge pull request '调整glcc白名单逻辑' (#142) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-26 10:05:24 +08:00
呱呱呱 fab25436a0 调整glcc 白名单处理逻辑 2023-09-26 10:03:01 +08:00
xxq250 c6461de871 Merge branch 'pre_trustie_server' into trustie_server 2023-09-25 17:58:15 +08:00
xxq250 09bab2f462 Merge branch 'standalone_develop' into pre_trustie_server 2023-09-25 17:57:57 +08:00
KingChan 4d1be6134c Merge pull request '返回逻辑调整' (#141) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-25 13:02:44 +08:00
chenjing 7664e2e4d3 update response for checkkeyword 2023-09-25 13:01:13 +08:00
KingChan 35ca53c202 Merge pull request '根据前端要求调整检测敏感词接口返回内容' (#140) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-25 12:51:32 +08:00
chenjing 6bd1eef14a update check keyword response 2023-09-25 12:49:14 +08:00
KingChan eccdc572c4 Merge pull request '调整关键词判定,去掉emoj干扰' (#139) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-25 11:42:02 +08:00
chenjing 8d7c114b40 update check keywords 2023-09-25 11:40:11 +08:00
KingChan 7b3dbfd9ab Merge pull request '关键词检测接口' (#138) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-25 11:31:33 +08:00
chenjing 892aa31ea9 check keywords 2023-09-25 11:29:44 +08:00
xxq250 02b85859b5 pages 合并 2023-09-25 10:50:35 +08:00
xxq250 14462752cc Merge branch 'standalone_develop' into pre_trustie_server 2023-09-25 10:47:59 +08:00
KingChan 3235a60a34 Merge pull request '参数调整' (#137) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-01 14:17:26 +08:00
chenjing 192f48f26c update enum for oage 2023-09-01 14:15:39 +08:00
KingChan b48c65c3ff Merge pull request '修复部署bug' (#136) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-01 13:37:33 +08:00
chenjing bd441d024b update 2023-09-01 13:36:07 +08:00
KingChan 747f58d4d0 Merge pull request '调整部署逻辑,新增部署状态和部署说明' (#135) from KingChan/forgeplus:chenjing into standalone_develop 2023-09-01 13:29:31 +08:00
chenjing 477b21e633 build service change 2023-09-01 13:27:40 +08:00
xxq250 18377dc2e0 Merge branch 'pre_trustie_server' into trustie_server 2023-08-31 16:08:38 +08:00
xxq250 743c63a796 fixed 文件无权限提示修改 2023-08-31 16:07:48 +08:00
xxq250 74c42f679a fixed 册除失败提示 2023-08-31 16:07:48 +08:00
xxq250 300dffd2a1 fixed 分支删除时有开启的pr需要一同关闭,整理fix 2023-08-31 16:07:47 +08:00
xxq250 9db60413d9 fixed 分支删除时有开启的pr需要一同关闭,整理 2023-08-31 16:07:47 +08:00
xxq250 04c147d80d fixed 分支删除时有开启的pr需要一同关闭,合并请求下issue关闭 2023-08-31 16:07:46 +08:00
xxq250 1da6c582f0 fixed 分支删除时有开启的pr需要一同关闭 2023-08-31 16:07:46 +08:00
xxq250 2e15988ad6 gitea api error log show 2023-08-31 16:07:30 +08:00
xxq250 f47c4e4b9c gitea api error show 2023-08-31 16:07:29 +08:00
xxq250 1d1d6ebda1 fixed 注册时支持中划线的邮箱地址 2023-08-31 16:07:14 +08:00
xxq250 56103a885b fixed fork后重命名项目标识再forked失败 2023-08-31 16:07:14 +08:00
KingChan e177e059dc Merge pull request '调整部署域名默认值,从全局参数中获取' (#134) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-31 09:24:40 +08:00
呱呱呱 71fd9969cb 调整部署域名来源,可从全局设置进行调整 2023-08-31 09:22:41 +08:00
xxq250 cdf62b4626 fixed 分支删除时有开启的pr需要一同关闭 2023-08-30 17:42:24 +08:00
xxq250 53b66f6145 fixed 文件增加编辑删除操作无权限提示修改 2023-08-30 16:34:23 +08:00
xxq250 03ce084916 fixed 文件无权限提示修改 2023-08-30 16:09:28 +08:00
xxq250 075f525783 fixed 册除失败提示 2023-08-30 15:56:48 +08:00
xxq250 6248040f8c fixed 分支删除时有开启的pr需要一同关闭,整理fix 2023-08-30 15:43:51 +08:00
xxq250 a9f4292586 fixed 分支删除时有开启的pr需要一同关闭,整理 2023-08-30 15:39:32 +08:00
xxq250 9946b85205 fixed 分支删除时有开启的pr需要一同关闭,合并请求下issue关闭 2023-08-30 13:55:57 +08:00
xxq250 810e8b9887 fixed 分支删除时有开启的pr需要一同关闭 2023-08-30 13:51:56 +08:00
xxq250 a2fb12ffd6 404状态码测试页面xml 2023-08-30 09:23:56 +08:00
xxq250 1d20f8e5fb 404状态码测试页面 2023-08-30 09:13:05 +08:00
xxq250 092a890577 gitea api error log show 2023-08-29 14:53:44 +08:00
xxq250 46430fc0f0 Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-08-29 14:43:36 +08:00
xxq250 d3bf9f66d6 gitea api error show 2023-08-29 14:43:15 +08:00
KingChan 1b3a825c81 Merge pull request 'admins用户列表新增修改提示与二次确认' (#133) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-29 11:04:44 +08:00
呱呱呱 798488e689 用户列表新增修改提示与二次确认 2023-08-29 11:03:11 +08:00
KingChan df94f815ba Merge pull request '主题列表强制换行' (#132) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-29 10:52:32 +08:00
呱呱呱 463c87e68a 主题列表强制换行 2023-08-29 10:51:09 +08:00
KingChan e2334f9604 Merge pull request '增加建站主题管理输入限制' (#131) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-29 10:48:01 +08:00
呱呱呱 9fc5324319 增加主题管理输入限制 2023-08-29 10:46:27 +08:00
KingChan 75e3c4f121 Merge pull request '调整身份审核显示效果' (#130) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-29 10:17:10 +08:00
呱呱呱 0a5f575315 update 2023-08-29 10:15:38 +08:00
KingChan a1f7414e3e Merge pull request '调整用户获取站点排序' (#129) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-29 09:36:41 +08:00
呱呱呱 497c1d827f 调整用户获取站点排序 2023-08-29 09:35:03 +08:00
KingChan 913552a2c4 Merge pull request '修复排序' (#128) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-29 09:32:57 +08:00
呱呱呱 77d72e8e1a 主题列表调整,去掉图片限制 2023-08-29 09:31:29 +08:00
呱呱呱 06bd275b95 修复审核列表排序异常 2023-08-28 17:28:49 +08:00
KingChan a574216c18 Merge pull request '根据issue调整后端展示界面' (#127) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-28 13:54:52 +08:00
呱呱呱 d4d6751dc0 用户审核详情调整 2023-08-28 11:36:00 +08:00
呱呱呱 d22a18a8fe 调整站点详情的url展示长度 2023-08-28 10:51:18 +08:00
呱呱呱 484d769f1b 为主题配置增加字段验证 2023-08-28 10:19:20 +08:00
KingChan 23ac219a94 Merge pull request '为建站主题配置增加删除限制' (#126) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-25 11:48:33 +08:00
chenjing 94d0862868 add page theme destroy limitation 2023-08-25 11:46:30 +08:00
KingChan 5bcc963530 Merge pull request '新建站点增加限制' (#125) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 17:25:13 +08:00
呱呱呱 4f5f7639f9 add page exit for page_migrate 2023-08-24 17:21:26 +08:00
KingChan 5a69e604b9 Merge pull request '调整返回值' (#124) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 17:09:30 +08:00
呱呱呱 1d220a6f13 fix bug 2023-08-24 17:08:04 +08:00
KingChan cded93715d Merge pull request '调整返回值' (#123) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 17:04:37 +08:00
呱呱呱 eb449f9937 update 2023-08-24 17:03:22 +08:00
KingChan 0ceda653e8 Merge pull request 'page themes' (#122) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 16:05:11 +08:00
呱呱呱 31bb2502b8 themes image fix 2023-08-24 16:03:40 +08:00
KingChan 8624ae4f22 Merge pull request '移除binding.pry' (#121) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 15:07:03 +08:00
呱呱呱 3dacc83e4a fix 2023-08-24 15:05:47 +08:00
KingChan 2a0322bae9 Merge pull request '前端动态获取主题' (#120) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 15:03:42 +08:00
呱呱呱 c3a949906a update theme 2023-08-24 14:50:43 +08:00
KingChan a4d8193484 Merge pull request '新增关闭信息返回' (#119) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 11:52:07 +08:00
呱呱呱 7139ae0613 add state_description 2023-08-24 11:50:44 +08:00
KingChan 766e190b2a Merge pull request '修复图片' (#118) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 11:42:03 +08:00
呱呱呱 35062aa87d card_front_attachment fix 2023-08-24 11:40:33 +08:00
KingChan 6cb0fd44f1 Merge pull request '修复审核详情报错' (#117) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 11:37:51 +08:00
呱呱呱 e8c1933778 fix bug 2023-08-24 11:36:28 +08:00
KingChan 4220788b1f Merge pull request '修复bug' (#116) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 11:33:01 +08:00
呱呱呱 9544846c6c fix 500 for identity_verification 2023-08-24 11:22:21 +08:00
KingChan 2ed7ce3e6f Merge pull request '调整admins界面展示' (#115) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-24 11:16:19 +08:00
呱呱呱 c4222f1d65 update admins identity_verifications site_pages 2023-08-24 11:14:56 +08:00
KingChan 36b482e6ed Merge pull request 'admins 删除站点' (#114) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-23 17:26:36 +08:00
呱呱呱 890c826685 add site destroy for admin 2023-08-23 17:25:24 +08:00
KingChan 8a2d927e8d Merge pull request '新增管理员端的站点主题管理' (#113) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-23 17:17:43 +08:00
呱呱呱 beeb12c336 add page themes for admins 2023-08-23 17:16:03 +08:00
xxq250 6f01ce170e fixed 注册时支持中划线的邮箱地址 2023-08-22 13:59:02 +08:00
xxq250 235ecf6ce2 fixed fork后重命名项目标识再forked失败 2023-08-22 13:47:34 +08:00
xxq250 c9659fd926 fixed fork后重命名项目标识再forked失败 2023-08-22 12:25:15 +08:00
xxq250 b73f724bb7 fixed fork后重命名项目标识再forked失败 2023-08-22 11:45:10 +08:00
xxq250 ca85975197 fixed fork后重命名项目标识再forked失败 2023-08-22 11:42:26 +08:00
呱呱呱 9763d5c780 fix fork create bug 2023-08-22 09:46:06 +08:00
KingChan 4260fe7a71 Merge pull request '修复forkbug' (#112) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-22 09:38:12 +08:00
呱呱呱 471fbcace4 fix fork create bug 2023-08-22 09:36:12 +08:00
呱呱呱 47a00092b1 update 2023-08-21 17:30:49 +08:00
KingChan cf2f5b3e0f Merge pull request '调整page枚举' (#111) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-21 15:11:07 +08:00
呱呱呱 4790f34e0e change page language_frame enum 2023-08-21 15:09:26 +08:00
KingChan 65be43ed4a Merge pull request '调整建站主题文件' (#110) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-21 14:54:40 +08:00
呱呱呱 78ea8988de theme update 2023-08-21 14:52:58 +08:00
KingChan 52f751de78 Merge pull request '调整deploy部署key' (#109) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-21 09:52:53 +08:00
呱呱呱 1b944e4914 change page service deploy key 2023-08-21 09:50:01 +08:00
KingChan e5e2f48126 Merge pull request '调整个人建站时key获取' (#108) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-18 11:51:26 +08:00
chenjing 13768a2f3a update page service key 2023-08-18 10:50:42 +08:00
KingChan 79029fc43b Merge pull request '调整站点返回值' (#107) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-17 17:32:12 +08:00
呱呱呱 bfa5c18304 change site page response 2023-08-17 17:30:29 +08:00
呱呱呱 cc6f85939c fix site page bug 2023-08-17 16:50:49 +08:00
KingChan 7e7b8407f2 Merge pull request 'page_migrate增加返回值' (#106) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-17 14:15:18 +08:00
呱呱呱 f7e1487c10 add page_migrate response 2023-08-17 14:13:38 +08:00
KingChan 766d41f7de Merge pull request '调整获取主题的参数' (#105) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-17 11:49:02 +08:00
呱呱呱 a286d97fca change sitepage theme 2023-08-17 11:47:14 +08:00
xxq250 391059602e Merge branch 'pre_trustie_server' into trustie_server
# Conflicts:
#	app/helpers/repositories_helper.rb
2023-08-16 17:18:03 +08:00
xxq250 dd938a218e Merge pull request 'GLCC PR检测并发送邮件功能' (#104) from KingChan/forgeplus:pr_detection into pre_trustie_server 2023-08-16 17:15:39 +08:00
KingChan d708c65797 调整glcc pr 检测列表显示 2023-08-16 14:23:30 +08:00
呱呱呱 7b2db3bd93 update glcc_pr_check list view 2023-08-16 14:21:58 +08:00
KingChan 153c8aebed Merge pull request '调整Admin Pr检测显示界面' (#102) from KingChan/forgeplus:pr_detection into standalone_develop 2023-08-16 11:32:01 +08:00
呱呱呱 9a2610cfc5 update glcc_pr_check list 2023-08-16 11:30:30 +08:00
KingChan 2f35b2b5d1 Merge pull request '调整PR检测页面显示内容' (#101) from KingChan/forgeplus:pr_detection into standalone_develop 2023-08-16 11:03:14 +08:00
呱呱呱 c811ded37f update pr detection 2023-08-16 10:54:51 +08:00
xxq250 34d763005e js zip 2023-08-15 17:28:15 +08:00
xxq250 bcf085b860 fixed patch换成put方法,js 2023-08-15 17:24:41 +08:00
xxq250 e4823c2d18 fixed patch换成put方法 2023-08-15 17:17:21 +08:00
xxq250 0ea45459b8 fixed PR中合并来源显示错误,列表 2023-08-11 17:33:42 +08:00
xxq250 78b2c80bec fixed PR中合并来源显示错误,列表 2023-08-11 17:33:26 +08:00
xxq250 d1adffbd76 fixed PR中合并来源显示错误 2023-08-11 17:24:05 +08:00
xxq250 f0b7618b3d fixed PR中合并来源显示错误 2023-08-11 17:22:55 +08:00
KingChan d74cb997ab Merge pull request '修复mysql index 超长导致的问题' (#98) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-10 17:38:40 +08:00
呱呱呱 36a3a3a24c fix 2023-08-10 17:37:06 +08:00
KingChan b706bb26d2 Merge pull request 'website' (#97) from KingChan/forgeplus:chenjing into standalone_develop 2023-08-10 17:32:34 +08:00
呱呱呱 96936da9ac add site page 2023-08-10 14:29:26 +08:00
xxq250 232bef8f88 fixed readme图片解析增加多种格式 2023-08-09 16:43:35 +08:00
xxq250 7e29a5d47f fixed readme图片解析增加多种格式 2023-08-09 16:43:34 +08:00
xxq250 ba4c479cc2 fixed readme图片解析增加多种格式 2023-08-09 16:17:08 +08:00
xxq250 b01d767bcd Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-08-09 15:56:59 +08:00
xxq250 e4b5479d51 fixed readme图片解析增加多种格式 2023-08-09 15:56:12 +08:00
KingChan 26094679e4 Merge pull request '调整PR检测列表的展示' (#96) from KingChan/forgeplus:pr_detection into standalone_develop 2023-08-09 14:41:45 +08:00
呱呱呱 2784405847 新增课题ID显示 2023-08-09 14:40:22 +08:00
KingChan 1765f7b842 Merge pull request 'GLCC PR检测增加白名单' (#95) from KingChan/forgeplus:pr_detection into standalone_develop 2023-08-09 14:32:46 +08:00
呱呱呱 6c44ecae2d white list for glcc pr check 2023-08-09 14:30:23 +08:00
KingChan 5039f2a9d1 Merge pull request 'GLCC考核检测,发送邮件' (#93) from KingChan/forgeplus:pr_detection into standalone_develop 2023-08-08 16:35:00 +08:00
呱呱呱 e3b3dacde7 pr check and send email 2023-08-08 16:27:54 +08:00
xxq250 174a2d47dc fixed @compare_result null done 2023-08-07 15:20:33 +08:00
xxq250 eb860f742a fixed @compare_result null done 2023-08-07 15:20:07 +08:00
xxq250 5fb8c7739f readme中变量路径修正,放行符处理 2023-07-28 18:00:31 +08:00
xxq250 9f23400d2a readme中变量路径修正,放行符处理 2023-07-28 17:56:40 +08:00
xxq250 3527e89866 readme中变量路径修正,放行符处理 2023-07-28 17:54:14 +08:00
xxq250 9a5a4e8d66 readme中变量路径修正 2023-07-27 18:33:29 +08:00
xxq250 61c4e149de readme中变量路径修正 2023-07-27 18:26:17 +08:00
xxq250 92f0ed71a1 readme中变量图片相对路径 2023-07-27 18:10:33 +08:00
xxq250 69c8403758 readme中变量图片相对路径 log error 2023-07-27 18:01:09 +08:00
xxq250 06613493a3 readme中变量图片相对路径 log error 2023-07-27 17:59:43 +08:00
xxq250 9e0404b24e readme中变量图片相对路径 log error 2023-07-27 17:55:54 +08:00
xxq250 8197e30069 readme中变量图片相对路径 log error 2023-07-27 17:52:56 +08:00
xxq250 d9cc7f43b5 readme中变量图片相对路径 log error 2023-07-27 17:50:25 +08:00
xxq250 9da15029b0 readme中变量图片相对路径 log 2023-07-27 17:48:22 +08:00
xxq250 b4029b9aa4 readme中变量图片相对路径 log 2023-07-27 17:46:23 +08:00
xxq250 64bca88d35 readme中变量图片相对路径 log 2023-07-27 17:46:04 +08:00
xxq250 b0e10207a4 readme中变量图片相对路径 2023-07-27 17:36:25 +08:00
xxq250 efe1425157 readme中变量图片相对路径 2023-07-27 17:29:18 +08:00
xxq250 1189388431 readme中变量图片相对路径 2023-07-27 17:23:35 +08:00
xxq250 e00da21545 readme中变量图片相对路径 2023-07-27 17:23:11 +08:00
xxq250 a29b4546e4 readme中变量图片相对路径 2023-07-27 17:22:20 +08:00
xxq250 28942c7863 readme中变量图片相对路径 2023-07-27 16:53:18 +08:00
xxq250 9428b5aebb SyncRepoUpdateTimeJob stop 2023-07-27 15:38:45 +08:00
xxq250 001f505555 Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-07-27 15:23:16 +08:00
xxq250 85fe03e40f SyncRepoUpdateTimeJob stop 2023-07-27 15:23:06 +08:00
KingChan 2dbe80fb29 Merge pull request '回滚代码,回滚为正式服fork功能代码' (#92) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-24 09:32:03 +08:00
呱呱呱 7eb9f0ce2e 重置回正式服fork功能 2023-07-24 09:29:29 +08:00
KingChan 3741445d2b Merge pull request '调整错误信息' (#91) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-20 17:26:43 +08:00
呱呱呱 4713f526d0 update fork org message 2023-07-20 17:25:28 +08:00
KingChan c58b821b9f Merge pull request '调整fork判定写法' (#90) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-20 17:24:10 +08:00
呱呱呱 012077923c update fork 2023-07-20 17:22:18 +08:00
KingChan 62781412dd Merge pull request '新增判定 用户是否已经fork过一次' (#89) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-20 17:05:17 +08:00
呱呱呱 c98e3c9d74 update fork 2023-07-20 17:03:40 +08:00
KingChan d871c45fca Merge pull request '根据需求返回fork list 中的user mail' (#88) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-19 16:49:53 +08:00
呱呱呱 39825e9e02 response forks list user mail 2023-07-19 16:48:29 +08:00
KingChan a33f2f93c5 Merge pull request '根据前端需求调整fork返回值' (#87) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-19 15:21:50 +08:00
呱呱呱 ab3cf745e8 change response code 2023-07-19 15:20:26 +08:00
xxq250 72f88c8c13 Update deploy.md 2023-07-18 15:52:54 +08:00
xxq250 349c775404 fixed 更新时判断是否有昵称 2023-07-17 23:05:26 +08:00
xxq250 a136a0468e fixed 更新时判断是否有昵称 2023-07-17 22:24:21 +08:00
xxq250 dd914595fa 用户支持手机号搜索 2023-07-17 21:47:20 +08:00
xxq250 d0178a4a6c 用户支持手机号搜索 2023-07-17 21:46:26 +08:00
xxq250 0ffb5f892d api限流 2023-07-17 09:34:43 +08:00
xxq250 3ac9c0b5d8 merge develop 2023-07-14 14:07:48 +08:00
xxq250 0f5b0b6b48 Merge branch 'standalone_develop' into pre_trustie_server 2023-07-14 14:04:49 +08:00
KingChan b838921f74 Merge pull request '修改pull接口 新增merge_project_identifier参数接收' (#86) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-14 10:54:26 +08:00
chenjing 5490dd8ee4 Merge branch 'chenjing' of https://gitlink.org.cn/KingChan/forgeplus into chenjing 2023-07-14 10:51:29 +08:00
chenjing 97861afef9 change compare_head_base 2023-07-14 10:50:51 +08:00
KingChan 31e9c406c3 Merge pull request '修改提示语' (#85) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-13 11:13:36 +08:00
呱呱呱 101534d8fd change text 2023-07-13 11:11:13 +08:00
KingChan f109332288 Merge pull request '修复bug' (#84) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-13 11:03:26 +08:00
呱呱呱 5d31401d7e fix 2023-07-13 11:02:23 +08:00
KingChan d62bbe5943 Merge pull request '修复bug' (#83) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-13 11:00:02 +08:00
呱呱呱 8b1857a3d8 fix fork error when exit repo and fix emoj for nickname bug 2023-07-13 10:57:20 +08:00
xxq250 b4f2d0a9a8 Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-07-12 16:29:19 +08:00
xxq250 53135857fe Get gitea tokens sudo 2023-07-12 16:29:02 +08:00
KingChan 15c584625a Merge pull request '用户修改昵称纳入关键词保留' (#82) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-12 15:57:28 +08:00
呱呱呱 80321c6ca2 add nickname with reversed_keywords 2023-07-12 15:55:56 +08:00
xxq250 5f3f9afbce Get gitea tokens 2023-07-12 15:22:53 +08:00
xxq250 0f45f31db0 Get gitea tokens 2023-07-12 15:22:32 +08:00
xxq250 86a583017b fixed diff接口切换到hat 2023-07-11 17:06:04 +08:00
xxq250 3bd4187b0e fixed diff接口切换到hat 2023-07-11 17:00:57 +08:00
xxq250 46456d956a fixed 调用区块链接口 2023-07-11 15:30:01 +08:00
xxq250 f15bc3a3bf fixed log跟踪 2023-07-11 15:16:46 +08:00
xxq250 466705bd0f fixed 项目detail 2023-07-10 14:02:08 +08:00
xxq250 b1e55baf36 fixed 项目detail 2023-07-10 14:01:40 +08:00
xxq250 a40c5a7619 贡献者数量调整 2023-07-07 17:14:25 +08:00
xxq250 d1fc1c21f1 贡献者数量调整 2023-07-07 17:13:43 +08:00
xxq250 3740ae3108 项目贡献排行分页参数3年内 2023-07-07 14:23:32 +08:00
xxq250 fc4520c06f 项目贡献排行分页参数3年内 2023-07-07 10:32:55 +08:00
xxq250 909488b072 项目贡献排行分页参数3年内 2023-07-07 10:31:35 +08:00
xxq250 3a2b476dd0 项目贡献排行分页参数 2023-07-07 10:05:07 +08:00
xxq250 17934e55e5 项目贡献排行分页参数 2023-07-07 10:04:48 +08:00
xxq250 205e93dd1a Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-07-06 16:08:01 +08:00
xxq250 b7ab513efd 更新文件失败处理 2023-07-06 16:06:19 +08:00
xxq250 bbacebc1c9 更新文件失败处理 2023-07-06 16:04:28 +08:00
xxq250 c344859063 更新文件日志 2023-07-06 15:37:37 +08:00
xxq250 c85a15b794 更新文件日志 2023-07-06 15:26:23 +08:00
KingChan bdbbdecd70 Merge pull request '新增fork功能' (#81) from KingChan/forgeplus:chenjing into standalone_develop 2023-07-04 16:48:47 +08:00
chenjing 1533e5e737 add fork to orgs 2023-07-04 16:45:06 +08:00
xxq250 1b68e7c9d5 fixed: user rank project owner changed remove rank 2023-07-04 16:08:40 +08:00
xxq250 bcab75e5d1 fixed: user rank project owner changed remove rank 2023-07-04 16:07:19 +08:00
xxq250 2b03ccc67c Merge branch 'pre_trustie_server' into trustie_server 2023-06-30 17:11:56 +08:00
xxq250 f18f71db9c Merge branch 'standalone_develop' into pre_trustie_server 2023-06-30 17:10:32 +08:00
xxq250 3f63181b4f readme GBK编码问题 执行顺序调整 2023-06-30 17:01:11 +08:00
xxq250 2f411e3421 readme GBK编码问题 执行顺序调整 2023-06-30 16:58:35 +08:00
xxq250 8dc1c7f48c readme GBK编码问题 log 2023-06-30 16:34:06 +08:00
xxq250 0b10f1bcee readme GBK编码问题 log 2023-06-30 16:24:32 +08:00
xxq250 daf498d6b5 readme GBK编码问题 2023-06-30 14:46:36 +08:00
xxq250 1a0de3752e readme GBK编码问题 2023-06-30 14:40:38 +08:00
xxq250 956531e8f1 readme GBK编码问题 2023-06-30 14:12:25 +08:00
xxq250 aff64187c0 readme GBK编码问题 2023-06-30 14:10:31 +08:00
xxq250 de095953cc readme GBK编码问题 2023-06-30 14:07:10 +08:00
xxq250 7e66c13497 readme GBK编码问题 2023-06-30 11:45:03 +08:00
xxq250 be9185543b 下载文件链接encode 2023-06-28 11:35:29 +08:00
xxq250 cf46deb21a 下载文件链接encode 2023-06-28 11:30:52 +08:00
xxq250 7673a13d3a Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-06-28 11:15:08 +08:00
xxq250 64e85397f3 下载文件链接encode 2023-06-28 11:14:58 +08:00
KingChan d29052a8dd Merge pull request '修改feedback list 展示效果' (#80) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-27 11:56:10 +08:00
chenjing 53906590f7 change admins feedback list 2023-06-27 11:54:37 +08:00
chenjing 921c285d0f fix bug 2023-06-26 11:15:44 +08:00
chenjing bc7008d8a4 fix bug 2023-06-26 11:15:06 +08:00
KingChan ff53e15b31 Merge pull request '修复project为User时 CLA关系不存在时导致的问题' (#79) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-26 11:01:04 +08:00
chenjing 58abe47051 fix bug 2023-06-26 10:58:51 +08:00
KingChan c2d0f040e5 Merge pull request '管理员 org界面新增对CLA的筛选' (#78) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-26 09:31:18 +08:00
chenjing bd3a0d1cab admins org index search enabling_cla 2023-06-26 09:29:53 +08:00
xxq250 61b0d4d302 Merge branch 'pre_trustie_server' into trustie_server 2023-06-21 16:33:51 +08:00
xxq250 f9a02c3bd6 后台js打包 2023-06-21 16:32:58 +08:00
xxq250 f094c3a84c Merge branch 'pre_trustie_server' into trustie_server 2023-06-21 16:19:54 +08:00
KingChan d38707f317 Merge pull request '调整返回的验证token信息' (#77) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-20 15:51:12 +08:00
chenjing 1b09c93b5e change verify token response 2023-06-20 15:50:11 +08:00
KingChan 2dec7be029 Merge pull request 'CLA功能调整,增加token验证' (#76) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-20 15:30:25 +08:00
chenjing 65816a980b cla fix and add token verify 2023-06-20 15:27:03 +08:00
KingChan d35bbcf6fb Merge pull request 'user_clas show' (#75) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-19 16:44:27 +08:00
chenjing 99f2c5b996 add user cla show 2023-06-19 16:43:06 +08:00
xxq250 6c1aa9bb31 Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-06-19 15:46:27 +08:00
xxq250 c0f0b90347 fixed job中issue不存在处理 2023-06-19 15:46:19 +08:00
xxq250 3b896fca3d fixed job中issue不存在处理 2023-06-19 15:45:14 +08:00
xxq250 0faf192b45 fixed job中issue不存在处理 2023-06-19 15:41:28 +08:00
xxq250 076120de8d fixed job中issue不存在 2023-06-19 15:39:45 +08:00
KingChan 88eb382a2b Merge pull request '修复admins org详情,去除无法查看私有空间cla' (#74) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-19 15:26:55 +08:00
chenjing 65eaafe003 fix admins org and show private org's cla 2023-06-19 15:25:38 +08:00
KingChan 897c21e682 Merge pull request '修复签署协议失败问题' (#73) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-19 15:11:31 +08:00
chenjing 325f345381 fix 2023-06-19 15:10:16 +08:00
KingChan eebbc348f4 Merge pull request '修复admin删除组织报错问题' (#72) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-19 11:30:38 +08:00
chenjing 86a616fc2f fix org delete error 2023-06-19 11:14:45 +08:00
KingChan 2df283e202 Merge pull request '修复问题' (#71) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-19 10:45:59 +08:00
chenjing 7a9be10194 fix bug 2023-06-19 10:44:58 +08:00
KingChan de87bd8d75 Merge pull request '更新SendJournalService notes' (#70) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-16 17:11:10 +08:00
chenjing 633a6ba585 update JournalService notes 2023-06-16 17:09:55 +08:00
KingChan 9844ffa0cb Merge pull request '修复PR index cla 问题' (#69) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-16 16:29:01 +08:00
chenjing 4077de7360 fix cla error for pr 2023-06-16 16:27:07 +08:00
KingChan b6a47350ee Merge pull request 'PR 新增 签署CLA 状态, 用户签署后自动更新PR状态' (#68) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-16 11:59:54 +08:00
chenjing 1727435aa6 add pull request state 2023-06-16 11:58:31 +08:00
KingChan 962c2bb04d Merge pull request '更換USER CLA刪除查詢逻辑' (#67) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-16 11:02:42 +08:00
chenjing a04e0508d6 update 2023-06-16 11:01:27 +08:00
KingChan a4fa95f352 Merge pull request 'org CLA show 新增email' (#66) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-16 10:36:17 +08:00
chenjing fed604989f cla show add response 2023-06-16 10:35:10 +08:00
KingChan 3eb59b0281 Merge pull request '组织开启cla时,其他人提交PR时增加一条消息' (#65) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-16 10:21:44 +08:00
xxqfamous d407b3c674 禁止pr访问标识 2023-06-16 10:20:37 +08:00
chenjing fb4a44a6fa cla pr and destroy user_cla 2023-06-16 10:20:06 +08:00
chenjing 74dcdebe5e add user_cla response 2023-06-16 10:19:38 +08:00
chenjing d5807c0df0 cla send issue journal 2023-06-16 10:19:38 +08:00
xxq250 63cc2528cd Update README.md 2023-06-15 14:47:00 +08:00
xxq250 e3df5a0f64 Update README.md 2023-06-15 14:45:32 +08:00
xxq250 6be6dd1bf1 fixed readme中图片链接问号处理2 2023-06-15 14:43:13 +08:00
xxq250 328c5c3561 fixed readme中图片链接问号处理2 2023-06-15 14:43:01 +08:00
xxq250 d0baa9073d fixed readme中图片链接问号处理 2023-06-15 14:38:31 +08:00
xxq250 fca25ff482 fixed readme中图片链接问号处理 2023-06-15 14:37:58 +08:00
xxq250 f28d835e58 Update README.md 2023-06-15 14:35:34 +08:00
xxq250 f4a7903613 fixed readme中图片链接问号处理 2023-06-15 14:31:00 +08:00
xxq250 fafae74dec Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-06-15 14:30:34 +08:00
xxq250 cc4452e4ad fixed readme中图片链接问号处理 2023-06-15 14:30:27 +08:00
KingChan 8ef2839e9c Merge pull request '调整CLA返回' (#64) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-15 14:02:41 +08:00
chenjing fccf36e1eb update response for cla 2023-06-15 14:01:36 +08:00
xxq250 a74b6a1ca4 Update README.md 2023-06-15 13:58:23 +08:00
xxq250 6e42b84040 图片链接 2023-06-15 13:54:49 +08:00
KingChan cc504e3c54 Merge pull request 'cla 取消针对org id的获取' (#63) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-14 16:56:04 +08:00
chenjing 6b772ea889 fix cla 2023-06-14 16:53:24 +08:00
KingChan 6270cfb18d Merge pull request 'CLA增加返回count数据' (#62) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-14 14:22:04 +08:00
chenjing b938025e5b cla add count 2023-06-14 14:20:58 +08:00
KingChan af1e2ae003 Merge pull request 'CLA 组织id问题修复' (#61) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-14 12:00:12 +08:00
chenjing 78a1d48a3e fix bug 2023-06-14 11:58:51 +08:00
KingChan 37d1db6c82 Merge pull request '修复因CLA为空时列表错误' (#60) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-14 11:23:24 +08:00
chenjing 0d00fd1744 fix when cla nil index error 2023-06-14 11:22:13 +08:00
KingChan 43c2879f65 Merge pull request '修改CLA验证条件' (#59) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-14 10:47:47 +08:00
chenjing 04b3351962 change validate for create cla 2023-06-14 10:46:48 +08:00
KingChan ead3bfdffd Merge pull request '更新CLA admin操作流程,增加提示,调整字段' (#58) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-13 17:17:33 +08:00
chenjing bde9220641 change cla 2023-06-13 17:16:30 +08:00
KingChan 1a0d2fa3e2 Merge pull request 'cla index过长修复' (#57) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-13 16:10:28 +08:00
chenjing 0a483cf762 change migration index length 2023-06-13 16:09:35 +08:00
KingChan 606d6ab621 Merge pull request 'CLA 创建系列' (#56) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-13 15:39:15 +08:00
chenjing cfaa5301ea cla init 2023-06-13 15:30:16 +08:00
xxq250 a46de1b658 fixed 发送通知报错 2023-06-12 18:10:15 +08:00
xxq250 b4a5f685be fixed 发送通知报错 2023-06-12 17:49:32 +08:00
xxq250 89c64e276e site css 2023-06-09 17:45:54 +08:00
xxq250 46252c2feb site css 2023-06-09 15:54:08 +08:00
xxq250 eb8266db90 site css 2023-06-09 15:52:04 +08:00
xxq250 31923c9086 competition 配置 2023-06-09 15:49:26 +08:00
xxq250 5135f60e50 merge pre 2023-06-09 15:38:41 +08:00
xxq250 66004f3457 gitea-hat-client log 2023-06-09 09:39:07 +08:00
xxq250 caa5ad5ac4 fixed 新建项目初始化项目标签,语言获取必需延时 2023-06-08 18:01:44 +08:00
xxq250 8be1373bf9 fixed 属性判断 2023-06-08 17:54:32 +08:00
xxqfamous 7bebe42c49 fixed 属性判断 2023-06-08 17:28:09 +08:00
xxqfamous 635ca7ca4b fixed 新建项目初始化项目标签,语言获取必需延时 2023-06-08 17:18:48 +08:00
xxqfamous 52cefc5a51 fixed 新建项目初始化项目标签不延时日志 2023-06-08 17:16:01 +08:00
xxqfamous cf4b5e9ab8 fixed 新建项目初始化项目标签不延时 2023-06-08 17:08:58 +08:00
xxqfamous c7b61775c2 fixed 新建项目初始化项目标签 2023-06-08 17:05:48 +08:00
xxqfamous 289e024253 fixed 新建项目初始化项目标签 2023-06-08 16:49:35 +08:00
xxqfamous 68be385af0 fixed 组织多角色判断错误 2023-06-08 16:07:01 +08:00
xxqfamous 74de1cf78f fixed 组织多角色判断错误 2023-06-08 15:55:56 +08:00
xxqfamous 18a4833759 接口请求限流 2023-06-08 14:00:06 +08:00
xxqfamous 9f40886c45 接口请求限流 2023-06-08 13:58:07 +08:00
xxqfamous f1ab52da5c 接口请求限流 2023-06-08 11:25:03 +08:00
xxqfamous 6f33016a78 迁移异常处理 2023-06-07 16:31:08 +08:00
xxqfamous 4591ef2df3 用户动态仅显示公开项目中的动态 2023-06-07 14:55:17 +08:00
xxqfamous b8807d6009 用户动态仅显示公开项目中的动态 2023-06-07 14:52:03 +08:00
xxqfamous 471de1dc07 取消完善资料 2023-06-07 14:32:29 +08:00
xxqfamous 63824eaa8b 优化注册 2023-06-07 14:26:19 +08:00
xxqfamous 80f9e1065d 注册error 2023-06-07 14:16:22 +08:00
xxqfamous d87a2fcd7e 支持用户fork自己的仓库 2023-06-07 13:56:32 +08:00
xxqfamous a6fa3f9354 禁止pr访问标识 2023-06-07 11:45:50 +08:00
xxqfamous aad2db5c5b 禁止pr访问标识 2023-06-07 11:03:49 +08:00
xxqfamous 8f51955bd7 支持用户fork自己的仓库 2023-06-07 10:54:36 +08:00
xxqfamous b114ee9701 fixed 最后提交增加参数stat加整 2023-06-06 17:55:04 +08:00
xxqfamous 14da90d601 fixed 最后提交增加参数stat加整 2023-06-06 17:54:35 +08:00
xxqfamous 73d91440d9 Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop 2023-06-06 17:11:13 +08:00
xxqfamous dc6b92c774 导航个人主页去掉固定显示 2023-06-06 17:11:08 +08:00
KingChan 554bbe7c7b Merge pull request 'github导入项目功能' (#55) from KingChan/forgeplus:chenjing into standalone_develop 2023-06-06 10:36:30 +08:00
chenjing e90c79486a add github token for mirror 2023-06-06 10:18:32 +08:00
xxqfamous d6aa23b484 fixed 注册错误记录日志 2023-06-05 16:21:05 +08:00
xxqfamous 1b93da7f67 Merge branch 'standalone_develop' into trustie_server 2023-06-05 16:05:28 +08:00
xxqfamous a2ebf3dbd6 fixed 复杂文件名称处理 2023-06-05 16:05:01 +08:00
xxqfamous cddb204d28 Merge branch 'pre_trustie_server' into trustie_server 2023-06-05 15:01:36 +08:00
xxqfamous da299195a0 fixed 注册error message 2023-06-05 14:59:59 +08:00
xxqfamous f7162abe0d fixed 注册error message 2023-06-05 14:47:14 +08:00
xxqfamous 6d8956e803 复杂文件名称处理 2023-06-05 14:29:14 +08:00
xxqfamous 677f9c2f4e user list返回脱敏手机号 2023-06-01 18:33:29 +08:00
xxqfamous da7e0a4143 Merge branch 'pre_trustie_server' into trustie_server 2023-05-30 18:34:00 +08:00
xxqfamous f19dfc9d08 PR数据访问权限控制 2023-05-30 17:59:40 +08:00
xxqfamous 3456ddf526 PR数据访问权限控制 2023-05-30 15:10:02 +08:00
xxqfamous f5c3fe2b8d PR数据访问权限控制 2023-05-30 14:47:46 +08:00
xxqfamous 712fe34c12 PR数据访问权限控制 2023-05-30 14:46:15 +08:00
xxqfamous b6448d127d fixed 修改用户参数校验错误 2023-05-30 14:05:11 +08:00
xxqfamous 7116f38061 fixed 修改用户参数错误 log 2023-05-30 14:00:36 +08:00
xxqfamous a7968ed95c fixed 修改用户参数错误 log 2023-05-30 13:55:48 +08:00
xxqfamous 2998fce62e fixed 修改用户参数错误 log 2023-05-30 13:51:29 +08:00
xxqfamous b45e9fb224 fixed 修改用户参数错误 log 2023-05-30 12:40:30 +08:00
xxqfamous fa57d3a9ba fixed 修改用户参数错误 log 2023-05-30 12:38:36 +08:00
xxqfamous 9c9c376224 fixed 修改用户参数错误 log 2023-05-30 12:36:43 +08:00
xxqfamous cc6228bcfe fixed 修改用户参数错误 2023-05-30 12:34:49 +08:00
xxqfamous 818781f6e0 fixed 修改用户参数错误 2023-05-30 12:34:09 +08:00
xxqfamous dbdd2f8968 fixed 修改用户参数错误 2023-05-30 12:32:41 +08:00
xxqfamous ba134ad0fa fixed 修改用户 log 2023-05-30 12:27:16 +08:00
xxqfamous 1327fcb4f4 fixed 修改用户 log 2023-05-30 12:25:34 +08:00
xxqfamous 166952560e fixed 修改用户 log 2023-05-30 11:43:59 +08:00
xxqfamous 7fdd39291b fixed 修改用户 2023-05-30 11:41:36 +08:00
xxqfamous d78408d799 Merge branch 'pre_trustie_server' into trustie_server 2023-05-30 11:38:33 +08:00
xxqfamous 5fa1709664 fixed 修改用户 2023-05-30 11:38:00 +08:00
xxqfamous f289b8046f 竞赛用户关联优化 2023-05-30 11:16:54 +08:00
xxqfamous c8a02bf7b0 Merge branch 'develop' into standalone_develop 2023-05-30 11:13:09 +08:00
xxqfamous 09e674f0c1 竞赛用户关联优化 2023-05-30 11:12:21 +08:00
xxqfamous 41a9773c90 注册失败日志 2023-05-29 15:15:52 +08:00
xxqfamous d14fca3792 fixed 项目查询增加id参数 2023-05-24 14:35:26 +08:00
xxqfamous 206b71cf72 fixed 项目查询增加id参数 2023-05-24 14:33:50 +08:00
xxqfamous 9449bd6eb9 fixed 补偿users.gitea_uid不存在的用户,error message 2023-05-22 14:20:47 +08:00
xxqfamous 9f4d9aa5db fixed 补偿users.gitea_uid不存在的用户,error message 2023-05-22 14:17:24 +08:00
xxqfamous a336e91dd8 fixed 补偿users.gitea_uid不存在的用户 2023-05-22 14:02:42 +08:00
xxqfamous 65a00efd32 fixed 补偿users.gitea_uid不存在的用户 2023-05-22 14:01:14 +08:00
xxqfamous 9859c30f9d fixed 补偿users.gitea_uid不存在的用户 2023-05-22 11:35:26 +08:00
xxqfamous 9232f3ca9b fixed 补偿users.gitea_uid不存在的用户 2023-05-22 11:33:00 +08:00
xxqfamous c56d3dfd83 fixed 补偿users.gitea_uid不存在的用户 2023-05-22 11:27:29 +08:00
xxqfamous 24ac425c21 fixed 修改user login唯一索引 2023-05-22 11:22:12 +08:00
xxqfamous 41465a456e fixed 修改user login唯一索引 2023-05-22 11:21:46 +08:00
xxqfamous 2c0c6a1a77 fixed 清除user未使用关联表 2023-05-22 10:32:01 +08:00
xxqfamous ef88c31b96 fixed 修改user login唯一索引 2023-05-22 10:31:53 +08:00
xxqfamous eb7e658a7d fixed 修改user login唯一索引 2023-05-22 10:31:53 +08:00
xxqfamous e16452ac90 fixed 修改user login唯一索引 2023-05-20 12:28:35 +08:00
xxqfamous 8cc565ca0c fixed 修改user login唯一索引 2023-05-20 12:27:34 +08:00
xxqfamous 1b2a4e0b94 fixed 清除user未使用关联表 2023-05-20 11:35:20 +08:00
xxqfamous 99f7fe6102 Merge branch 'pre_trustie_server' into trustie_server 2023-05-19 15:01:10 +08:00
xxq250 8fbf1b4a35 fixed 贡献者匹配用户email,名称区分 2023-05-18 14:26:38 +08:00
xxq250 09b1007800 fixed 贡献者匹配用户email 2023-05-18 14:22:53 +08:00
xxq250 2aeaee8479 fixed 项目名称,标识,所有者变化时重置缓存 2023-05-18 10:21:32 +08:00
xxq250 681a485192 fixed 审批utf8mb4 2023-05-18 09:50:56 +08:00
xxq250 ee62c394fc fixed 审批utf8mb4 2023-05-18 09:32:36 +08:00
xxq250 bea6442a1c fixed 提交者匹配用户email 2023-05-18 09:19:45 +08:00
xxq250 6b68de130c fixed 提交者匹配用户email 2023-05-18 09:17:27 +08:00
xxq250 58354dc944 Merge branch 'pre_trustie_server' into trustie_server 2023-05-12 17:06:36 +08:00
KingChan 77c4a44041 Merge pull request '根据前端需求调整issue index to name返回值' (#54) from KingChan/forgeplus:chenjing into standalone_develop 2023-05-11 16:19:49 +08:00
chenjing afe87a2ff1 change response for index to name for issue 2023-05-11 16:18:43 +08:00
KingChan f44b503eec Merge pull request '调整 index_to_name response' (#53) from KingChan/forgeplus:chenjing into standalone_develop 2023-05-11 09:39:38 +08:00
chenjing 23e8bea507 update issue index_to_name response data 2023-05-11 09:38:07 +08:00
KingChan 0dc810e72d Merge pull request '新增issue index获取name接口' (#52) from KingChan/forgeplus:chenjing into standalone_develop 2023-05-11 09:01:33 +08:00
chenjing 3d0cd96e32 issue index to name 2023-05-11 09:00:09 +08:00
xxq250 d1c8f1aead 整理gitea docker配置文件 2023-05-10 18:38:35 +08:00
xxq250 bf1ffadf41 整理docker配置文件 2023-05-10 17:41:15 +08:00
xxq250 f07ae49246 整理配置文件 2023-05-10 17:31:57 +08:00
xxq250 69f8b43186 Merge branch 'master' of https://gitlink.org.cn/Gitlink/forgeplus into standalone_develop 2023-05-10 16:15:51 +08:00
xxq250 b3f713e050 整理配置文件 2023-05-10 16:12:04 +08:00
xxq250 5eee13ea87 Merge pull request '20230220版本' (#332) from master into develop 2023-05-10 14:48:41 +08:00
394 changed files with 6620 additions and 141140 deletions

5
.gitignore vendored
View File

@ -10,7 +10,7 @@
# Ignore lock config file
*.log
.env
# mac
*.DS_Store
.bashrc
@ -84,4 +84,5 @@ redis_data/
dump.rdb
.tags*
ceshi_user.xlsx
public/trace_task_results
public/trace_task_results
public/项目活跃度排行.xls

View File

@ -41,11 +41,19 @@ RUN /bin/bash -l -c 'gem install puma -v 5.6.5'
RUN rm -rf Gemfile.lock
RUN cp config/configuration.yml.example config/configuration.yml
RUN cp config/database.yml.example config/database.yml
RUN cp config/database-docker.yml.example config/database.yml
RUN touch config/redis.yml
RUN touch config/elasticsearch.yml
RUN /bin/bash -l -c 'bundle install'
#EXPOSE 4000
#RUN /bin/bash -l -c 'RAILS_ENV=production puma'
RUN redis-server &
RUN /bin/bash -l -c 'bundle exec rake sync_table_structure:import_csv'
RUN /bin/bash -l -c 'rails db:migrate RAILS_ENV=development'
RUN /bin/bash -l -c 'bundle exec sidekiq -C config/sidekiq.yml -e production -d'
EXPOSE 4000
RUN /bin/bash -l -c 'RAILS_ENV=production puma -C config/puma.rb'

View File

@ -141,4 +141,4 @@ gem 'doorkeeper'
gem 'doorkeeper-jwt'
gem 'gitea-client', '~> 1.4.2'
gem 'gitea-client', '~> 1.4.6'

View File

@ -245,13 +245,12 @@ GEM
powerpack (0.1.2)
prettier (0.18.2)
public_suffix (4.0.3)
puma (3.12.2)
puma (5.6.5)
nio4r (~> 2.0)
raabro (1.4.0)
rack (2.0.9)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-mini-profiler (2.0.1)
rack (>= 1.2.0)
rack-protection (2.0.8.1)
rack
rack-test (1.1.0)
@ -514,9 +513,8 @@ DEPENDENCIES
parallel (~> 1.19, >= 1.19.1)
pdfkit
prettier
puma (~> 3.11)
puma (~> 5.6.5)
rack-cors
rack-mini-profiler
rails (~> 5.2.0)
rails-i18n (~> 5.1)
ransack
@ -538,7 +536,7 @@ DEPENDENCIES
sidekiq-cron (= 1.2.0)
sidekiq-failures
simple_form
simple_xlsx_reader
simple_xlsx_reader (~> 1.0.4)
sinatra
solargraph (~> 0.38.0)
spreadsheet

View File

@ -3,7 +3,8 @@
GitLink确实开源是中国计算机学会CCF官方指定的开源创新服务平台旨在以“为开源创新服务”为使命以“成为开源创新的汇聚地”为愿景秉承“创新、开放、协作、共享”的价值观致力于为大规模开源开放协同创新助力赋能打造创新成果孵化和新工科人才培养的开源创新生态
<center>
<img src="https://code.gitlink.org.cn/young/forgeplus/raw/branch/master/docs/figs/gitlink.png?raw=true" width=80% /></center>
<img src="docs/figs/gitlink.png" width=80% /></center>
## 特色功能
@ -174,31 +175,31 @@ http://localhost:3000/
- 项目列表
<center>
<img src="https://code.gitlink.org.cn/young/forgeplus/raw/branch/master/docs/figs/project_list.png?raw=true" width=50% />
<img src="docs/figs/project_list.png" width=80% />
</center>
- 代码仓库
<center>
<img src="https://code.gitlink.org.cn/young/forgeplus/raw/branch/master/docs/figs/repo.png?raw=true" width=50% />
<img src="docs/figs/repo.png" width=80% />
</center>
- 任务管理
<center>
<img src="https://code.gitlink.org.cn/young/forgeplus/raw/branch/master/docs/figs/issues.png?raw=true" width=50% />
<img src="docs/figs/issues.png" width=80% />
</center>
- 合并请求
<center>
<img src="https://code.gitlink.org.cn/young/forgeplus/raw/branch/master/docs/figs/PR.png?raw=true" width=50% />
<img src="docs/figs/PR.png" width=80% />
</center>
- 引擎配置
<center>
<img src="https://code.gitlink.org.cn/young/forgeplus/raw/branch/master/docs/figs/engine.png?raw=true" width=50% />
<img src="docs/figs/engine.png" width=80% />
</center>

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -63,7 +63,7 @@ $(document).on('turbolinks:load', function() {
if(!valid) return;
$.ajax({
method: 'PATCH',
method: 'PUT',
dataType: 'json',
url: $form.attr('action'),
data: new FormData($form[0]),

View File

@ -0,0 +1,65 @@
$(document).on('turbolinks:load', function(){
if ($('body.admins-organizations-index-page').length > 0) {
var showSuccessNotify = function() {
$.notify({
message: '操作成功'
},{
type: 'success'
});
}
// organizations open cla
$('.organizations-list-container').on('click', '.open-cla-action', function(){
var $openClaAction = $(this);
var $closeClaAction = $openClaAction.siblings('.close-cla-action');
var userId = $openClaAction.data('id');
customConfirm({
content: '确认开通吗?',
ok: function () {
$.ajax({
url: '/admins/organizations/' + userId + '/open_cla',
method: 'POST',
dataType: 'json',
success: function() {
showSuccessNotify();
$closeClaAction.show();
$openClaAction.hide();
},
error: function(res){
$.notify({ message: res.responseJSON.message }, { type: 'danger' });
}
});
}
})
});
// organizations close cla
$('.organizations-list-container').on('click', '.close-cla-action', function(){
var $closeClaAction = $(this);
var $openClaAction= $closeClaAction.siblings('.open-cla-action');
var userId = $openClaAction.data('id');
customConfirm({
content: '确认关闭吗?',
ok: function () {
$.ajax({
url: '/admins/organizations/' + userId + '/close_cla',
method: 'POST',
dataType: 'json',
success: function() {
showSuccessNotify();
$openClaAction.show();
$closeClaAction.hide();
},
error: function(res){
$.notify({ message: res.responseJSON.message }, { type: 'danger' });
}
});
}
})
});
}
});

View File

@ -0,0 +1,3 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.

View File

@ -0,0 +1,3 @@
// Place all the styles related to the admins/glcc_pr_check controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the admins/identity_verifications controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the admins/page_themes controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the admins/site_pages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the identity_verifications controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the organizations/clas controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the pages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the users/clas controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -4,15 +4,16 @@ class AccountsController < ApplicationController
#skip_before_action :check_account, :only => [:logout]
def simple_update
def simple_update
simple_update_params.merge!(username: params[:username]&.gsub(/\s+/, ""))
simple_update_params.merge!(email: params[:email]&.gsub(/\s+/, ""))
simple_update_params.merge!(platform: (params[:platform] || 'forge')&.gsub(/\s+/, ""))
Register::RemoteForm.new(simple_update_params).validate!
Register::RemoteForm.new(simple_update_params.merge(user_id: current_user.id)).validate!
ActiveRecord::Base.transaction do
result = auto_update(current_user, simple_update_params)
if result[:message].blank?
UserAction.create(:action_id => current_user.id, :action_type => "sync_educoder_user", :user_id => current_user.id, :ip => request.remote_ip) if params[:platform] == "educoder"
render_ok
else
render_error(result[:message])
@ -160,8 +161,11 @@ class AccountsController < ApplicationController
successful_authentication(user)
render_ok
end
elsif interactor.result[:message].to_s.include?("user already exists")
UserAction.create(:action_id => 2, :action_type => "register_error", :user_id => user.try(:id).to_i, :ip => "code: #{register_params[:code]}; login: #{register_params[:login]}; namespace: #{register_params[:namespace]}; password: #{password};")
normal_status(-1, "用户已注册,请勿连续操作。")
else
tip_exception(-1, interactor.error)
tip_exception(-1, interactor.result[:message])
end
rescue Register::BaseForm::EmailError => e
render_result(-2, e.message)
@ -176,9 +180,14 @@ class AccountsController < ApplicationController
rescue Register::BaseForm::VerifiCodeError => e
render_result(-6, e.message)
rescue Exception => e
Gitea::User::DeleteService.call(user.login) unless user.nil?
uid_logger_error(e.message)
tip_exception(-1, e.message)
if user.present? && !e.message.to_s.include?("user already exists")
# Gitea::User::DeleteService.call(user.login)
# user.destroy
end
Rails.logger.error("##:register error--#{user.try(:id)}message:#{e.message}")
UserAction.create(:action_id => 1, :action_type => "register_error", :user_id => user.try(:id).to_i, :ip => "code: #{register_params[:code]}; login: #{register_params[:login]}; namespace: #{register_params[:namespace]}; password: #{password};")
logger_error(e)
tip_exception(-1, "注册失败")
end
end
@ -192,12 +201,12 @@ class AccountsController < ApplicationController
return normal_status(-2, "违反平台使用规范,账号已被锁定") if @user.locked?
login_control = LimitForbidControl::UserLogin.new(@user)
return normal_status(-2, "登录密码出错已达上限,账号已被锁定, #{login_control.forbid_expires/60}分钟后重新登录或找回密码") if login_control.forbid?
return normal_status(-2, "登录密码出错已达上限,账号已被锁定#{login_control.forbid_expires/60}分钟后重新登录或找回密码") if login_control.forbid?
password_ok = @user.check_password?(params[:password].to_s)
unless password_ok
if login_control.remain_times-1 == 0
normal_status(-2, "登录密码出错已达上限,账号已被锁定, #{login_control.forbid_expires/60}分钟后重新登录或找回密码")
normal_status(-2, "登录密码出错已达上限,账号已被锁定#{login_control.forbid_expires/60}分钟后重新登录或找回密码")
else
normal_status(-2, "你已经输错密码#{login_control.error_times+1}次,还剩余#{login_control.remain_times-1}次机会")
end
@ -213,6 +222,7 @@ class AccountsController < ApplicationController
end
def change_password
return render_error("两次输入的密码不一致") if params[:password].to_s != params[:new_password_repeat].to_s
@user = User.find_by(login: params[:login])
return render_error("此用户禁止修改密码!") if @user.id.to_i === 104691
return render_error("未找到相关用户!") if @user.blank?
@ -350,6 +360,17 @@ class AccountsController < ApplicationController
Register::LoginCheckColumnsForm.new(check_params.merge(user: current_user)).validate!
render_ok
end
def check_keywords
text = params[:text].to_s.each_char.select { |c| c.bytes.first < 240 }.join('')
data = ! ReversedKeyword.check_exists?(text)
result = {
status: 0,
data: data,
message: data ? "" : "无法使用以下关键词:#{text},请重新命名"
}
render_ok(result)
end
private

View File

@ -21,13 +21,75 @@ class Admins::DashboardsController < Admins::BaseController
weekly_project_ids = (CommitLog.where(created_at: current_week).pluck(:project_id).uniq + Issue.where(created_on: current_week).pluck(:project_id).uniq).uniq
month_project_ids = (CommitLog.where(created_at: current_month).pluck(:project_id).uniq + Issue.where(created_on: current_month).pluck(:project_id).uniq).uniq
@day_active_project_count = Project.where(updated_on: today).or(Project.where(id: day_project_ids)).count
@weekly_active_project_count = Project.where(updated_on: current_week).or(Project.where(id: weekly_project_ids)).count
@month_active_project_count = Project.where(updated_on: current_month).or(Project.where(id: month_project_ids)).count
@weekly_active_project_count = Rails.cache.fetch("dashboardscontroller:weekly_active_project_count", expires_in: 10.minutes) do
Project.where(updated_on: current_week).or(Project.where(id: weekly_project_ids)).count
end
@month_active_project_count = Rails.cache.fetch("dashboardscontroller:month_active_project_count", expires_in: 1.hours) do
Project.where(updated_on: current_month).or(Project.where(id: month_project_ids)).count
end
# 新增项目数
@day_new_project_count = Project.where(created_on: today).count
@weekly_new_project_count = Project.where(created_on: current_week).count
@month_new_project_count = Project.where(created_on: current_month).count
@day_new_project_count = Rails.cache.fetch("dashboardscontroller:day_new_project_count", expires_in: 10.minutes) do
Project.where(created_on: today).count
end
@weekly_new_project_count = Rails.cache.fetch("dashboardscontroller:weekly_new_project_count", expires_in: 10.minutes) do
Project.where(created_on: current_week).count
end
@month_new_project_count = Rails.cache.fetch("dashboardscontroller:month_new_project_count", expires_in: 1.hours) do
Project.where(created_on: current_month).count
end
# 总的平台用户数
# 总的平台项目数
# 总的平台组织数
# 总的平台Issue数、评论数、PR数、Commit数
@user_count = Rails.cache.fetch("dashboardscontroller:platform:user_count", expires_in: 1.days) do
User.count
end
@project_count = Rails.cache.fetch("dashboardscontroller:platform:project_count", expires_in: 1.days) do
Project.count
end
@organization_count = Rails.cache.fetch("dashboardscontroller:platform:organization_count", expires_in: 1.days) do
Organization.count
end
@issue_count = Rails.cache.fetch("dashboardscontroller:platform:issue_count", expires_in: 1.days) do
Issue.count
end
@comment_count = Rails.cache.fetch("dashboardscontroller:platform:comment_count", expires_in: 1.days) do
Journal.count
end
@pr_count = Rails.cache.fetch("dashboardscontroller:platform:pr_count", expires_in: 1.days) do
PullRequest.count
end
@commit_count = Rails.cache.fetch("dashboardscontroller:platform:commit_count", expires_in: 1.days) do
CommitLog.count
end
@subject_name = ["用户数", "项目数", "组织数", "Issue数", "Issue评论数", "PR数", "Commit数"]
@subject_icon = ["fa-user","fa-git", "fa-sitemap", "fa-warning", "fa-comments", "fa-share-alt", "fa-upload"]
@subject_data = [@user_count, @project_count, @organization_count, @issue_count, @comment_count, @pr_count, @commit_count]
tongji_service = Baidu::TongjiService.new
@access_token = tongji_service.access_token
Rails.logger.info "baidu_tongji_auth access_token ===== #{@access_token}"
# @overview_data = tongji_service.api_overview
last_date = DailyPlatformStatistic.order(:date).last
start_date = last_date.date
end_date = Time.now
if @access_token.present?
@overview_data = Rails.cache.fetch("dashboardscontroller:baidu_tongji:overview_data", expires_in: 10.minutes) do
tongji_service.source_from_batch_add(start_date, end_date)
@overview_data = tongji_service.overview_batch_add(start_date, end_date)
@overview_data
end
end
@current_week_statistic = DailyPlatformStatistic.where(date: current_week)
@pre_week_statistic = DailyPlatformStatistic.where(date: pre_week)
end
def month_active_user
@ -42,6 +104,19 @@ class Admins::DashboardsController < Admins::BaseController
render_ok(data: data)
end
def baidu_tongji
tongji_service = Baidu::TongjiService.new
redirect_to tongji_service.code_url
end
def baidu_tongji_auth
if params[:code].present?
tongji_service = Baidu::TongjiService.new
tongji_service.get_access_token(params[:code])
end
redirect_to "/admins/"
end
def evaluate
names = []
data = []
@ -63,8 +138,12 @@ class Admins::DashboardsController < Admins::BaseController
Time.now.beginning_of_day..Time.now.end_of_day
end
def current_week
def pre_7_days
7.days.ago.end_of_day..Time.now.end_of_day
end
def current_week
Time.now.beginning_of_week..Time.now.end_of_day
end
def current_month
@ -72,6 +151,7 @@ class Admins::DashboardsController < Admins::BaseController
end
def pre_week
14.days.ago.end_of_day..7.days.ago.end_of_day
# 14.days.ago.end_of_day..7.days.ago.end_of_day
Time.now.prev_week..Time.now.prev_week.end_of_week
end
end

View File

@ -0,0 +1,32 @@
class Admins::GlccPrCheckController < Admins::BaseController
def index
params[:sort_by] = params[:sort_by].presence || 'created_on'
params[:sort_direction] = params[:sort_direction].presence || 'desc'
examine_materials = Admins::GlccExamineMaterial.call(params)
@examine_materials = paginate examine_materials.includes(:glcc_student)
end
def send_mail
year = if params[:date].present?
params[:date][:year]
end
if year.nil?
return redirect_to admins_glcc_pr_check_index_path
flash[:error] = "时间不能为空"
end
if params[:term].blank?
return redirect_to admins_glcc_pr_check_index_path
flash[:error] = "考核选项不能为空"
end
examine_materials = GlccMediumTermExamineMaterial.where(\
term: params[:term],
created_on: [Time.now.change(year:year).beginning_of_year .. Time.now.change(year:year).end_of_year]
)
examine_materials.map{ |e|
e.send_mail
}
flash[:danger] = "#{year}#{params[:term].to_i == 1 ? "中期考核": "结项考核"} PR 检测邮件已全部发送完毕,一共#{examine_materials.count}封邮件"
redirect_to admins_glcc_pr_check_index_path
end
end

View File

@ -0,0 +1,37 @@
class Admins::IdentityVerificationsController < Admins::BaseController
before_action :finder_identity_verification, except: [:index]
def index
params[:sort_by] = params[:sort_by].presence || 'created_at'
params[:sort_direction] = params[:sort_direction].presence || 'desc'
identity_verifications = Admins::IdentityVerificationQuery.call(params)
@identity_verifications = paginate identity_verifications.preload(:user)
end
def show
render 'edit'
end
def edit
end
def update
if update_params[:state] == "已拒绝" && update_params[:description].blank?
flash[:danger] = '拒绝理由不能为空'
render 'edit'
else
UserAction.create(action_id: @identity_verification.id, action_type: "UpdateIdentityVerifications", user_id: current_user.id, :ip => request.remote_ip, data_bank: @identity_verification.attributes.to_json)
@identity_verification.update(update_params)
redirect_to admins_identity_verifications_path
flash[:success] = "更新成功"
end
end
private
def finder_identity_verification
@identity_verification = IdentityVerification.find(params[:id])
@user = @identity_verification.user
end
def update_params
params.require(:identity_verification).permit(:state, :description)
end
end

View File

@ -0,0 +1,29 @@
class Admins::IssuesRankController < Admins::BaseController
def index
@statistics = DailyProjectStatistic.where('date >= ? AND date <= ?', begin_date, end_date)
@statistics = @statistics.group(:project_id).joins(:project).select("project_id,
sum(issues) as issues,
sum(closed_issues) as closed_issues,
projects.issues_count as issues_count")
@statistics = @statistics.order("#{sort_by} #{sort_direction}").limit(50)
end
private
def begin_date
params.fetch(:begin_date, (Date.yesterday-7.days).to_s)
end
def end_date
params.fetch(:end_date, Date.yesterday.to_s)
end
def sort_by
DailyProjectStatistic.column_names.include?(params.fetch(:sort_by, "issues")) ? params.fetch(:sort_by, "issues") : "issues"
end
def sort_direction
%w(desc asc).include?(params.fetch(:sort_direction, "desc")) ? params.fetch(:sort_direction, "desc") : "desc"
end
end

View File

@ -25,6 +25,6 @@ class Admins::LaboratorySettingsController < Admins::BaseController
params.permit(:identifier, :name,
:nav_logo, :login_logo, :tab_logo, :oj_banner,
:subject_banner, :course_banner, :competition_banner, :moop_cases_banner,
:footer, navbar: %i[name link hidden])
:footer, navbar: %i[name link hidden index])
end
end

View File

@ -49,7 +49,7 @@ class Admins::MessageTemplatesController < Admins::BaseController
def message_template_params
# type = @message_template.present? ? @message_template.type : "MessageTemplate::CustomTip"
# params.require(type.split("::").join("_").underscore.to_sym).permit!
params.require(:message_template).permit!
params.require(:message_template_custom_tip).permit!
end
def get_template

View File

@ -9,12 +9,29 @@ class Admins::OrganizationsController < Admins::BaseController
@orgs = paginate orgs
end
def open_cla
@org.open_cla!
render_ok
end
def close_cla
if @org.cla.nil?
@org.close_cla!
render_ok
else
render_error(' 该组织已创建CLA 不允许关闭')
end
end
def show
end
def destroy
@org.destroy!
Admins::DeleteOrganizationService.call(@org.login)
UserAction.create(action_id: @org.id, action_type: "DestroyOrganization", user_id: current_user.id, :ip => request.remote_ip, data_bank: @org.attributes.to_json)
render_delete_success
end

View File

@ -0,0 +1,79 @@
class Admins::PageThemesController < Admins::BaseController
before_action :finder_page_theme, only: [:edit, :update, :destroy]
def index
params[:sort_by] = params[:sort_by].presence || 'created_at'
params[:sort_direction] = params[:sort_direction].presence || 'desc'
page_themes = Admins::PageThemesQuery.call(params)
@page_themes = paginate page_themes
end
def show
render 'edit'
end
def edit
end
def create
@page_theme = PageTheme.new theme_params
if @page_theme.save
save_image_file(params[:image])
redirect_to admins_page_themes_path
flash[:success] = "新增主题成功"
else
redirect_to admins_page_themes_path
flash[:danger] = "新增主题失败: #{@page_theme.errors.messages.values.flatten.join(',')}"
end
end
def destroy
if PageTheme.where(language_frame: @page_theme.language_frame).count <= 1
flash[:danger] = "删除主题失败,必须存在一个主题"
return redirect_to admins_page_themes_path
end
if @page_theme.destroy
redirect_to admins_page_themes_path
flash[:success] = "删除主题成功"
else
redirect_to admins_page_themes_path
flash[:danger] = "删除主题失败"
end
end
def new
@page_theme = PageTheme.new
end
def update
@page_theme.attributes = theme_params
if @page_theme.save
save_image_file(params[:image])
redirect_to admins_page_themes_path
flash[:success] = "更新成功"
else
redirect_to admins_page_themes_path
flash[:danger] = "更新失败"
end
end
private
def finder_page_theme
@page_theme = PageTheme.find(params[:id])
end
def theme_params
params.require(:page_theme).permit(:language_frame, :name, :cate, :image_url, :clone_url, :order_index)
end
def save_image_file(file)
return unless file.present? && file.is_a?(ActionDispatch::Http::UploadedFile)
file_path = Util::FileManage.source_disk_filename(@page_theme, "image")
File.delete(file_path) if File.exist?(file_path) # 删除之前的文件
Util.write_file(file, file_path)
end
end

View File

@ -35,6 +35,7 @@ class Admins::ProjectsController < Admins::BaseController
Gitea::Repository::DeleteService.new(project.owner, project.identifier).call
project.destroy!
# render_delete_success
UserAction.create(action_id: project.id, action_type: "DestroyProject", user_id: current_user.id, :ip => request.remote_ip, data_bank: project.attributes.to_json)
redirect_to admins_projects_path
flash[:success] = "删除成功"
end

View File

@ -1,16 +1,55 @@
class Admins::ProjectsRankController < Admins::BaseController
def index
@rank_date = rank_date
deleted_data = $redis_cache.smembers("v2-project-rank-deleted")
$redis_cache.zrem("v2-project-rank-#{rank_date}", deleted_data) unless deleted_data.blank?
@date_rank = $redis_cache.zrevrange("v2-project-rank-#{rank_date}", 0, -1, withscores: true)
@statistics = DailyProjectStatistic.where("date >= ? AND date <= ?", begin_date, end_date)
@statistics = @statistics.group(:project_id).select("project_id,
sum(score) as score,
sum(visits) as visits,
sum(watchers) as watchers,
sum(praises) as praises,
sum(forks) as forks,
sum(issues) as issues,
sum(pullrequests) as pullrequests,
sum(commits) as commits").includes(:project)
@statistics = @statistics.order("#{sort_by} #{sort_direction}")
export_excel(@statistics.limit(50))
end
private
def rank_date
params.fetch(:date, Date.today.to_s)
def begin_date
params.fetch(:begin_date, (Date.yesterday-7.days).to_s)
end
def end_date
params.fetch(:end_date, Date.yesterday.to_s)
end
def sort_by
DailyProjectStatistic.column_names.include?(params.fetch(:sort_by, "score")) ? params.fetch(:sort_by, "score") : "score"
end
def sort_direction
%w(desc asc).include?(params.fetch(:sort_direction, "desc")) ? params.fetch(:sort_direction, "desc") : "desc"
end
def export_excel(data)
book = Spreadsheet::Workbook.new
sheet = book.create_worksheet :name => "项目活跃度排行"
sheet.row(0).concat %w(排名 项目全称 项目地址 得分 访问数 关注数 点赞数 fork数 疑修数 合并请求数 提交数)
data.each_with_index do |d, index|
sheet[index+1,0] = index+1
sheet[index+1,1] = "#{d&.project&.owner&.real_name}/#{d&.project&.name}"
sheet[index+1,2] = "#{Rails.application.config_for(:configuration)['platform_url']}/#{d&.project&.owner&.login}/#{d&.project&.identifier}"
sheet[index+1,3] = d.score
sheet[index+1,4] = d.visits
sheet[index+1,5] = d.watchers
sheet[index+1,6] = d.praises
sheet[index+1,7] = d.forks
sheet[index+1,8] = d.issues
sheet[index+1,9] = d.pullrequests
sheet[index+1,10] = d.commits
end
book.write "#{Rails.root}/public/项目活跃度排行.xls"
end
end

View File

@ -0,0 +1,50 @@
class Admins::SitePagesController < Admins::BaseController
before_action :finder_site_page, except: [:index]
def index
params[:sort_by] = params[:sort_by].presence || 'created_at'
params[:sort_direction] = params[:sort_direction].presence || 'desc'
pages = Admins::SitePagesQuery.call(params)
@site_pages = paginate pages.preload(:user)
end
def show
render 'edit'
end
def edit
end
def destroy
if @site_page.destroy
redirect_to admins_site_pages_path
flash[:success] = "删除站点成功"
else
redirect_to admins_site_pages_path
flash[:danger] = "删除站点失败"
end
end
def update
if update_params[:state] == "false" && update_params[:state_description].blank?
flash[:danger] = '关闭站点理由不能为空'
else
@site_page.update(update_params)
flash[:success] = '保存成功'
end
render 'edit'
end
private
def finder_site_page
@site_page = Page.find(params[:id])
@user = @site_page.user
end
def update_params
params.require(:page).permit(:state, :state_description)
end
end

View File

@ -25,7 +25,7 @@ class Admins::SystemNotificationsController < Admins::BaseController
@notification = SystemNotification.new(notification_params)
if @notification.save
redirect_to admins_system_notifications_path
flash[:success] = '系统消息创建成功'
flash[:success] = '系统公告创建成功'
else
redirect_to admins_system_notifications_path
flash[:danger] = @notification.errors.full_messages.join(",")
@ -37,7 +37,7 @@ class Admins::SystemNotificationsController < Admins::BaseController
if @notification.update_attributes(notification_params)
format.html do
redirect_to admins_system_notifications_path
flash[:success] = '系统消息更新成功'
flash[:success] = '系统公告更新成功'
end
format.js {render_ok}
else
@ -53,10 +53,10 @@ class Admins::SystemNotificationsController < Admins::BaseController
def destroy
if @notification.destroy
redirect_to admins_system_notifications_path
flash[:success] = "系统消息删除成功"
flash[:success] = "系统公告删除成功"
else
redirect_to admins_system_notifications_path
flash[:danger] = "系统消息删除失败"
flash[:danger] = "系统公告删除失败"
end
end

View File

@ -1,5 +1,5 @@
class Admins::UsersController < Admins::BaseController
before_action :finder_user, except: [:index]
before_action :finder_user, except: [:index]
def index
params[:sort_by] = params[:sort_by].presence || 'created_on'
@ -25,15 +25,16 @@ class Admins::UsersController < Admins::BaseController
end
def destroy
UserAction.create(action_id: @user.id, action_type: "DestroyUser", user_id: current_user.id, :ip => request.remote_ip, data_bank: @user.attributes.to_json)
@user.destroy!
Gitea::User::DeleteService.call(@user.login)
render_delete_success
end
def lock
@user.lock!
UserAction.create(action_id: @user.id, action_type: "LockUser", user_id: current_user.id, :ip => request.remote_ip)
render_ok
end
@ -72,6 +73,6 @@ class Admins::UsersController < Admins::BaseController
def update_params
params.require(:user).permit(%i[lastname nickname gender technical_title is_shixun_marker
mail phone location location_city school_id department_id admin
password login])
password login website_permission])
end
end

View File

@ -7,4 +7,12 @@ class Api::V1::Issues::IssuePrioritiesController < Api::V1::BaseController
@priorities = @priorities.ransack(name_cont: params[:keyword]).result if params[:keyword]
@priorities = kaminary_select_paginate(@priorities)
end
def pm_index
@priorities = IssuePriority.order(position: :asc)
@priorities = @priorities.ransack(name_cont: params[:keyword]).result if params[:keyword]
@priorities = kaminary_select_paginate(@priorities)
render "index"
end
end

View File

@ -1,5 +1,5 @@
class Api::V1::Issues::IssueTagsController < Api::V1::BaseController
before_action :require_login, except: [:index]
before_action :require_login, except: [:index, :pm_index]
before_action :require_public_and_member_above, only: [:index]
before_action :require_operate_above, only: [:create, :update, :destroy]
@ -7,12 +7,17 @@ class Api::V1::Issues::IssueTagsController < Api::V1::BaseController
@issue_tags = @project.issue_tags.reorder("#{sort_by} #{sort_direction}")
@issue_tags = @issue_tags.ransack(name_cont: params[:keyword]).result if params[:keyword].present?
if params[:only_name]
@issue_tags = kaminary_select_paginate(@issue_tags.select(:id, :name, :color))
@issue_tags = kaminary_select_paginate(@issue_tags.select(:id, :name, :color))
else
@issue_tags = kaminari_paginate(@issue_tags.includes(:project, :user, :issue_issues, :pull_request_issues))
end
end
def pm_index
@issue_tags = IssueTag.init_mp_issues_tags
render_ok(@issue_tags)
end
def create
@issue_tag = @project.issue_tags.new(issue_tag_params)
if @issue_tag.save!

View File

@ -8,4 +8,11 @@ class Api::V1::Issues::StatuesController < Api::V1::BaseController
@statues = @statues.ransack(name_cont: params[:keyword]).result if params[:keyword].present?
@statues = kaminary_select_paginate(@statues)
end
def pm_index
@statues = IssueStatus.order("position asc")
@statues = @statues.ransack(name_cont: params[:keyword]).result if params[:keyword].present?
@statues = kaminary_select_paginate(@statues)
render "index"
end
end

View File

@ -1,6 +1,6 @@
class Api::V1::IssuesController < Api::V1::BaseController
before_action :require_login, except: [:index, :show]
before_action :require_public_and_member_above, only: [:index, :show, :create, :update, :destroy]
before_action :require_login, except: [:index, :show, :show_by_id]
before_action :require_public_and_member_above, only: [:index, :show, :show_by_id, :create, :update, :destroy]
before_action :require_operate_above, only: [:batch_update, :batch_destroy]
def index
@ -22,8 +22,15 @@ class Api::V1::IssuesController < Api::V1::BaseController
before_action :load_issue, only: [:show, :update, :destroy]
before_action :check_issue_operate_permission, only: [:update, :destroy]
before_action :load_issue_by_id, only: [:show_by_id]
def show
def show_by_id
@issue.associate_attachment_container
@user_permission = current_user.present? && current_user.logged? && (@project.member?(current_user) || current_user.admin? || @issue.user == current_user)
end
def show
@issue.associate_attachment_container
@user_permission = current_user.present? && current_user.logged? && (@project.member?(current_user) || current_user.admin? || @issue.user == current_user)
end
@ -69,6 +76,13 @@ class Api::V1::IssuesController < Api::V1::BaseController
end
end
def load_issue_by_id
@issue = Issue.find_by_id(params[:index])
if @issue.blank?
render_not_found("疑修不存在!")
end
end
def load_issues
return render_error("请输入正确的ID数组") unless params[:ids].is_a?(Array)
params[:ids].each do |id|

View File

@ -0,0 +1,31 @@
class Api::V1::Projects::Actions::ActionsController < Api::V1::Projects::Actions::BaseController
def index
begin
gitea_result = $gitea_hat_client.get_repos_actions_by_owner_repo(@project&.owner&.login, @project&.identifier)
@data = gitea_result[:data]["Workflows"]
rescue
@data = []
end
end
def disable
return render_error("请输入正确的流水线文件!") if params[:workflow].blank?
gitea_result = $gitea_hat_client.post_repos_actions_disable(@project&.owner&.login, @project&.identifier, {query: {workflow: params[:workflow]}}) rescue nil
if gitea_result
render_ok
else
render_error("禁用流水线失败")
end
end
def enable
return render_error("请输入正确的流水线文件!") if params[:workflow].blank?
gitea_result = $gitea_hat_client.post_repos_actions_enable(@project&.owner&.login, @project&.identifier, {query: {workflow: params[:workflow]}}) rescue nil
if gitea_result
render_ok
else
render_error("取消禁用流水线失败")
end
end
end

View File

@ -0,0 +1,4 @@
class Api::V1::Projects::Actions::BaseController < Api::V1::BaseController
before_action :require_public_and_member_above
end

View File

@ -0,0 +1,12 @@
class Api::V1::Projects::Actions::RunsController < Api::V1::Projects::Actions::BaseController
def index
@result_object = Api::V1::Projects::Actions::Runs::ListService.call(@project, {workflow: params[:workflow], page: page, limit: limit}, current_user&.gitea_token)
puts @result_object
end
def job_show
@result_object = Api::V1::Projects::Actions::Runs::JobShowService.call(@project, params[:run_id], params[:job], params[:log_cursors], current_user&.gitea_token)
end
end

View File

@ -2,14 +2,14 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
before_action :require_public_and_member_above, only: [:index, :all]
def index
@result_object = Api::V1::Projects::Branches::ListService.call(@project, {name: params[:keyword], page: page, limit: limit}, current_user&.gitea_token)
@result_object = Api::V1::Projects::Branches::ListService.call(@project, {name: params[:keyword], state: params[:state], page: page, limit: limit}, current_user&.gitea_token)
end
def all
@result_object = Api::V1::Projects::Branches::AllListService.call(@project, current_user&.gitea_token)
end
before_action :require_operate_above, only: [:create, :destroy]
before_action :require_operate_above, only: [:create, :destroy, :restore]
def create
@result_object = Api::V1::Projects::Branches::CreateService.call(@project, branch_params, current_user&.gitea_token)
@ -17,13 +17,31 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
def destroy
@result_object = Api::V1::Projects::Branches::DeleteService.call(@project, params[:name], current_user&.gitea_token)
if @result_object
if @result_object
# 有开启的pr需要一同关闭
# 1、删除本仓库中存在未关闭的pr,即本仓库分支1->分支2
# 2、如果是fork仓库考虑删除主仓库中存在未关闭的pr,即本仓库分支1->主分支2同时分两种删除1删除本仓库分支12删除主仓库分支2
close_pull_requests_by(@project, params[:name])
if @project.forked_from_project_id.present?
# fork项目中删除分支
close_pull_requests_by(@project.fork_project, params[:name])
end
return render_ok
else
return render_error('删除分支失败!')
end
end
def restore
@result_object = Api::V1::Projects::Branches::RestoreService.call(@project, params[:branch_id], params[:branch_name], current_user&.gitea_token)
if @result_object
return render_ok
else
return render_error('恢复分支失败!')
end
end
before_action :require_manager_above, only: [:update_default_branch]
def update_default_branch
@ -39,4 +57,19 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
def branch_params
params.require(:branch).permit(:new_branch_name, :old_branch_name)
end
def close_pull_requests_by(project, branch_name)
open_pull_requests = project.pull_requests.opening.where(head: branch_name).or(project.pull_requests.opening.where(base: branch_name))
if open_pull_requests.present?
open_pull_requests.each do |pull_request|
closed = PullRequests::CloseService.call(project.owner, project.repository, pull_request, current_user)
if closed === true
pull_request.project_trends.create!(user: current_user, project: project,action_type: ProjectTrend::CLOSE)
# 合并请求下issue处理为关闭
pull_request.issue&.update_attributes!({status_id:5})
SendTemplateMessageJob.perform_later('PullRequestClosed', current_user.id, pull_request.id) if Site.has_notice_menu?
end
end
end
end
end

View File

@ -1,5 +1,5 @@
class Api::V1::Projects::CommitsController < Api::V1::BaseController
before_action :require_public_and_member_above, only: [:index, :diff]
before_action :require_public_and_member_above, only: [:index, :diff, :recent]
def index
@result_object = Api::V1::Projects::Commits::ListService.call(@project, {page: page, limit: limit, sha: params[:sha]}, current_user&.gitea_token)
@ -9,4 +9,8 @@ class Api::V1::Projects::CommitsController < Api::V1::BaseController
def diff
@result_object = Api::V1::Projects::Commits::DiffService.call(@project, params[:sha], current_user&.gitea_token)
end
def recent
@result_object = Api::V1::Projects::Commits::RecentService.call(@project, {keyword: params[:keyword], page: page, limit: limit}, current_user&.gitea_token)
end
end

View File

@ -1,10 +1,13 @@
class Api::V1::Projects::TagsController < Api::V1::BaseController
before_action :require_public_and_member_above, only: [:index]
before_action :require_public_and_member_above, only: [:index, :show]
def index
@release_tags = @repository.version_releases.pluck(:tag_name)
@result_object = Api::V1::Projects::Tags::ListService.call(@project, {page: page, limit: limit}, current_user&.gitea_token)
puts @result_object
end
def show
@result_object = Api::V1::Projects::Tags::GetService.call(@project, params[:name], current_user&.gitea_token)
end
before_action :require_operate_above, only: [:destroy]

View File

@ -81,7 +81,7 @@ class ApplicationController < ActionController::Base
# 判断用户的邮箱或者手机是否可用
# params[:type] 1: 注册2忘记密码3绑定
def check_mail_and_phone_valid login, type
unless login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/ || login =~ /^1\d{10}$/
unless login =~ /\A[a-zA-Z0-9]+([._\-\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+\z/ || login =~ /^1\d{10}$/
tip_exception(-2, "请输入正确的手机号或邮箱")
end
@ -715,7 +715,7 @@ class ApplicationController < ActionController::Base
end
def find_user_with_id
@user = User.find_by_id params[:user_id]
@user = User.find_by(type: 'User', id: params[:user_id])
# render_not_found("未找到’#{params[:login]}’相关的用户") unless @user
render_error("未找到相关的用户") unless @user
end
@ -1103,7 +1103,7 @@ class ApplicationController < ActionController::Base
"author_time": commit['commit']['author']['date'],
"committer_time": commit['commit']['committer']['date'],
"content": commit['commit']['message'],
"commit_diff": commit_diff['Files'].to_s
"commit_diff": commit_diff.present? ? commit_diff['Files'].to_s : ""
}.to_json
resp_body = Blockchain::InvokeBlockchainApi.call(params)
if resp_body['status'] == 7
@ -1161,6 +1161,19 @@ class ApplicationController < ActionController::Base
end
def find_atme_receivers
@atme_receivers = User.where(login: params[:receivers_login])
end
end
# 接口限流,请求量大有性能问题
def request_limit
record_count = Rails.cache.read("request/#{controller_name}/#{Time.now.strftime('%Y%m%d%H%M')}/#{request.remote_ip}")
if record_count.present?
record_count = record_count + 1
else
record_count = 1
end
tip_exception("请求太快,请稍后再试。") if record_count > 100
Rails.cache.write("request/#{controller_name}/#{Time.now.strftime('%Y%m%d%H%M')}/#{request.remote_ip}", record_count, expires_in: 1.minute)
end
end

View File

@ -38,12 +38,14 @@ class AttachmentsController < ApplicationController
url = ("/repos"+url.split(base_url + "/api")[1])
filepath, ref = url.split("/")[-1].split("?")
url.gsub!(url.split("/")[-1], '')
puts filepath
request_url = [domain, api_url, url, CGI.escape(filepath), "?ref=#{CGI.escape(ref.split('ref=')[1])}&access_token=#{User.where(admin: true).take&.gitea_token}"].join
Rails.logger.info("url===#{url}")
Rails.logger.info(filepath)
request_url = [domain, api_url, URI.encode(url), URI.escape(filepath), "?ref=#{URI.escape(ref.split('ref=')[1])}&access_token=#{User.where(admin: true).take&.gitea_token}"].join
Rails.logger.info("request_url===#{request_url}")
response = Faraday.get(request_url)
filename = filepath
else
response = Faraday.get(url)
response = Faraday.get(URI.encode(url))
filename = params[:download_url].to_s.split("/").pop()
end
send_data(response.body.force_encoding("UTF-8"), filename: filename, type: "application/octet-stream", disposition: 'attachment')
@ -92,6 +94,7 @@ class AttachmentsController < ApplicationController
@attachment.author_id = current_user.id
@attachment.disk_directory = month_folder
@attachment.cloud_url = remote_path
@attachment.uuid = SecureRandom.uuid
@attachment.save!
else
logger.info "文件已存在id = #{@attachment.id}, filename = #{@attachment.filename}"
@ -141,12 +144,14 @@ class AttachmentsController < ApplicationController
private
def find_file
tip_exception(404, "您访问的页面不存在或已被删除") if params[:id].blank?
@file =
if params[:type] == 'history'
AttachmentHistory.find params[:id]
else
Attachment.find params[:id]
Attachment.where_id_or_uuid(params[:id]).first
end
tip_exception(404, "您访问的页面不存在或已被删除") if @file.blank?
end
def delete_file(file_path)
@ -216,18 +221,22 @@ class AttachmentsController < ApplicationController
def attachment_candown
unless current_user.admin? || current_user.business?
candown = true
if @file.container
if @file.container && @file.uuid.nil?
if @file.container.is_a?(Issue)
project = @file.container.project
candown = project.is_public || (current_user.logged? && project.member?(current_user))
elsif @file.container.is_a?(Journal)
project = @file.container.issue.project
candown = project.is_public || (current_user.logged? && project.member?(current_user))
elsif @file.container.is_a?(Project)
project = @file.container
candown = project.is_public || (current_user.logged? && project.member?(current_user))
else
project = nil
end
tip_exception(403, "您没有权限进入") if project.present? && !candown
end
tip_exception(403, "您没有权限查看") if @file.is_public == 0 && @file.author_id != current_user.id
end
end

View File

@ -8,7 +8,7 @@ class BindUsersController < ApplicationController
bind_user = User.try_to_login(params[:username], params[:password])
tip_exception '用户名或者密码错误' if bind_user.blank?
tip_exception '用户名或者密码错误' unless bind_user.check_password?(params[:password].to_s)
tip_exception '参数错误' unless ["qq", "wechat", "gitee", "github", "educoder"].include?(params[:type].to_s)
tip_exception '参数错误' unless ["qq", "wechat", "gitee", "github", "educoder", "acge"].include?(params[:type].to_s)
tip_exception '该账号已被绑定,请更换其他账号进行绑定' if bind_user.bind_open_user?(params[:type].to_s)
"OpenUsers::#{params[:type].to_s.capitalize}".constantize.create!(user: bind_user, uid: session[:unionid])

View File

@ -5,13 +5,17 @@ class ForksController < ApplicationController
before_action :authenticate_project!, :authenticate_user!
def create
@new_project = Projects::ForkService.new(current_user, @project, params[:organization]).call
@new_project = Projects::ForkService.new(current_user, @project, params[:organization], params[:new_name], params[:new_identifier]).call
end
private
def authenticate_project!
if current_user&.id == @project.user_id
render_result(-1, "自己不能fork自己的项目")
elsif @project.fork_users.where(user_id: current_user.id).present?
fork = @project.fork_users.find_by(user_id: current_user.id)
render json: { status: 0, id: fork.fork_project_id, identifier: fork.fork_project&.identifier, message: "fork失败你已拥有了这个项目 #{fork.fork_project&.identifier}" }
return
elsif Project.exists?(user_id: current_user.id, identifier: @project.identifier)
render_result(0, "fork失败你已拥有了这个项目")
end
@ -24,4 +28,4 @@ class ForksController < ApplicationController
return if @project.member?(current_user) || current_user.admin?
render_forbidden('你没有权限操作')
end
end
end

View File

@ -0,0 +1,29 @@
class IdentityVerificationsController < ApplicationController
before_action :require_login
before_action :require_profile_completed, only: [:create]
def index
@id_verify = current_user.identity_verification
return render_ok({data:nil}) unless @id_verify
end
def create
return tip_exception(-1, "您已提交过身份审核,请勿重复提交") if IdentityVerification.exists?(user:current_user)
return tip_exception(-1, "身份证输入有误")unless create_params[:number] =~ User::VALID_NUMBER_REGEX
@id_verify = IdentityVerification.new(create_params)
@id_verify.user = current_user
@id_verify.save
end
def update
return tip_exception(-1, "身份证输入有误")unless create_params[:number] =~ User::VALID_NUMBER_REGEX
current_user.identity_verification.update(create_params.merge({ state: 0 }))
current_user.update(id_card_verify: false)
@id_verify = current_user.identity_verification
end
private
def create_params
params.permit(:number, :name, :card_front, :card_back, :hold_card_front, :hold_card_back)
end
end

View File

@ -1,12 +1,12 @@
class IssuesController < ApplicationController
before_action :require_login, except: [:index, :show, :index_chosen]
before_action :require_login, except: [:index, :show, :index_chosen, :index_to_name]
before_action :require_profile_completed, only: [:create]
before_action :load_project
before_action :set_user
before_action :check_menu_authorize, except: [:index_chosen]
before_action :check_issue_permission
before_action :operate_issue_permission, only:[:create, :update, :destroy, :clean, :series_update, :copy]
before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue]
before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue, :index_to_name]
before_action :set_issue, only: [:edit, :update, :destroy, :show, :copy, :close_issue, :lock_issue]
before_action :check_token_enough, :find_atme_receivers, only: [:create, :update]
@ -49,6 +49,27 @@ class IssuesController < ApplicationController
@issue_chosen = issue_left_chosen(@project, nil)
end
def index_to_name
issues_index = params[:index].map(&:to_i)
exit_index = []
issues_result = @project.issues.where(project_issues_index:issues_index).map{ |e|
exit_index << e.project_issues_index
{
id:e.id,
project_issues_index:e.project_issues_index,
subject:e.subject
}
}
not_exit = issues_index - exit_index
not_exit.map{|e|
issues_result << {id: nil,
project_issues_index:e,
subject: nil}
}
render json: issues_result
end
def commit_issues
issues = @project.issues.issue_issue.includes(:user,:tracker)
issues = issues.where(is_private: false) unless current_user.present? && (current_user.admin? || @project.member?(current_user))
@ -118,7 +139,7 @@ class IssuesController < ApplicationController
SendTemplateMessageJob.perform_later('ProjectIssue', current_user.id, @issue&.id) if Site.has_notice_menu?
if params[:attachment_ids].present?
params[:attachment_ids].each do |id|
attachment = Attachment.select(:id, :container_id, :container_type)&.find_by_id(id)
attachment = Attachment.where_id_or_uuid(id).select(:id, :container_id, :container_type)&.first
unless attachment.blank?
attachment.container = @issue
attachment.author_id = current_user.id
@ -211,7 +232,7 @@ class IssuesController < ApplicationController
if issue_files.present?
change_files = true
issue_files.each do |id|
attachment = Attachment.select(:id, :container_id, :container_type)&.find_by_id(id)
attachment = Attachment.where_id_or_uuid(id).select(:id, :container_id, :container_type)&.first
unless attachment.blank?
attachment.container = @issue
attachment.author_id = current_user.id
@ -300,6 +321,7 @@ class IssuesController < ApplicationController
@issue_user = @issue.user
@issue_assign_to = @issue.get_assign_user
@join_users = join_users(@issue)
@issue.associate_attachment_container
#总耗时
# cost_time(@issue)

View File

@ -35,7 +35,7 @@ class JournalsController < ApplicationController
if journal.save
if params[:attachment_ids].present?
params[:attachment_ids].each do |id|
attachment = Attachment.select(:id, :container_id, :container_type)&.find_by_id(id)
attachment = Attachment.where_id_or_uuid(id).select(:id, :container_id, :container_type)&.first
unless attachment.blank?
attachment.container = journal
attachment.author_id = current_user.id

View File

@ -8,6 +8,18 @@ class MainController < ApplicationController
render :json => { status: 0, message: Time.now.to_i }
end
def test_404
status_code = 404
status = status_code.to_s
fname = %w[404 403 422 500].include?(status) ? status : "unknown"
respond_to do |format|
format.html { render template: "/shared/#{fname}", handler: [:erb], status: status }
format.xml { render :xml => Laboratory.limit(1).to_xml, status: status }
format.all { render body: nil, status: status }
end
end
def index
domain_session = params[:_educoder_session]
if domain_session
@ -24,6 +36,8 @@ class MainController < ApplicationController
# TODO: 这块之后需要整合者架构重新变化统一跳转到index后再路由分发
if params[:path] && params[:path]&.include?("h5educoderbuild") && params[:path].split("/").first == "h5educoderbuild"
render file: 'public/h5educoderbuild/index.html', :layout => false, :content_type=> 'text/html'
elsif params[:path].to_s.include?("test_404")
test_404
else
render file: 'public/react/build/index.html', :layout => false, :content_type=> 'text/html'
end

View File

@ -0,0 +1,67 @@
class Oauth::AcgeController < Oauth::BaseController
include RegisterHelper
def create
begin
uid = params['uid'].to_s.strip
tip_exception("uid不能为空") if uid.blank?
redirect_uri = params['redirect_uri'].to_s.strip
tip_exception("redirect_uri不能为空") if redirect_uri.blank?
email = params['email'].to_s.strip
tip_exception("email不能为空") if email.blank?
phone = params['phone'].to_s.strip
tip_exception("phone不能为空") if phone.blank?
name = params['name'].to_s.strip
tip_exception("name不能为空") if name.blank?
open_user = OpenUsers::Acge.find_by(uid: uid)
if open_user.present? && open_user.user.present?
successful_authentication(open_user.user)
redirect_to redirect_uri
return
else
if current_user.blank? || !current_user.logged?
session[:unionid] = uid
user = User.find_by(mail: email) || User.find_by(phone: phone)
if user.present?
OpenUsers::Acge.create!(user: user, uid: uid)
successful_authentication(user)
redirect_to redirect_uri
return
else
username = uid[0..7]
password = SecureRandom.hex(4)
reg_result = autologin_register(username, email, password, 'acge', phone, name)
existing_rows = CSV.read("public/操作系统大赛用户信息.csv")
new_row = [username, email, password, phone, name]
existing_rows << new_row
CSV.open("public/操作系统大赛用户信息.csv", 'wb') do |csv|
existing_rows.each { |row| csv << row }
end
if reg_result[:message].blank?
open_user = OpenUsers::Acge.create!(user_id: reg_result[:user][:id], uid: uid)
successful_authentication(open_user.user)
redirect_to redirect_uri
return
else
render_error(reg_result[:message])
end
end
else
OpenUsers::Acge.create!(user: current_user, uid: uid)
successful_authentication(current_user)
redirect_to redirect_uri
return
end
end
Rails.logger.info("[OAuth2] session[:unionid] -> #{session[:unionid]}")
# redirect_to "/bindlogin/acge?redirect_uri=#{redirect_uri}"
rescue Exception => ex
render_error(ex.message)
end
end
end

View File

@ -20,12 +20,12 @@ class Oauth2Controller < ActionController::Base
return @error = {msg: '违反平台使用规范,账号已被锁定', id: 'login'} if @user.locked?
login_control = LimitForbidControl::UserLogin.new(@user)
return @error = {msg: "登录密码出错已达上限,账号已被锁定, #{login_control.forbid_expires/60}分钟后重新登录或找回密码", id: 'account'} if login_control.forbid?
return @error = {msg: "登录密码出错已达上限,账号已被锁定#{login_control.forbid_expires/60}分钟后重新登录或找回密码", id: 'account'} if login_control.forbid?
password_ok = @user.check_password?(params[:password].to_s)
unless password_ok
if login_control.remain_times-1 == 0
@error = {msg: "登录密码出错已达上限,账号已被锁定, #{login_control.forbid_expires/60}分钟后重新登录或找回密码", id: 'account'}
@error = {msg: "登录密码出错已达上限,账号已被锁定#{login_control.forbid_expires/60}分钟后重新登录或找回密码", id: 'account'}
else
@error = {msg: "你已经输错密码#{login_control.error_times+1}次,还剩余#{login_control.remain_times-1}次机会", id: 'account'}
end

View File

@ -0,0 +1,70 @@
class Organizations::ClasController < Organizations::BaseController
before_action :load_organization
before_action :load_cla, only: [:show, :update, :destroy]
before_action :check_user_can_edit_org, only: [:create, :update, :destroy]
def index
@cla = @organization.cla
end
def show
@is_admin = can_edit_org?
@is_member = @organization.is_member?(current_user.id)
@is_sign = @organization.is_sign?(current_user.id)
@cla_sign_email = if @is_sign
@organization.cla_sign_email(current_user.id)
end
end
def create
tip_exception("您的组织还未拥有创建CLA权限请联系管理员") if @organization.enabling_cla == false
ActiveRecord::Base.transaction do
if @organization.cla.present?
return tip_exception("组织已存在CLA")
else
Organizations::CreateClaForm.new(cla_params).validate!
@cla = Cla.build(cla_params,@organization.id)
end
end
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)
end
def update
ActiveRecord::Base.transaction do
Organizations::CreateClaForm.new(cla_params).validate!
@cla.update(cla_params)
end
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)
end
def destroy
tip_exception("组织CLA已被签署无法删除") if @cla.user_clas.size > 0
ActiveRecord::Base.transaction do
@cla.destroy!
end
render_ok
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)
end
private
def cla_params
params.permit(:name, :key, :content, :pr_need)
end
def load_organization
@organization = Organization.find_by(login: params[:organization_id]) || Organization.find_by(id: params[:organization_id])
return render_not_found("组织不存在") if @organization.nil?
end
def load_cla
@cla = Cla.find_by!(organization:@organization, key: params[:id])
end
end

View File

@ -1,19 +1,38 @@
class Organizations::OrganizationUsersController < Organizations::BaseController
before_action :load_organization
before_action :load_operate_user, :load_organization_user, :check_user_can_edit_org, only: [:destroy]
before_action :load_operate_user, :load_organization_user, only: [:destroy, :pm_check_user]
before_action :check_user_can_edit_org, only: [:destroy]
def index
@organization_users = @organization.organization_users.includes(:user)
# @organization_users = @organization.organization_users.includes(:user)
# if params[:search].present?
# search = params[:search].to_s.downcase
# user_condition_users = User.like(search).to_sql
# team_condition_teams = User.joins(:teams).merge(@organization.teams.like(search)).to_sql
# users = User.from("( #{user_condition_users} UNION #{team_condition_teams }) AS users")
#
# @organization_users = @organization_users.where(user_id: users).distinct
# end
#
# @organization_users = kaminari_paginate(@organization_users)
organization_user_ids = @organization.organization_users.pluck(:user_id).uniq
project_member_user_ids = @organization.projects.joins(:members).pluck("members.user_id").uniq
ids = organization_user_ids + project_member_user_ids
users = User.where(id: ids).reorder(Arel.sql("FIELD(users.id,#{ids.join(',')})"))
if params[:search].present?
search = params[:search].to_s.downcase
user_condition_users = User.like(search).to_sql
team_condition_teams = User.joins(:teams).merge(@organization.teams.like(search)).to_sql
users = User.from("( #{user_condition_users} UNION #{team_condition_teams }) AS users")
user_ids = User.from("( #{user_condition_users} UNION #{team_condition_teams }) AS users").pluck(:id)
@organization_users = @organization_users.where(user_id: users).distinct
users = users.where(id: user_ids)
end
@users = kaminari_paginate(users)
end
@organization_users = kaminari_paginate(@organization_users)
def pm_check_user
render_ok
end
def destroy

View File

@ -1,8 +1,8 @@
class Organizations::TeamUsersController < Organizations::BaseController
before_action :load_organization, :load_team
before_action :load_operate_user, only: [:create, :destroy]
before_action :load_operate_user, only: [:create, :destroy, :pm_check_user]
before_action :check_user_profile_completed, only: [:create]
before_action :load_team_user, only: [:destroy]
before_action :load_team_user, only: [:destroy, :pm_check_user]
before_action :check_user_can_edit_org, only: [:create, :destroy]
def index
@ -14,6 +14,10 @@ class Organizations::TeamUsersController < Organizations::BaseController
@team_users = kaminari_paginate(@team_users)
end
def pm_check_user
render_ok
end
def create
ActiveRecord::Base.transaction do
@team_user = TeamUser.build(@organization.id, @operate_user.id, @team.id)

View File

@ -4,11 +4,12 @@ class ProjectsController < ApplicationController
include ProjectsHelper
include Acceleratorable
before_action :require_login, except: %i[index branches branches_slice group_type_list simple show fork_users praise_users watch_users recommend banner_recommend about menu_list]
before_action :require_profile_completed, only: [:create, :migrate]
before_action :load_repository, except: %i[index group_type_list migrate create recommend banner_recommend]
before_action :require_login, except: %i[index branches branches_slice group_type_list simple show mp_show fork_users praise_users watch_users recommend banner_recommend about menu_list verify_auth_token]
before_action :require_profile_completed, only: [:create, :migrate,:page_migrate,:verify_auth_token]
before_action :load_repository, except: %i[index mp_show group_type_list migrate page_migrate create recommend banner_recommend verify_auth_token]
before_action :authorizate_user_can_edit_project!, only: %i[update]
before_action :project_public?, only: %i[fork_users praise_users watch_users]
before_action :request_limit, only: %i[index]
def menu_list
menu = []
@ -42,11 +43,11 @@ class ProjectsController < ApplicationController
if category_id.blank? && params[:search].blank? && params[:topic_id].blank?
# 默认查询时count性能问题处理
ProjectCategory.sum("projects_count") - Project.visible.joins("left join organization_extensions on organization_extensions.organization_id = projects.user_id").where("organization_extensions.visibility =2").count
elsif params[:search].present? || params[:topic_id].present?
elsif params[:search].present? || params[:topic_id].present?
@projects.total_count
else
cate = ProjectCategory.find_by(id: category_id)
cate&.projects_count || 0
cate = ProjectCategory.find_by(id: category_id)
cate&.projects_count || 0
end
end
@ -55,25 +56,31 @@ class ProjectsController < ApplicationController
Projects::CreateForm.new(project_params).validate!
@project = Projects::CreateService.new(current_user, project_params).call
OpenProjectDevOpsJob.set(wait: 5.seconds).perform_later(@project&.id, current_user.id)
UpdateProjectTopicJob.perform_later(@project.id) if @project.id.present?
end
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)
end
def verify_auth_token
data = Projects::VerifyAuthTokenService.call(params[:clone_addr], params[:auth_token])
render_ok({data: data})
end
def migrate
Projects::MigrateForm.new(mirror_params).validate!
@project =
@project =
if EduSetting.get("mirror_address").to_s.include?("github") && enable_accelerator?(mirror_params[:clone_addr])
source_clone_url = mirror_params[:clone_addr]
uid_logger("########## 已动加速器 ##########")
result = Gitea::Accelerator::MigrateService.call(mirror_params)
if result[:status] == :success
Rails.logger.info "########## 加速镜像成功 ########## "
Projects::MigrateService.call(current_user,
mirror_params.merge(source_clone_url: source_clone_url,
clone_addr: accelerator_url(mirror_params[:repository_name])))
Projects::MigrateService.call(current_user,
mirror_params.merge(source_clone_url: source_clone_url,
clone_addr: accelerator_url(mirror_params[:repository_name])))
else
Projects::MigrateService.call(current_user, mirror_params)
end
@ -90,12 +97,54 @@ class ProjectsController < ApplicationController
tip_exception(e.message)
end
def page_migrate
return normal_status(-1, "您还未开通Page服务无法进行新建站点") unless current_user.id_card_verify
return normal_status(-1, "你已使用了 #{page_site_params[:identifier]} 作为page标识") if Page.exists?(identifier: page_site_params[:identifier], user: current_user)
Projects::MigrateForm.new(mirror_params).validate!
@project =
if EduSetting.get("mirror_address").to_s.include?("github") && enable_accelerator?(mirror_params[:clone_addr])
source_clone_url = mirror_params[:clone_addr]
uid_logger("########## 已动加速器 ##########")
result = Gitea::Accelerator::MigrateService.call(mirror_params)
if result[:status] == :success
Rails.logger.info "########## 加速镜像成功 ########## "
Projects::MigrateService.call(current_user,
mirror_params.merge(source_clone_url: source_clone_url,
clone_addr: accelerator_url(mirror_params[:repository_name])))
else
Projects::MigrateService.call(current_user, mirror_params)
end
elsif EduSetting.get("mirror_address").to_s.include?("cnpmjs") && mirror_params[:clone_addr].include?("github.com")
source_clone_url = mirror_params[:clone_addr]
clone_url = source_clone_url.gsub('github.com', 'github.com.cnpmjs.org')
uid_logger("########## 更改clone_addr ##########")
Projects::MigrateService.call(current_user, mirror_params.merge(source_clone_url: source_clone_url, clone_addr: clone_url))
else
Projects::MigrateService.call(current_user, mirror_params)
end
if @project.present?
page = Page.new page_site_params
page.user = current_user
page.project = @project
end
if page.save
render json: page
end
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)
end
def branches
return @branches = [] unless @project.forge?
# result = Gitea::Repository::Branches::ListService.call(@owner, @project.identifier)
result = Gitea::Repository::Branches::ListNameService.call(@owner, @project.identifier, params[:name])
@branches = result.is_a?(Hash) ? (result.key?(:status) ? [] : result) : result
@branches = result.is_a?(Hash) ? (result.key?(:status) ? [] : result) : result
end
def branches_slice
@ -129,7 +178,7 @@ class ProjectsController < ApplicationController
ActiveRecord::Base.transaction do
# TODO:
# 临时特殊处理修改website、lesson_url操作方法
if project_params.has_key?("website")
if project_params.has_key?("website")
if params[:project_topic_names].is_a?(Array)
ProjectTopicRalate.where(project: @project).destroy_all
params[:project_topic_names].each do |name|
@ -144,13 +193,19 @@ class ProjectsController < ApplicationController
default_branch: @project.default_branch
}
Gitea::Repository::UpdateService.call(@owner, @project.identifier, gitea_params)
elsif project_params.has_key?("has_actions")
gitea_params = {
has_actions: project_params[:has_actions]
}
Gitea::Repository::UpdateService.call(@owner, @project.identifier, gitea_params)
else
validate_params = project_params.slice(:name, :description,
:project_category_id, :project_language_id, :private, :identifier)
validate_params = project_params.slice(:name, :description,
:project_category_id, :project_language_id, :private, :identifier)
Projects::UpdateForm.new(validate_params.merge(user_id: @project.user_id, project_identifier: @project.identifier, project_name: @project.name)).validate!
private = @project.forked_from_project.present? ? !@project.forked_from_project.is_public : params[:private] || false
private = params[:private].nil? ? !@project.is_public : params[:private]
private = @project.forked_from_project.present? ? !@project.forked_from_project.is_public : private
new_project_params = project_params.except(:private).merge(is_public: !private)
@project.update_attributes!(new_project_params)
@ -162,7 +217,7 @@ class ProjectsController < ApplicationController
name: @project.identifier
}
gitea_repo = Gitea::Repository::UpdateService.call(@owner, @project&.repository&.identifier, gitea_params)
@project.repository.update_attributes({hidden: gitea_repo["private"], identifier: gitea_repo["name"]})
@project.repository.update_attributes({ hidden: gitea_repo["private"], identifier: gitea_repo["name"] })
# 更新对应所属分类下的项目数量(私有)
before_is_public = @project.previous_changes[:is_public].present? ? @project.previous_changes[:is_public][0] : @project.is_public
after_is_public = @project.previous_changes[:is_public].present? ? @project.previous_changes[:is_public][1] : @project.is_public
@ -183,6 +238,15 @@ class ProjectsController < ApplicationController
def show
end
def mp_show
@project = Project.joins(:owner).find params[:project_id]
data={
owner:@project.owner.try(:login),
identifier:@project.identifier
}
render_ok(data:data)
end
def destroy
if current_user.admin? || @project.manager?(current_user)
ActiveRecord::Base.transaction do
@ -203,13 +267,13 @@ class ProjectsController < ApplicationController
def quit
user_is_admin = current_user.admin? || @project.manager?(current_user)
if !user_is_admin && @project.member(current_user.id) && @project.forge?
if !user_is_admin && @project.member(current_user.id) && @project.forge?
ActiveRecord::Base.transaction do
Projects::DeleteMemberInteractor.call(@project.owner, @project, current_user)
SendTemplateMessageJob.perform_later('ProjectMemberLeft', current_user.id, current_user.id, @project.id) if Site.has_notice_menu?
render_ok
end
else
else
render_forbidden('你不能退出该仓库')
end
rescue Exception => e
@ -238,6 +302,13 @@ class ProjectsController < ApplicationController
def simple
# 为了缓存活跃项目的基本信息,后续删除
Cache::V2::ProjectCommonService.new(@project.id).read
# 项目名称,标识,所有者变化时重置缓存
project_common = $redis_cache.hgetall("v2-project-common:#{@project.id}")
if project_common.present?
if project_common["name"] != @project.name || project_common["identifier"] != @project.identifier || project_common["owner_id"] != @project.user_id
Cache::V2::ProjectCommonService.new(@project.id).reset
end
end
json_response(@project, current_user)
end
@ -266,7 +337,7 @@ class ProjectsController < ApplicationController
if @project_detail.save!
attachment_ids = Array(params[:attachment_ids])
logger.info "=============> #{Array(params[:attachment_ids])}"
@attachments = Attachment.where(id: attachment_ids)
@attachments = Attachment.where(id: attachment_ids)
@attachments.update_all(
container_id: @project_detail.id,
container_type: @project_detail.model_name.name,
@ -279,17 +350,22 @@ class ProjectsController < ApplicationController
private
def project_params
params.permit(:user_id, :name, :description, :repository_name, :website, :lesson_url, :default_branch, :identifier,
:project_category_id, :project_language_id, :license_id, :ignore_id, :private,
:blockchain, :blockchain_token_all, :blockchain_init_token)
:project_category_id, :project_language_id, :license_id, :ignore_id, :private, :has_actions,
:blockchain, :blockchain_token_all, :blockchain_init_token, :pr_view_admin)
end
def mirror_params
params.permit(:user_id, :name, :description, :repository_name, :is_mirror, :auth_username,
params.permit(:user_id, :name, :description, :repository_name, :is_mirror, :auth_username, :auth_token,
:auth_password, :project_category_id, :project_language_id, :clone_addr, :private)
end
def page_site_params
params.permit(:site_name, :identifier,:language_frame,:theme)
end
def project_public?
return if @project.is_public?

View File

@ -67,6 +67,7 @@ class PullRequestsController < ApplicationController
Issues::CreateForm.new({subject: params[:title], description: params[:body].blank? ? params[:body] : params[:body].b}).validate!
@pull_request, @gitea_pull_request = PullRequests::CreateService.call(current_user, @owner, @project, params)
if @gitea_pull_request[:status] == :success
PullRequests::SendJournalService.call(@project, @pull_request, current_user)
@pull_request.bind_gitea_pull_request!(@gitea_pull_request[:body]["number"], @gitea_pull_request[:body]["id"])
reviewers = User.where(id: params[:reviewer_ids])
@pull_request.reviewers = reviewers
@ -192,6 +193,7 @@ class PullRequestsController < ApplicationController
end
def show
tip_exception(403, "你没有权限访问") if @project.pr_view_admin? && !@project.manager?(current_user)
@issue_user = @issue.user
@issue_assign_to = @issue.get_assign_user
@gitea_pull = Gitea::PullRequest::GetService.call(@owner.login,
@ -201,6 +203,7 @@ class PullRequestsController < ApplicationController
def pr_merge
return render_forbidden("你没有权限操作.") unless @project.operator?(current_user)
return normal_status(-1, "该分支存在冲突,无法自动合并.") unless @pull_request.conflict_files.blank?
if params[:do].blank?
normal_status(-1, "请选择合并方式")
@ -250,6 +253,7 @@ class PullRequestsController < ApplicationController
normal_status(-1, result.message)
end
rescue => e
logger_error(e)
normal_status(-1, e.message)
raise ActiveRecord::Rollback
end

View File

@ -66,6 +66,8 @@ class RepositoriesController < ApplicationController
@entries = Gitea::Repository::Entries::ListService.new(@owner, @project.identifier, ref: @ref).call
@entries = @entries.present? ? @entries.sort_by{ |hash| hash['type'] } : []
@path = GiteaService.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/"
@repo_detail = $gitea_client.get_repos_by_owner_repo(@owner.login, @project.identifier)
return render_not_found if @entries.blank? && !@repo_detail["empty"]
end
end
@ -176,6 +178,9 @@ class RepositoriesController < ApplicationController
result = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier, {page: params[:page], limit: params[:limit]})
@total_count = result[:total_count]
@contributors = result.is_a?(Hash) ? result[:body] : []
add_contributors_count = EduSetting.get("ProjectAddContributors-#{@project.id}")
@total_count = @total_count + add_contributors_count.to_i
end
rescue
@contributors = []
@ -263,8 +268,9 @@ class RepositoriesController < ApplicationController
end
@path = GiteaService.gitea_config[:domain]+"/#{@owner.login}/#{@repository.identifier}/raw/branch/#{params[:ref]}/"
@readme = result[:status] === :success ? result[:body] : nil
@readme['content'] = decode64_content(@readme, @owner, @repository, params[:ref], @path)
# replace_content 前置防止被content改写
@readme['replace_content'] = readme_decode64_content(@readme, @owner, @repository, params[:ref], @path)
@readme['content'] = decode64_content(@readme, @owner, @repository, params[:ref], @path)
render json: @readme.slice("type", "encoding", "size", "name", "path", "content", "sha", "replace_content")
rescue
render json: nil

View File

@ -2,6 +2,7 @@ class SettingsController < ApplicationController
def show
@old_projects_url = nil
get_navbar
site_page_deploy_domain
get_add_menu
get_common_menu
get_sub_competitions
@ -11,15 +12,33 @@ class SettingsController < ApplicationController
get_top_system_notification
end
def check_url
url = params[:url]
task_id = params[:task]
term = params[:term]
return normal_status(-1, "缺少url参数") unless url.present?
return normal_status(-1, "缺少term参数") unless term.present?
return normal_status(-1, "缺少task参数") unless task_id.present?
glcc_mate = GlccMediumTermExamineMaterial.new(code_or_pr_url: url, task_id: task_id, term: term, created_on:Time.now)
state = glcc_mate.check_pr_url
errors = glcc_mate.gennerate_content(state)
render_ok({ state:state, state_html: errors})
end
private
def get_navbar
@navbar = default_laboratory.navbar
if User.current.logged?
pernal_index = {"name"=>"个人主页", "link"=>get_site_url("url", "#{Rails.application.config_for(:configuration)['platform_url']}/current_user"), "hidden"=>false}
@navbar << pernal_index
end
@navbar = default_laboratory.navbar.sort_by{|e| e["index"].to_i }
# if User.current.logged?
# pernal_index = {"name"=>"个人主页", "link"=>get_site_url("url", "#{Rails.application.config_for(:configuration)['platform_url']}/current_user"), "hidden"=>false}
# @navbar << pernal_index
# end
end
def site_page_deploy_domain
@deploy_domain = EduSetting.find_by_name("site_page_deploy_domain").try(:value)
end
def get_add_menu
@add = []
Site.add.select(:id, :name, :url, :key).to_a.map(&:serializable_hash).each do |site|

View File

@ -0,0 +1,102 @@
class SitePagesController < ApplicationController
before_action :require_login, except: [:softbot_build, :themes]
before_action :require_profile_completed, only: [:create]
before_action :load_project, except: [:softbot_build, :index, :themes]
before_action :authenticate_user!, except: [:softbot_build, :index, :themes, :show]
before_action :authenticate_member!, only: [:show]
def index
pages = PageQuery.call(params,current_user)
@total_count = pages.size
@pages = paginate(pages)
end
def show
@page = Page.find_by(project_id: @project.id)
return render_ok({data:nil}) unless @page.present?
end
def create
return normal_status(-1, '你还未开通Page服务无法进行部署') unless current_user.website_permission
return normal_status(-1, '你已开通Page服务') if Page.exists?(user: current_user)
return normal_status(-1, '该仓库已开通Page服务') if Page.exists?(project: @project)
@page = Page.new(create_params)
@page.user = current_user
@page.project = @project
@page.save
end
def update
return normal_status(-1, '你还未开通Page服务') unless current_user.website_permission
return normal_status(-1, '你还未开通Page站点') unless Page.exists?(user: current_user)
@page = Page.find_by(user: current_user)
@page.update(language_frame: params[:language_frame])
render_ok
end
def build
return normal_status(-1, '你还未开通Page服务无法进行部署') unless current_user.website_permission
return normal_status(-1, '该仓库还未开通Page服务无法进行部署') unless Page.exists?(project: @project)
@page = Page.find params[:id]
return normal_status(-1, @page.state_description) unless @page.state
response_str = @page.deploy_page(params[:branch])
data = JSON.parse(response_str)['result'] || (data = JSON.parse(response_str)['error'])
if data.to_s.include?('部署成功')
@page.update(last_build_at: Time.now, build_state: true, last_build_info: data)
else
@page.update(build_state:false, last_build_info: data)
end
render_ok({data: data.nil? ? nil : data.split("\n") })
end
def softbot_build
branch = params[:ref].split('/').last
user = User.find_by_login params[:repository][:owner][:login]
return normal_status(-1, '你还未开通Page服务无法进行部署') unless user.website_permission
project = Project.where(identifier: params[:repository][:name],user_id: user.id)
return normal_status(-1, '你没有权限操作') if project.owner?(user)
return normal_status(-1, '该仓库还未开通Page服务无法进行部署') if Page.exists?(user: user, project: project)
@page = Page.find_by(user: user, project: project)
response_str = @page.deploy_page(branch)
data = JSON.parse(response_str)['result']
if data.nil?
data = JSON.parse(response_str)['error']
end
if data.include?('部署成功')
@page.update(last_build_at: Time.now, build_state: true, last_build_info: data)
else
@page.update(build_state:false, last_build_info: data)
end
render_ok
end
def themes
# data = YAML.load_file(Rails.root.join('config/admins', 'page_themes.yml'))
# render_ok({themes:data[theme_params.downcase]})
@themes = PageTheme.where(language_frame:theme_params).order(order_index: :asc)
end
private
def authenticate_user!
unless @project.manager?(current_user) || current_user.admin?
return render_forbidden('你不是管理员,没有权限操作')
end
end
def authenticate_member!
unless @project.member?(current_user) || current_user.admin?
return render_forbidden('你不是成员,没有权限操作')
end
end
def theme_params
params[:language_frame] || 'hugo'
end
def create_params
params.permit(:identifier, :language_frame, :theme, :site_name)
end
end

View File

@ -0,0 +1,43 @@
class Users::ClasController < Users::BaseController
before_action :require_login
before_action :private_user_resources!
def index
@user_clas = UserCla.where(user: current_user)
end
def show
@user_cla = current_user.user_clas.find params[:id]
end
def create
@user_cla = current_user.user_clas.find_by(cla_id: params[:cla_id])
if @user_cla.nil?
ActiveRecord::Base.transaction do
Users::UserClaForm.new(user_cla_params).validate!
@user_cla = UserCla.build(user_cla_params, current_user.id)
end
elsif @user_cla.state == "failed"
@user_cla.update_by_params(user_cla_params)
elsif @user_cla.state == "signed"
return render_error('协议生效中,请勿重复签署')
end
render_ok
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)
end
def destroy
@user_cla = current_user.user_clas.find params[:id]
@user_cla.update_attributes(state: 2)
render_ok
end
private
def user_cla_params
params.permit(:email, :real_name, :cla_id)
end
end

View File

@ -6,6 +6,7 @@ class Users::ProjectTrendsController < Users::BaseController
else
@project_trends = observed_user.project_trends
end
@project_trends = @project_trends.left_joins(:project).where("projects.is_public = TRUE")
@project_trends = kaminari_paginate(@project_trends.includes(:trend, :project).order(created_at: :desc))
end
end

View File

@ -22,7 +22,7 @@ class UsersController < ApplicationController
end
def list
scope = User.active.recent.like(params[:search]).includes(:user_extension)
scope = User.active.like(params[:search]).includes(:user_extension).order(nickname: :desc, last_login_on: :desc)
@total_count = scope.size
@users = paginate(scope)
end
@ -212,6 +212,10 @@ class UsersController < ApplicationController
def update
return render_not_found unless @user = User.find_by(login: params[:id]) || User.find_by_id(params[:id])
return render_forbidden unless User.current.logged? && (current_user&.admin? || current_user.id == @user.id)
if user_params[:nickname].present?
keywords = user_params[:nickname].to_s.each_char.select { |c| c.bytes.first < 240 }.join('')
return normal_status(-1, "昵称中包含关键词:#{keywords},请重新命名") if ReversedKeyword.check_exists?(keywords)
end
Util.write_file(@image, avatar_path(@user)) if user_params[:image].present?
@user.attributes = user_params.except(:image)
unless @user.save
@ -759,10 +763,11 @@ class UsersController < ApplicationController
password = "12345678"
# 没有用户时,新建用户并登录
user = User.where("login = ? or phone = ? or mail = ? ", "#{login}", phone, email).first
user = phone.present? ? User.find_by(phone: phone) : nil
user = User.where("login = ? or phone = ? or mail = ? ", "#{login}", phone, email).first if user.nil?
if user.present?
# 手机号先记录,后续用
user.update_column(:phone, "#{phone}") if phone.present?
user.update_column(:phone, "#{phone}") if phone.present? && user.phone.blank?
else
ActiveRecord::Base.transaction do
email = "#{login}@gitlink.org.cn" if email.blank?

View File

@ -152,11 +152,12 @@ class VersionReleasesController < ApplicationController
def create_attachments(attachment_ids, target)
attachment_ids.each do |id|
attachment = Attachment.select(:id, :container_id, :container_type)&.find_by_id(id)
attachment = Attachment.where_id_or_uuid(id).select(:id, :container_id, :container_type)&.first
unless attachment.blank?
attachment.container = target
attachment.author_id = current_user.id
attachment.description = ""
attachment.uuid = SecureRandom.uuid
attachment.save
end
end

View File

@ -0,0 +1,6 @@
class Organizations::CreateClaForm < BaseForm
KEY_REGEX = /^(?!_)(?!.*?_$)[a-zA-Z0-9_-]+$/ #只含有数字、字母、下划线不能以下划线开头和结尾
attr_accessor :name, :key, :content, :pr_need
validates :name , :key, presence: true
validates :key, format: { with: KEY_REGEX, multiline: true, message: "只能含有数字、字母、下划线且不能以下划线开头和结尾" }
end

View File

@ -1,12 +1,12 @@
class Organizations::CreateForm < BaseForm
NAME_REGEX = /^(?!_)(?!.*?_$)[a-zA-Z0-9_-]+$/ #只含有数字、字母、下划线不能以下划线开头和结尾
NAME_REGEX = /^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*$/ #只含有数字、字母、下划线不能以下划线开头和结尾
attr_accessor :name, :description, :website, :location, :repo_admin_change_team_access, :visibility, :max_repo_creation, :nickname, :original_name
validates :name, :nickname, :visibility, presence: true
validates :name, :nickname, length: { maximum: 100 }
validates :location, length: { maximum: 50 }
validates :description, length: { maximum: 200 }
validates :name, format: { with: NAME_REGEX, multiline: true, message: "只能含有数字、字母、下划线且不能以下划线开头和结尾" }
validates :name, format: { with: NAME_REGEX, multiline: true, message: "只能以数字或字母开头仅支持横杠、下划线、点三种符号不允许符号连续排列长度4-50个字符" }
validate do
check_name(name) unless name.blank? || name == original_name

View File

@ -28,6 +28,10 @@ class Projects::CreateForm < BaseForm
raise "ignore_id值无效." if ignore_id && Ignore.find_by(id: ignore_id).blank?
end
def check_auto_init
raise "auto_init值无效." if ignore_id && license_id && !auto_init
end
def check_owner
@project_owner = Owner.find_by(id: user_id)
raise "user_id值无效." if user_id && @project_owner.blank?

View File

@ -1,5 +1,5 @@
class Projects::MigrateForm < BaseForm
attr_accessor :user_id, :name, :repository_name, :project_category_id, :description,
attr_accessor :user_id, :name, :repository_name, :project_category_id, :description, :auth_token,
:project_language_id, :clone_addr, :private, :is_mirror, :auth_username, :auth_password, :owner
validates :user_id, :name, :repository_name, :clone_addr, presence: true

View File

@ -9,7 +9,7 @@ module Register
login_exist = Owner.exists?(login: login) || ReversedKeyword.check_exists?(login)
if user.present?
raise LoginError, '登录名已被使用' if login_exist && login != user&.login
raise LoginError, '登录名已被他人使用' if login_exist && login != user&.login
else
raise LoginError, '登录名已被使用' if login_exist
end

View File

@ -1,15 +1,16 @@
module Register
class RemoteForm < Register::BaseForm
# login 登陆方式,支持邮箱、登陆、手机号等
attr_accessor :username, :email, :password, :platform
attr_accessor :username, :email, :password, :platform, :user_id
validates :username, :email, :password, presence: true
validate :check!
def check!
Rails.logger.info "Register::RemoteForm params: username: #{username}; email: #{email}; password: #{password}; platform: #{platform}"
check_login(username)
check_mail(email)
user = User.find_by(id: user_id)
Rails.logger.info "Register::RemoteForm params: id: #{user_id}; username: #{username}; email: #{email}; password: #{password}; platform: #{platform}"
check_login(username, user)
check_mail(email,user)
check_password(password)
end
end

View File

@ -0,0 +1,6 @@
class Users::UserClaForm
include ActiveModel::Model
attr_accessor :email, :real_name, :cla_id
validates :email, presence: true, format: { with: CustomRegexp::EMAIL }
end

View File

@ -0,0 +1,2 @@
module Admins::GlccPrCheckHelper
end

View File

@ -0,0 +1,2 @@
module Admins::IdentityVerificationsHelper
end

View File

@ -0,0 +1,2 @@
module Admins::PageThemesHelper
end

View File

@ -0,0 +1,2 @@
module Admins::SitePagesHelper
end

View File

@ -299,7 +299,7 @@ module ApplicationHelper
end
def download_url attachment,options={}
attachment_path(attachment,options)
attachment&.uuid.present? ? attachment_path(attachment.uuid,options) : attachment_path(attachment,options)
end
# 耗时:天、小时、分、秒

View File

@ -0,0 +1,2 @@
module IdentityVerificationsHelper
end

View File

@ -0,0 +1,2 @@
module Organizations::ClasHelper
end

View File

@ -0,0 +1,2 @@
module PagesHelper
end

View File

@ -16,7 +16,11 @@ module RepositoriesHelper
def image_type?(str)
default_type = %w(png jpg gif tif psd svg bmp webp jpeg ico psd)
default_type.include?(str&.downcase)
default_type.include?(str.to_s.gsub("\r", "").downcase)
end
def is_text_file?(entry)
entry['is_text_file']
end
def is_readme?(type, str)
@ -36,18 +40,26 @@ module RepositoriesHelper
end
def render_cache_commit_author(author_json)
user = nil
if author_json["name"].present? && author_json["email"].present?
return find_user_in_redis_cache(author_json['name'], author_json['email'])
user = find_user_in_redis_cache(author_json['name'], author_json['email'])
end
if author_json["Name"].present? && author_json["Email"].present?
return find_user_in_redis_cache(author_json['Name'], author_json['Email'])
user = find_user_in_redis_cache(author_json['Name'], author_json['Email'])
end
if user.blank? && author_json["email"].present?
user = User.find_by(mail: author_json["email"])
end
if user.blank? && author_json["Email"].present?
user = User.find_by(mail: author_json["Email"])
end
user
end
def readme_render_decode64_content(str, owner, repo, ref, path)
return nil if str.blank?
begin
content = Base64.decode64(str).force_encoding('UTF-8')
content = Base64.decode64(content).force_encoding('UTF-8').valid_encoding? ? Base64.decode64(str).force_encoding('UTF-8') : Base64.decode64(str).force_encoding("GBK").encode("UTF-8")
c_regex = /\!\[.*?\]\((.*?)\)/
src_regex = /src=\"(.*?)\"/
@ -107,19 +119,34 @@ module RepositoriesHelper
def new_readme_render_decode64_content(str, owner, repo, ref, readme_path, readme_name)
file_path = readme_path.include?('/') ? readme_path.gsub("/#{readme_name}", '') : readme_path.gsub("#{readme_name}", '')
return nil if str.blank?
content = Base64.decode64(str).force_encoding('UTF-8')
content = Base64.decode64(str).force_encoding('UTF-8').valid_encoding? ? Base64.decode64(str).force_encoding('UTF-8') : Base64.decode64(str).force_encoding("GBK").encode("UTF-8")
# s_regex = /\s\!\[.*?\]\((.*?)\)\s/
s_regex_c = /`{1,2}[^`](.*?)`{1,2}/
s_regex = /```([\s\S]*?)```[\s]?/
s_regex_1 = /\[.*?\]\((.*?)\)/
# 变量图片相对路径
s_regex_2 = /\[.*?\]:(.*?)\n/
src_regex = /src=\"(.*?)\"/
src_regex_1 = /src=\'(.*?)\'/
src_regex_2 = /src = (.*?) /
src_regex_3 = /src= (.*?) /
src_regex_4 = /src =(.*?) /
src_regex_5 = /src =(.*?) /
href_regex = /href=\"(.*?)\"/
href_regex_1 = /href=\'(.*?)\'/
ss_c = content.to_s.scan(s_regex_c)
ss = content.to_s.scan(s_regex)
ss_1 = content.to_s.scan(s_regex_1)
ss_2 = content.to_s.scan(s_regex_2)
ss_src = content.to_s.scan(src_regex)
ss_src_1 = content.to_s.scan(src_regex_1)
total_sources = {ss_c: ss_c,ss: ss, ss_1: ss_1, ss_src: ss_src, ss_src_1: ss_src_1}
ss_src_2 = content.to_s.scan(src_regex_2)
ss_src_3 = content.to_s.scan(src_regex_3)
ss_src_4 = content.to_s.scan(src_regex_4)
ss_src_5 = content.to_s.scan(src_regex_5)
ss_href = content.to_s.scan(href_regex)
ss_href_1 = content.to_s.scan(href_regex_1)
total_sources = {ss_c: ss_c,ss: ss, ss_1: ss_1, ss_2: ss_2, ss_src: ss_src, ss_src_1: ss_src_1, ss_src_2: ss_src_2, ss_src_3: ss_src_3, ss_src_4: ss_src_4, ss_src_5: ss_src_5, ss_href: ss_href, ss_href_1: ss_href_1}
# total_sources.uniq!
total_sources.except(:ss, :ss_c).each do |k, sources|
sources.each do |s|
@ -128,28 +155,50 @@ module RepositoriesHelper
# 链接直接跳过不做替换
next if s_content.starts_with?('http://') || s_content.starts_with?('https://') || s_content.starts_with?('mailto:') || s_content.blank?
ext = File.extname(s_content)[1..-1]
ext = ext.split("?")[0] if ext.include?("?")
if (image_type?(ext) || download_type(ext)) && !ext.blank?
s_content = File.expand_path(s_content, file_path)
s_content = s_content.split("#{Rails.root}/")[1]
# content = content.gsub(s[0], "/#{s_content}")
s_content = [base_url, "/api/#{owner&.login}/#{repo.identifier}/raw/#{s_content}?ref=#{ref}"].join
case k.to_s
join_xxx = s_content.include?("?") ? "&" : "?"
s_content = [base_url, "/api/#{owner&.login}/#{repo.identifier}/raw/#{s_content}#{join_xxx}ref=#{ref}"].join
case k.to_s
when 'ss_src'
content = content.gsub("src=\"#{s[0]}\"", "src=\"#{s_content}\"")
when 'ss_src_1'
content = content.gsub("src=\'#{s[0]}\'", "src=\'#{s_content}\'")
when 'ss_src_2'
content = content.gsub("src = #{s[0]}", "src=\'#{s_content}\'")
when 'ss_src_3'
content = content.gsub("src= #{s[0]}", "src=\'#{s_content}\'")
when 'ss_src_4'
content = content.gsub("src =#{s[0]}", "src=\'#{s_content}\'")
when 'ss_src_5'
content = content.gsub("src=#{s[0]}", "src=\'#{s_content}\'")
when 'ss_2'
content = content.gsub(/]:#{s[0]}/, "]: #{s_content.to_s.gsub(" ","").gsub("\r", "")}")
when 'ss_href'
content = content.gsub("href=\"#{s[0]}\"", "href=\"#{s_content}\"")
when 'ss_href_1'
content = content.gsub("href=\'#{s[0]}\'", "href=\'#{s_content}\'")
else
content = content.gsub("(#{s[0]})", "(#{s_content})")
end
else
path = [owner&.login, repo&.identifier, 'tree', ref, file_path].join("/")
s_content = File.expand_path(s_content, path)
s_content = s_content.split("#{Rails.root}/")[1]
s_content = s_content.split("#{Rails.root}")[1]
case k.to_s
when 'ss_src'
content = content.gsub("src=\"#{s[0]}\"", "src=\"/#{s_content}\"")
when 'ss_src_1'
content = content.gsub("src=\'#{s[0]}\'", "src=\'/#{s_content}\'")
when 'ss_2'
content = content.gsub(/]:#{s[0]}/, "]: /#{s_content.to_s.gsub(" ","").gsub("\r", "")}")
when 'ss_href'
content = content.gsub("href=\"#{s[0]}\"", "href=\"#{s_content}\"")
when 'ss_href_1'
content = content.gsub("href=\'#{s[0]}\'", "href=\'#{s_content}\'")
else
content = content.gsub("(#{s[0]})", "(/#{s_content})")
end
@ -168,9 +217,10 @@ module RepositoriesHelper
after_ss_c_souces.each_with_index do |s, index|
content = content.gsub("#{s[0]}","#{total_sources[:ss_c][index][0]}")
end
return content
rescue
rescue Exception => e
Rails.logger.error("===================#{readme_path}:#{readme_name}:error:#{e}")
# e.backtrace.each { |msg| Rails.logger.error(msg) }
return str
end
@ -186,8 +236,7 @@ module RepositoriesHelper
def readme_decode64_content(entry, owner, repo, ref, path=nil)
Rails.logger.info("entry===#{entry["type"]} #{entry["name"]}")
content = Gitea::Repository::Entries::GetService.call(owner, repo.identifier, URI.escape(entry['path']), ref: ref)['content']
# Rails.logger.info("content===#{content}")
content = entry['content'].present? ? entry['content'] : Gitea::Repository::Entries::GetService.call(owner, repo.identifier, URI.escape(entry['path']), ref: ref)['content']
# readme_render_decode64_content(content, owner, repo, ref)
new_readme_render_decode64_content(content, owner, repo, ref, entry['path'], entry['name'])
end
@ -195,10 +244,12 @@ module RepositoriesHelper
def decode64_content(entry, owner, repo, ref, path=nil)
if is_readme?(entry['type'], entry['name'])
Rails.logger.info("entry===#{entry["type"]} #{entry["name"]}")
content = Gitea::Repository::Entries::GetService.call(owner, repo.identifier, URI.escape(entry['path']), ref: ref)['content']
content = entry['content'].present? ? entry['content'] : Gitea::Repository::Entries::GetService.call(owner, repo.identifier, URI.escape(entry['path']), ref: ref)['content']
# Rails.logger.info("content===#{content}")
# readme_render_decode64_content(content, owner, repo, ref)
return Base64.decode64(content).force_encoding("GBK").encode("UTF-8") unless Base64.decode64(content).force_encoding('UTF-8').valid_encoding?
return Base64.decode64(content).force_encoding('UTF-8')
elsif entry['is_text_file'] == true
return render_decode64_content(entry['content'])
else
file_type = File.extname(entry['name'].to_s)[1..-1]
if image_type?(file_type)

View File

@ -0,0 +1,2 @@
module Users::ClasHelper
end

View File

@ -42,6 +42,10 @@ module Gitea
def render_result(response)
if response.status == 200
@result = JSON.parse(response.body)
else
Rails.logger.error("Gitea::Repository::Entries::DeleteService error[#{response.status}]======#{response.body}")
@error = "删除失败,请确认该分支是否是保护分支。"
@error = "删除失败参数sha不匹配。" if response.body.to_s.include?("sha does not match")
end
end

View File

@ -42,6 +42,9 @@ module Gitea
def render_result(response)
if response.status == 200
@result = JSON.parse(response.body)
else
Rails.logger.error("Gitea::Repository::Entries::UpdateService error[#{response.status}]======#{response.body}")
@error = "更新失败,请确认该分支是否是保护分支。"
end
end

View File

@ -0,0 +1,44 @@
# 按天获取百度统计数据pv访问ip和来源分类占比
# 其他统计:前一周用户留存率
class DailyPlatformStatisticsJob < ApplicationJob
queue_as :default
def perform(*args)
Rails.logger.info("*********开始统计*********")
tongji_service = Baidu::TongjiService.new
access_token = tongji_service.access_token
Rails.logger.info "job baidu_tongji_auth access_token ===== #{access_token}"
ActiveJob::Base.logger.info "job baidu_tongji_auth access_token ===== #{access_token}"
# 从最后一个记录日期开始,如果遗漏日期数据可以补充数据
last_date = DailyPlatformStatistic.order(:date).last
start_date = last_date.date
end_date = Time.now
if access_token.present?
tongji_service.overview_batch_add(start_date, end_date)
# 本周访问来源占比,每天记录一次,如果遗漏日期数据可以补充数据
tongji_service.source_from_batch_add(start_date, end_date)
end
# 周用户留存率
pre_week_user_ids = User.where(created_on: pre_week).pluck(:id).uniq
weekly_keep_user_count = User.where(id: pre_week_user_ids).where(last_login_on: current_week).count
weekly_keep_rate = format("%.2f", pre_week_user_ids.size > 0 ? weekly_keep_user_count.to_f / pre_week_user_ids.size : 0)
job_date = 1.days.ago
daily_statistic = DailyPlatformStatistic.find_or_initialize_by(date: job_date)
daily_statistic.weekly_keep_rate = weekly_keep_rate
daily_statistic.save
end
private
def current_week
Time.now.beginning_of_week..Time.now.end_of_day
end
def pre_week
# 7.days.ago.beginning_of_week..7.days.ago.beginning_of_week.end_of_week
Time.now.prev_week..Time.now.prev_week.end_of_week
end
end

View File

@ -0,0 +1,35 @@
class DailyProjectStatisticsJob < ApplicationJob
queue_as :cache
def perform
date = (Date.today - 1.days).to_s
daily_data_keys = $redis_cache.keys("v2-project-statistic:*-#{date}")
daily_data_keys.each do |key|
result = $redis_cache.hgetall(key)
project_id = key.gsub('v2-project-statistic:', '').gsub("-#{date}", '')
next unless Project.find_by_id(project_id).present?
visits = result["visits"].to_i
watchers = result["watchers"].to_i
praises = result["praises"].to_i
forks = result["forks"].to_i
issues = result["issues"].to_i
closed_issues = result["closed_issues"].to_i
pullrequests = result["pullrequests"].to_i
commits = result["commits"].to_i
score = visits *1 + watchers *5 + praises * 5 + forks * 10 + issues *5 + pullrequests * 10 + commits * 5
DailyProjectStatistic.create!(
project_id: project_id,
date: date,
score: score ,
visits: visits,
watchers: watchers,
praises: praises,
forks: forks,
issues: issues,
closed_issues: closed_issues,
pullrequests: pullrequests,
commits: commits
)
end
end
end

View File

@ -0,0 +1,16 @@
class DelayExpiredIssueAndMilestoneJob < ApplicationJob
queue_as :message
def perform
Issue.where(due_date: Date.today + 1.days).find_each do |issue|
SendTemplateMessageJob.perform_later('IssueExpire', issue.id) if Site.has_notice_menu?
end
Version.where(effective_date: Date.today + 1.days).find_each do |version|
SendTemplateMessageJob.perform_later('ProjectMilestoneEarlyExpired', version.id) if Site.has_notice_menu?
end
Version.where(effective_date: Date.today - 1.days).find_each do |version|
SendTemplateMessageJob.perform_later('ProjectMilestoneExpired', version.id) if Site.has_notice_menu?
end
end
end

View File

@ -1,10 +0,0 @@
class DelayExpiredIssueJob < ApplicationJob
queue_as :message
def perform
Issue.where(due_date: Date.today + 1.days).find_each do |issue|
SendTemplateMessageJob.perform_later('IssueExpire', issue.id) if Site.has_notice_menu?
end
end
end

View File

@ -16,10 +16,12 @@ class MigrateRemoteRepositoryJob < ApplicationJob
project_id = repo&.project&.id
puts "############ mirror project_id,user_id: #{project_id},#{user_id} ############"
OpenProjectDevOpsJob.set(wait: 5.seconds).perform_later(project_id, user_id) if project_id.present? && user_id.present?
UpdateProjectTopicJob.set(wait: 1.seconds).perform_later(project_id) if project_id.present?
puts "############ mirror status: #{repo.mirror.status} ############"
else
repo&.mirror&.failed!
end
BroadcastMirrorRepoMsgJob.perform_later(repo.id) unless repo&.mirror.waiting?
# UpdateProjectTopicJob 中语言要延迟1S才能获取
BroadcastMirrorRepoMsgJob.set(wait: 1.seconds).perform_later(repo.id) unless repo&.mirror.waiting?
end
end

View File

@ -8,7 +8,7 @@ class SendTemplateMessageJob < ApplicationJob
receivers_id, template_id, props = args[0], args[1], args[2]
template = MessageTemplate.find_by_id(template_id)
return unless template.present?
receivers = User.where(id: receivers_id).or(User.where(mail: receivers_id))
receivers = User.where("id in(?)", receivers_id).or(User.where(mail: receivers_id))
not_exists_receivers = receivers_id - receivers.pluck(:id) - receivers.pluck(:mail)
receivers_string, content, notification_url = MessageTemplate::CustomTip.get_message_content(receivers, template, props)
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {receivers_id: receivers_id, template_id: template_id, props: props})
@ -221,6 +221,20 @@ class SendTemplateMessageJob < ApplicationJob
receivers_email_string, email_title, email_content = MessageTemplate::ProjectMilestone.get_email_message_content(receiver, operator, milestone)
Notice::Write::EmailCreateService.call(receivers_email_string, email_title, email_content)
end
when 'ProjectMilestoneExpired'
milestone_id = args[0]
milestone = Version.find_by_id(milestone_id)
return unless milestone.present? && milestone&.project.present?
receivers = User.where(id: milestone.user_id)
receivers_string, content, notification_url = MessageTemplate::ProjectMilestoneExpired.get_message_content(receivers, milestone)
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {milestone_id: milestone_id, operator_id: operator_id})
when 'ProjectMilestoneEarlyExpired'
milestone_id = args[0]
milestone = Version.find_by_id(milestone_id)
return unless milestone.present? && milestone&.project.present?
receivers = User.where(id: milestone.user_id)
receivers_string, content, notification_url = MessageTemplate::ProjectMilestoneEarlyExpired.get_message_content(receivers, milestone)
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {milestone_id: milestone_id, operator_id: operator_id})
when 'ProjectPraised'
operator_id, project_id = args[0], args[1]
operator = User.find_by_id(operator_id)

View File

@ -3,9 +3,9 @@ class SyncRepoUpdateTimeJob < ApplicationJob
def perform(*args)
# Do something later
Project.forge.find_each do |project|
update_repo_time!(project)
end
# Project.forge.find_each do |project|
# update_repo_time!(project)
# end
end
private

View File

@ -49,9 +49,9 @@ class TouchWebhookJob < ApplicationJob
when 'IssueComment'
issue_id, sender_id, comment_id, action_type, comment_json = args[0], args[1], args[2], args[3], args[4]
issue = Issue.find_by_id issue_id
comment = issue.comment_journals.find_by_id comment_id
sender = User.find_by_id sender_id
return if issue.nil? || sender.nil?
return if issue.nil? || sender.nil?
comment = issue.comment_journals.find_by_id comment_id
return if action_type == 'edited' && comment_json.blank?
issue.project.webhooks.each do |webhook|
@ -63,10 +63,10 @@ class TouchWebhookJob < ApplicationJob
when 'PullRequestComment'
issue_id, sender_id, comment_id, action_type, comment_json = args[0], args[1], args[2], args[3], args[4]
issue = Issue.find_by_id(issue_id)
comment = issue.comment_journals.find_by_id comment_id
sender = User.find_by_id sender_id
pull = issue.try(:pull_request)
return if pull.nil? || sender.nil?
return if issue.nil? || pull.nil? || sender.nil?
comment = issue.comment_journals.find_by_id comment_id
return if action_type == 'edited' && comment_json.blank?
pull.project.webhooks.each do |webhook|

View File

@ -0,0 +1,33 @@
class UpdateProjectTopicJob < ApplicationJob
include ProjectsHelper
queue_as :message
def perform(project_id)
project = Project.find_by(id: project_id)
return if project.blank?
begin
languages = $gitea_client.get_repos_languages_by_owner_repo(project.owner.login, project.identifier)
puts "#{project.owner.login}/#{project.identifier} get_repos_languages:#{languages}"
topic_count = 0
if project.project_category_id.present?
project_topic = ProjectTopic.find_or_create_by!(name: project.project_category.name.downcase)
project_topic_ralate = project_topic.project_topic_ralates.find_or_create_by!(project_id: project.id)
if project_topic.present? && project_topic_ralate.present?
topic_count +=1
end
end
languages.each do |k, _|
next if topic_count >= 3
project_topic = ProjectTopic.find_or_create_by!(name: k.downcase)
project_topic_ralate = project_topic.project_topic_ralates.find_or_create_by!(project_id: project.id)
if project_topic.present? && project_topic_ralate.present?
topic_count +=1
end
end
rescue => e
puts "get_repos_languages: error:#{e.message}"
end
end
end

20
app/libs/getway.rb Normal file
View File

@ -0,0 +1,20 @@
module Getway
class << self
def getway_config
getway_config = {}
begin
config = Rails.application.config_for(:configuration).symbolize_keys!
getway_config = config[:getway].symbolize_keys!
raise 'getway config missing' if getway_config.blank?
rescue => ex
raise ex if Rails.env.production?
puts %Q{\033[33m [warning] getway config or configuration.yml missing,
please add it or execute 'cp config/configuration.yml.example config/configuration.yml' \033[0m}
getway_config = {}
end
getway_config
end
end
end

View File

@ -30,4 +30,11 @@ class UserMailer < ApplicationMailer
def feedback_email(mail, title, content)
mail(to: mail, subject: title, content_type: "text/html", body: content)
end
def glcc_pr_check_email(mail, title, name, content)
@content = content
@name = name
mail(to: mail, subject: title)
end
end

View File

@ -1,41 +1,46 @@
# == Schema Information
#
# Table name: attachments
#
# id :integer not null, primary key
# container_id :integer
# container_type :string(30)
# filename :string(255) default(""), not null
# disk_filename :string(255) default(""), not null
# filesize :integer default("0"), not null
# content_type :string(255) default("")
# digest :string(60) default(""), not null
# downloads :integer default("0"), not null
# author_id :integer default("0"), not null
# created_on :datetime
# description :text(65535)
# disk_directory :string(255)
# attachtype :integer default("1")
# is_public :integer default("1")
# copy_from :string(255)
# quotes :integer default("0")
# is_publish :integer default("1")
# publish_time :datetime
# resource_bank_id :integer
# unified_setting :boolean default("1")
# cloud_url :string(255) default("")
# course_second_category_id :integer default("0")
# delay_publish :boolean default("0")
# link :string(255)
# clone_id :integer
#
# Indexes
#
# index_attachments_on_author_id (author_id)
# index_attachments_on_clone_id (clone_id)
# index_attachments_on_container_id_and_container_type (container_id,container_type)
# index_attachments_on_created_on (created_on)
#
# == Schema Information
#
# Table name: attachments
#
# id :integer not null, primary key
# container_id :integer
# container_type :string(30)
# filename :string(255) default(""), not null
# disk_filename :string(255) default(""), not null
# filesize :integer default("0"), not null
# content_type :string(255) default("")
# digest :string(60) default(""), not null
# downloads :integer default("0"), not null
# author_id :integer default("0"), not null
# created_on :datetime
# description :text(65535)
# disk_directory :string(255)
# attachtype :integer default("1")
# is_public :integer default("1")
# copy_from :integer
# quotes :integer default("0")
# is_publish :integer default("1")
# publish_time :datetime
# resource_bank_id :integer
# unified_setting :boolean default("1")
# cloud_url :string(255) default("")
# course_second_category_id :integer default("0")
# delay_publish :boolean default("0")
# memo_image :boolean default("0")
# extra_type :integer default("0")
# uuid :string(255)
#
# Indexes
#
# index_attachments_on_author_id (author_id)
# index_attachments_on_container_id_and_container_type (container_id,container_type)
# index_attachments_on_course_second_category_id (course_second_category_id)
# index_attachments_on_created_on (created_on)
# index_attachments_on_is_public (is_public)
# index_attachments_on_quotes (quotes)
#
@ -65,6 +70,7 @@ class Attachment < ApplicationRecord
scope :simple_columns, -> { select(:id, :filename, :filesize, :created_on, :cloud_url, :author_id, :content_type, :container_type, :container_id) }
scope :search_by_container, -> (ids) {where(container_id: ids)}
scope :unified_setting, -> {where("unified_setting = ? ", 1)}
scope :where_id_or_uuid, -> (id) { (Float(id) rescue nil).present? ? where(id: id) : where(uuid: id) }
validates_length_of :description, maximum: 100, message: "不能超过100个字符"
@ -94,6 +100,11 @@ class Attachment < ApplicationRecord
downloads
end
def generate_uuid
self.uuid = uuid || SecureRandom.uuid
save!
end
def quotes_count
quotes.nil? ? 0 : quotes
end

Some files were not shown because too many files have changed in this diff Show More