Skip to content

Commit 7b61d2f

Browse files
authored
Merge branch 'main' into feature-container-architectures
2 parents beceb01 + f5593d0 commit 7b61d2f

21 files changed

+169
-101
lines changed

.eslintrc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ rules:
164164
jquery/no-parse-html: [2]
165165
jquery/no-prop: [0]
166166
jquery/no-proxy: [2]
167-
jquery/no-ready: [0]
167+
jquery/no-ready: [2]
168168
jquery/no-serialize: [2]
169169
jquery/no-show: [2]
170170
jquery/no-size: [2]

models/auth/source.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,14 @@ func UpdateSource(source *Source) error {
317317
}
318318
}
319319

320-
_, err := db.GetEngine(db.DefaultContext).ID(source.ID).AllCols().Update(source)
320+
has, err := db.GetEngine(db.DefaultContext).Where("name=? AND id!=?", source.Name, source.ID).Exist(new(Source))
321+
if err != nil {
322+
return err
323+
} else if has {
324+
return ErrSourceAlreadyExist{source.Name}
325+
}
326+
327+
_, err = db.GetEngine(db.DefaultContext).ID(source.ID).AllCols().Update(source)
321328
if err != nil {
322329
return err
323330
}

modules/public/public.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ func AssetsHandlerFunc(opts *Options) http.HandlerFunc {
4545
return
4646
}
4747

48-
var corsSent bool
4948
if opts.CorsHandler != nil {
49+
var corsSent bool
5050
opts.CorsHandler(http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
5151
corsSent = true
5252
})).ServeHTTP(resp, req)
53-
}
54-
// If CORS is not sent, the response must have been written by other handlers
55-
if !corsSent {
56-
return
53+
// If CORS is not sent, the response must have been written by other handlers
54+
if !corsSent {
55+
return
56+
}
5757
}
5858

5959
file := req.URL.Path[len(opts.Prefix):]

options/locale/locale_pt-PT.ini

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,10 +2140,10 @@ settings.dismiss_stale_approvals_desc=Quando novos cometimentos que mudam o cont
21402140
settings.require_signed_commits=Exigir cometimentos assinados
21412141
settings.require_signed_commits_desc=Rejeitar envios para este ramo que não estejam assinados ou que não sejam validáveis.
21422142
settings.protect_branch_name_pattern=Padrão do nome do ramo protegido
2143-
settings.protect_protected_file_patterns=`Padrões de ficheiros protegidos (separados com ponto e vírgula ' ;'):`
2144-
settings.protect_protected_file_patterns_desc=`Não é permitido alterar imediatamente ficheiros protegidos, mesmo que o utilizador tenha autorização para adicionar, editar ou eliminar ficheiros neste ramo. Podem ser usados múltiplos padrões separados por ponto e vírgula (' ;'). See <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> documentation for pattern syntax. Examples: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>.`
2145-
settings.protect_unprotected_file_patterns=`Padrões de ficheiros desprotegidos (separados com ponto e vírgula ' ;'):`
2146-
settings.protect_unprotected_file_patterns_desc=`Ficheiros desprotegidos que é permitido alterar imediatamente se o utilizador tiver permissão de escrita, passando ao lado da restrição no envio. Podem ser usados múltiplos padrões separados por ponto e vírgula (' ;'). See <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> documentation for pattern syntax. Examples: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>.`
2143+
settings.protect_protected_file_patterns=Padrões de ficheiros protegidos (separados com ponto e vírgula ';'):
2144+
settings.protect_protected_file_patterns_desc=Ficheiros protegidos não podem ser modificados imediatamente, mesmo que o utilizador tenha direitos para adicionar, editar ou eliminar ficheiros neste ramo. Múltiplos padrões podem ser separados com ponto e vírgula (';'). Veja a documentação em <a href='https://pkg.go.dev/github.com/gobwas/glob#Compile'>github.com/gobwas/glob</a> para ver a sintaxe. Exemplos: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>.
2145+
settings.protect_unprotected_file_patterns=Padrões de ficheiros desprotegidos (separados com ponto e vírgula ';'):
2146+
settings.protect_unprotected_file_patterns_desc=Ficheiros desprotegidos que podem ser modificados imediatamente se o utilizador tiver direitos de escrita, contornando a restrição no envio. Múltiplos padrões podem ser separados com ponto e vírgula (';'). Veja a documentação em <a href='https://pkg.go.dev/github.com/gobwas/glob#Compile'>github.com/gobwas/glob</a> para ver a sintaxe. Exemplos: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>.
21472147
settings.add_protected_branch=Habilitar salvaguarda
21482148
settings.delete_protected_branch=Desabilitar salvaguarda
21492149
settings.update_protect_branch_success=A salvaguarda do ramo '%s' foi modificada.
@@ -2280,6 +2280,8 @@ diff.image.side_by_side=Lado a Lado
22802280
diff.image.swipe=Deslizar
22812281
diff.image.overlay=Sobrepor
22822282
diff.has_escaped=Esta linha tem caracteres unicode escondidos
2283+
diff.show_file_tree=Mostrar árvore de ficheiros
2284+
diff.hide_file_tree=Esconder árvore de ficheiros
22832285

22842286
releases.desc=Acompanhe as versões e as descargas do repositório.
22852287
release.releases=Lançamentos
@@ -2293,6 +2295,7 @@ release.compare=Comparar
22932295
release.edit=editar
22942296
release.ahead.commits=<strong>%d</strong> cometimentos
22952297
release.ahead.target=para %s desde este lançamento
2298+
tag.ahead.target=para o ramo %s desde esta etiqueta
22962299
release.source_code=Código fonte
22972300
release.new_subheader=Lançamentos organizam as versões do trabalho.
22982301
release.edit_subheader=Lançamentos organizam as versões do trabalho.
@@ -3364,6 +3367,7 @@ runners.status.idle=Parada
33643367
runners.status.active=Em funcionamento
33653368
runners.status.offline=Desconectada
33663369
runners.version=Versão
3370+
runners.reset_registration_token_success=O código de incrição do executor foi reposto com sucesso
33673371

33683372
runs.all_workflows=Todas as sequências de trabalho
33693373
runs.open_tab=%d abertas

options/locale/locale_zh-CN.ini

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ release=版本发布
10681068
releases=版本发布
10691069
tag=Git标签
10701070
released_this=发布
1071+
tagged_this=已标记
10711072
file.title=%s 位于 %s
10721073
file_raw=原始文件
10731074
file_history=文件历史
@@ -1276,6 +1277,7 @@ issues.choose.blank=默认模板
12761277
issues.choose.blank_about=从默认模板创建一个工单。
12771278
issues.choose.ignore_invalid_templates=已忽略无效模板
12781279
issues.choose.invalid_templates=发现了 %v 个无效模板
1280+
issues.choose.invalid_config=问题配置包含错误:
12791281
issues.no_ref=分支/标记未指定
12801282
issues.create=创建工单
12811283
issues.new_label=创建标签
@@ -1489,6 +1491,9 @@ issues.due_date_invalid=到期日期无效或超出范围。请使用 'yyyy-mm-d
14891491
issues.dependency.title=依赖工单
14901492
issues.dependency.issue_no_dependencies=没有设置依赖项。
14911493
issues.dependency.pr_no_dependencies=没有设置依赖项。
1494+
issues.dependency.no_permission_1=您没有读取 %d 依赖关系的权限
1495+
issues.dependency.no_permission_n=您没有读取 %d 依赖关系的权限
1496+
issues.dependency.no_permission.can_remove=您没有读取此依赖关系的权限,但可以删除此依赖关系
14921497
issues.dependency.add=添加依赖工单...
14931498
issues.dependency.cancel=取消
14941499
issues.dependency.remove=删除
@@ -2135,10 +2140,10 @@ settings.dismiss_stale_approvals_desc=当新的提交更改合并请求内容被
21352140
settings.require_signed_commits=需要签名提交
21362141
settings.require_signed_commits_desc=拒绝推送未签名或无法验证的提交到分支
21372142
settings.protect_branch_name_pattern=受保护的分支名称模式
2138-
settings.protect_protected_file_patterns=`"受保护的文件模式 (使用分号 '\;' 分隔):" ;'):``
2139-
settings.protect_protected_file_patterns_desc=`即使用户有权添加、编辑或删除此分支中的文件,也不允许直接更改受保护的文件。 可以使用分号分隔多个模式(' ;'). See <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> documentation for pattern syntax. Examples: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>.`
2140-
settings.protect_unprotected_file_patterns=`不受保护的文件模式 (使用分号分隔 ' ;'):`
2141-
settings.protect_unprotected_file_patterns_desc=`如果用户有写入权限,则允许直接更改的不受保护的文件,以绕过推送限制。可以使用分号分隔多重模式 (' ;'). See <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> documentation for pattern syntax. Examples: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>.`
2143+
settings.protect_protected_file_patterns=受保护的文件模式(使用分号 ';' 分隔):
2144+
settings.protect_protected_file_patterns_desc=即使用户有权添加、编辑或删除此分支中的文件,也不允许直接更改受保护的文件。 可以使用分号 (';') 分隔多个模式。 见<a href='https://pkg.go.dev/github.com/gobwas/glob#Compile'>github.com/gobwas/glob</a>文档了解模式语法。例如: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>
2145+
settings.protect_unprotected_file_patterns=不受保护的文件模式(使用分号 ';' 分隔):
2146+
settings.protect_unprotected_file_patterns_desc=如果用户有写权限,则允许直接更改的不受保护的文件,以绕过推送限制。可以使用分号分隔多个模式 (';')。 见 <a href='https://pkg.go.dev/github.com/gobwas/glob#Compile'>github.com/gobwas/glob</a> 文档了解模式语法。例如: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>
21422147
settings.add_protected_branch=启用保护
21432148
settings.delete_protected_branch=禁用保护
21442149
settings.update_protect_branch_success=分支 "%s" 的分支保护已更新。
@@ -2275,6 +2280,8 @@ diff.image.side_by_side=双排
22752280
diff.image.swipe=滑动
22762281
diff.image.overlay=叠加
22772282
diff.has_escaped=这一行有隐藏的 Unicode 字符
2283+
diff.show_file_tree=显示文件树
2284+
diff.hide_file_tree=隐藏文件树
22782285

22792286
releases.desc=跟踪项目版本和下载。
22802287
release.releases=版本发布
@@ -2288,6 +2295,7 @@ release.compare=比较
22882295
release.edit=编辑
22892296
release.ahead.commits=<strong>%d</strong> 次提交
22902297
release.ahead.target=在此版本发布后被加入到 %s
2298+
tag.ahead.target=自此标签到 %s
22912299
release.source_code=源代码
22922300
release.new_subheader=版本发布组织项目的版本。
22932301
release.edit_subheader=版本发布组织项目的版本。
@@ -3359,6 +3367,7 @@ runners.status.idle=空闲
33593367
runners.status.active=激活
33603368
runners.status.offline=离线
33613369
runners.version=版本
3370+
runners.reset_registration_token_success=成功重置运行器注册令牌
33623371
33633372
runs.all_workflows=所有工作流
33643373
runs.open_tab=%d 开启中

options/locale/locale_zh-TW.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,7 @@ issues.choose.blank=預設
12761276
issues.choose.blank_about=從預設範本建立問題。
12771277
issues.choose.ignore_invalid_templates=已忽略無效的範本
12781278
issues.choose.invalid_templates=找到了 %v 個無效的範本
1279+
issues.choose.invalid_config=問題設定包含錯誤:
12791280
issues.no_ref=未指定分支或標籤
12801281
issues.create=建立問題
12811282
issues.new_label=新增標籤
@@ -1935,6 +1936,7 @@ settings.trust_model.collaborator.long=協作者: 信任協作者的簽署
19351936
settings.trust_model.collaborator.desc=此儲存庫協作者的有效簽署將被標記為「受信任」(無論它們是否符合提交者),簽署只符合提交者時將標記為「不受信任」,都不符合時標記為「不符合」。
19361937
settings.trust_model.committer=提交者
19371938
settings.trust_model.committer.long=提交者: 信任與提交者相符的簽署 (此選項與 GitHub 相同,這會強制 Gitea 簽署提交並以 Gitea 作為提交者)
1939+
settings.trust_model.committer.desc=提交者的有效簽署將被標記為「受信任」,否則將被標記為「不符合」。這將會強制 Gitea 成為受簽署提交的提交者,實際的提交者將於提交訊息結尾被標記為「Co-authored-by:」和「Co-committed-by:」。預設的 Gitea 金鑰必須符合資料庫中的一位使用者。
19381940
settings.trust_model.collaboratorcommitter=協作者+提交者
19391941
settings.trust_model.collaboratorcommitter.long=協作者 + 提交者: 信任協作者同時是提交者的簽署
19401942
settings.trust_model.collaboratorcommitter.desc=此儲存庫協作者的有效簽署在他同時是提交者時將被標記為「受信任」,簽署只符合提交者時將標記為「不受信任」,都不符合時標記為「不符合」。這會強制 Gitea 成為受簽署提交的提交者,實際的提交者將於提交訊息結尾被標記為「Co-Authored-By:」和「Co-Committed-By:」。預設的 Gitea 金鑰必須符合資料庫中的一位使用者。
@@ -2134,6 +2136,10 @@ settings.dismiss_stale_approvals_desc=當新的提交有修改到合併請求的
21342136
settings.require_signed_commits=僅接受經簽署的提交
21352137
settings.require_signed_commits_desc=拒絕未經簽署或未經驗證的提交推送到此分支。
21362138
settings.protect_branch_name_pattern=受保護的分支名稱模式
2139+
settings.protect_protected_file_patterns=受保護的檔案模式 (以分號區隔「;」):
2140+
settings.protect_protected_file_patterns_desc=即便使用者有權限新增、修改、刪除此分支的檔案,仍不允許直接修改受保護的檔案。可以用半形分號「;」分隔多個模式。請於 <a href='https://pkg.go.dev/github.com/gobwas/glob#Compile'>github.com/gobwas/glob</a> 文件查看模式格式。範例: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>。
2141+
settings.protect_unprotected_file_patterns=未受保護的檔案模式 (以分號區隔「;」):
2142+
settings.protect_unprotected_file_patterns_desc=當使用者有寫入權限時,可繞過推送限制,直接修改未受保護的檔案。可以用半形分號「;」分隔多個模式。請於 <a href='https://pkg.go.dev/github.com/gobwas/glob#Compile'>github.com/gobwas/glob</a> 文件查看模式格式。範例: <code>.drone.yml</code>, <code>/docs/**/*.txt</code>。
21372143
settings.add_protected_branch=啟用保護
21382144
settings.delete_protected_branch=停用保護
21392145
settings.update_protect_branch_success=已更新「%s」的分支保護。
@@ -2270,6 +2276,8 @@ diff.image.side_by_side=並列
22702276
diff.image.swipe=滑動
22712277
diff.image.overlay=重疊
22722278
diff.has_escaped=這一行有隱藏的 Unicode 字元
2279+
diff.show_file_tree=顯示檔案樹狀圖
2280+
diff.hide_file_tree=隱藏檔案樹狀圖
22732281

22742282
releases.desc=追蹤專案版本和檔案下載。
22752283
release.releases=版本發布
@@ -2283,6 +2291,7 @@ release.compare=比較
22832291
release.edit=編輯
22842292
release.ahead.commits=<strong>%d</strong> 次提交
22852293
release.ahead.target=在此版本發布後被加入到 %s
2294+
tag.ahead.target=在此標籤後被加入到 %s
22862295
release.source_code=程式碼
22872296
release.new_subheader=發布、整理專案的版本。
22882297
release.edit_subheader=發布、整理專案的版本。
@@ -3354,6 +3363,7 @@ runners.status.idle=閒置
33543363
runners.status.active=啟用
33553364
runners.status.offline=離線
33563365
runners.version=版本
3366+
runners.reset_registration_token_success=成功重設了 Runner 註冊 Token
33573367

33583368
runs.all_workflows=所有工作流程
33593369
runs.open_tab=%d 開放中

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"add-asset-webpack-plugin": "2.0.1",
2020
"ansi-to-html": "0.7.2",
2121
"asciinema-player": "3.2.0",
22+
"clippie": "3.1.4",
2223
"css-loader": "6.7.3",
2324
"dropzone": "6.0.0-beta.2",
2425
"easymde": "2.18.0",
@@ -55,6 +56,7 @@
5556
"@playwright/test": "1.31.2",
5657
"@rollup/pluginutils": "5.0.2",
5758
"@stoplight/spectral-cli": "6.6.0",
59+
"@vitejs/plugin-vue": "4.1.0",
5860
"eslint": "8.36.0",
5961
"eslint-plugin-import": "2.27.5",
6062
"eslint-plugin-jquery": "1.5.1",

routers/web/admin/auths.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,11 @@ func EditAuthSourcePost(ctx *context.Context) {
426426
source.IsActive = form.IsActive
427427
source.IsSyncEnabled = form.IsSyncEnabled
428428
source.Cfg = config
429-
// FIXME: if the name conflicts, it will result in 500: Error 1062: Duplicate entry 'aa' for key 'login_source.UQE_login_source_name'
430429
if err := auth.UpdateSource(source); err != nil {
431-
if oauth2.IsErrOpenIDConnectInitialize(err) {
430+
if auth.IsErrSourceAlreadyExist(err) {
431+
ctx.Data["Err_Name"] = true
432+
ctx.RenderWithErr(ctx.Tr("admin.auths.login_source_exist", err.(auth.ErrSourceAlreadyExist).Name), tplAuthEdit, form)
433+
} else if oauth2.IsErrOpenIDConnectInitialize(err) {
432434
ctx.Flash.Error(err.Error(), true)
433435
ctx.Data["Err_DiscoveryURL"] = true
434436
ctx.HTML(http.StatusOK, tplAuthEdit)

templates/home.tmpl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{{template "base/head" .}}
22
<div role="main" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}" class="page-content home">
3-
<div class="ui stackable middle very relaxed page grid">
4-
<div class="sixteen wide center aligned centered column">
5-
<div>
6-
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}">
7-
</div>
3+
<div class="gt-mb-5 gt-px-5">
4+
<div class="center">
5+
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}">
86
<div class="hero">
97
<h1 class="ui icon header title">
108
{{AppName}}

templates/repo/diff/comment_form.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
{{if $.reply}}
2828
<button class="ui submit green tiny button btn-reply" type="submit">{{$.root.locale.Tr "repo.diff.comment.reply"}}</button>
2929
<input type="hidden" name="reply" value="{{$.reply}}">
30+
<input type="hidden" name="single_review" value="true">
3031
{{else}}
3132
{{if $.root.CurrentReview}}
3233
<button name="pending_review" type="submit" class="ui submit green tiny button btn-add-comment">{{$.root.locale.Tr "repo.diff.comment.add_review_comment"}}</button>

templates/repo/issue/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
{{.locale.Tr "repo.issues.filter_sort"}}
183183
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
184184
</span>
185-
<div class="left menu">
185+
<div class="menu">
186186
<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a>
187187
<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a>
188188
<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>

vitest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {defineConfig} from 'vitest/dist/config.js';
22
import {readFile} from 'node:fs/promises';
33
import {dataToEsm} from '@rollup/pluginutils';
44
import {extname} from 'node:path';
5+
import vue from '@vitejs/plugin-vue';
56

67
function stringPlugin() {
78
return {
@@ -28,5 +29,6 @@ export default defineConfig({
2829
},
2930
plugins: [
3031
stringPlugin(),
32+
vue(),
3133
],
3234
});

0 commit comments

Comments
 (0)