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
00502ce3
Commit
00502ce3
authored
Sep 13, 2016
by
xiaoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trivial js style changes; bugfix for patch method
parent
89923333
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
17 deletions
+14
-17
user_detail.html
apps/users/templates/users/user_detail.html
+14
-17
No files found.
apps/users/templates/users/user_detail.html
View file @
00502ce3
...
...
@@ -22,7 +22,7 @@
</ul>
</div>
<div
class=
"tab-content"
>
<div
class=
"col-sm-7"
style=
"padding-left: 0
px;
"
>
<div
class=
"col-sm-7"
style=
"padding-left: 0"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<span
class=
"label"
><b>
{{ user_object.name }}
</b></span>
...
...
@@ -108,7 +108,7 @@
<div
class=
"col-sm-5"
style=
"padding-left: 0;padding-right: 0"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<i
class=
"fa fa-info-circle"
></i>
{% trans 'Quick
update
' %}
<i
class=
"fa fa-info-circle"
></i>
{% trans 'Quick
modify
' %}
</div>
<div
class=
"panel-body"
>
<table
class=
"table"
>
...
...
@@ -191,7 +191,7 @@
<tr>
<td
><b
class=
"bdg_user_group"
data-gid=
{{
group
.
id
}}
>
{{ group.name }}
</b></td>
<td>
<button
class=
"btn btn-danger btn-
xs
btn_delete_user_group"
type=
"button"
style=
"float: right;"
><i
class=
"fa fa-minus"
></i></button>
<button
class=
"btn btn-danger btn-
sm
btn_delete_user_group"
type=
"button"
style=
"float: right;"
><i
class=
"fa fa-minus"
></i></button>
</td>
</tr>
{% endfor %}
...
...
@@ -205,12 +205,10 @@
</div>
</div>
</div>
</div>
{% endblock %}
{% block custom_foot_js %}
<script>
jumpserver
.
selected_groups
=
new
Object
()
;
jumpserver
.
selected_groups
=
{}
;
function
updateUserGroups
(
user_groups
)
{
var
the_url
=
"{% url 'users:user-group-edit-api' pk=user_object.id%}"
;
var
body
=
{
...
...
@@ -234,36 +232,35 @@ function updateUserGroups(user_groups) {
// clear jumpserver.selected_groups
jumpserver
.
selected_groups
=
{};
toastr
.
success
(
'{% trans "Update success!" %}'
)
}
}
;
APIUpdateAttr
({
url
:
the_url
,
body
:
JSON
.
stringify
(
body
),
success
:
success
,
method
:
'PUT'
});
}
$
(
document
).
ready
(
function
()
{
$
(
'.select2'
).
select2
()
.
on
(
'select2:select'
,
function
(
evt
,
params
)
{
.
on
(
'select2:select'
,
function
(
evt
)
{
var
data
=
evt
.
params
.
data
;
jumpserver
.
selected_groups
[
data
.
id
]
=
data
.
text
;
}).
on
(
'select2:unselect'
,
function
(
evt
)
{
var
data
=
evt
.
params
.
data
;
delete
jumpserver
.
selected_groups
[
data
.
id
]
})
});
$
(
document
).
on
(
'click'
,
'#is_active'
,
function
(){
}).
on
(
'click'
,
'#is_active'
,
function
(){
var
the_url
=
"{% url 'users:user-patch-api' pk=user_object.id %}"
;
var
checked
=
!
$
(
this
).
prop
(
'checked'
);
var
body
=
{
'is_active'
:
checked
};
var
success
=
function
(
data
)
{
var
success
=
function
()
{
toastr
.
success
(
'{% trans "Update success!" %}'
)
}
APIUpdateAttr
({
url
:
the_url
,
body
:
body
,
success
:
success
});
}
;
APIUpdateAttr
({
url
:
the_url
,
body
:
JSON
.
stringify
(
body
)
,
success
:
success
});
}).
on
(
'click'
,
'#enable_otp'
,
function
(){
var
the_url
=
"{% url 'users:user-patch-api' pk=user_object.id %}"
;
var
checked
=
!
$
(
this
).
prop
(
'checked'
);
var
body
=
{
'enable_otp'
:
checked
};
var
success
=
function
(
data
)
{
var
success
=
function
()
{
toastr
.
success
(
'{% trans "Update success!" %}'
)
}
APIUpdateAttr
({
url
:
the_url
,
body
:
body
,
success
:
success
});
}
;
APIUpdateAttr
({
url
:
the_url
,
body
:
JSON
.
stringify
(
body
)
,
success
:
success
});
}).
on
(
'click'
,
'#btn_add_user_group'
,
function
(){
if
(
Object
.
keys
(
jumpserver
.
selected_groups
).
length
===
0
)
{
return
false
;
...
...
@@ -290,6 +287,6 @@ $(document).on('click', '#is_active', function(){
return
$
(
this
).
data
(
'gid'
);
}).
get
();
updateUserGroups
(
user_groups
)
})
})
;
</script>
{% endblock %}
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