Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
d284c217
Commit
d284c217
authored
Mar 02, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改一些小问题
parent
f7ab1395
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
16 deletions
+30
-16
asset_list.html
apps/assets/templates/assets/asset_list.html
+6
-6
mixins.py
apps/common/mixins.py
+2
-3
common_tags.py
apps/common/templatetags/common_tags.py
+6
-3
_header_bar.html
apps/templates/_header_bar.html
+1
-1
login.html
apps/users/templates/users/login.html
+6
-2
login.py
apps/users/views/login.py
+9
-1
No files found.
apps/assets/templates/assets/asset_list.html
View file @
d284c217
...
@@ -2,6 +2,12 @@
...
@@ -2,6 +2,12 @@
{% load static %}
{% load static %}
{% load i18n %}
{% load i18n %}
{% block help_message %}
<div
class=
"alert alert-info help-message"
>
左侧是资产树,右击可以新建、删除、更改树节点,授权资产也是以节点方式组织的,右侧是属于该节点下的资产
</div>
{% endblock %}
{% block custom_head_css_js %}
{% block custom_head_css_js %}
<link
href=
"{% static 'css/plugins/ztree/awesomeStyle/awesome.css' %}"
rel=
"stylesheet"
>
<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>
<script
type=
"text/javascript"
src=
"{% static 'js/plugins/ztree/jquery.ztree.all.min.js' %}"
></script>
...
@@ -321,12 +327,6 @@ function onDrag(event, treeId, treeNodes) {
...
@@ -321,12 +327,6 @@ function onDrag(event, treeId, treeNodes) {
}
}
function
onDrop
(
event
,
treeId
,
treeNodes
,
targetNode
,
moveType
)
{
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
treeNodesNames
=
[];
var
treeNodesIds
=
[];
var
treeNodesIds
=
[];
$
.
each
(
treeNodes
,
function
(
index
,
value
)
{
$
.
each
(
treeNodes
,
function
(
index
,
value
)
{
...
...
apps/common/mixins.py
View file @
d284c217
...
@@ -99,9 +99,8 @@ class DatetimeSearchMixin:
...
@@ -99,9 +99,8 @@ class DatetimeSearchMixin:
if
date_from_s
:
if
date_from_s
:
date_from
=
timezone
.
datetime
.
strptime
(
date_from_s
,
self
.
date_format
)
date_from
=
timezone
.
datetime
.
strptime
(
date_from_s
,
self
.
date_format
)
self
.
date_from
=
date_from
.
replace
(
tz
=
timezone
.
get_current_timezone
()
tzinfo
=
timezone
.
get_current_timezone
()
self
.
date_from
=
tz
.
localize
(
date_from
)
)
else
:
else
:
self
.
date_from
=
timezone
.
now
()
-
timezone
.
timedelta
(
7
)
self
.
date_from
=
timezone
.
now
()
-
timezone
.
timedelta
(
7
)
...
...
apps/common/templatetags/common_tags.py
View file @
d284c217
...
@@ -73,7 +73,12 @@ def to_html(s):
...
@@ -73,7 +73,12 @@ def to_html(s):
@register.filter
@register.filter
def
time_util_with_seconds
(
date_from
,
date_to
):
def
time_util_with_seconds
(
date_from
,
date_to
):
if
date_from
and
date_to
:
if
not
date_from
:
return
''
if
not
date_to
:
return
''
date_to
=
timezone
.
now
()
delta
=
date_to
-
date_from
delta
=
date_to
-
date_from
seconds
=
delta
.
seconds
seconds
=
delta
.
seconds
if
seconds
<
60
:
if
seconds
<
60
:
...
@@ -82,8 +87,6 @@ def time_util_with_seconds(date_from, date_to):
...
@@ -82,8 +87,6 @@ def time_util_with_seconds(date_from, date_to):
return
'{} m'
.
format
(
seconds
//
60
)
return
'{} m'
.
format
(
seconds
//
60
)
else
:
else
:
return
'{} h'
.
format
(
seconds
//
3600
)
return
'{} h'
.
format
(
seconds
//
3600
)
else
:
return
''
@register.filter
@register.filter
...
...
apps/templates/_header_bar.html
View file @
d284c217
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
{#
<span
class=
"m-r-sm text-muted welcome-message"
>
{% trans 'Welcome to use Jumpserver system' %}
</span>
#}
{#
<span
class=
"m-r-sm text-muted welcome-message"
>
{% trans 'Welcome to use Jumpserver system' %}
</span>
#}
{#
</li>
#}
{#
</li>
#}
<li
class=
"dropdown"
>
<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>
<span
class=
"m-r-sm text-muted welcome-message"
>
{% trans 'Supports' %}
</span>
</a>
</a>
</li>
</li>
...
...
apps/users/templates/users/login.html
View file @
d284c217
...
@@ -60,12 +60,16 @@
...
@@ -60,12 +60,16 @@
</div>
</div>
<button
type=
"submit"
class=
"btn btn-primary block full-width m-b"
>
{% trans 'Login' %}
</button>
<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' %}"
>
<a
href=
"{% url 'users:forgot-password' %}"
>
<small>
{% trans 'Forgot password' %}?
</small>
<small>
{% trans 'Forgot password' %}?
</small>
</a>
</a>
<p
class=
"text-muted text-center"
>
</p>
</form>
</form>
<p
class=
"m-t"
>
<p
class=
"m-t"
>
</p>
</p>
...
...
apps/users/views/login.py
View file @
d284c217
# ~*~ coding: utf-8 ~*~
# ~*~ coding: utf-8 ~*~
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
os
from
django
import
forms
from
django
import
forms
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.contrib.auth
import
login
as
auth_login
,
logout
as
auth_logout
from
django.contrib.auth
import
login
as
auth_login
,
logout
as
auth_logout
...
@@ -75,6 +76,13 @@ class UserLoginView(FormView):
...
@@ -75,6 +76,13 @@ class UserLoginView(FormView):
self
.
redirect_field_name
,
self
.
redirect_field_name
,
self
.
request
.
GET
.
get
(
self
.
redirect_field_name
,
reverse
(
'index'
)))
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'
)
@method_decorator
(
never_cache
,
name
=
'dispatch'
)
class
UserLogoutView
(
TemplateView
):
class
UserLogoutView
(
TemplateView
):
...
@@ -237,7 +245,7 @@ class LoginLogListView(DatetimeSearchMixin, ListView):
...
@@ -237,7 +245,7 @@ class LoginLogListView(DatetimeSearchMixin, ListView):
if
self
.
user
:
if
self
.
user
:
queryset
=
queryset
.
filter
(
username
=
self
.
user
)
queryset
=
queryset
.
filter
(
username
=
self
.
user
)
if
self
.
keyword
:
if
self
.
keyword
:
queryset
=
self
.
queryset
.
filter
(
queryset
=
queryset
.
filter
(
Q
(
ip__contains
=
self
.
keyword
)
|
Q
(
ip__contains
=
self
.
keyword
)
|
Q
(
city__contains
=
self
.
keyword
)
|
Q
(
city__contains
=
self
.
keyword
)
|
Q
(
username__contains
=
self
.
keyword
)
Q
(
username__contains
=
self
.
keyword
)
...
...
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