feat(runner): add runner page in repo and org settings

This commit is contained in:
fuxiaohei
2022-10-19 21:19:29 +08:00
committed by Jason Song
parent c3530bf47c
commit 38b36edc5c
11 changed files with 85 additions and 97 deletions

View File

@@ -0,0 +1,26 @@
package org
import (
"net/http"
"code.gitea.io/gitea/models/webhook"
"code.gitea.io/gitea/modules/context"
)
// Runners render runners page
func Runners(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("org.settings")
ctx.Data["PageIsOrgSettings"] = true
ctx.Data["PageIsOrgSettingsRunners"] = true
ctx.Data["BaseLink"] = ctx.Org.OrgLink + "/settings/runners"
ctx.Data["Description"] = ctx.Tr("org.settings.runners_desc")
ws, err := webhook.ListWebhooksByOpts(ctx, &webhook.ListWebhookOptions{OrgID: ctx.Org.Organization.ID})
if err != nil {
ctx.ServerError("GetWebhooksByOrgId", err)
return
}
ctx.Data["Webhooks"] = ws
ctx.HTML(http.StatusOK, tplSettingsRunners)
}