mirror of
https://github.com/go-gitea/gitea.git
synced 2025-05-18 00:49:09 -04:00
chore: removed to shared
This commit is contained in:
parent
825b838b81
commit
9c3395c556
@ -12,7 +12,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/routers/common"
|
||||
actions_shared "code.gitea.io/gitea/routers/web/shared/actions"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -40,7 +40,7 @@ func Runners(ctx *context.Context) {
|
||||
Filter: ctx.Req.URL.Query().Get("q"),
|
||||
}
|
||||
|
||||
common.RunnersList(ctx, tplRunners, opts)
|
||||
actions_shared.RunnersList(ctx, tplRunners, opts)
|
||||
}
|
||||
|
||||
// EditRunner show editing runner page
|
||||
@ -54,7 +54,7 @@ func EditRunner(ctx *context.Context) {
|
||||
page = 1
|
||||
}
|
||||
|
||||
common.RunnerDetails(ctx, tplRunnerEdit, page, ctx.ParamsInt64(":runnerid"), 0, 0)
|
||||
actions_shared.RunnerDetails(ctx, tplRunnerEdit, page, ctx.ParamsInt64(":runnerid"), 0, 0)
|
||||
}
|
||||
|
||||
// EditRunnerPost response for editing runner
|
||||
@ -62,18 +62,18 @@ func EditRunnerPost(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.runners.edit")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminRunners"] = true
|
||||
common.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"), 0, 0,
|
||||
actions_shared.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"), 0, 0,
|
||||
setting.AppSubURL+"/admin/runners/"+url.PathEscape(ctx.Params(":runnerid")))
|
||||
}
|
||||
|
||||
// DeleteRunnerPost response for deleting a runner
|
||||
func DeleteRunnerPost(ctx *context.Context) {
|
||||
common.RunnerDeletePost(ctx, ctx.ParamsInt64(":runnerid"),
|
||||
actions_shared.RunnerDeletePost(ctx, ctx.ParamsInt64(":runnerid"),
|
||||
setting.AppSubURL+"/admin/runners/",
|
||||
setting.AppSubURL+"/admin/runners/"+url.PathEscape(ctx.Params(":runnerid")),
|
||||
)
|
||||
}
|
||||
|
||||
func ResetRunnerRegistrationToken(ctx *context.Context) {
|
||||
common.RunnerResetRegistrationToken(ctx, 0, 0, setting.AppSubURL+"/admin/runners/")
|
||||
actions_shared.RunnerResetRegistrationToken(ctx, 0, 0, setting.AppSubURL+"/admin/runners/")
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
actions_model "code.gitea.io/gitea/models/actions"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/routers/common"
|
||||
actions_shared "code.gitea.io/gitea/routers/web/shared/actions"
|
||||
)
|
||||
|
||||
// Runners render runners page
|
||||
@ -34,12 +34,12 @@ func Runners(ctx *context.Context) {
|
||||
WithAvailable: true,
|
||||
}
|
||||
|
||||
common.RunnersList(ctx, tplSettingsRunners, opts)
|
||||
actions_shared.RunnersList(ctx, tplSettingsRunners, opts)
|
||||
}
|
||||
|
||||
// ResetRunnerRegistrationToken reset runner registration token
|
||||
func ResetRunnerRegistrationToken(ctx *context.Context) {
|
||||
common.RunnerResetRegistrationToken(ctx,
|
||||
actions_shared.RunnerResetRegistrationToken(ctx,
|
||||
ctx.Org.Organization.ID, 0,
|
||||
ctx.Org.OrgLink+"/settings/runners")
|
||||
}
|
||||
@ -54,7 +54,7 @@ func RunnersEdit(ctx *context.Context) {
|
||||
page = 1
|
||||
}
|
||||
|
||||
common.RunnerDetails(ctx, tplSettingsRunnersEdit, page,
|
||||
actions_shared.RunnerDetails(ctx, tplSettingsRunnersEdit, page,
|
||||
ctx.ParamsInt64(":runnerid"), ctx.Org.Organization.ID, 0,
|
||||
)
|
||||
}
|
||||
@ -64,14 +64,14 @@ func RunnersEditPost(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("org.runners.edit")
|
||||
ctx.Data["PageIsOrgSettings"] = true
|
||||
ctx.Data["PageIsOrgSettingsRunners"] = true
|
||||
common.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"),
|
||||
actions_shared.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"),
|
||||
ctx.Org.Organization.ID, 0,
|
||||
ctx.Org.OrgLink+"/settings/runners/"+url.PathEscape(ctx.Params(":runnerid")))
|
||||
}
|
||||
|
||||
// RunnerDeletePost response for deleting runner
|
||||
func RunnerDeletePost(ctx *context.Context) {
|
||||
common.RunnerDeletePost(ctx,
|
||||
actions_shared.RunnerDeletePost(ctx,
|
||||
ctx.ParamsInt64(":runnerid"),
|
||||
ctx.Org.OrgLink+"/settings/runners",
|
||||
ctx.Org.OrgLink+"/settings/runners/"+url.PathEscape(ctx.Params(":runnerid")))
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
actions_model "code.gitea.io/gitea/models/actions"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/routers/common"
|
||||
actions_shared "code.gitea.io/gitea/routers/web/shared/actions"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -38,7 +38,7 @@ func Runners(ctx *context.Context) {
|
||||
WithAvailable: true,
|
||||
}
|
||||
|
||||
common.RunnersList(ctx, tplRunners, opts)
|
||||
actions_shared.RunnersList(ctx, tplRunners, opts)
|
||||
}
|
||||
|
||||
func RunnersEdit(ctx *context.Context) {
|
||||
@ -49,7 +49,7 @@ func RunnersEdit(ctx *context.Context) {
|
||||
page = 1
|
||||
}
|
||||
|
||||
common.RunnerDetails(ctx, tplRunnerEdit, page,
|
||||
actions_shared.RunnerDetails(ctx, tplRunnerEdit, page,
|
||||
ctx.ParamsInt64(":runnerid"), 0, ctx.Repo.Repository.ID,
|
||||
)
|
||||
}
|
||||
@ -57,20 +57,20 @@ func RunnersEdit(ctx *context.Context) {
|
||||
func RunnersEditPost(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.settings.runners")
|
||||
ctx.Data["PageIsSettingsRunners"] = true
|
||||
common.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"),
|
||||
actions_shared.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"),
|
||||
0, ctx.Repo.Repository.ID,
|
||||
ctx.Repo.RepoLink+"/settings/runners/"+url.PathEscape(ctx.Params(":runnerid")))
|
||||
}
|
||||
|
||||
func ResetRunnerRegistrationToken(ctx *context.Context) {
|
||||
common.RunnerResetRegistrationToken(ctx,
|
||||
actions_shared.RunnerResetRegistrationToken(ctx,
|
||||
0, ctx.Repo.Repository.ID,
|
||||
ctx.Repo.RepoLink+"/settings/runners")
|
||||
}
|
||||
|
||||
// RunnerDeletePost response for deleting runner
|
||||
func RunnerDeletePost(ctx *context.Context) {
|
||||
common.RunnerDeletePost(ctx, ctx.ParamsInt64(":runnerid"),
|
||||
actions_shared.RunnerDeletePost(ctx, ctx.ParamsInt64(":runnerid"),
|
||||
ctx.Repo.RepoLink+"/settings/runners",
|
||||
ctx.Repo.RepoLink+"/settings/runners/"+url.PathEscape(ctx.Params(":runnerid")))
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Copyright 2022 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package common
|
||||
package actions
|
||||
|
||||
import (
|
||||
"errors"
|
Loading…
x
Reference in New Issue
Block a user