Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
d24b7a30
提交
d24b7a30
authored
1月 17, 2018
作者:
xuxueli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
国际化
上级
82d6375e
显示空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
134 行增加
和
38 行删除
+134
-38
CookieInterceptor.java
...l/job/admin/controller/interceptor/CookieInterceptor.java
+8
-0
FtlUtil.java
...in/src/main/java/com/xxl/job/admin/core/util/FtlUtil.java
+25
-0
I18nUtil.java
...n/src/main/java/com/xxl/job/admin/core/util/I18nUtil.java
+7
-1
message.properties
xxl-job-admin/src/main/resources/i18n/message.properties
+21
-0
message_en.properties
xxl-job-admin/src/main/resources/i18n/message_en.properties
+7
-0
message_zh.properties
xxl-job-admin/src/main/resources/i18n/message_zh.properties
+7
-0
common.macro.ftl
.../src/main/webapp/WEB-INF/template/common/common.macro.ftl
+14
-4
help.ftl
xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl
+2
-2
index.ftl
xxl-job-admin/src/main/webapp/WEB-INF/template/index.ftl
+3
-2
jobcode.index.ftl
...rc/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl
+1
-1
jobgroup.index.ftl
.../main/webapp/WEB-INF/template/jobgroup/jobgroup.index.ftl
+2
-2
jobinfo.index.ftl
...rc/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl
+2
-2
joblog.detail.ftl
...src/main/webapp/WEB-INF/template/joblog/joblog.detail.ftl
+1
-1
joblog.index.ftl
.../src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl
+2
-2
login.ftl
xxl-job-admin/src/main/webapp/WEB-INF/template/login.ftl
+18
-6
common.1.js
xxl-job-admin/src/main/webapp/static/js/common.1.js
+5
-4
index.js
xxl-job-admin/src/main/webapp/static/js/index.js
+0
-2
login.1.js
xxl-job-admin/src/main/webapp/static/js/login.1.js
+9
-9
没有找到文件。
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java
浏览文件 @
d24b7a30
package
com
.
xxl
.
job
.
admin
.
controller
.
interceptor
;
import
com.xxl.job.admin.core.util.FtlUtil
;
import
com.xxl.job.admin.core.util.I18nUtil
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
...
...
@@ -20,6 +22,7 @@ public class CookieInterceptor extends HandlerInterceptorAdapter {
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
// cookie
if
(
modelAndView
!=
null
&&
ArrayUtils
.
isNotEmpty
(
request
.
getCookies
()))
{
HashMap
<
String
,
Cookie
>
cookieMap
=
new
HashMap
<
String
,
Cookie
>();
for
(
Cookie
ck
:
request
.
getCookies
())
{
...
...
@@ -28,6 +31,11 @@ public class CookieInterceptor extends HandlerInterceptorAdapter {
modelAndView
.
addObject
(
"cookieMap"
,
cookieMap
);
}
// static method
if
(
modelAndView
!=
null
)
{
modelAndView
.
addObject
(
"I18nUtil"
,
FtlUtil
.
generateStaticModel
(
I18nUtil
.
class
.
getName
()));
}
super
.
postHandle
(
request
,
response
,
handler
,
modelAndView
);
}
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/FtlUtil.java
0 → 100644
浏览文件 @
d24b7a30
package
com
.
xxl
.
job
.
admin
.
core
.
util
;
import
freemarker.ext.beans.BeansWrapper
;
import
freemarker.template.TemplateHashModel
;
/**
* ftl util
*
* @author xuxueli 2018-01-17 20:37:48
*/
public
class
FtlUtil
{
public
static
TemplateHashModel
generateStaticModel
(
String
packageName
)
{
try
{
BeansWrapper
wrapper
=
BeansWrapper
.
getDefaultInstance
();
TemplateHashModel
staticModels
=
wrapper
.
getStaticModels
();
TemplateHashModel
fileStatics
=
(
TemplateHashModel
)
staticModels
.
get
(
packageName
);
return
fileStatics
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/I18nUtil.java
浏览文件 @
d24b7a30
...
...
@@ -10,14 +10,20 @@ import org.springframework.core.io.support.PropertiesLoaderUtils;
import
java.io.IOException
;
import
java.util.Properties
;
/**
* i18n util
*
* @author xuxueli 2018-01-17 20:39:06
*/
public
class
I18nUtil
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
I18nUtil
.
class
);
private
static
final
String
i18n_file
=
"i18n/message.properties"
;
private
static
Properties
prop
=
null
;
private
static
boolean
prop_cache
=
false
;
public
static
Properties
loadI18nProp
(){
if
(
prop
==
null
)
{
if
(
prop
_cache
&&
prop
==
null
)
{
try
{
Resource
resource
=
new
ClassPathResource
(
i18n_file
);
EncodedResource
encodedResource
=
new
EncodedResource
(
resource
,
"UTF-8"
);
...
...
xxl-job-admin/src/main/resources/i18n/message.properties
浏览文件 @
d24b7a30
admin_name
=
任务调度中心
login_btn
=
登录
login_remember_me
=
记住密码
login_username_placeholder
=
请输入登录账号
login_password_placeholder
=
请输入登录密码
login_username_empty
=
请输入登录账号
login_username_lt_5
=
登录账号不应低于5位
login_password_empty
=
请输入登录密码
login_password_lt_5
=
登录密码不应低于5位
login_success
=
登录成功
login_fail
=
登录失败
logout_btn
=
注销
logout_confirm
=
确认注销登录?
logout_success
=
注销成功
logout_fail
=
注销失败
system_tips
=
系统提示
system_ok
=
确定2
system_close
=
关闭2
\ No newline at end of file
xxl-job-admin/src/main/resources/i18n/message_en.properties
浏览文件 @
d24b7a30
admin_name
=
Job Scheduling Center
login_btn
=
Login
login_remember_me
=
Remember Me
login_username_placeholder
=
Please input username
login_password_placeholder
=
Please input password
\ No newline at end of file
xxl-job-admin/src/main/resources/i18n/message_zh.properties
0 → 100644
浏览文件 @
d24b7a30
admin_name
=
任务调度中心
login_btn
=
登录
login_remember_me
=
记住密码
login_username_placeholder
=
请输入登录账号
login_password_placeholder
=
请输入登录密码
\ No newline at end of file
xxl-job-admin/src/main/webapp/WEB-INF/template/common/common.macro.ftl
浏览文件 @
d24b7a30
...
...
@@ -53,7 +53,17 @@
<#-- common -->
<script src="${request.contextPath}/static/js/common.1.js"></script>
<script>var base_url = '${request.contextPath}';</script>
<script>
var base_url = '${request.contextPath}';
var system_tips = '${I18nUtil.getString("system_tips")}';
var system_ok = '${I18nUtil.getString("system_ok")}';
var system_close = '${I18nUtil.getString("system_close")}';
var logout_confirm = '${I18nUtil.getString("logout_confirm")}';
var logout_success = '${I18nUtil.getString("logout_success")}';
var logout_fail = '${I18nUtil.getString("logout_fail")}';
</script>
</#macro>
...
...
@@ -61,7 +71,7 @@
<header class="main-header">
<a href="${request.contextPath}/" class="logo">
<span class="logo-mini"><b>XXL</b></span>
<span class="logo-lg"><b>
任务调度中心
</b></span>
<span class="logo-lg"><b>
${I18nUtil.getString("admin_name")}
</b></span>
</a>
<nav class="navbar navbar-static-top" role="navigation">
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"><span class="sr-only">切换导航</span></a>
...
...
@@ -69,7 +79,7 @@
<ul class="nav navbar-nav">
<li class="dropdown user user-menu">
<a href=";" id="logoutBtn" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="hidden-xs">
注销
</span>
<span class="hidden-xs">
${I18nUtil.getString("logout_btn")}
</span>
</a>
</li>
</ul>
...
...
@@ -175,7 +185,7 @@
<#macro commonFooter >
<footer class="main-footer">
Powered by <b>XXL-JOB</b> 1.9.1(
快照版本
)
Powered by <b>XXL-JOB</b> 1.9.1(
SNAPSHOT
)
<div class="pull-right hidden-xs">
<strong>Copyright © 2015-${.now?string('yyyy')}
<a href="http://www.xuxueli.com/" target="_blank" >xuxueli</a>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl
浏览文件 @
d24b7a30
<!DOCTYPE html>
<html>
<head>
<title>
任务调度中心
</title>
<title>
${I18nUtil.getString("admin_name")}
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
</head>
...
...
@@ -16,7 +16,7 @@
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<h1>
使用教程
<
small>
任务调度中心
</small><
/h1>
<h1>
使用教程
</h1>
<!--
<ol class="breadcrumb">
<li><a><i class="fa fa-dashboard"></i>调度中心</a></li>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/index.ftl
浏览文件 @
d24b7a30
<!DOCTYPE html>
<html>
<head>
<title>
任务调度中心
</title>
<title>
${I18nUtil.getString("admin_name")}
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
<!-- daterangepicker -->
...
...
@@ -18,8 +18,9 @@
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<h1>
运行报表
<
small>
任务调度中心
</small><
/h1>
<h1>
运行报表
</h1>
<!--
<h1>运行报表<small>任务调度中心</small></h1>
<ol class="breadcrumb">
<li><a><i class="fa fa-dashboard"></i>调度中心</a></li>
<li class="active">使用教程</li>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl
浏览文件 @
d24b7a30
<!DOCTYPE html>
<html>
<head>
<title>
任务调度中心
</title>
<title>
${I18nUtil.getString("admin_name")}
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
<link
rel=
"stylesheet"
href=
"${request.contextPath}/static/plugins/codemirror/lib/codemirror.css"
>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/jobgroup/jobgroup.index.ftl
浏览文件 @
d24b7a30
<!DOCTYPE html>
<html>
<head>
<title>
任务调度中心
</title>
<title>
${I18nUtil.getString("admin_name")}
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
<!-- DataTables -->
...
...
@@ -18,7 +18,7 @@
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<h1>
执行器管理
<
small>
任务调度中心
</small><
/h1>
<h1>
执行器管理
</h1>
</section>
<!-- Main content -->
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl
浏览文件 @
d24b7a30
<!DOCTYPE html>
<html>
<head>
<title>
任务调度中心
</title>
<title>
${I18nUtil.getString("admin_name")}
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
<!-- DataTables -->
...
...
@@ -19,7 +19,7 @@
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<h1>
任务管理
<
small>
任务调度中心
</small><
/h1>
<h1>
任务管理
</h1>
<!--
<ol class="breadcrumb">
<li><a><i class="fa fa-dashboard"></i>调度管理</a></li>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.detail.ftl
浏览文件 @
d24b7a30
<!DOCTYPE html>
<html>
<head>
<title>
任务调度中心
</title>
<title>
${I18nUtil.getString("admin_name")}
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
</head>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl
浏览文件 @
d24b7a30
<!DOCTYPE html>
<html>
<head>
<title>
任务调度中心
</title>
<title>
${I18nUtil.getString("admin_name")}
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
<!-- DataTables -->
...
...
@@ -20,7 +20,7 @@
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<h1>
调度日志
<
small>
任务调度中心
</small><
/h1>
<h1>
调度日志
</h1>
<!--
<ol class="breadcrumb">
<li><a><i class="fa fa-dashboard"></i>调度日志</a></li>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/login.ftl
浏览文件 @
d24b7a30
<!DOCTYPE html>
<html>
<head>
<title>
调度中心
</title>
<title>
${I18nUtil.getString("admin_name")}
</title>
<
#
import
"/
common
/
common
.
macro
.
ftl
"
as
netCommon
>
<
@
netCommon
.
commonStyle
/>
<link
rel=
"stylesheet"
href=
"${request.contextPath}/static/adminlte/plugins/iCheck/square/blue.css"
>
...
...
@@ -13,31 +13,43 @@
</div>
<form
id=
"loginForm"
method=
"post"
>
<div
class=
"login-box-body"
>
<p
class=
"login-box-msg"
>
任务调度中心
</p>
<p
class=
"login-box-msg"
>
${I18nUtil.getString("admin_name")}
</p>
<div
class=
"form-group has-feedback"
>
<input
type=
"text"
name=
"userName"
class=
"form-control"
placeholder=
"
请输入登录账号"
value=
"admin
"
>
<input
type=
"text"
name=
"userName"
class=
"form-control"
placeholder=
"
${I18nUtil.getString("
login_username_placeholder
")}"
value=
"admin"
maxlength=
"18
"
>
<span
class=
"glyphicon glyphicon-envelope form-control-feedback"
></span>
</div>
<div
class=
"form-group has-feedback"
>
<input
type=
"password"
name=
"password"
class=
"form-control"
placeholder=
"
请输入登录密码"
value=
"123456
"
>
<input
type=
"password"
name=
"password"
class=
"form-control"
placeholder=
"
${I18nUtil.getString("
login_password_placeholder
")}"
value=
"123456"
maxlength=
"18
"
>
<span
class=
"glyphicon glyphicon-lock form-control-feedback"
></span>
</div>
<div
class=
"row"
>
<div
class=
"col-xs-8"
>
<div
class=
"checkbox icheck"
>
<label>
<input
type=
"checkbox"
name=
"ifRemember"
>
Remember Me
<input
type=
"checkbox"
name=
"ifRemember"
>
${I18nUtil.getString("login_remember_me")}
</label>
</div>
</div>
<!-- /.col -->
<div
class=
"col-xs-4"
>
<button
type=
"submit"
class=
"btn btn-primary btn-block btn-flat"
>
登录
</button>
<button
type=
"submit"
class=
"btn btn-primary btn-block btn-flat"
>
${I18nUtil.getString("login_btn")}
</button>
</div>
</div>
</div>
</form>
</div>
<
@
netCommon
.
commonScript
/>
<script>
var
login_username_empty
=
'${I18nUtil.getString("login_username_empty")}'
;
var
login_username_lt_5
=
'${I18nUtil.getString("login_username_lt_5")}'
;
var
login_password_empty
=
'${I18nUtil.getString("login_password_empty")}'
;
var
login_password_lt_5
=
'${I18nUtil.getString("login_password_lt_5")}'
;
var
login_success
=
'${I18nUtil.getString("login_success")}'
;
var
login_fail
=
'${I18nUtil.getString("login_fail")}'
;
var
system_tips
=
'${I18nUtil.getString("system_tips")}'
;
var
system_ok
=
'${I18nUtil.getString("system_ok")}'
;
</script>
<script
src=
"${request.contextPath}/static/plugins/jquery/jquery.validate.min.js"
></script>
<script
src=
"${request.contextPath}/static/adminlte/plugins/iCheck/icheck.min.js"
></script>
<script
src=
"${request.contextPath}/static/js/login.1.js"
></script>
...
...
xxl-job-admin/src/main/webapp/static/js/common.1.js
浏览文件 @
d24b7a30
...
...
@@ -2,12 +2,12 @@ $(function(){
// logout
$
(
"#logoutBtn"
).
click
(
function
(){
layer
.
confirm
(
'确认注销登录?'
,
{
icon
:
3
,
title
:
'系统提示'
},
function
(
index
){
layer
.
confirm
(
logout_confirm
,
{
icon
:
3
,
title
:
system_tips
},
function
(
index
){
layer
.
close
(
index
);
$
.
post
(
base_url
+
"/logout"
,
function
(
data
,
status
)
{
if
(
data
.
code
==
"200"
)
{
layer
.
msg
(
'注销成功'
);
layer
.
msg
(
logout_success
);
setTimeout
(
function
(){
window
.
location
.
href
=
base_url
+
"/"
;
},
500
);
...
...
@@ -21,8 +21,9 @@ $(function(){
});*/
}
else
{
layer
.
open
({
title
:
'系统提示'
,
content
:
(
data
.
msg
||
"操作失败"
),
title
:
system_tips
,
btn
:
[
system_ok
,
system_close
],
content
:
(
data
.
msg
||
logout_fail
),
icon
:
'2'
});
}
...
...
xxl-job-admin/src/main/webapp/static/js/index.js
浏览文件 @
d24b7a30
/**
* Created by xuxueli on 17/4/24.
*/
$
(
function
()
{
// 过滤时间
...
...
xxl-job-admin/src/main/webapp/static/js/login.1.js
浏览文件 @
d24b7a30
...
...
@@ -25,14 +25,13 @@ $(function(){
},
messages
:
{
userName
:
{
required
:
"请输入登录账号."
,
minlength
:
"登录账号不应低于5位"
,
maxlength
:
"登录账号不应超过18位"
required
:
login_username_empty
,
minlength
:
login_username_lt_5
},
password
:
{
required
:
"请输入登录密码."
,
minlength
:
"登录密码不应低于5位"
,
maxlength
:
"登录密码不应超过18位"
required
:
login_password_empty
,
minlength
:
login_password_lt_5
/*,maxlength:"登录密码不应超过18位"*/
}
},
highlight
:
function
(
element
)
{
...
...
@@ -48,7 +47,7 @@ $(function(){
submitHandler
:
function
(
form
)
{
$
.
post
(
base_url
+
"/login"
,
$
(
"#loginForm"
).
serialize
(),
function
(
data
,
status
)
{
if
(
data
.
code
==
"200"
)
{
layer
.
msg
(
'登录成功'
);
layer
.
msg
(
login_success
);
setTimeout
(
function
(){
window
.
location
.
href
=
base_url
;
},
500
);
...
...
@@ -62,8 +61,9 @@ $(function(){
});*/
}
else
{
layer
.
open
({
title
:
'系统提示'
,
content
:
(
data
.
msg
||
"登录失败"
),
title
:
system_tips
,
btn
:
[
system_ok
],
content
:
(
data
.
msg
||
login_fail
),
icon
:
'2'
});
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论