mirror of https://github.com/jumpserver/jumpserver
[Update] 去掉资产组添加
parent
2f06a2b1d3
commit
c4b52cb2a3
|
@ -13,12 +13,12 @@ class AssetCreateForm(forms.ModelForm):
|
||||||
model = Asset
|
model = Asset
|
||||||
fields = [
|
fields = [
|
||||||
'hostname', 'ip', 'public_ip', 'port', 'comment', 'cluster',
|
'hostname', 'ip', 'public_ip', 'port', 'comment', 'cluster',
|
||||||
'groups', 'is_active', 'admin_user', 'labels'
|
'nodes', 'is_active', 'admin_user', 'labels',
|
||||||
|
|
||||||
]
|
]
|
||||||
widgets = {
|
widgets = {
|
||||||
'groups': forms.SelectMultiple(attrs={
|
'nodes': forms.SelectMultiple(attrs={
|
||||||
'class': 'select2', 'data-placeholder': _('Select asset groups')
|
'class': 'select2', 'data-placeholder': _('Select nodes')
|
||||||
}),
|
}),
|
||||||
'cluster': forms.Select(attrs={
|
'cluster': forms.Select(attrs={
|
||||||
'class': 'select2', 'data-placeholder': _('Select cluster')
|
'class': 'select2', 'data-placeholder': _('Select cluster')
|
||||||
|
@ -59,12 +59,12 @@ class AssetUpdateForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Asset
|
model = Asset
|
||||||
fields = [
|
fields = [
|
||||||
'hostname', 'ip', 'port', 'groups', "cluster", 'is_active',
|
'hostname', 'ip', 'port', 'nodes', "cluster", 'is_active',
|
||||||
'public_ip', 'number', 'comment', 'admin_user', 'labels'
|
'public_ip', 'number', 'comment', 'admin_user', 'labels',
|
||||||
]
|
]
|
||||||
widgets = {
|
widgets = {
|
||||||
'groups': forms.SelectMultiple(attrs={
|
'nodes': forms.SelectMultiple(attrs={
|
||||||
'class': 'select2', 'data-placeholder': _('Select asset groups')
|
'class': 'select2', 'data-placeholder': _('Select nodes')
|
||||||
}),
|
}),
|
||||||
'cluster': forms.Select(attrs={
|
'cluster': forms.Select(attrs={
|
||||||
'class': 'select2', 'data-placeholder': _('Select cluster')
|
'class': 'select2', 'data-placeholder': _('Select cluster')
|
||||||
|
|
|
@ -10,7 +10,7 @@ __all__ = ['Node']
|
||||||
|
|
||||||
class Node(models.Model):
|
class Node(models.Model):
|
||||||
id = models.CharField(primary_key=True, max_length=64) # '1:1:1:1'
|
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)
|
child_mark = models.IntegerField(default=0)
|
||||||
date_create = models.DateTimeField(auto_now_add=True)
|
date_create = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
<div class="hr-line-dashed"></div>
|
<div class="hr-line-dashed"></div>
|
||||||
<h3>{% trans 'Group' %}</h3>
|
<h3>{% trans 'Group' %}</h3>
|
||||||
{% bootstrap_field form.groups layout="horizontal" %}
|
{% bootstrap_field form.nodes layout="horizontal" %}
|
||||||
|
|
||||||
<div class="hr-line-dashed"></div>
|
<div class="hr-line-dashed"></div>
|
||||||
<h3>{% trans 'Labels' %}</h3>
|
<h3>{% trans 'Labels' %}</h3>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
{% block custom_head_css_js %}
|
{% block custom_head_css_js %}
|
||||||
<link href="{% static 'css/plugins/jstree/style.min.css' %}" rel="stylesheet">
|
<link href="{% static 'css/plugins/jstree/style.min.css' %}" rel="stylesheet">
|
||||||
<link href="{% static 'css/plugins/ztree/ztreestyle/ztreestyle.css' %}" rel="stylesheet">
|
<link href="{% static 'css/plugins/ztree/awesomeStyle/awesome.css' %}" rel="stylesheet">
|
||||||
{# <link href="{% static 'css/plugins/ztree/demo.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" src="{% static 'js/plugins/ztree/jquery.ztree.all.min.js' %}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -268,7 +268,8 @@
|
||||||
function initTree() {
|
function initTree() {
|
||||||
var setting = {
|
var setting = {
|
||||||
view: {
|
view: {
|
||||||
dblClickExpand: false
|
dblClickExpand: false,
|
||||||
|
showLine: true
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
simpleData: {
|
simpleData: {
|
||||||
|
|
Loading…
Reference in New Issue