Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gjl2004yn
jumpserver
提交
d284c217
J
jumpserver
项目概览
gjl2004yn
/
jumpserver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jumpserver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d284c217
编写于
3月 02, 2018
作者:
baltery
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Update] 修改一些小问题
上级
f7ab1395
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
37 addition
and
23 deletion
+37
-23
apps/assets/templates/assets/asset_list.html
apps/assets/templates/assets/asset_list.html
+6
-6
apps/common/mixins.py
apps/common/mixins.py
+2
-3
apps/common/templatetags/common_tags.py
apps/common/templatetags/common_tags.py
+13
-10
apps/templates/_header_bar.html
apps/templates/_header_bar.html
+1
-1
apps/users/templates/users/login.html
apps/users/templates/users/login.html
+6
-2
apps/users/views/login.py
apps/users/views/login.py
+9
-1
未找到文件。
apps/assets/templates/assets/asset_list.html
浏览文件 @
d284c217
...
...
@@ -2,6 +2,12 @@
{% load static %}
{% load i18n %}
{% block help_message %}
<div
class=
"alert alert-info help-message"
>
左侧是资产树,右击可以新建、删除、更改树节点,授权资产也是以节点方式组织的,右侧是属于该节点下的资产
</div>
{% endblock %}
{% block custom_head_css_js %}
<link
href=
"{% static 'css/plugins/ztree/awesomeStyle/awesome.css' %}"
rel=
"stylesheet"
>
<script
type=
"text/javascript"
src=
"{% static 'js/plugins/ztree/jquery.ztree.all.min.js' %}"
></script>
...
...
@@ -321,12 +327,6 @@ function onDrag(event, treeId, treeNodes) {
}
function
onDrop
(
event
,
treeId
,
treeNodes
,
targetNode
,
moveType
)
{
console
.
log
(
"
DROP
"
);
console
.
log
(
event
);
console
.
log
(
treeNodes
);
console
.
log
(
targetNode
);
console
.
log
(
moveType
);
var
treeNodesNames
=
[];
var
treeNodesIds
=
[];
$
.
each
(
treeNodes
,
function
(
index
,
value
)
{
...
...
apps/common/mixins.py
浏览文件 @
d284c217
...
...
@@ -99,9 +99,8 @@ class DatetimeSearchMixin:
if
date_from_s
:
date_from
=
timezone
.
datetime
.
strptime
(
date_from_s
,
self
.
date_format
)
self
.
date_from
=
date_from
.
replace
(
tzinfo
=
timezone
.
get_current_timezone
()
)
tz
=
timezone
.
get_current_timezone
()
self
.
date_from
=
tz
.
localize
(
date_from
)
else
:
self
.
date_from
=
timezone
.
now
()
-
timezone
.
timedelta
(
7
)
...
...
apps/common/templatetags/common_tags.py
浏览文件 @
d284c217
...
...
@@ -73,17 +73,20 @@ def to_html(s):
@
register
.
filter
def
time_util_with_seconds
(
date_from
,
date_to
):
if
date_from
and
date_to
:
delta
=
date_to
-
date_from
seconds
=
delta
.
seconds
if
seconds
<
60
:
return
'{} s'
.
format
(
seconds
)
elif
seconds
<
60
*
60
:
return
'{} m'
.
format
(
seconds
//
60
)
else
:
return
'{} h'
.
format
(
seconds
//
3600
)
else
:
if
not
date_from
:
return
''
if
not
date_to
:
return
''
date_to
=
timezone
.
now
()
delta
=
date_to
-
date_from
seconds
=
delta
.
seconds
if
seconds
<
60
:
return
'{} s'
.
format
(
seconds
)
elif
seconds
<
60
*
60
:
return
'{} m'
.
format
(
seconds
//
60
)
else
:
return
'{} h'
.
format
(
seconds
//
3600
)
@
register
.
filter
...
...
apps/templates/_header_bar.html
浏览文件 @
d284c217
...
...
@@ -14,7 +14,7 @@
{#
<span
class=
"m-r-sm text-muted welcome-message"
>
{% trans 'Welcome to use Jumpserver system' %}
</span>
#}
{#
</li>
#}
<li
class=
"dropdown"
>
<a
class=
"dropdown-toggle count-info"
data-toggle=
"dropdown"
href=
"
#
"
>
<a
class=
"dropdown-toggle count-info"
data-toggle=
"dropdown"
href=
"
https://market.aliyun.com/products/53690006/cmgj026011.html?spm=5176.730005.0.0.cY2io1
"
>
<span
class=
"m-r-sm text-muted welcome-message"
>
{% trans 'Supports' %}
</span>
</a>
</li>
...
...
apps/users/templates/users/login.html
浏览文件 @
d284c217
...
...
@@ -60,12 +60,16 @@
</div>
<button
type=
"submit"
class=
"btn btn-primary block full-width m-b"
>
{% trans 'Login' %}
</button>
{% if demo_mode %}
<p
class=
"text-muted font-bold"
style=
"color: red"
>
Demo账号: admin 密码: admin
</p>
{% endif %}
<a
href=
"{% url 'users:forgot-password' %}"
>
<small>
{% trans 'Forgot password' %}?
</small>
</a>
<p
class=
"text-muted text-center"
>
</p>
</form>
<p
class=
"m-t"
>
</p>
...
...
apps/users/views/login.py
浏览文件 @
d284c217
# ~*~ coding: utf-8 ~*~
from
__future__
import
unicode_literals
import
os
from
django
import
forms
from
django.shortcuts
import
render
from
django.contrib.auth
import
login
as
auth_login
,
logout
as
auth_logout
...
...
@@ -75,6 +76,13 @@ class UserLoginView(FormView):
self
.
redirect_field_name
,
self
.
request
.
GET
.
get
(
self
.
redirect_field_name
,
reverse
(
'index'
)))
def
get_context_data
(
self
,
**
kwargs
):
context
=
{
'demo_mode'
:
os
.
environ
.
get
(
"DEMO_MODE"
),
}
kwargs
.
update
(
context
)
return
super
().
get_context_data
(
**
kwargs
)
@
method_decorator
(
never_cache
,
name
=
'dispatch'
)
class
UserLogoutView
(
TemplateView
):
...
...
@@ -237,7 +245,7 @@ class LoginLogListView(DatetimeSearchMixin, ListView):
if
self
.
user
:
queryset
=
queryset
.
filter
(
username
=
self
.
user
)
if
self
.
keyword
:
queryset
=
self
.
queryset
.
filter
(
queryset
=
queryset
.
filter
(
Q
(
ip__contains
=
self
.
keyword
)
|
Q
(
city__contains
=
self
.
keyword
)
|
Q
(
username__contains
=
self
.
keyword
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录