mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-27 04:35:16 +01:00
parent
373acba9fa
commit
e7da22d812
@ -14,13 +14,23 @@
|
||||
|
||||
package controllers
|
||||
|
||||
import "github.com/astaxie/beego"
|
||||
import (
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/vmware/harbor/src/ui/config"
|
||||
)
|
||||
|
||||
// IndexController handles request to /
|
||||
type IndexController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
//Prepare to check if incoming requests should be served
|
||||
func (ic *IndexController) Prepare() {
|
||||
if config.WithAdmiral() {
|
||||
ic.Redirect(config.AdmiralEndpoint(), 302)
|
||||
}
|
||||
}
|
||||
|
||||
// Get renders the index page
|
||||
func (ic *IndexController) Get() {
|
||||
ic.TplExt = "html"
|
||||
|
@ -30,9 +30,6 @@ func initRouters() {
|
||||
beego.SetStaticPath("/static", "./static")
|
||||
beego.SetStaticPath("/i18n", "./static/i18n")
|
||||
|
||||
// standalone
|
||||
if !config.WithAdmiral() {
|
||||
//Disable page access in integration mode.
|
||||
//Page Controllers:
|
||||
beego.Router("/", &controllers.IndexController{})
|
||||
beego.Router("/sign-in", &controllers.IndexController{})
|
||||
@ -46,6 +43,7 @@ func initRouters() {
|
||||
beego.Router("/harbor/dashboard", &controllers.IndexController{})
|
||||
beego.Router("/harbor/projects", &controllers.IndexController{})
|
||||
beego.Router("/harbor/projects/:id/repositories", &controllers.IndexController{})
|
||||
beego.Router("/harbor/projects/:id/repositories/*", &controllers.IndexController{})
|
||||
beego.Router("/harbor/projects/:id/replications", &controllers.IndexController{})
|
||||
beego.Router("/harbor/projects/:id/members", &controllers.IndexController{})
|
||||
beego.Router("/harbor/projects/:id/logs", &controllers.IndexController{})
|
||||
@ -59,6 +57,9 @@ func initRouters() {
|
||||
beego.Router("/harbor/tags", &controllers.IndexController{})
|
||||
beego.Router("/harbor/configs", &controllers.IndexController{})
|
||||
|
||||
// standalone
|
||||
if !config.WithAdmiral() {
|
||||
//Controller API:
|
||||
beego.Router("/login", &controllers.CommonController{}, "post:Login")
|
||||
beego.Router("/log_out", &controllers.CommonController{}, "get:LogOut")
|
||||
beego.Router("/reset", &controllers.CommonController{}, "post:ResetPassword")
|
||||
|
Loading…
Reference in New Issue
Block a user