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
c4b52cb2
Commit
c4b52cb2
authored
Jan 31, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 去掉资产组添加
parent
2f06a2b1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
11 deletions
+12
-11
forms.py
apps/assets/forms.py
+7
-7
tree.py
apps/assets/models/tree.py
+1
-1
asset_create.html
apps/assets/templates/assets/asset_create.html
+1
-1
tree.html
apps/assets/templates/assets/tree.html
+3
-2
No files found.
apps/assets/forms.py
View file @
c4b52cb2
...
...
@@ -13,12 +13,12 @@ class AssetCreateForm(forms.ModelForm):
model
=
Asset
fields
=
[
'hostname'
,
'ip'
,
'public_ip'
,
'port'
,
'comment'
,
'cluster'
,
'
groups'
,
'is_active'
,
'admin_user'
,
'labels'
'
nodes'
,
'is_active'
,
'admin_user'
,
'labels'
,
]
widgets
=
{
'
group
s'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'Select
asset group
s'
)
'
node
s'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'Select
node
s'
)
}),
'cluster'
:
forms
.
Select
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'Select cluster'
)
...
...
@@ -59,12 +59,12 @@ class AssetUpdateForm(forms.ModelForm):
class
Meta
:
model
=
Asset
fields
=
[
'hostname'
,
'ip'
,
'port'
,
'
group
s'
,
"cluster"
,
'is_active'
,
'public_ip'
,
'number'
,
'comment'
,
'admin_user'
,
'labels'
'hostname'
,
'ip'
,
'port'
,
'
node
s'
,
"cluster"
,
'is_active'
,
'public_ip'
,
'number'
,
'comment'
,
'admin_user'
,
'labels'
,
]
widgets
=
{
'
group
s'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'Select
asset group
s'
)
'
node
s'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'Select
node
s'
)
}),
'cluster'
:
forms
.
Select
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'Select cluster'
)
...
...
apps/assets/models/tree.py
View file @
c4b52cb2
...
...
@@ -10,7 +10,7 @@ __all__ = ['Node']
class
Node
(
models
.
Model
):
id
=
models
.
CharField
(
primary_key
=
True
,
max_length
=
64
)
# '1:1:1:1'
name
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
_
(
"Name"
))
name
=
models
.
CharField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
_
(
"Name"
))
child_mark
=
models
.
IntegerField
(
default
=
0
)
date_create
=
models
.
DateTimeField
(
auto_now_add
=
True
)
...
...
apps/assets/templates/assets/asset_create.html
View file @
c4b52cb2
...
...
@@ -26,7 +26,7 @@
<div
class=
"hr-line-dashed"
></div>
<h3>
{% trans 'Group' %}
</h3>
{% bootstrap_field form.
group
s layout="horizontal" %}
{% bootstrap_field form.
node
s layout="horizontal" %}
<div
class=
"hr-line-dashed"
></div>
<h3>
{% trans 'Labels' %}
</h3>
...
...
apps/assets/templates/assets/tree.html
View file @
c4b52cb2
...
...
@@ -4,7 +4,7 @@
{% block custom_head_css_js %}
<link
href=
"{% static 'css/plugins/jstree/style.min.css' %}"
rel=
"stylesheet"
>
<link
href=
"{% static 'css/plugins/ztree/
ztreestyle/ztreestyl
e.css' %}"
rel=
"stylesheet"
>
<link
href=
"{% static 'css/plugins/ztree/
awesomeStyle/awesom
e.css' %}"
rel=
"stylesheet"
>
{#
<link
href=
"{% static 'css/plugins/ztree/demo.css' %}"
rel=
"stylesheet"
>
#}
<script
type=
"text/javascript"
src=
"{% static 'js/plugins/ztree/jquery.ztree.all.min.js' %}"
></script>
<script
type=
"text/javascript"
>
...
...
@@ -268,7 +268,8 @@
function
initTree
()
{
var
setting
=
{
view
:
{
dblClickExpand
:
false
dblClickExpand
:
false
,
showLine
:
true
},
data
:
{
simpleData
:
{
...
...
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