change some html

pull/530/head
wangyong 8 years ago
parent 69349368bf
commit 342e4bdee8

@ -1,111 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-03 14:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
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='\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')),
('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')),
('brand', models.CharField(blank=True, max_length=64, verbose_name='\u786c\u4ef6\u5382\u5546\u578b\u53f7')),
('cpu', models.CharField(blank=True, max_length=64, verbose_name='CPU')),
('memory', models.CharField(blank=True, max_length=128, verbose_name='\u5185\u5b58')),
('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, 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')),
('is_active', models.BooleanField(default=True, verbose_name='\u662f\u5426\u6fc0\u6d3b')),
('date_added', models.DateTimeField(auto_now=True, null=True)),
('comment', models.CharField(blank=True, max_length=128, verbose_name='\u5907\u6ce8')),
],
options={
'db_table': 'asset',
},
),
migrations.CreateModel(
name='AssetExtend',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.CreateModel(
name='AssetGroup',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64, unique=True)),
('created_by', models.CharField(blank=True, max_length=32, verbose_name='\u521b\u5efa\u8005')),
('comment', models.CharField(blank=True, max_length=128, null=True)),
],
options={
'db_table': 'assetgroup',
},
),
migrations.CreateModel(
name='IDC',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=32, verbose_name='\u673a\u623f\u540d\u79f0')),
('bandwidth', models.CharField(blank=True, max_length=32, verbose_name='\u673a\u623f\u5e26\u5bbd')),
('contact', models.CharField(blank=True, max_length=16, verbose_name='\u8054\u7cfb\u4eba')),
('phone', models.CharField(blank=True, max_length=32, verbose_name='\u8054\u7cfb\u7535\u8bdd')),
('address', models.CharField(blank=True, max_length=128, verbose_name='\u673a\u623f\u5730\u5740')),
('network', models.TextField(blank=True, verbose_name='IP\u5730\u5740\u6bb5')),
('date_added', models.DateField(auto_now=True, null=True)),
('operator', models.CharField(blank=True, max_length=32, verbose_name='\u8fd0\u8425\u5546')),
('created_by', models.CharField(blank=True, max_length=32, verbose_name='\u521b\u5efa\u8005')),
('comment', models.CharField(blank=True, max_length=128, verbose_name='\u5907\u6ce8')),
],
options={
'db_table': 'idc',
'verbose_name': 'IDC\u673a\u623f',
'verbose_name_plural': 'IDC\u673a\u623f',
},
),
migrations.AddField(
model_name='asset',
name='env',
field=models.ManyToManyField(blank=True, related_name='asset_env_extend', to='assets.AssetExtend', verbose_name='\u6240\u5c5e\u4e3b\u673a\u7ec4\u73af\u5883'),
),
migrations.AddField(
model_name='asset',
name='group',
field=models.ManyToManyField(blank=True, to='assets.AssetGroup', verbose_name='\u6240\u5c5e\u4e3b\u673a\u7ec4'),
),
migrations.AddField(
model_name='asset',
name='idc',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='assets.IDC', verbose_name='\u673a\u623f'),
),
migrations.AddField(
model_name='asset',
name='status',
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='\u8d44\u4ea7\u7c7b\u578b'),
),
]

@ -1,20 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-21 09:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assets', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='asset',
name='cabinet_pos',
field=models.IntegerField(blank=True, max_length=4, verbose_name='\u673a\u5668\u4f4d\u7f6e'),
),
]

@ -1,20 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-21 09:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assets', '0002_auto_20160821_1757'),
]
operations = [
migrations.AlterField(
model_name='asset',
name='cabinet_pos',
field=models.IntegerField(blank=True, max_length=4, null=True, verbose_name='\u673a\u5668\u4f4d\u7f6e'),
),
]

@ -6,9 +6,9 @@ from django.utils.translation import ugettext_lazy as _
class AssetGroup(models.Model):
name = models.CharField(max_length=64, unique=True, null=True, blank=True, verbose_name=_('Name'))
name = models.CharField(max_length=64, unique=True, verbose_name=_('Name'))
created_by = models.CharField(max_length=32, null=True, blank=True, verbose_name=_('Created by'))
comment = models.TextField(blank=True, verbose_name=_('Comment'))
comment = models.TextField(null=True, blank=True, verbose_name=_('Comment'))
def __unicode__(self):
return self.name
@ -37,10 +37,10 @@ class IDC(models.Model):
class AssetExtend(models.Model):
key = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('KEY'))
value = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('VALUE'))
key = models.CharField(max_length=64, verbose_name=_('KEY'))
value = models.CharField(max_length=64, verbose_name=_('VALUE'))
created_by = models.CharField(max_length=32, blank=True, verbose_name=_("Created by"))
date_added = models.DateTimeField(auto_now=True, null=True, blank=True)
date_added = models.DateTimeField(auto_now=True, null=True, verbose_name=_('Date added'))
comment = models.TextField(blank=True, verbose_name=_('Comment'))
def __unicode__(self):
@ -51,13 +51,13 @@ class AssetExtend(models.Model):
class AdminUser(models.Model):
name = models.CharField(max_length=128, unique=True, null=True, blank=True, verbose_name=_('Name'))
username = models.CharField(max_length=16, null=True, blank=True, verbose_name=_('Username'))
name = models.CharField(max_length=128, unique=True, verbose_name=_('Name'))
username = models.CharField(max_length=16, verbose_name=_('Username'))
password = models.CharField(max_length=256, null=True, blank=True, verbose_name=_('Password'))
private_key = models.CharField(max_length=4096, null=True, blank=True, verbose_name=_('SSH private key'))
is_default = models.BooleanField(default=True, verbose_name=_('As default'))
is_default = models.BooleanField(default=False, verbose_name=_('As default'))
auto_update = models.BooleanField(default=True, verbose_name=_('Auto update pass/key'))
date_added = models.DateTimeField(auto_now=True, null=True, blank=True)
date_added = models.DateTimeField(auto_now=True, null=True, verbose_name=_('Date added'))
create_by = models.CharField(max_length=32, null=True, blank=True, verbose_name=_('Created by'))
comment = models.TextField(blank=True, verbose_name=_('Comment'))
@ -73,20 +73,20 @@ class SysUser(models.Model):
('ssh', 'ssh'),
('telnet', 'telnet'),
)
name = models.CharField(max_length=128, unique=True, verbose_name=_('Name'))
username = models.CharField(max_length=16, blank=True, verbose_name=_('Username'))
password = models.CharField(max_length=256, blank=True, verbose_name=_('Password'))
name = models.CharField(max_length=128, verbose_name=_('Name'))
username = models.CharField(max_length=16, verbose_name=_('Username'))
password = models.CharField(max_length=256, null=True, blank=True, verbose_name=_('Password'))
protocol = models.CharField(max_length=16, default='ssh', verbose_name=_('Protocol'))
private_key = models.CharField(max_length=4096, blank=True, verbose_name=_('SSH private key'))
public_key = models.CharField(max_length=4096, blank=True, verbose_name=_('SSH public key'))
is_default = models.BooleanField(default=True, verbose_name=_('As default'))
is_default = models.BooleanField(default=False, verbose_name=_('As default'))
auto_push = models.BooleanField(default=True, verbose_name=_('Auto push'))
auto_update = models.BooleanField(default=True, verbose_name=_('Auto update pass/key'))
sudo = models.TextField(max_length=4096, blank=True, verbose_name=_('Sudo'))
shell = models.CharField(max_length=64, blank=True, verbose_name=_('Shell'))
home = models.CharField(max_length=64, blank=True, verbose_name=_('Home'))
uid = models.IntegerField(blank=True, verbose_name=_('Uid'))
date_added = models.DateTimeField(auto_now=True, null=True)
date_added = models.DateTimeField(auto_now=True, null=True, verbose_name=_('Date added'))
create_by = models.CharField(max_length=32, blank=True, verbose_name=_('Created by'))
comment = models.CharField(max_length=128, blank=True, verbose_name=_('Comment'))
@ -98,34 +98,34 @@ class SysUser(models.Model):
class Asset(models.Model):
ip = models.CharField(max_length=32, null=True, blank=True, verbose_name=_('IP'))
other_ip = models.CharField(max_length=255, null=True, blank=True, verbose_name=_('Other IP'))
remote_card_ip = models.CharField(max_length=16, null=True, blank=True, verbose_name=_('Remote card IP'))
hostname = models.CharField(max_length=128, unique=True, null=True, blank=True, verbose_name=_('Hostname'))
port = models.IntegerField(null=True, blank=True, verbose_name=_('Port'))
groups = models.ManyToManyField(AssetGroup, null=True, blank=True, verbose_name=_('Asset groups'))
username = models.CharField(max_length=16, null=True, blank=True, verbose_name=_('Admin user'))
password = models.CharField(max_length=256, null=True, blank=True, verbose_name=_("Admin password"))
admin_user = models.ForeignKey(AdminUser, null=True, blank=True, on_delete=models.SET_NULL, verbose_name=_("Admin User"))
sys_user = models.ManyToManyField(SysUser, null=True, blank=True, verbose_name=_("Sys User"))
ip = models.CharField(max_length=32, verbose_name=_('IP'))
other_ip = models.CharField(max_length=255, blank=True, verbose_name=_('Other IP'))
remote_card_ip = models.CharField(max_length=16, blank=True, verbose_name=_('Remote card IP'))
hostname = models.CharField(max_length=128, unique=True, blank=True, verbose_name=_('Hostname'))
port = models.IntegerField(default=22, verbose_name=_('Port'))
groups = models.ManyToManyField(AssetGroup, blank=True, verbose_name=_('Asset groups'))
username = models.CharField(max_length=16, blank=True, verbose_name=_('Admin user'))
password = models.CharField(max_length=256, blank=True, verbose_name=_("Admin password"))
admin_user = models.ForeignKey(AdminUser, null=True, on_delete=models.SET_NULL, verbose_name=_("Admin User"))
sys_user = models.ManyToManyField(SysUser, verbose_name=_("Sys User"))
idc = models.ForeignKey(IDC, null=True, blank=True, on_delete=models.SET_NULL, verbose_name=_('IDC'))
mac_addr = models.CharField(max_length=20, null=True, blank=True, verbose_name=_("Mac address"))
brand = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('Brand'))
cpu = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('CPU'))
memory = models.CharField(max_length=128, null=True, blank=True, verbose_name=_('Memory'))
disk = models.CharField(max_length=1024, null=True, blank=True, verbose_name=_('Disk'))
os = models.CharField(max_length=128, null=True, blank=True, verbose_name=_('OS'))
cabinet_no = models.CharField(max_length=32, null=True, blank=True, verbose_name=_('Cabinet number'))
mac_addr = models.CharField(max_length=20, blank=True, verbose_name=_("Mac address"))
brand = models.CharField(max_length=64, blank=True, verbose_name=_('Brand'))
cpu = models.CharField(max_length=64, blank=True, verbose_name=_('CPU'))
memory = models.CharField(max_length=128, blank=True, verbose_name=_('Memory'))
disk = models.CharField(max_length=1024, blank=True, verbose_name=_('Disk'))
os = models.CharField(max_length=128, blank=True, verbose_name=_('OS'))
cabinet_no = models.CharField(max_length=32, blank=True, verbose_name=_('Cabinet number'))
cabinet_pos = models.IntegerField(null=True, blank=True, verbose_name=_('Cabinet position'))
number = models.CharField(max_length=32, null=True, blank=True, unique=True, verbose_name=_('Asset number'))
status = models.ManyToManyField(AssetExtend, related_name="asset_status_extend", verbose_name=_('Asset status'))
type = models.ManyToManyField(AssetExtend, related_name="asset_type_extend", verbose_name=_('Asset type'))
env = models.ManyToManyField(AssetExtend, related_name="asset_env_extend", verbose_name=_('Asset environment'))
sn = models.CharField(max_length=128, null=True, blank=True, unique=True, verbose_name=_('Serial number'))
created_by = models.CharField(max_length=32, null=True, blank=True, verbose_name=_('Created by'))
number = models.CharField(max_length=32, blank=True, unique=True, verbose_name=_('Asset number'))
status = models.ForeignKey(AssetExtend, null=True, blank=True, related_name="asset_status_extend", verbose_name=_('Asset status'))
type = models.ForeignKey(AssetExtend, null=True, blank=True, related_name="asset_type_extend", verbose_name=_('Asset type'))
env = models.ForeignKey(AssetExtend, null=True, blank=True, related_name="asset_env_extend", verbose_name=_('Asset environment'))
sn = models.CharField(max_length=128, blank=True, unique=True, verbose_name=_('Serial number'))
created_by = models.CharField(max_length=32, blank=True, verbose_name=_('Created by'))
is_active = models.BooleanField(default=True, verbose_name=_('Is active'))
date_added = models.DateTimeField(auto_now=True, null=True, blank=True, verbose_name=_('Date added'))
comment = models.CharField(max_length=128, null=True, blank=True, verbose_name=_('Comment'))
date_added = models.DateTimeField(auto_now=True, null=True, verbose_name=_('Date added'))
comment = models.CharField(max_length=128, blank=True, verbose_name=_('Comment'))
def __unicode__(self):
return self.ip
@ -135,11 +135,11 @@ class Asset(models.Model):
class Label(models.Model):
key = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('KEY'))
value = models.CharField(max_length=64, null=True, blank=True, verbose_name=_('VALUE'))
key = models.CharField(max_length=64, verbose_name=_('KEY'))
value = models.CharField(max_length=64, verbose_name=_('VALUE'))
asset = models.ForeignKey(Asset, null=True, blank=True, on_delete=models.SET_NULL, verbose_name=_('Asset'))
created_by = models.CharField(max_length=32, blank=True, verbose_name=_("Created by"))
date_added = models.DateTimeField(auto_now=True, null=True)
date_added = models.DateTimeField(auto_now=True, null=True, verbose_name=_('Date added'))
comment = models.CharField(max_length=128, blank=True, verbose_name=_('Comment'))
def __unicode__(self):

@ -38,12 +38,14 @@
{{ form.ip|bootstrap_horizontal }}
<div class="form-group" id="id_port">
<label class="col-sm-2 control-label">端口</label>
<div class="col-sm-9">
<input type="text" placeholder="" name="port" class="form-control">
</div>
</div>
{{ form.port|bootstrap_horizontal }}
{# <div class="form-group" id="id_port">#}
{# <label class="col-sm-2 control-label">端口</label>#}
{# <div class="col-sm-9">#}
{# <input type="text" placeholder="" name="port" class="form-control">#}
{# </div>#}
{# </div>#}
{# <div class="form-group" id="id_type">#}
{# <label class="col-sm-2 control-label">资产类型</label>#}

Loading…
Cancel
Save