Skip to content

Commit c221767

Browse files
lunnywxiaoguang
andauthored
Move admin routers from /admin to /-/admin (#32189)
Resolve #32181 --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent dd83cfc commit c221767

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+103
-105
lines changed

models/user/user.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,6 @@ var (
565565
".",
566566
"..",
567567
".well-known",
568-
"admin",
569568
"api",
570569
"assets",
571570
"attachments",

routers/api/v1/admin/hooks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func ListHooks(ctx *context.APIContext) {
4545
}
4646
hooks := make([]*api.Hook, len(sysHooks))
4747
for i, hook := range sysHooks {
48-
h, err := webhook_service.ToHook(setting.AppURL+"/admin", hook)
48+
h, err := webhook_service.ToHook(setting.AppURL+"/-/admin", hook)
4949
if err != nil {
5050
ctx.Error(http.StatusInternalServerError, "convert.ToHook", err)
5151
return
@@ -83,7 +83,7 @@ func GetHook(ctx *context.APIContext) {
8383
}
8484
return
8585
}
86-
h, err := webhook_service.ToHook("/admin/", hook)
86+
h, err := webhook_service.ToHook("/-/admin/", hook)
8787
if err != nil {
8888
ctx.Error(http.StatusInternalServerError, "convert.ToHook", err)
8989
return

routers/api/v1/utils/hook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func checkCreateHookOption(ctx *context.APIContext, form *api.CreateHookOption)
100100
func AddSystemHook(ctx *context.APIContext, form *api.CreateHookOption) {
101101
hook, ok := addHook(ctx, form, 0, 0)
102102
if ok {
103-
h, err := webhook_service.ToHook(setting.AppSubURL+"/admin", hook)
103+
h, err := webhook_service.ToHook(setting.AppSubURL+"/-/admin", hook)
104104
if err != nil {
105105
ctx.Error(http.StatusInternalServerError, "convert.ToHook", err)
106106
return
@@ -268,7 +268,7 @@ func EditSystemHook(ctx *context.APIContext, form *api.EditHookOption, hookID in
268268
ctx.Error(http.StatusInternalServerError, "GetSystemOrDefaultWebhook", err)
269269
return
270270
}
271-
h, err := webhook_service.ToHook(setting.AppURL+"/admin", updated)
271+
h, err := webhook_service.ToHook(setting.AppURL+"/-/admin", updated)
272272
if err != nil {
273273
ctx.Error(http.StatusInternalServerError, "convert.ToHook", err)
274274
return

routers/web/admin/admin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ func DashboardPost(ctx *context.Context) {
185185
}
186186
}
187187
if form.From == "monitor" {
188-
ctx.Redirect(setting.AppSubURL + "/admin/monitor/cron")
188+
ctx.Redirect(setting.AppSubURL + "/-/admin/monitor/cron")
189189
} else {
190-
ctx.Redirect(setting.AppSubURL + "/admin")
190+
ctx.Redirect(setting.AppSubURL + "/-/admin")
191191
}
192192
}
193193

routers/web/admin/applications.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ var (
2323
func newOAuth2CommonHandlers() *user_setting.OAuth2CommonHandlers {
2424
return &user_setting.OAuth2CommonHandlers{
2525
OwnerID: 0,
26-
BasePathList: fmt.Sprintf("%s/admin/applications", setting.AppSubURL),
27-
BasePathEditPrefix: fmt.Sprintf("%s/admin/applications/oauth2", setting.AppSubURL),
26+
BasePathList: fmt.Sprintf("%s/-/admin/applications", setting.AppSubURL),
27+
BasePathEditPrefix: fmt.Sprintf("%s/-/admin/applications/oauth2", setting.AppSubURL),
2828
TplAppEdit: tplSettingsOauth2ApplicationEdit,
2929
}
3030
}

routers/web/admin/auths.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ func NewAuthSourcePost(ctx *context.Context) {
324324
log.Trace("Authentication created by admin(%s): %s", ctx.Doer.Name, form.Name)
325325

326326
ctx.Flash.Success(ctx.Tr("admin.auths.new_success", form.Name))
327-
ctx.Redirect(setting.AppSubURL + "/admin/auths")
327+
ctx.Redirect(setting.AppSubURL + "/-/admin/auths")
328328
}
329329

330330
// EditAuthSource render editing auth source page
@@ -437,7 +437,7 @@ func EditAuthSourcePost(ctx *context.Context) {
437437
log.Trace("Authentication changed by admin(%s): %d", ctx.Doer.Name, source.ID)
438438

439439
ctx.Flash.Success(ctx.Tr("admin.auths.update_success"))
440-
ctx.Redirect(setting.AppSubURL + "/admin/auths/" + strconv.FormatInt(form.ID, 10))
440+
ctx.Redirect(setting.AppSubURL + "/-/admin/auths/" + strconv.FormatInt(form.ID, 10))
441441
}
442442

443443
// DeleteAuthSource response for deleting an auth source
@@ -454,11 +454,11 @@ func DeleteAuthSource(ctx *context.Context) {
454454
} else {
455455
ctx.Flash.Error(fmt.Sprintf("auth_service.DeleteSource: %v", err))
456456
}
457-
ctx.JSONRedirect(setting.AppSubURL + "/admin/auths/" + url.PathEscape(ctx.PathParam(":authid")))
457+
ctx.JSONRedirect(setting.AppSubURL + "/-/admin/auths/" + url.PathEscape(ctx.PathParam(":authid")))
458458
return
459459
}
460460
log.Trace("Authentication deleted by admin(%s): %d", ctx.Doer.Name, source.ID)
461461

462462
ctx.Flash.Success(ctx.Tr("admin.auths.deletion_success"))
463-
ctx.JSONRedirect(setting.AppSubURL + "/admin/auths")
463+
ctx.JSONRedirect(setting.AppSubURL + "/-/admin/auths")
464464
}

routers/web/admin/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func SendTestMail(ctx *context.Context) {
4040
ctx.Flash.Info(ctx.Tr("admin.config.test_mail_sent", email))
4141
}
4242

43-
ctx.Redirect(setting.AppSubURL + "/admin/config")
43+
ctx.Redirect(setting.AppSubURL + "/-/admin/config")
4444
}
4545

4646
// TestCache test the cache settings
@@ -56,7 +56,7 @@ func TestCache(ctx *context.Context) {
5656
}
5757
}
5858

59-
ctx.Redirect(setting.AppSubURL + "/admin/config")
59+
ctx.Redirect(setting.AppSubURL + "/-/admin/config")
6060
}
6161

6262
func shadowPasswordKV(cfgItem, splitter string) string {

routers/web/admin/emails.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func ActivateEmail(ctx *context.Context) {
134134
ctx.Flash.Info(ctx.Tr("admin.emails.updated"))
135135
}
136136

137-
redirect, _ := url.Parse(setting.AppSubURL + "/admin/emails")
137+
redirect, _ := url.Parse(setting.AppSubURL + "/-/admin/emails")
138138
q := url.Values{}
139139
if val := ctx.FormTrim("q"); len(val) > 0 {
140140
q.Set("q", val)

routers/web/admin/hooks.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ func DefaultOrSystemWebhooks(ctx *context.Context) {
3636
sys["Title"] = ctx.Tr("admin.systemhooks")
3737
sys["Description"] = ctx.Tr("admin.systemhooks.desc", "https://docs.gitea.com/usage/webhooks")
3838
sys["Webhooks"], err = webhook.GetSystemWebhooks(ctx, optional.None[bool]())
39-
sys["BaseLink"] = setting.AppSubURL + "/admin/hooks"
40-
sys["BaseLinkNew"] = setting.AppSubURL + "/admin/system-hooks"
39+
sys["BaseLink"] = setting.AppSubURL + "/-/admin/hooks"
40+
sys["BaseLinkNew"] = setting.AppSubURL + "/-/admin/system-hooks"
4141
if err != nil {
4242
ctx.ServerError("GetWebhooksAdmin", err)
4343
return
@@ -46,8 +46,8 @@ func DefaultOrSystemWebhooks(ctx *context.Context) {
4646
def["Title"] = ctx.Tr("admin.defaulthooks")
4747
def["Description"] = ctx.Tr("admin.defaulthooks.desc", "https://docs.gitea.com/usage/webhooks")
4848
def["Webhooks"], err = webhook.GetDefaultWebhooks(ctx)
49-
def["BaseLink"] = setting.AppSubURL + "/admin/hooks"
50-
def["BaseLinkNew"] = setting.AppSubURL + "/admin/default-hooks"
49+
def["BaseLink"] = setting.AppSubURL + "/-/admin/hooks"
50+
def["BaseLinkNew"] = setting.AppSubURL + "/-/admin/default-hooks"
5151
if err != nil {
5252
ctx.ServerError("GetWebhooksAdmin", err)
5353
return
@@ -67,5 +67,5 @@ func DeleteDefaultOrSystemWebhook(ctx *context.Context) {
6767
ctx.Flash.Success(ctx.Tr("repo.settings.webhook_deletion_success"))
6868
}
6969

70-
ctx.JSONRedirect(setting.AppSubURL + "/admin/hooks")
70+
ctx.JSONRedirect(setting.AppSubURL + "/-/admin/hooks")
7171
}

routers/web/admin/notice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ func EmptyNotices(ctx *context.Context) {
7474

7575
log.Trace("System notices deleted by admin (%s): [start: %d]", ctx.Doer.Name, 0)
7676
ctx.Flash.Success(ctx.Tr("admin.notices.delete_success"))
77-
ctx.Redirect(setting.AppSubURL + "/admin/notices")
77+
ctx.Redirect(setting.AppSubURL + "/-/admin/notices")
7878
}

routers/web/admin/packages.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func DeletePackageVersion(ctx *context.Context) {
9999
}
100100

101101
ctx.Flash.Success(ctx.Tr("packages.settings.delete.success"))
102-
ctx.JSONRedirect(setting.AppSubURL + "/admin/packages?page=" + url.QueryEscape(ctx.FormString("page")) + "&q=" + url.QueryEscape(ctx.FormString("q")) + "&type=" + url.QueryEscape(ctx.FormString("type")))
102+
ctx.JSONRedirect(setting.AppSubURL + "/-/admin/packages?page=" + url.QueryEscape(ctx.FormString("page")) + "&q=" + url.QueryEscape(ctx.FormString("q")) + "&type=" + url.QueryEscape(ctx.FormString("type")))
103103
}
104104

105105
func CleanupExpiredData(ctx *context.Context) {
@@ -109,5 +109,5 @@ func CleanupExpiredData(ctx *context.Context) {
109109
}
110110

111111
ctx.Flash.Success(ctx.Tr("admin.packages.cleanup.success"))
112-
ctx.Redirect(setting.AppSubURL + "/admin/packages")
112+
ctx.Redirect(setting.AppSubURL + "/-/admin/packages")
113113
}

routers/web/admin/queue.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func QueueSet(ctx *context.Context) {
5353
maxNumber, err = strconv.Atoi(maxNumberStr)
5454
if err != nil {
5555
ctx.Flash.Error(ctx.Tr("admin.monitor.queue.settings.maxnumberworkers.error"))
56-
ctx.Redirect(setting.AppSubURL + "/admin/monitor/queue/" + strconv.FormatInt(qid, 10))
56+
ctx.Redirect(setting.AppSubURL + "/-/admin/monitor/queue/" + strconv.FormatInt(qid, 10))
5757
return
5858
}
5959
if maxNumber < -1 {
@@ -65,7 +65,7 @@ func QueueSet(ctx *context.Context) {
6565

6666
mq.SetWorkerMaxNumber(maxNumber)
6767
ctx.Flash.Success(ctx.Tr("admin.monitor.queue.settings.changed"))
68-
ctx.Redirect(setting.AppSubURL + "/admin/monitor/queue/" + strconv.FormatInt(qid, 10))
68+
ctx.Redirect(setting.AppSubURL + "/-/admin/monitor/queue/" + strconv.FormatInt(qid, 10))
6969
}
7070

7171
func QueueRemoveAllItems(ctx *context.Context) {
@@ -85,5 +85,5 @@ func QueueRemoveAllItems(ctx *context.Context) {
8585
}
8686

8787
ctx.Flash.Success(ctx.Tr("admin.monitor.queue.settings.remove_all_items_done"))
88-
ctx.Redirect(setting.AppSubURL + "/admin/monitor/queue/" + strconv.FormatInt(qid, 10))
88+
ctx.Redirect(setting.AppSubURL + "/-/admin/monitor/queue/" + strconv.FormatInt(qid, 10))
8989
}

routers/web/admin/repos.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func DeleteRepo(ctx *context.Context) {
5858
log.Trace("Repository deleted: %s", repo.FullName())
5959

6060
ctx.Flash.Success(ctx.Tr("repo.settings.deletion_success"))
61-
ctx.JSONRedirect(setting.AppSubURL + "/admin/repos?page=" + url.QueryEscape(ctx.FormString("page")) + "&sort=" + url.QueryEscape(ctx.FormString("sort")))
61+
ctx.JSONRedirect(setting.AppSubURL + "/-/admin/repos?page=" + url.QueryEscape(ctx.FormString("page")) + "&sort=" + url.QueryEscape(ctx.FormString("sort")))
6262
}
6363

6464
// UnadoptedRepos lists the unadopted repositories
@@ -114,15 +114,15 @@ func AdoptOrDeleteRepository(ctx *context.Context) {
114114

115115
dirSplit := strings.SplitN(dir, "/", 2)
116116
if len(dirSplit) != 2 {
117-
ctx.Redirect(setting.AppSubURL + "/admin/repos")
117+
ctx.Redirect(setting.AppSubURL + "/-/admin/repos")
118118
return
119119
}
120120

121121
ctxUser, err := user_model.GetUserByName(ctx, dirSplit[0])
122122
if err != nil {
123123
if user_model.IsErrUserNotExist(err) {
124124
log.Debug("User does not exist: %s", dirSplit[0])
125-
ctx.Redirect(setting.AppSubURL + "/admin/repos")
125+
ctx.Redirect(setting.AppSubURL + "/-/admin/repos")
126126
return
127127
}
128128
ctx.ServerError("GetUserByName", err)
@@ -160,5 +160,5 @@ func AdoptOrDeleteRepository(ctx *context.Context) {
160160
}
161161
ctx.Flash.Success(ctx.Tr("repo.delete_preexisting_success", dir))
162162
}
163-
ctx.Redirect(setting.AppSubURL + "/admin/repos/unadopted?search=true&q=" + url.QueryEscape(q) + "&page=" + url.QueryEscape(page))
163+
ctx.Redirect(setting.AppSubURL + "/-/admin/repos/unadopted?search=true&q=" + url.QueryEscape(q) + "&page=" + url.QueryEscape(page))
164164
}

routers/web/admin/runners.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ import (
99
)
1010

1111
func RedirectToDefaultSetting(ctx *context.Context) {
12-
ctx.Redirect(setting.AppSubURL + "/admin/actions/runners")
12+
ctx.Redirect(setting.AppSubURL + "/-/admin/actions/runners")
1313
}

routers/web/admin/stacktrace.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ func Stacktrace(ctx *context.Context) {
4242
func StacktraceCancel(ctx *context.Context) {
4343
pid := ctx.PathParam("pid")
4444
process.GetManager().Cancel(process.IDType(pid))
45-
ctx.JSONRedirect(setting.AppSubURL + "/admin/monitor/stacktrace")
45+
ctx.JSONRedirect(setting.AppSubURL + "/-/admin/monitor/stacktrace")
4646
}

routers/web/admin/users.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ func NewUserPost(ctx *context.Context) {
215215
}
216216

217217
ctx.Flash.Success(ctx.Tr("admin.users.new_success", u.Name))
218-
ctx.Redirect(setting.AppSubURL + "/admin/users/" + strconv.FormatInt(u.ID, 10))
218+
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + strconv.FormatInt(u.ID, 10))
219219
}
220220

221221
func prepareUserInfo(ctx *context.Context) *user_model.User {
222222
u, err := user_model.GetUserByID(ctx, ctx.PathParamInt64(":userid"))
223223
if err != nil {
224224
if user_model.IsErrUserNotExist(err) {
225-
ctx.Redirect(setting.AppSubURL + "/admin/users")
225+
ctx.Redirect(setting.AppSubURL + "/-/admin/users")
226226
} else {
227227
ctx.ServerError("GetUserByID", err)
228228
}
@@ -481,7 +481,7 @@ func EditUserPost(ctx *context.Context) {
481481
}
482482

483483
ctx.Flash.Success(ctx.Tr("admin.users.update_profile_success"))
484-
ctx.Redirect(setting.AppSubURL + "/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
484+
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
485485
}
486486

487487
// DeleteUser response for deleting a user
@@ -495,24 +495,24 @@ func DeleteUser(ctx *context.Context) {
495495
// admin should not delete themself
496496
if u.ID == ctx.Doer.ID {
497497
ctx.Flash.Error(ctx.Tr("admin.users.cannot_delete_self"))
498-
ctx.Redirect(setting.AppSubURL + "/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
498+
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
499499
return
500500
}
501501

502502
if err = user_service.DeleteUser(ctx, u, ctx.FormBool("purge")); err != nil {
503503
switch {
504504
case models.IsErrUserOwnRepos(err):
505505
ctx.Flash.Error(ctx.Tr("admin.users.still_own_repo"))
506-
ctx.Redirect(setting.AppSubURL + "/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
506+
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
507507
case models.IsErrUserHasOrgs(err):
508508
ctx.Flash.Error(ctx.Tr("admin.users.still_has_org"))
509-
ctx.Redirect(setting.AppSubURL + "/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
509+
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
510510
case models.IsErrUserOwnPackages(err):
511511
ctx.Flash.Error(ctx.Tr("admin.users.still_own_packages"))
512-
ctx.Redirect(setting.AppSubURL + "/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
512+
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
513513
case models.IsErrDeleteLastAdminUser(err):
514514
ctx.Flash.Error(ctx.Tr("auth.last_admin"))
515-
ctx.Redirect(setting.AppSubURL + "/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
515+
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
516516
default:
517517
ctx.ServerError("DeleteUser", err)
518518
}
@@ -521,7 +521,7 @@ func DeleteUser(ctx *context.Context) {
521521
log.Trace("Account deleted by admin (%s): %s", ctx.Doer.Name, u.Name)
522522

523523
ctx.Flash.Success(ctx.Tr("admin.users.deletion_success"))
524-
ctx.Redirect(setting.AppSubURL + "/admin/users")
524+
ctx.Redirect(setting.AppSubURL + "/-/admin/users")
525525
}
526526

527527
// AvatarPost response for change user's avatar request
@@ -538,7 +538,7 @@ func AvatarPost(ctx *context.Context) {
538538
ctx.Flash.Success(ctx.Tr("settings.update_user_avatar_success"))
539539
}
540540

541-
ctx.Redirect(setting.AppSubURL + "/admin/users/" + strconv.FormatInt(u.ID, 10))
541+
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + strconv.FormatInt(u.ID, 10))
542542
}
543543

544544
// DeleteAvatar render delete avatar page
@@ -552,5 +552,5 @@ func DeleteAvatar(ctx *context.Context) {
552552
ctx.Flash.Error(err.Error())
553553
}
554554

555-
ctx.JSONRedirect(setting.AppSubURL + "/admin/users/" + strconv.FormatInt(u.ID, 10))
555+
ctx.JSONRedirect(setting.AppSubURL + "/-/admin/users/" + strconv.FormatInt(u.ID, 10))
556556
}

routers/web/repo/setting/runners.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func getRunnersCtx(ctx *context.Context) (*runnersCtx, error) {
7676
IsAdmin: true,
7777
RunnersTemplate: tplAdminRunners,
7878
RunnerEditTemplate: tplAdminRunnerEdit,
79-
RedirectLink: setting.AppSubURL + "/admin/actions/runners/",
79+
RedirectLink: setting.AppSubURL + "/-/admin/actions/runners/",
8080
}, nil
8181
}
8282

routers/web/repo/setting/variables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func getVariablesCtx(ctx *context.Context) (*variablesCtx, error) {
7474
RepoID: 0,
7575
IsGlobal: true,
7676
VariablesTemplate: tplAdminVariables,
77-
RedirectLink: setting.AppSubURL + "/admin/actions/variables",
77+
RedirectLink: setting.AppSubURL + "/-/admin/actions/variables",
7878
}, nil
7979
}
8080

routers/web/repo/setting/webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
100100
return &ownerRepoCtx{
101101
IsAdmin: true,
102102
IsSystemWebhook: ctx.PathParam(":configType") == "system-hooks",
103-
Link: path.Join(setting.AppSubURL, "/admin/hooks"),
104-
LinkNew: path.Join(setting.AppSubURL, "/admin/", ctx.PathParam(":configType")),
103+
Link: path.Join(setting.AppSubURL, "/-/admin/hooks"),
104+
LinkNew: path.Join(setting.AppSubURL, "/-/admin/", ctx.PathParam(":configType")),
105105
NewTemplate: tplAdminHookNew,
106106
}, nil
107107
}

routers/web/web.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ func registerRoutes(m *web.Router) {
683683
adminReq := verifyAuthWithOptions(&common.VerifyOptions{SignInRequired: true, AdminRequired: true})
684684

685685
// ***** START: Admin *****
686-
m.Group("/admin", func() {
686+
m.Group("/-/admin", func() {
687687
m.Get("", admin.Dashboard)
688688
m.Get("/system_status", admin.SystemStatus)
689689
m.Post("", web.Bind(forms.AdminDashboardForm{}), admin.DashboardPost)

templates/admin/auth/list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h4 class="ui top attached header">
44
{{ctx.Locale.Tr "admin.auths.auth_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
55
<div class="ui right">
6-
<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/auths/new">{{ctx.Locale.Tr "admin.auths.new"}}</a>
6+
<a class="ui primary tiny button" href="{{AppSubUrl}}/-/admin/auths/new">{{ctx.Locale.Tr "admin.auths.new"}}</a>
77
</div>
88
</h4>
99
<div class="ui attached table segment">
@@ -23,12 +23,12 @@
2323
{{range .Sources}}
2424
<tr>
2525
<td>{{.ID}}</td>
26-
<td><a href="{{AppSubUrl}}/admin/auths/{{.ID}}">{{.Name}}</a></td>
26+
<td><a href="{{AppSubUrl}}/-/admin/auths/{{.ID}}">{{.Name}}</a></td>
2727
<td>{{.TypeName}}</td>
2828
<td>{{svg (Iif .IsActive "octicon-check" "octicon-x")}}</td>
2929
<td>{{DateTime "short" .UpdatedUnix}}</td>
3030
<td>{{DateTime "short" .CreatedUnix}}</td>
31-
<td><a href="{{AppSubUrl}}/admin/auths/{{.ID}}">{{svg "octicon-pencil"}}</a></td>
31+
<td><a href="{{AppSubUrl}}/-/admin/auths/{{.ID}}">{{svg "octicon-pencil"}}</a></td>
3232
</tr>
3333
{{end}}
3434
</tbody>

0 commit comments

Comments
 (0)