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
3223d3b7
Commit
3223d3b7
authored
Jan 10, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修复了一些显示上的bug
parent
b2b123b4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
18 deletions
+43
-18
forms.py
apps/assets/forms.py
+1
-1
admin_user_assets.html
apps/assets/templates/assets/admin_user_assets.html
+1
-1
asset_list.html
apps/assets/templates/assets/asset_list.html
+18
-6
cluster_assets.html
apps/assets/templates/assets/cluster_assets.html
+1
-1
forms.py
apps/users/forms.py
+3
-2
user_list.html
apps/users/templates/users/user_list.html
+19
-7
No files found.
apps/assets/forms.py
View file @
3223d3b7
...
...
@@ -93,7 +93,7 @@ class AssetBulkUpdateForm(forms.ModelForm):
model
=
Asset
fields
=
[
'assets'
,
'port'
,
'groups'
,
"cluster"
,
'type'
,
'env'
,
'status'
,
'type'
,
'env'
,
]
widgets
=
{
'groups'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'Select asset groups'
)}),
...
...
apps/assets/templates/assets/admin_user_assets.html
View file @
3223d3b7
...
...
@@ -34,7 +34,7 @@
<div
class=
"col-sm-8"
style=
"padding-left: 0;"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<span
style=
"float: left"
>
{% trans 'Asset list of ' %}
<b>
{{ admin_user.name }}
</b>
<span
class=
"badge"
>
{{ total_amount }}
</span>
<span
class=
"badge badge-danger"
>
{{ unreachable_amount }}
</span>
</span>
<span
style=
"float: left"
>
{% trans 'Asset list of ' %}
<b>
{{ admin_user.name }}
</b></span>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
apps/assets/templates/assets/asset_list.html
View file @
3223d3b7
...
...
@@ -178,9 +178,15 @@ $(document).ready(function(){
var
obj
=
{
"pk"
:
object_id
,
"is_active"
:
false
};
data
.
push
(
obj
);
});
APIUpdateAttr
({
url
:
the_url
,
method
:
'PATCH'
,
body
:
JSON
.
stringify
(
data
)});
$data_table
.
ajax
.
reload
();
jumpserver
.
checked
=
false
;
function
success
()
{
location
.
reload
()
}
APIUpdateAttr
({
url
:
the_url
,
method
:
'PATCH'
,
body
:
JSON
.
stringify
(
data
),
success
:
success
});
}
function
doActive
()
{
var
data
=
[];
...
...
@@ -188,9 +194,15 @@ $(document).ready(function(){
var
obj
=
{
"pk"
:
object_id
,
"is_active"
:
true
};
data
.
push
(
obj
);
});
APIUpdateAttr
({
url
:
the_url
,
method
:
'PATCH'
,
body
:
JSON
.
stringify
(
data
)});
$data_table
.
ajax
.
reload
();
jumpserver
.
checked
=
false
;
function
success
()
{
location
.
reload
();
}
APIUpdateAttr
({
url
:
the_url
,
method
:
'PATCH'
,
body
:
JSON
.
stringify
(
data
),
success
:
success
});
}
function
doDelete
()
{
swal
({
...
...
apps/assets/templates/assets/cluster_assets.html
View file @
3223d3b7
...
...
@@ -28,7 +28,7 @@
<div
class=
"col-sm-8"
style=
"padding-left: 0;"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-title"
>
<span
style=
"float: left"
>
{% trans 'Cluster assets' %}
<b>
{{ cluster.name }}
</b><
span
class=
"badge"
>
{{ cluster.assets.all.count }}
</span><
/span>
<span
style=
"float: left"
>
{% trans 'Cluster assets' %}
<b>
{{ cluster.name }}
</b></span>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
apps/users/forms.py
View file @
3223d3b7
...
...
@@ -156,7 +156,7 @@ class UserBulkUpdateForm(forms.ModelForm):
class
Meta
:
model
=
User
fields
=
[
'users'
,
'role'
,
'groups'
,
'date_expired'
,
'is_active'
]
fields
=
[
'users'
,
'role'
,
'groups'
,
'date_expired'
]
widgets
=
{
"groups"
:
forms
.
SelectMultiple
(
attrs
=
{
...
...
@@ -172,6 +172,7 @@ class UserBulkUpdateForm(forms.ModelForm):
if
self
.
data
.
get
(
field
)
is
not
None
:
changed_fields
.
append
(
field
)
print
(
changed_fields
)
cleaned_data
=
{
k
:
v
for
k
,
v
in
self
.
cleaned_data
.
items
()
if
k
in
changed_fields
}
users
=
cleaned_data
.
pop
(
'users'
,
''
)
...
...
@@ -186,7 +187,7 @@ class UserBulkUpdateForm(forms.ModelForm):
class
UserGroupForm
(
forms
.
ModelForm
):
users
=
forms
.
ModelMultipleChoiceField
(
queryset
=
User
.
objects
.
all
(
),
queryset
=
User
.
objects
.
exclude
(
role
=
User
.
ROLE_APP
),
label
=
_
(
"User"
),
widget
=
forms
.
SelectMultiple
(
attrs
=
{
...
...
apps/users/templates/users/user_list.html
View file @
3223d3b7
...
...
@@ -161,18 +161,30 @@ $(document).ready(function(){
var
body
=
$
.
each
(
id_list
,
function
(
index
,
user_object
)
{
user_object
[
'is_active'
]
=
false
;
});
console
.
log
(
body
);
APIUpdateAttr
({
url
:
the_url
,
method
:
'PATCH'
,
body
:
JSON
.
stringify
(
body
)});
$data_table
.
ajax
.
reload
();
jumpserver
.
checked
=
false
;
function
success
()
{
location
.
reload
();
}
APIUpdateAttr
({
url
:
the_url
,
method
:
'PATCH'
,
body
:
JSON
.
stringify
(
body
),
success
:
success
});
location
.
reload
();
}
function
doActive
()
{
var
body
=
$
.
each
(
id_list
,
function
(
index
,
user_object
)
{
user_object
[
'is_active'
]
=
true
;
});
APIUpdateAttr
({
url
:
the_url
,
method
:
'PATCH'
,
body
:
JSON
.
stringify
(
body
)});
$data_table
.
ajax
.
reload
();
jumpserver
.
checked
=
false
;
function
success
()
{
location
.
reload
();
}
APIUpdateAttr
({
url
:
the_url
,
method
:
'PATCH'
,
body
:
JSON
.
stringify
(
body
),
success
:
success
});
}
function
doDelete
()
{
swal
({
...
...
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