mirror of
https://github.com/goharbor/harbor.git
synced 2024-10-02 07:18:01 +02:00
commit
9a624c1dfc
16
src/ui/controllers/error.go
Normal file
16
src/ui/controllers/error.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/astaxie/beego"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ErrorController handles beego error pages
|
||||||
|
type ErrorController struct {
|
||||||
|
beego.Controller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Error404 renders the 404 page
|
||||||
|
func (ec *ErrorController) Error404() {
|
||||||
|
ec.Data["content"] = "page not found"
|
||||||
|
ec.TplName = "404.tpl"
|
||||||
|
}
|
@ -107,4 +107,7 @@ func initRouters() {
|
|||||||
//external service that hosted on harbor process:
|
//external service that hosted on harbor process:
|
||||||
beego.Router("/service/notifications", &service.NotificationHandler{})
|
beego.Router("/service/notifications", &service.NotificationHandler{})
|
||||||
beego.Router("/service/token", &token.Handler{})
|
beego.Router("/service/token", &token.Handler{})
|
||||||
|
|
||||||
|
//Error pages
|
||||||
|
beego.ErrorController(&controllers.ErrorController{})
|
||||||
}
|
}
|
||||||
|
75
src/ui/views/404.tpl
Normal file
75
src/ui/views/404.tpl
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>404 - Page Not Found</title>
|
||||||
|
<style>
|
||||||
|
|
||||||
|
*{
|
||||||
|
maring: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link{
|
||||||
|
color: #1f3759;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a:active{
|
||||||
|
color: #1f3759;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a:hover{
|
||||||
|
color: #9fb7d9;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a:visited{
|
||||||
|
color: #1f3759;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.underline, .underline{
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content{
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 800px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main-body{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-code {
|
||||||
|
font-weight: bolder;
|
||||||
|
font-size: 4em;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-text {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 3em;
|
||||||
|
margin-left: 10px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-subtitle {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="content">
|
||||||
|
<div id="main-body">
|
||||||
|
<div>
|
||||||
|
<span class="status-code">404</span>
|
||||||
|
<span class="status-text">Page Not Found</span>
|
||||||
|
</div>
|
||||||
|
<div class="status-subtitle">
|
||||||
|
<p> <a href="/harbor" class="underline">Home</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user