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
071d14c6
Commit
071d14c6
authored
Apr 13, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改资产获取select
parent
823e8794
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
80 additions
and
37 deletions
+80
-37
node.py
apps/assets/models/node.py
+2
-2
_add_assets_to_node_modal.html
apps/assets/templates/assets/_add_assets_to_node_modal.html
+0
-8
_asset_list_modal.html
apps/assets/templates/assets/_asset_list_modal.html
+1
-2
asset_detail.html
apps/assets/templates/assets/asset_detail.html
+2
-2
asset_list.html
apps/assets/templates/assets/asset_list.html
+0
-0
domain_create_update.html
apps/assets/templates/assets/domain_create_update.html
+16
-4
label_create_update.html
apps/assets/templates/assets/label_create_update.html
+21
-4
django.mo
apps/i18n/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/i18n/zh/LC_MESSAGES/django.po
+0
-0
asset_permission_create_update.html
...perms/templates/perms/asset_permission_create_update.html
+32
-14
_modal.html
apps/templates/_modal.html
+5
-0
_nav.html
apps/templates/_nav.html
+1
-1
No files found.
apps/assets/models/node.py
View file @
071d14c6
...
...
@@ -19,7 +19,7 @@ class Node(models.Model):
is_asset
=
False
def
__str__
(
self
):
return
self
.
value
return
self
.
full_
value
@property
def
name
(
self
):
...
...
@@ -30,7 +30,7 @@ class Node(models.Model):
if
self
==
self
.
__class__
.
root
():
return
self
.
value
else
:
return
'{}
/{}'
.
format
(
self
.
value
,
self
.
parent
.
full_
value
)
return
'{}
/ {}'
.
format
(
self
.
parent
.
full_value
,
self
.
value
)
@property
def
level
(
self
):
...
...
apps/assets/templates/assets/_add_assets_to_node_modal.html
deleted
100644 → 0
View file @
823e8794
{% extends 'assets/_asset_list_modal.html' %}
{% load i18n %}
{% block modal_button %}
<button
class=
"btn btn-white btn-node-update"
type=
"button"
id=
"btn_move"
>
{% trans "Move to" %}
</button>
<button
class=
"btn btn-primary btn-node-update"
type=
"button"
id=
"btn_copy"
>
{% trans 'Copy to' %}
</button>
{% endblock %}
\ No newline at end of file
apps/assets/templates/assets/_asset_list_modal.html
View file @
071d14c6
...
...
@@ -14,6 +14,7 @@
padding
:
10px
10px
;
text-align
:
center
;
}
#assetTree2
.ztree
*
{
background-color
:
#f8fafb
;
}
...
...
@@ -97,9 +98,7 @@ function initTree2() {
$
.
get
(
"{% url 'api-assets:node-list' %}"
,
function
(
data
,
status
){
$
.
each
(
data
,
function
(
index
,
value
)
{
value
[
"pId"
]
=
value
[
"parent"
];
{
#
if
(
value
[
"key"
]
===
"0"
)
{
#
}
value
[
"open"
]
=
true
;
{
#
}
#
}
value
[
"name"
]
=
value
[
"value"
]
+
' ('
+
value
[
'assets_amount'
]
+
')'
;
value
[
'value'
]
=
value
[
'value'
];
});
...
...
apps/assets/templates/assets/asset_detail.html
View file @
071d14c6
...
...
@@ -305,9 +305,9 @@ $(document).ready(function () {
success_message
:
success
});
if
(
status
===
"False"
)
{
$
(
".ibox-content > table > tbody > tr:nth-child(13) > td:last >b"
).
html
(
'True'
);
$
(
".ibox-content > table > tbody > tr:nth-child(13) > td:last >b"
).
html
(
'True'
);
}
else
{
$
(
".ibox-content > table > tbody > tr:nth-child(13) > td:last >b"
).
html
(
'False'
);
$
(
".ibox-content > table > tbody > tr:nth-child(13) > td:last >b"
).
html
(
'False'
);
}
}).
on
(
'click'
,
'#btn-update-nodes'
,
function
()
{
if
(
Object
.
keys
(
jumpserver
.
nodes_selected
).
length
===
0
)
{
...
...
apps/assets/templates/assets/asset_list.html
View file @
071d14c6
This diff is collapsed.
Click to expand it.
apps/assets/templates/assets/domain_create_update.html
View file @
071d14c6
...
...
@@ -18,14 +18,25 @@
</div>
</div>
</form>
{% include 'assets/_asset_list_modal.html' %}
{% endblock %}
{% block custom_foot_js %}
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'.select2'
).
select2
({
closeOnSelect
:
false
});
$
(
document
).
ready
(
function
()
{
console
.
log
(
$
.
fn
.
select2
.
defaults
);
$
(
'.select2'
).
select2
().
off
(
"select2:open"
);
}).
on
(
'click'
,
'.select2-selection__rendered'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
"#asset_list_modal"
).
modal
();
})
.
on
(
'click'
,
'#btn_asset_modal_confirm'
,
function
()
{
var
assets
=
asset_table2
.
selected
;
$
.
each
(
assets
,
function
(
id
,
data
)
{
$
(
'.select2'
).
val
(
assets
).
trigger
(
'change'
);
});
$
(
"#asset_list_modal"
).
modal
(
'hide'
);
})
</script>
{% endblock %}
\ No newline at end of file
apps/assets/templates/assets/label_create_update.html
View file @
071d14c6
...
...
@@ -3,6 +3,8 @@
{% load bootstrap3 %}
{% load i18n %}
{% block form %}
<form
id=
"groupForm"
method=
"post"
class=
"form-horizontal"
>
{% csrf_token %}
...
...
@@ -18,14 +20,28 @@
</div>
</div>
</form>
{% include 'assets/_asset_list_modal.html' %}
{% endblock %}
{% block custom_foot_js %}
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'.select2'
).
select2
({
closeOnSelect
:
false
});
$
(
document
).
ready
(
function
()
{
$
(
'.select2'
).
select2
({
closeOnSelect
:
false
})
}).
on
(
'click'
,
'.select2-selection__rendered'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
"#asset_list_modal"
).
modal
();
})
.
on
(
'click'
,
'#btn_asset_modal_confirm'
,
function
()
{
var
assets
=
asset_table2
.
selected
;
$
(
'.select2 option:selected'
).
each
(
function
(
i
,
data
)
{
assets
.
push
(
$
(
data
).
attr
(
'value'
))
});
$
.
each
(
assets
,
function
(
id
,
data
)
{
$
(
'.select2'
).
val
(
assets
).
trigger
(
'change'
);
});
$
(
"#asset_list_modal"
).
modal
(
'hide'
);
})
</script>
{% endblock %}
\ No newline at end of file
apps/i18n/zh/LC_MESSAGES/django.mo
View file @
071d14c6
No preview for this file type
apps/i18n/zh/LC_MESSAGES/django.po
View file @
071d14c6
This diff is collapsed.
Click to expand it.
apps/perms/templates/perms/asset_permission_create_update.html
View file @
071d14c6
...
...
@@ -76,20 +76,37 @@
</div>
</div>
</div>
{% include 'assets/_asset_list_modal.html' %}
{% endblock %}
{% block custom_foot_js %}
<script
src=
"{% static 'js/plugins/datepicker/bootstrap-datepicker.js' %}"
></script>
<script>
$
(
document
).
ready
(
function
()
{
$
(
'.select2'
).
select2
();
$
(
'#datepicker'
).
datepicker
({
format
:
"yyyy-mm-dd"
,
todayBtn
:
"linked"
,
keyboardNavigation
:
false
,
forceParse
:
false
,
calendarWeeks
:
true
,
autoclose
:
true
});
})
</script>
<script
src=
"{% static 'js/plugins/datepicker/bootstrap-datepicker.js' %}"
></script>
<script>
$
(
document
).
ready
(
function
()
{
$
(
'.select2'
).
select2
({
closeOnSelect
:
false
});
$
(
'#datepicker'
).
datepicker
({
format
:
"yyyy-mm-dd"
,
todayBtn
:
"linked"
,
keyboardNavigation
:
false
,
forceParse
:
false
,
calendarWeeks
:
true
,
autoclose
:
true
});
$
(
"#id_assets"
).
parent
().
find
(
".select2-selection"
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
"#asset_list_modal"
).
modal
();
})
})
.
on
(
'click'
,
'#btn_asset_modal_confirm'
,
function
()
{
var
assets
=
asset_table2
.
selected
;
$
(
'.select2 option:selected'
).
each
(
function
(
i
,
data
)
{
assets
.
push
(
$
(
data
).
attr
(
'value'
))
});
$
.
each
(
assets
,
function
(
id
,
data
)
{
$
(
'.select2'
).
val
(
assets
).
trigger
(
'change'
);
});
$
(
"#asset_list_modal"
).
modal
(
'hide'
);
})
</script>
{% endblock %}
\ No newline at end of file
apps/templates/_modal.html
View file @
071d14c6
{% load i18n %}
<style>
.modal-body
{
padding
:
0px
20px
0px
20px
;
}
</style>
<div
aria-hidden=
"true"
role=
"dialog"
id=
"{% block modal_id %}{% endblock %}"
class=
"modal inmodal"
>
<div
class=
"modal-dialog {% block modal_class %}{% endblock %}"
>
<div
class=
"modal-content animated fadeIn"
>
...
...
apps/templates/_nav.html
View file @
071d14c6
...
...
@@ -61,7 +61,7 @@
</li>
<li
id=
"audits"
>
<a>
<i
class=
"fa fa-
coffee
"
style=
"width: 14px"
></i>
<span
class=
"nav-label"
>
{% trans 'Audits' %}
</span><span
class=
"fa arrow"
></span>
<i
class=
"fa fa-
history
"
style=
"width: 14px"
></i>
<span
class=
"nav-label"
>
{% trans 'Audits' %}
</span><span
class=
"fa arrow"
></span>
</a>
<ul
class=
"nav nav-second-level"
>
<li
id=
"ftp-log"
><a
href=
"{% url 'audits:ftp-log-list' %}"
>
{% trans 'FTP log' %}
</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