backport: Fix adding default Telegram webhook (#7992)

Signed-off-by: Gary Kim <gary@garykim.dev>
This commit is contained in:
Gary Kim 2019-08-27 04:24:26 +00:00 committed by Lunny Xiao
parent b6b1560701
commit 4d6c8d9b13
2 changed files with 5 additions and 0 deletions

View File

@ -440,6 +440,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Post("/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost) m.Post("/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost)
m.Post("/discord/new", bindIgnErr(auth.NewDiscordHookForm{}), repo.DiscordHooksNewPost) m.Post("/discord/new", bindIgnErr(auth.NewDiscordHookForm{}), repo.DiscordHooksNewPost)
m.Post("/dingtalk/new", bindIgnErr(auth.NewDingtalkHookForm{}), repo.DingtalkHooksNewPost) m.Post("/dingtalk/new", bindIgnErr(auth.NewDingtalkHookForm{}), repo.DingtalkHooksNewPost)
m.Post("/telegram/new", bindIgnErr(auth.NewTelegramHookForm{}), repo.TelegramHooksNewPost)
m.Post("/msteams/new", bindIgnErr(auth.NewMSTeamsHookForm{}), repo.MSTeamsHooksNewPost) m.Post("/msteams/new", bindIgnErr(auth.NewMSTeamsHookForm{}), repo.MSTeamsHooksNewPost)
m.Get("/:id", repo.WebHooksEdit) m.Get("/:id", repo.WebHooksEdit)
m.Post("/gitea/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost) m.Post("/gitea/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost)
@ -447,6 +448,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Post("/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost) m.Post("/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost)
m.Post("/discord/:id", bindIgnErr(auth.NewDiscordHookForm{}), repo.DiscordHooksEditPost) m.Post("/discord/:id", bindIgnErr(auth.NewDiscordHookForm{}), repo.DiscordHooksEditPost)
m.Post("/dingtalk/:id", bindIgnErr(auth.NewDingtalkHookForm{}), repo.DingtalkHooksEditPost) m.Post("/dingtalk/:id", bindIgnErr(auth.NewDingtalkHookForm{}), repo.DingtalkHooksEditPost)
m.Post("/telegram/:id", bindIgnErr(auth.NewTelegramHookForm{}), repo.TelegramHooksEditPost)
m.Post("/msteams/:id", bindIgnErr(auth.NewMSTeamsHookForm{}), repo.MSTeamsHooksNewPost) m.Post("/msteams/:id", bindIgnErr(auth.NewMSTeamsHookForm{}), repo.MSTeamsHooksNewPost)
}) })

View File

@ -20,6 +20,8 @@
<img class="img-13" src="{{AppSubUrl}}/img/discord.png"> <img class="img-13" src="{{AppSubUrl}}/img/discord.png">
{{else if eq .HookType "dingtalk"}} {{else if eq .HookType "dingtalk"}}
<img class="img-13" src="{{AppSubUrl}}/img/dingtalk.ico"> <img class="img-13" src="{{AppSubUrl}}/img/dingtalk.ico">
{{else if eq .HookType "telegram"}}
<img class="img-13" src="{{AppSubUrl}}/img/telegram.png">
{{else if eq .HookType "msteams"}} {{else if eq .HookType "msteams"}}
<img class="img-13" src="{{AppSubUrl}}/img/msteams.png"> <img class="img-13" src="{{AppSubUrl}}/img/msteams.png">
{{end}} {{end}}
@ -31,6 +33,7 @@
{{template "repo/settings/webhook/slack" .}} {{template "repo/settings/webhook/slack" .}}
{{template "repo/settings/webhook/discord" .}} {{template "repo/settings/webhook/discord" .}}
{{template "repo/settings/webhook/dingtalk" .}} {{template "repo/settings/webhook/dingtalk" .}}
{{template "repo/settings/webhook/telegram" .}}
{{template "repo/settings/webhook/msteams" .}} {{template "repo/settings/webhook/msteams" .}}
</div> </div>