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
d852f018
Commit
d852f018
authored
Mar 07, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改bug
parent
c4afd04c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
node.py
apps/assets/models/node.py
+1
-1
system_user_detail.html
apps/assets/templates/assets/system_user_detail.html
+8
-8
No files found.
apps/assets/models/node.py
View file @
d852f018
...
...
@@ -12,7 +12,7 @@ __all__ = ['Node']
class
Node
(
models
.
Model
):
id
=
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
)
key
=
models
.
CharField
(
unique
=
True
,
max_length
=
64
,
verbose_name
=
_
(
"Key"
))
# '1:1:1:1'
value
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
_
(
"Value"
))
value
=
models
.
CharField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
_
(
"Value"
))
child_mark
=
models
.
IntegerField
(
default
=
0
)
date_create
=
models
.
DateTimeField
(
auto_now_add
=
True
)
...
...
apps/assets/templates/assets/system_user_detail.html
View file @
d852f018
...
...
@@ -164,12 +164,12 @@
<i
class=
"fa fa-info-circle"
></i>
{% trans 'Nodes' %}
</div>
<div
class=
"panel-body"
>
<table
class=
"table
cluster
_edit"
id=
"add-asset2group"
>
<table
class=
"table
node
_edit"
id=
"add-asset2group"
>
<tbody>
<form>
<tr>
<td
colspan=
"2"
class=
"no-borders"
>
<select
data-placeholder=
"{% trans 'Add to node' %}"
id=
"
cluster
_selected"
class=
"select2"
style=
"width: 100%"
multiple=
""
tabindex=
"4"
>
<select
data-placeholder=
"{% trans 'Add to node' %}"
id=
"
node
_selected"
class=
"select2"
style=
"width: 100%"
multiple=
""
tabindex=
"4"
>
{% for node in nodes_remain %}
<option
value=
"{{ node.id }}"
id=
"opt_{{ node.id }}"
>
{{ node.name }}
</option>
{% endfor %}
...
...
@@ -212,13 +212,13 @@ function updateSystemUserCluster(nodes) {
var
success
=
function
(
data
)
{
// remove all the selected groups from select > option and rendered ul element;
$
(
'.select2-selection__rendered'
).
empty
();
$
(
'#
cluster
_selected'
).
val
(
''
);
$
.
map
(
jumpserver
.
nodes_selected
,
function
(
cluster
_name
,
index
)
{
$
(
'#
node
_selected'
).
val
(
''
);
$
.
map
(
jumpserver
.
nodes_selected
,
function
(
node
_name
,
index
)
{
$
(
'#opt_'
+
index
).
remove
();
// change tr html of user groups.
$
(
'.
cluster
_edit tbody'
).
append
(
$
(
'.
node
_edit tbody'
).
append
(
'<tr>'
+
'<td><b class="bdg_node" data-gid="'
+
index
+
'">'
+
cluster
_name
+
'</b></td>'
+
'<td><b class="bdg_node" data-gid="'
+
index
+
'">'
+
node
_name
+
'</b></td>'
+
'<td><button class="btn btn-danger btn-xs pull-right btn-remove-from-node" type="button"><i class="fa fa-minus"></i></button></td>'
+
'</tr>'
)
...
...
@@ -277,10 +277,10 @@ $(document).ready(function () {
'<option value="'
+
gid
+
'" id="opt_'
+
gid
+
'">'
+
node_name
+
'</option>'
);
$tr
.
remove
();
var
cluster
s
=
$
(
'.bdg_node'
).
map
(
function
()
{
var
node
s
=
$
(
'.bdg_node'
).
map
(
function
()
{
return
$
(
this
).
data
(
'gid'
);
}).
get
();
updateSystemUserCluster
(
cluster
s
);
updateSystemUserCluster
(
node
s
);
}).
on
(
'click'
,
'.btn-del'
,
function
()
{
var
$this
=
$
(
this
);
var
name
=
"{{ system_user.name}}"
;
...
...
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