diff --git a/apps/assets/models/node.py b/apps/assets/models/node.py index 7facaed22..5ce195783 100644 --- a/apps/assets/models/node.py +++ b/apps/assets/models/node.py @@ -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) diff --git a/apps/assets/templates/assets/system_user_detail.html b/apps/assets/templates/assets/system_user_detail.html index ad1afa7a4..c655436b9 100644 --- a/apps/assets/templates/assets/system_user_detail.html +++ b/apps/assets/templates/assets/system_user_detail.html @@ -164,12 +164,12 @@ {% trans 'Nodes' %}
- +
' + - '' + + '' + '' + '' ) @@ -277,10 +277,10 @@ $(document).ready(function () { '' ); $tr.remove(); - var clusters = $('.bdg_node').map(function () { + var nodes = $('.bdg_node').map(function () { return $(this).data('gid'); }).get(); - updateSystemUserCluster(clusters); + updateSystemUserCluster(nodes); }).on('click', '.btn-del', function () { var $this = $(this); var name = "{{ system_user.name}}";
- {% for node in nodes_remain %} {% 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( '
' + cluster_name + '' + node_name + '