Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
git test
Jpress
Commits
f782e4a4
Commit
f782e4a4
authored
6 years ago
by
fuhai999@gmail.com
Browse files
Options
Download
Email Patches
Plain Diff
v2.0.2
parent
e97f8559
No related merge requests found
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
jpress-core/src/main/java/io/jpress/web/base/AdminControllerBase.java
+9
-0
...src/main/java/io/jpress/web/base/AdminControllerBase.java
jpress-core/src/main/java/io/jpress/web/render/JPressRenderFactory.java
+8
-0
...c/main/java/io/jpress/web/render/JPressRenderFactory.java
jpress-web/src/main/java/io/jpress/web/WebInitializer.java
+1
-0
jpress-web/src/main/java/io/jpress/web/WebInitializer.java
jpress-web/src/main/webapp/WEB-INF/views/admin/_layout/_errpage.html
+61
-0
...src/main/webapp/WEB-INF/views/admin/_layout/_errpage.html
jpress-web/src/main/webapp/WEB-INF/views/admin/_layout/_layer.html
+1
-0
...b/src/main/webapp/WEB-INF/views/admin/_layout/_layer.html
jpress-web/src/main/webapp/WEB-INF/views/admin/error/404.html
+9
-35
...ss-web/src/main/webapp/WEB-INF/views/admin/error/404.html
jpress-web/src/main/webapp/WEB-INF/views/admin/error/500.html
+9
-34
...ss-web/src/main/webapp/WEB-INF/views/admin/error/500.html
jpress-web/src/main/webapp/WEB-INF/views/admin/error/nopermission.html
+6
-28
...c/main/webapp/WEB-INF/views/admin/error/nopermission.html
with
104 additions
and
97 deletions
+104
-97
jpress-core/src/main/java/io/jpress/web/base/AdminControllerBase.java
+
9
-
0
View file @
f782e4a4
...
...
@@ -81,5 +81,14 @@ public abstract class AdminControllerBase extends ControllerBase {
}
}
@Override
public
void
renderError
(
int
errorCode
)
{
if
(
errorCode
==
404
)
{
renderError
(
errorCode
,
"/WEB-INF/views/admin/error/404.html"
);
}
else
{
renderError
(
errorCode
,
"/WEB-INF/views/admin/error/500.html"
);
}
}
}
This diff is collapsed.
Click to expand it.
jpress-core/src/main/java/io/jpress/web/render/JPressRenderFactory.java
+
8
-
0
View file @
f782e4a4
...
...
@@ -37,6 +37,14 @@ public class JPressRenderFactory extends JbootRenderFactory {
@Override
public
Render
getErrorRender
(
int
errorCode
)
{
if
(
JPressHandler
.
getCurrentTarget
().
startsWith
(
"/admin/"
))
{
if
(
errorCode
==
404
)
{
return
getErrorRender
(
errorCode
,
"/WEB-INF/views/admin/error/404.html"
);
}
else
{
return
getErrorRender
(
errorCode
,
"/WEB-INF/views/admin/error/500.html"
);
}
}
Controller
currentController
=
JbootControllerContext
.
get
();
if
(
currentController
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
jpress-web/src/main/java/io/jpress/web/WebInitializer.java
+
1
-
0
View file @
f782e4a4
...
...
@@ -34,6 +34,7 @@ public class WebInitializer extends JbootAppListenerBase {
try
{
engine
.
addSharedFunction
(
"/WEB-INF/views/admin/_layout/_layout.html"
);
engine
.
addSharedFunction
(
"/WEB-INF/views/admin/_layout/_layer.html"
);
engine
.
addSharedFunction
(
"/WEB-INF/views/admin/_layout/_errpage.html"
);
engine
.
addSharedFunction
(
"/WEB-INF/views/admin/_layout/_paginate.html"
);
engine
.
addSharedFunction
(
"/WEB-INF/views/ucenter/_layout/_layout.html"
);
engine
.
addSharedStaticMethod
(
PermissionKits
.
class
);
...
...
This diff is collapsed.
Click to expand it.
jpress-web/src/main/webapp/WEB-INF/views/admin/_layout/_errpage.html
0 → 100755
+
61
-
0
View file @
f782e4a4
#define errpage()
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
>
<title>
发生错误了...
</title>
<link
rel=
"stylesheet"
href=
"#(CPATH)/static/components/bootstrap/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"#(CPATH)/static/components/font-awesome/css/font-awesome.min.css"
>
<link
rel=
"stylesheet"
href=
"#(CPATH)/static/adminlte/css/AdminLTE.min.css"
>
<link
rel=
"stylesheet"
href=
"#(CPATH)/static/adminlte/css/skins/skin-blue.min.css"
>
<!--[if lt IE 9]>
<script src="#(CPATH)/static/components/html5shiv/html5shiv.min.js"></script>
<script src="#(CPATH)/static/components/respond/respond.min.js"></script>
<![endif]-->
<script>
var
jpress
=
{
cpath
:
'
#(CPATH)
'
}
</script>
<style>
.error-page
>
.error-content
{
margin-left
:
0
;
display
:
block
;
text-align
:
center
;
}
.error-title
{
font-size
:
100px
;
text-align
:
center
;
}
.error-content
>
p
{
padding-left
:
20px
;
padding-right
:
20px
;
}
</style>
#@css?()
</head>
<body
class=
"hold-transition "
>
<div
class=
"wrapper"
>
#@content()
</div>
<!-- ./wrapper -->
<script
src=
"#(CPATH)/static/components/jquery/jquery.min.js"
></script>
<script
src=
"#(CPATH)/static/components/bootstrap/js/bootstrap.min.js"
></script>
<script
src=
"#(CPATH)/static/components/fastclick/fastclick.js"
></script>
<script
src=
"#(CPATH)/static/adminlte/js/adminlte.min.js"
></script>
#@script?()
</body>
</html>
#end
This diff is collapsed.
Click to expand it.
jpress-web/src/main/webapp/WEB-INF/views/admin/_layout/_layer.html
+
1
-
0
View file @
f782e4a4
...
...
@@ -4,6 +4,7 @@
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
>
<title>
JPress后台
</title>
<link
rel=
"stylesheet"
href=
"#(CPATH)/static/components/bootstrap/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"#(CPATH)/static/components/font-awesome/css/font-awesome.min.css"
>
...
...
This diff is collapsed.
Click to expand it.
jpress-web/src/main/webapp/WEB-INF/views/admin/error/404.html
+
9
-
35
View file @
f782e4a4
#@layout()
#define css()
<style>
.switchery-small
{
margin-top
:
0px
;
}
</style>
#end
#@errpage()
#define content()
<div
class=
"content-wrapper"
>
<section
class=
"content"
>
<div
class=
"error-page"
>
<h2
class=
"headline text-yellow"
>
404
</h2>
<div
class=
"error-content"
>
<h3><i
class=
"fa fa-warning text-yellow"
></i>
Oops! Page not found.
</h3>
<p>
We could not find the page you were looking for.
Meanwhile, you may
<a
href=
"../../index.html"
>
return to dashboard
</a>
or try using the search form.
</p>
<form
class=
"search-form"
>
<div
class=
"input-group"
>
<input
type=
"text"
name=
"search"
class=
"form-control"
placeholder=
"Search"
>
<div
class=
"error-page"
>
<div
class=
"error-content"
>
<div
class=
"input-group-btn"
>
<button
type=
"submit"
name=
"submit"
class=
"btn btn-warning btn-flat"
><i
class=
"fa fa-search"
></i>
</button>
</div>
</div>
</form>
</div>
</div>
</section>
<h2
class=
"error-title text-yellow"
>
404
</h2>
<h3><i
class=
"fa fa-warning text-yellow"
></i>
诶呀! 页面找不到啦。
</h3>
<p>
我们找不到您要查找的页面,您可以访问
<a
href=
"http://www.jpress.io"
target=
"_blank"
>
JPress
</a>
获得帮助。
</p>
</div>
</div>
#end
This diff is collapsed.
Click to expand it.
jpress-web/src/main/webapp/WEB-INF/views/admin/error/500.html
+
9
-
34
View file @
f782e4a4
#@layout()
#define css()
<style>
.switchery-small
{
margin-top
:
0px
;
}
</style>
#end
#@errpage()
#define content()
<div
class=
"content-wrapper"
>
<section
class=
"content"
>
<div
class=
"error-page"
>
<h2
class=
"headline text-yellow"
>
500
</h2>
<div
class=
"error-content"
>
<h3><i
class=
"fa fa-warning text-yellow"
></i>
Oops! Page not found.
</h3>
<p>
We could not find the page you were looking for.
Meanwhile, you may
<a
href=
"../../index.html"
>
return to dashboard
</a>
or try using the search form.
</p>
<form
class=
"search-form"
>
<div
class=
"input-group"
>
<input
type=
"text"
name=
"search"
class=
"form-control"
placeholder=
"Search"
>
<div
class=
"error-page"
>
<div
class=
"error-content"
>
<div
class=
"input-group-btn"
>
<button
type=
"submit"
name=
"submit"
class=
"btn btn-warning btn-flat"
><i
class=
"fa fa-search"
></i>
</button>
</div>
</div>
</form>
</div>
</div>
</section>
<h2
class=
"error-title text-yellow"
>
500
</h2>
<h3><i
class=
"fa fa-warning text-yellow"
></i>
诶呀! 系统发生错误啦。
</h3>
<p>
不要担心,我们马上就着手解决这个问题。或者您可以访问
<a
href=
"http://www.jpress.io"
target=
"_blank"
>
JPress
</a>
获得帮助。
</p>
</div>
</div>
#end
This diff is collapsed.
Click to expand it.
jpress-web/src/main/webapp/WEB-INF/views/admin/error/nopermission.html
+
6
-
28
View file @
f782e4a4
#@layout()
#define css()
<style>
.error-content
{
margin-top
:
100px
;
}
.error-page
>
.error-content
{
margin-left
:
0
;
display
:
block
;
}
.error-page
>
.error-content
>
h3
{
font-weight
:
300
;
font-size
:
35px
;
}
</style>
#end
#@errpage()
#define content()
<div
class=
"content-wrapper"
>
<section
class=
"content"
>
<div
class=
"error-page"
>
<div
class=
"error-content"
>
<h3><i
class=
"fa fa-warning text-yellow"
></i>
诶呀! 您还没有权限操作此页面。
</h3>
</div>
</div>
</section>
<div
class=
"error-page"
>
<div
class=
"error-content"
>
<h2
class=
"error-title text-yellow"
>
403
</h2>
<h3><i
class=
"fa fa-warning text-yellow"
></i>
抱歉! 您没有权限操作此页面。
</h3>
</div>
</div>
#end
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help