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
eb93e634
Unverified
Commit
eb93e634
authored
Jul 16, 2019
by
BaiJiangJie
Committed by
GitHub
Jul 16, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2964 from jumpserver/dev
Dev
parents
341b6540
e0802ef2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
46 additions
and
6 deletions
+46
-6
0036_auto_20190716_1535.py
apps/assets/migrations/0036_auto_20190716_1535.py
+18
-0
cmd_filter.py
apps/assets/models/cmd_filter.py
+1
-1
cmd_filter.py
apps/assets/serializers/cmd_filter.py
+0
-1
cmd_filter_detail.html
apps/assets/templates/assets/cmd_filter_detail.html
+9
-1
domain_detail.html
apps/assets/templates/assets/domain_detail.html
+12
-2
mixin.py
apps/perms/api/mixin.py
+2
-0
user_permission.py
apps/perms/api/user_permission.py
+2
-0
jumpserver.js
apps/static/js/jumpserver.js
+1
-0
_foot_js.html
apps/templates/_foot_js.html
+1
-1
No files found.
apps/assets/migrations/0036_auto_20190716_1535.py
0 → 100644
View file @
eb93e634
# Generated by Django 2.1.7 on 2019-07-16 07:35
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'assets'
,
'0035_auto_20190711_2018'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'commandfilter'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
64
,
unique
=
True
,
verbose_name
=
'Name'
),
),
]
apps/assets/models/cmd_filter.py
View file @
eb93e634
...
...
@@ -17,7 +17,7 @@ __all__ = [
class
CommandFilter
(
OrgModelMixin
):
id
=
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
)
name
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
_
(
"Name"
))
name
=
models
.
CharField
(
max_length
=
64
,
unique
=
True
,
verbose_name
=
_
(
"Name"
))
is_active
=
models
.
BooleanField
(
default
=
True
,
verbose_name
=
_
(
'Is active'
))
comment
=
models
.
TextField
(
blank
=
True
,
default
=
''
,
verbose_name
=
_
(
"Comment"
))
date_created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
...
...
apps/assets/serializers/cmd_filter.py
View file @
eb93e634
...
...
@@ -22,7 +22,6 @@ class CommandFilterSerializer(BulkOrgResourceModelSerializer):
extra_kwargs
=
{
'rules'
:
{
'read_only'
:
True
},
'system_users'
:
{
'read_only'
:
True
}
}
...
...
apps/assets/templates/assets/cmd_filter_detail.html
View file @
eb93e634
...
...
@@ -29,7 +29,7 @@
<a
class=
"btn btn-outline btn-default"
href=
"{% url 'assets:cmd-filter-update' pk=object.id %}"
><i
class=
"fa fa-edit"
></i>
{% trans 'Update' %}
</a>
</li>
<li
class=
"pull-right"
>
<a
class=
"btn btn-outline btn-danger btn-del"
>
<a
class=
"btn btn-outline btn-danger btn-del
btn-delete-cmd-filter
"
>
<i
class=
"fa fa-trash-o"
></i>
{% trans 'Delete' %}
</a>
</li>
...
...
@@ -164,5 +164,13 @@ $(document).ready(function () {
});
updateCMDFilterSystemUsers
(
system_users
)
})
.
on
(
'click'
,
'.btn-delete-cmd-filter'
,
function
()
{
var
$this
=
$
(
this
);
var
name
=
"{{object.name }}"
;
var
uid
=
"{{ object.id }}"
;
var
the_url
=
'{% url "api-assets:cmd-filter-detail" pk=DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}'
,
uid
);
var
redirect_url
=
"{% url 'assets:cmd-filter-list' %}"
;
objectDelete
(
$this
,
name
,
the_url
,
redirect_url
);
})
</script>
{% endblock %}
apps/assets/templates/assets/domain_detail.html
View file @
eb93e634
...
...
@@ -24,7 +24,7 @@
<a
class=
"btn btn-outline btn-default"
href=
"{% url 'assets:domain-update' pk=object.id %}"
><i
class=
"fa fa-edit"
></i>
{% trans 'Update' %}
</a>
</li>
<li
class=
"pull-right"
>
<a
class=
"btn btn-outline btn-danger btn-del"
>
<a
class=
"btn btn-outline btn-danger btn-del
btn-delete-domain
"
>
<i
class=
"fa fa-trash-o"
></i>
{% trans 'Delete' %}
</a>
</li>
...
...
@@ -127,6 +127,15 @@ $(document).ready(function(){
setTimeout
(
function
()
{
$data_table
.
ajax
.
reload
();
},
3000
);
});
})
.
on
(
'click'
,
'.btn-delete-domain'
,
function
()
{
var
$this
=
$
(
this
);
var
name
=
"{{ object.name }}"
;
var
uid
=
"{{ object.id }}"
;
var
the_url
=
'{% url "api-assets:domain-detail" pk=DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}'
,
uid
);
var
redirect_url
=
"{% url 'assets:domain-list' %}"
;
objectDelete
(
$this
,
name
,
the_url
,
redirect_url
);
})
;
</script>
{% endblock %}
\ No newline at end of file
apps/perms/api/mixin.py
View file @
eb93e634
...
...
@@ -174,6 +174,8 @@ class GrantAssetsMixin(LabelFilterMixin):
system_user
=
system_users_map
.
get
(
sid
)
if
not
system_user
:
continue
if
not
asset
.
has_protocol
(
system_user
.
protocol
):
continue
system_user
.
actions
=
action
system_users_granted
.
append
(
system_user
)
asset
.
system_users_granted
=
system_users_granted
...
...
apps/perms/api/user_permission.py
View file @
eb93e634
...
...
@@ -256,6 +256,8 @@ class UserGrantedNodesWithAssetsApi(UserPermissionCacheMixin, NodesWithUngroupMi
system_user
=
_system_users_map
.
get
(
system_user_id
)
if
not
system_user
:
continue
if
not
asset
.
has_protocol
(
system_user
.
protocol
):
continue
system_user
.
actions
=
action
system_user_granted
.
append
(
system_user
)
asset
.
system_users_granted
=
system_user_granted
...
...
apps/static/js/jumpserver.js
View file @
eb93e634
...
...
@@ -1110,6 +1110,7 @@ function objectAttrsIsBool(obj, attrs) {
}
function
cleanDate
(
d
)
{
if
(
typeof
d
===
'number'
){
return
d
}
for
(
var
i
=
0
;
i
<
2
;
i
++
)
{
if
(
isNaN
(
Date
.
parse
(
d
)))
{
d
=
d
.
split
(
'+'
)[
0
].
trimRight
();
...
...
apps/templates/_foot_js.html
View file @
eb93e634
...
...
@@ -7,7 +7,7 @@
<script
src=
"{% static "
js
/
plugins
/
toastr
/
toastr
.
min
.
js
"
%}"
></script>
<script
src=
"{% static "
js
/
inspinia
.
js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% url 'javascript-catalog' %}"
></script>
<script
src=
"{% static "
js
/
jumpserver
.
js
"
%}"
></script>
<script
src=
"{% static "
js
/
jumpserver
.
js
"
%}
?
v=
1
"
></script>
<script>
activeNav
();
$
(
document
).
ready
(
function
(){
...
...
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