mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-02 00:18:35 +01:00
Add an optional Name field to webhooks so users can give them human-readable labels instead of relying only on URLs. The webhook overview page now displays names when available, or falls back to the URL for unnamed webhooks. Fixes #37025 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -206,6 +206,7 @@ type ProtectBranchPriorityForm struct {
|
||||
|
||||
// WebhookForm form for changing web hook
|
||||
type WebhookForm struct {
|
||||
Name string `binding:"MaxSize(255)"`
|
||||
Events string
|
||||
Create bool
|
||||
Delete bool
|
||||
|
||||
@@ -411,6 +411,7 @@ func ToHook(repoLink string, w *webhook_model.Webhook) (*api.Hook, error) {
|
||||
|
||||
return &api.Hook{
|
||||
ID: w.ID,
|
||||
Name: w.Name,
|
||||
Type: w.Type,
|
||||
URL: fmt.Sprintf("%s/settings/hooks/%d", repoLink, w.ID),
|
||||
Active: w.IsActive,
|
||||
|
||||
Reference in New Issue
Block a user