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
05e961f2
Commit
05e961f2
authored
Sep 30, 2016
by
xiaokong1937@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user-group detail: fix #15
parent
474f7e0f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
21 deletions
+33
-21
jumpserver.css
apps/static/css/jumpserver.css
+2
-2
_foot_js.html
apps/templates/_foot_js.html
+8
-8
user_group_detail.html
apps/users/templates/users/user_group_detail.html
+19
-11
user_list.html
apps/users/templates/users/user_list.html
+4
-0
No files found.
apps/static/css/jumpserver.css
View file @
05e961f2
...
...
@@ -79,7 +79,7 @@ th a {
}
table
.dataTable
tbody
>
tr
.selected
,
table
.dataTable
tbody
>
tr
>
.selected
{
background-color
:
#1ab394
;
background-color
:
#1ab394
!important
;
}
table
.dataTable
tbody
tr
.selected
a
,
table
.dataTable
tbody
th
.selected
a
,
...
...
@@ -88,7 +88,7 @@ table.dataTable tbody tr.selected td i.text-navy,
table
.dataTable
tbody
th
.selected
td
i
.text-navy
,
table
.dataTable
tbody
td
.selected
td
i
.text-navy
{
color
:
white
;
color
:
white
!important
;
}
.m-0
{
...
...
apps/templates/_foot_js.html
View file @
05e961f2
...
...
@@ -8,12 +8,12 @@
<script
src=
"{% static "
js
/
inspinia
.
js
"
%}"
></script>
<script
src=
"{% static "
js
/
jumpserver
.
js
"
%}"
></script>
<script>
activeNav
();
$
(
document
).
ready
(
function
(){
setAjaxCSRFToken
();
// Set textarea rows five
$
(
'
textarea'
).
attr
(
'rows'
,
5
);
}
);
activeNav
();
$
(
document
).
ready
(
function
(){
setAjaxCSRFToken
();
$
(
'textarea'
).
attr
(
'rows'
,
5
);
if
(
$
(
'.tooltip'
)[
0
])
{
$
(
'
.tooltip'
).
tooltip
(
);
}
});
</script>
apps/users/templates/users/user_group_detail.html
View file @
05e961f2
...
...
@@ -12,18 +12,21 @@
<script
src=
"{% static "
js
/
plugins
/
dataTables
/
dataTables
.
min
.
js
"
%}"
></script>
<style>
.user_div
{
background-color
:
#d1dade
;
color
:
#5e5e5e
;
font-family
:
"Open Sans"
;
padding
:
3px
8px
;
text-shadow
:
none
;
}
.user_div
.remove
{
color
:
#fff
;
.user_div
.ui_container
{
background-color
:
#d1dade
;
width
:
100%
;
}
.user_div
span
{
.user_div
a
{
color
:
#5e5e5e
;
}
.user_div
.remove
{
color
:
#fff
;
}
dl
{
width
:
100%
;
overflow
:
hidden
;
...
...
@@ -99,7 +102,7 @@ dd {
<dt>
{% trans 'Users' %}:
</dt>
<dd
style=
"line-height: 2"
id=
"group_user_container"
>
{% for user in object.users.all %}
<div
class=
"col-sm-4 user_div"
><div
class=
"
col-xs-9"
><a
href=
"{{ user.get_absolute_url }}"
><span>
{{ user.name }}
</span></a></div><div
class=
"col-xs-3"
><a
data-uid=
"{{ user.id }}"
class=
"btn_remove m-l-5"
><i
class=
"remove fa fa-times-circle"
></i></a
></div></div>
<div
class=
"col-sm-4 user_div"
><div
class=
"
ui_container row"
><div
class=
"col-xs-9"
><a
href=
"{{ user.get_absolute_url }}"
title=
"{{ user.name }}"
data-toggle=
"tooltip"
>
{{ user.name|truncatechars:15 }}
</a></div><div
class=
"col-xs-3"
><a
data-uid=
"{{ user.id }}"
class=
"btn_remove m-l-5"
><i
class=
"remove fa fa-times-circle"
></i></a></div
></div></div>
{% endfor %}
</dd>
</dl>
...
...
@@ -189,6 +192,10 @@ $(document).on('click', '.btn_remove', function(){
$
(
td
).
html
(
'<i class="fa fa-check text-navy"></i>'
)
}
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
)
{
var
innerHtml
=
cellData
.
length
>
8
?
cellData
.
substring
(
0
,
8
)
+
'...'
:
cellData
;
$
(
td
).
html
(
'<a href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</a>'
);
}}
],
ajax_url
:
'{% url "users:user-bulk-update-api" %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"username"
},
{
data
:
"name"
},
{
data
:
"get_role_display"
},
{
data
:
"group_display"
},
...
...
@@ -203,7 +210,6 @@ $(document).on('click', '.btn_remove', function(){
plain_id_list
.
push
(
this
.
data
().
id
);
selected_users
.
push
({
id
:
this
.
data
().
id
,
name
:
this
.
data
().
name
});
});
console
.
log
(
selected_users
)
if
(
plain_id_list
===
[])
{
return
false
;
};
...
...
@@ -218,13 +224,15 @@ $(document).on('click', '.btn_remove', function(){
var
html
=
""
;
$
.
each
(
selected_users
,
function
(
index
,
user
)
{
html
+=
[
'<div class="col-sm-4 user_div"><div class="col-xs-9"><a href="'
,
'{% url "users:user-detail" pk=99991937 %}'
.
replace
(
99991937
,
user
.
id
),
'"><span>'
,
'<div class="col-sm-4 user_div"><div class="ui_container row"><div class="col-xs-9"><a title="'
,
user
.
name
,
'</span></a></div><div class="col-xs-3"><a data-uid="'
,
'" data-toggle="tooltip" href="'
,
'{% url "users:user-detail" pk=99991937 %}'
.
replace
(
99991937
,
user
.
id
),
'">'
,
user
.
name
.
length
>=
13
?
user
.
name
.
substring
(
0
,
12
)
+
'...'
:
user
.
name
,
'</a></div><div class="col-xs-3"><a data-uid="'
,
user
.
id
,
'" class="btn_remove m-l-5"><i class="remove fa fa-times-circle"></i></a></div></div>
\
n'
,
'" class="btn_remove m-l-5"><i class="remove fa fa-times-circle"></i></a></div></div>
</div>
\
n'
,
].
join
(
""
);
});
$
(
html
).
appendTo
(
$
(
'#group_user_container'
));
...
...
apps/users/templates/users/user_list.html
View file @
05e961f2
...
...
@@ -64,6 +64,10 @@ $(document).ready(function(){
var
detail_btn
=
'<a href="{% url "users:user-detail" pk=99991937 %}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'99991937'
,
rowData
.
id
));
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
)
{
var
innerHtml
=
cellData
.
length
>
8
?
cellData
.
substring
(
0
,
8
)
+
'...'
:
cellData
;
$
(
td
).
html
(
'<a href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</a>'
);
}},
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
$
(
td
).
html
(
'<i class="fa fa-times text-danger"></i>'
)
...
...
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