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
0916757e
Commit
0916757e
authored
Dec 31, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修复一些bug
parent
0b299344
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
15 deletions
+36
-15
asset_create.html
apps/assets/templates/assets/asset_create.html
+4
-6
asset_list.html
apps/assets/templates/assets/asset_list.html
+1
-1
common_tags.py
apps/common/templatetags/common_tags.py
+16
-0
forms.py
apps/perms/forms.py
+2
-1
asset_permission_create_update.html
...perms/templates/perms/asset_permission_create_update.html
+3
-3
_user_profile.html
apps/templates/_user_profile.html
+5
-0
session_list.html
apps/terminal/templates/terminal/session_list.html
+2
-1
user_group_detail.html
apps/users/templates/users/user_group_detail.html
+3
-3
No files found.
apps/assets/templates/assets/asset_create.html
View file @
0916757e
...
...
@@ -47,12 +47,9 @@
{% block custom_foot_js %}
<script>
$
(
document
).
ready
(
function
()
{
$
(
'.select2'
).
select2
();
{
#
$
(
"#id_tags"
).
select2
({
#
}
{
#
tags
:
true
,
#
}
{
#
maximumSelectionLength
:
8
//最多能够选择的个数#}
{
#
//closeOnSelect: false#}
{
#
});
#
}
$
(
'.select2'
).
select2
({
allowClear
:
true
});
})
</script>
{% endblock %}
\ No newline at end of file
apps/assets/templates/assets/asset_list.html
View file @
0916757e
...
...
@@ -35,7 +35,7 @@
<th
class=
"text-center"
>
{% trans 'Env' %}
</th>
<th
class=
"text-center"
>
{% trans 'Hardware' %}
</th>
<th
class=
"text-center"
>
{% trans 'Active' %}
</th>
<th
class=
"text-center"
>
{% trans '
Connectiv
e' %}
</th>
<th
class=
"text-center"
>
{% trans '
Reachabl
e' %}
</th>
<th
class=
"text-center"
>
{% trans 'Action' %}
</th>
</tr>
</thead>
...
...
apps/common/templatetags/common_tags.py
View file @
0916757e
...
...
@@ -2,6 +2,7 @@
from
django
import
template
from
django.utils
import
timezone
from
django.utils.translation
import
gettext
as
_
from
django.utils.html
import
escape
register
=
template
.
Library
()
...
...
@@ -67,3 +68,18 @@ def ts_to_date(ts):
@register.filter
def
to_html
(
s
):
return
escape
(
s
)
.
replace
(
'
\n
'
,
'<br />'
)
@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
:
return
''
apps/perms/forms.py
View file @
0916757e
...
...
@@ -14,7 +14,8 @@ class AssetPermissionForm(forms.ModelForm):
queryset
=
User
.
objects
.
exclude
(
role
=
User
.
ROLE_APP
),
widget
=
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'Select users'
)},
)
),
label
=
_
(
"User"
)
)
class
Meta
:
...
...
apps/perms/templates/perms/asset_permission_create_update.html
View file @
0916757e
...
...
@@ -3,9 +3,9 @@
{% load static %}
{% load bootstrap3 %}
{% block custom_head_css_js %}
<link
href=
"{% static
"
css
/
plugins
/
select2
/
select2
.
min
.
css
"
%}"
rel=
"stylesheet"
>
<script
src=
"{% static
"
js
/
plugins
/
select2
/
select2
.
full
.
min
.
js
"
%}"
></script>
<link
href=
"{% static
"
css
/
plugins
/
datepicker
/
datepicker3
.
css
"
%}"
rel=
"stylesheet"
>
<link
href=
"{% static
'css/plugins/select2/select2.min.css'
%}"
rel=
"stylesheet"
>
<script
src=
"{% static
'js/plugins/select2/select2.full.min.js'
%}"
></script>
<link
href=
"{% static
'css/plugins/datepicker/datepicker3.css'
%}"
rel=
"stylesheet"
>
{% endblock %}
{% block content %}
...
...
apps/templates/_user_profile.html
View file @
0916757e
...
...
@@ -37,11 +37,16 @@
$
(
document
).
ready
(
function
()
{
})
.
on
(
'click'
,
'#switch_admin'
,
function
()
{
setTimeout
(
function
()
{
setCookie
(
"IN_ADMIN_PAGE"
,
"Yes"
);
window
.
location
=
"/"
},
100
)
})
.
on
(
'click'
,
'#switch_user'
,
function
()
{
setTimeout
(
function
()
{
console
.
log
(
"Set to No"
);
setCookie
(
"IN_ADMIN_PAGE"
,
"No"
);
window
.
location
=
"/"
},
100
);
})
</script>
apps/terminal/templates/terminal/session_list.html
View file @
0916757e
...
...
@@ -2,6 +2,7 @@
{% load i18n %}
{% load static %}
{% load terminal_tags %}
{% load common_tags %}
{% block custom_head_css_js %}
<link
href=
"{% static 'css/plugins/datepicker/datepicker3.css' %}"
rel=
"stylesheet"
>
<link
href=
"{% static "
css
/
plugins
/
select2
/
select2
.
min
.
css
"
%}"
rel=
"stylesheet"
>
...
...
@@ -91,7 +92,7 @@
<td
class=
"text-center"
>
{{ session.id | get_session_command_amount }}
</td>
<td
class=
"text-center"
>
{{ session.date_start }}
</td>
<td
class=
"text-center"
>
{{ session.date_
end|timeuntil:session.date_start
}}
</td>
<td
class=
"text-center"
>
{{ session.date_
start|time_util_with_seconds:session.date_end
}}
</td>
<td>
{% if session.is_finished %}
<a
onclick=
"window.open('/luna/replay/{{ session.id }}','luna', 'height=600, width=800, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=no, status=no')"
class=
"btn btn-xs btn-warning btn-replay"
>
{% trans "Replay" %}
</a>
...
...
apps/users/templates/users/user_group_detail.html
View file @
0916757e
...
...
@@ -21,9 +21,9 @@
<li
class=
"active"
>
<a
href=
"{% url 'users:user-group-detail' pk=user_group.id %}"
class=
"text-center"
><i
class=
"fa fa-laptop"
></i>
{% trans 'User group detail' %}
</a>
</li>
<li>
<a
href=
"{% url 'users:user-group-granted-asset' pk=user_group.id %}"
class=
"text-center"
><i
class=
"fa fa-cubes"
></i>
{% trans 'Asset granted' %}
</a>
</li>
{#
<li>
#}
{#
<a
href=
"{% url 'users:user-group-granted-asset' pk=user_group.id %}"
class=
"text-center"
><i
class=
"fa fa-cubes"
></i>
{% trans 'Asset granted' %}
</a>
#}
{#
</li>
#}
<li
class=
"pull-right"
>
<a
class=
"btn btn-outline btn-default"
href=
"{% url 'users:user-group-update' pk=user_group.id %}"
><i
class=
"fa fa-edit"
></i>
Update
</a>
</li>
...
...
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