Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
0e61a670
Commit
0e61a670
authored
Feb 06, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: error handling now displays page correctly, fixes #10777
parent
6e68c206
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
49 deletions
+41
-49
pkg/api/login_oauth.go
+2
-2
pkg/middleware/middleware.go
+3
-1
pkg/middleware/recovery.go
+1
-1
public/app/features/plugins/partials/ds_list.html
+1
-1
public/views/407.html
+0
-28
public/views/error.html
+34
-16
No files found.
pkg/api/login_oauth.go
View file @
0e61a670
...
...
@@ -40,14 +40,14 @@ func GenStateString() string {
func
OAuthLogin
(
ctx
*
middleware
.
Context
)
{
if
setting
.
OAuthService
==
nil
{
ctx
.
Handle
(
404
,
"
login.OAuthLogin(oauth service not enabled)
"
,
nil
)
ctx
.
Handle
(
404
,
"
OAuth not enabled
"
,
nil
)
return
}
name
:=
ctx
.
Params
(
":name"
)
connect
,
ok
:=
social
.
SocialMap
[
name
]
if
!
ok
{
ctx
.
Handle
(
404
,
"login.OAuthLogin(social login not enabled)"
,
errors
.
New
(
name
)
)
ctx
.
Handle
(
404
,
fmt
.
Sprintf
(
"No OAuth with name %s configured"
,
name
),
nil
)
return
}
...
...
pkg/middleware/middleware.go
View file @
0e61a670
...
...
@@ -206,7 +206,9 @@ func (ctx *Context) Handle(status int, title string, err error) {
ctx
.
Data
[
"Title"
]
=
title
ctx
.
Data
[
"AppSubUrl"
]
=
setting
.
AppSubUrl
ctx
.
HTML
(
status
,
strconv
.
Itoa
(
status
))
ctx
.
Data
[
"Theme"
]
=
"dark"
ctx
.
HTML
(
status
,
"error"
)
}
func
(
ctx
*
Context
)
JsonOK
(
message
string
)
{
...
...
pkg/middleware/recovery.go
View file @
0e61a670
...
...
@@ -137,7 +137,7 @@ func Recovery() macaron.Handler {
c
.
JSON
(
500
,
resp
)
}
else
{
c
.
HTML
(
500
,
"
500
"
)
c
.
HTML
(
500
,
"
error
"
)
}
}
}()
...
...
public/app/features/plugins/partials/ds_list.html
View file @
0e61a670
...
...
@@ -52,7 +52,7 @@
<empty-list-cta
model=
"{
title: 'There are no data sources defined yet',
buttonIcon: 'gicon gicon-add-datasources',
buttonLink: '
/
datasources/new',
buttonLink: 'datasources/new',
buttonTitle: 'Add data source',
proTip: 'You can also define data sources through configuration files.',
proTipLink: 'http://docs.grafana.org/administration/provisioning/#datasources?utm_source=grafana_ds_list',
...
...
public/views/407.html
deleted
100644 → 0
View file @
6e68c206
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<meta
name=
"viewport"
content=
"width=device-width"
>
<title>
Grafana
</title>
<base
href=
"[[.AppSubUrl]]/"
/>
<link
rel=
"stylesheet"
href=
"public/build/grafana.dark.min.css"
title=
"Dark"
>
<link
rel=
"icon"
type=
"image/png"
href=
"public/img/fav32.png"
>
</head>
<body>
<div
class=
"gf-box"
style=
"margin: 200px auto 0 auto; width: 500px;"
>
<div
class=
"gf-box-header"
>
<span
class=
"gf-box-title"
>
Proxy authentication required
</span>
</div>
<div
class=
"gf-box-body"
>
<h4>
Proxy authenticaion required
</h4>
</div>
</div>
</body>
</html>
public/views/
500
.html
→
public/views/
error
.html
View file @
0e61a670
...
...
@@ -4,32 +4,50 @@
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<meta
name=
"viewport"
content=
"width=device-width"
>
<title>
Grafana - Error
</title>
<meta
name=
"theme-color"
content=
"#000"
>
<title>
Grafana
</title>
<base
href=
"[[.AppSubUrl]]/"
/>
<link
href=
'public/css/fonts.min.css'
rel=
'stylesheet'
type=
'text/css'
>
<link
rel=
"stylesheet"
href=
"public/build/grafana.dark.min.css"
>
<link
rel=
"stylesheet"
href=
"public/build/grafana.[[ .Theme ]].css?v[[ .BuildVersion ]]"
>
<link
rel=
"icon"
type=
"image/png"
href=
"public/img/fav32.png"
>
<link
rel=
"mask-icon"
href=
"public/img/grafana_mask_icon.svg"
color=
"#F05A28"
>
</head>
<body>
<div
class=
"page-container"
>
<div
class=
"page-header"
>
<h1>
Server side error :(
</h1>
<body
class=
"theme-[[ .Theme ]]"
>
<div
class=
"main-view"
>
<div
class=
"page-container"
>
<div
class=
"page-header"
>
<div
class=
"page-header__inner"
>
<span
class=
"page-header__logo"
>
<i
class=
"page-header__icon fa fa-frown-o"
></i>
</span>
<div
class=
"page-header__info-block"
>
<h1
class=
"page-header__title"
>
<a
class=
"text-link"
href=
"login"
>
Grafana
</a><span>
/ Server Error
</span><span></span>
</h1>
<div
class=
"page-header__sub-title"
>
Sadly something went wrong
</div>
</div>
</div>
</div>
</div>
<div
class=
"pa
nel-container
"
style=
"padding: 2rem"
>
<div
class=
"pa
ge-container page-body ng-scope
"
style=
"padding: 2rem"
>
<div
class=
"alert"
>
<div
class=
"alert-icon"
><i
class=
"fa fa-exclamation-triangle"
></i></div>
<div
class=
"alert-body"
>
<div
class=
"alert-title"
>
[[.Title]]
</div>
<div
class=
"alert-text"
>
[[if .ErrorMsg]]
<pre>
[[.ErrorMsg]]
</pre>
[[end]]
</div>
</div>
<div
class=
"alert-body"
>
<div
class=
"alert-title"
>
[[.Title]]
</div>
</div>
</div>
<br
/>
[[if .ErrorMsg]]
<h4
class=
"page-heading"
>
Error details
</h4>
<div
class=
"alert-text"
>
<pre>
[[.ErrorMsg]]
</pre>
</div>
[[end]]
<div
style=
"padding: 2rem 0 0"
>
<p>
Check the Grafana server logs for the detailed error message.
</p>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment