diff --git a/apps/assets/migrations/0001_initial.py b/apps/assets/migrations/0001_initial.py index 1f8bae05e..dc20ec9f1 100644 --- a/apps/assets/migrations/0001_initial.py +++ b/apps/assets/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.10 on 2016-08-21 09:52 +# Generated by Django 1.10 on 2016-09-03 14:30 from __future__ import unicode_literals from django.db import migrations, models @@ -18,11 +18,11 @@ class Migration(migrations.Migration): name='Asset', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('ip', models.CharField(blank=True, max_length=32, verbose_name='\u4e3b\u673aIP')), + ('ip', models.CharField(blank=True, max_length=32, verbose_name='\u8d44\u4ea7IP')), ('other_ip', models.CharField(blank=True, max_length=255, verbose_name='\u5176\u4ed6IP')), ('remote_card_ip', models.CharField(blank=True, max_length=16, verbose_name='\u8fdc\u63a7\u5361IP')), ('hostname', models.CharField(blank=True, max_length=128, unique=True, verbose_name='\u4e3b\u673a\u540d')), - ('port', models.IntegerField(blank=True, verbose_name='\u7aef\u53e3\u53f7')), + ('port', models.IntegerField(blank=True, verbose_name='\u7aef\u53e3')), ('username', models.CharField(blank=True, max_length=16, verbose_name='\u7ba1\u7406\u7528\u6237\u540d')), ('password', models.CharField(blank=True, max_length=256, verbose_name='\u5bc6\u7801')), ('mac_addr', models.CharField(blank=True, max_length=20, unique=True, verbose_name='MAC\u5730\u5740')), @@ -32,7 +32,7 @@ class Migration(migrations.Migration): ('disk', models.CharField(blank=True, max_length=1024, verbose_name='\u786c\u76d8')), ('os', models.CharField(blank=True, max_length=128, verbose_name='\u7cfb\u7edf\u4fe1\u606f')), ('cabinet_no', models.CharField(blank=True, max_length=32, verbose_name='\u673a\u67dc\u53f7')), - ('cabinet_pos', models.IntegerField(blank=True, verbose_name='\u673a\u5668\u4f4d\u7f6e')), + ('cabinet_pos', models.IntegerField(blank=True, null=True, verbose_name='\u8d44\u4ea7\u4f4d\u7f6e')), ('number', models.CharField(blank=True, max_length=32, unique=True, verbose_name='\u8d44\u4ea7\u7f16\u53f7')), ('sn', models.CharField(blank=True, max_length=128, unique=True, verbose_name='SN\u7f16\u53f7')), ('created_by', models.CharField(blank=True, max_length=32, verbose_name='\u521b\u5efa\u8005')), @@ -101,11 +101,11 @@ class Migration(migrations.Migration): migrations.AddField( model_name='asset', name='status', - field=models.ManyToManyField(blank=True, related_name='asset_status_extend', to='assets.AssetExtend', verbose_name='\u673a\u5668\u72b6\u6001'), + field=models.ManyToManyField(blank=True, related_name='asset_status_extend', to='assets.AssetExtend', verbose_name='\u8d44\u4ea7\u72b6\u6001'), ), migrations.AddField( model_name='asset', name='type', - field=models.ManyToManyField(blank=True, related_name='asset_type_extend', to='assets.AssetExtend', verbose_name='\u673a\u5668\u7c7b\u578b'), + field=models.ManyToManyField(blank=True, related_name='asset_type_extend', to='assets.AssetExtend', verbose_name='\u8d44\u4ea7\u7c7b\u578b'), ), ] diff --git a/apps/assets/models.py b/apps/assets/models.py index d3a09d5ae..8ae2774d9 100644 --- a/apps/assets/models.py +++ b/apps/assets/models.py @@ -42,11 +42,11 @@ class AssetExtend(models.Model): class Asset(models.Model): - ip = models.CharField(max_length=32, blank=True, verbose_name="主机IP") + ip = models.CharField(max_length=32, blank=True, verbose_name="资产IP") other_ip = models.CharField(max_length=255, blank=True, verbose_name="其他IP") remote_card_ip = models.CharField(max_length=16, blank=True, verbose_name=u'远控卡IP') hostname = models.CharField(max_length=128, unique=True, blank=True, verbose_name=u"主机名") - port = models.IntegerField(blank=True, verbose_name=u"端口号") + port = models.IntegerField(blank=True, verbose_name=u"端口") group = models.ManyToManyField(AssetGroup, blank=True, verbose_name=u"所属主机组") username = models.CharField(max_length=16, blank=True, verbose_name=u"管理用户名") password = models.CharField(max_length=256, blank=True, verbose_name=u"密码") @@ -58,12 +58,12 @@ class Asset(models.Model): disk = models.CharField(max_length=1024, blank=True, verbose_name=u'硬盘') os = models.CharField(max_length=128, blank=True, verbose_name=u'系统信息') cabinet_no = models.CharField(max_length=32, blank=True, verbose_name=u'机柜号') - cabinet_pos = models.IntegerField(max_length=4, null=True, blank=True, verbose_name=u'机器位置') + cabinet_pos = models.IntegerField(null=True, blank=True, verbose_name=u'资产位置') number = models.CharField(max_length=32, blank=True, unique=True, verbose_name=u'资产编号') status = models.ManyToManyField(AssetExtend, blank=True, - related_name="asset_status_extend", verbose_name="机器状态") + related_name="asset_status_extend", verbose_name="资产状态") type = models.ManyToManyField(AssetExtend, blank=True, - related_name="asset_type_extend", verbose_name="机器类型") + related_name="asset_type_extend", verbose_name="资产类型") env = models.ManyToManyField(AssetExtend, blank=True, related_name="asset_env_extend", verbose_name="所属主机组环境") sn = models.CharField(max_length=128, blank=True, unique=True, verbose_name=u"SN编号") diff --git a/apps/assets/templates/assets/asset_add.html b/apps/assets/templates/assets/asset_add.html index dbfd11b15..0c21a9b85 100644 --- a/apps/assets/templates/assets/asset_add.html +++ b/apps/assets/templates/assets/asset_add.html @@ -22,12 +22,6 @@