Commit c4b52cb2 authored by ibuler's avatar ibuler

[Update] 去掉资产组添加

parent 2f06a2b1
......@@ -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 = {
'groups': forms.SelectMultiple(attrs={
'class': 'select2', 'data-placeholder': _('Select asset groups')
'nodes': forms.SelectMultiple(attrs={
'class': 'select2', 'data-placeholder': _('Select nodes')
}),
'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', 'groups', "cluster", 'is_active',
'public_ip', 'number', 'comment', 'admin_user', 'labels'
'hostname', 'ip', 'port', 'nodes', "cluster", 'is_active',
'public_ip', 'number', 'comment', 'admin_user', 'labels',
]
widgets = {
'groups': forms.SelectMultiple(attrs={
'class': 'select2', 'data-placeholder': _('Select asset groups')
'nodes': forms.SelectMultiple(attrs={
'class': 'select2', 'data-placeholder': _('Select nodes')
}),
'cluster': forms.Select(attrs={
'class': 'select2', 'data-placeholder': _('Select cluster')
......
......@@ -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)
......
......@@ -26,7 +26,7 @@
<div class="hr-line-dashed"></div>
<h3>{% trans 'Group' %}</h3>
{% bootstrap_field form.groups layout="horizontal" %}
{% bootstrap_field form.nodes layout="horizontal" %}
<div class="hr-line-dashed"></div>
<h3>{% trans 'Labels' %}</h3>
......
......@@ -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/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">#}
<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: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment