diff --git a/assetapp/excel_utils.py b/assetapp/excel_utils.py index 9c382f1..223b60a 100644 --- a/assetapp/excel_utils.py +++ b/assetapp/excel_utils.py @@ -16,7 +16,7 @@ EXPORT_COLUMNS = [ ('model', '型号', 20), ('asset_value', '资产面值', 12), ('serial_number', '序列号', 25), - ('location', '设备位置', 20), + ('location', '机房', 20), ('cabinet', '机柜', 10), ('cabinet_position', '机柜位置', 10), ('bmc_address', 'BMC地址', 16), diff --git a/assetapp/migrations/0008_alter_asset_location.py b/assetapp/migrations/0008_alter_asset_location.py new file mode 100644 index 0000000..76cb5b2 --- /dev/null +++ b/assetapp/migrations/0008_alter_asset_location.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.13 on 2026-04-28 04:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('assetapp', '0007_asset_business_type_asset_gpu_count_asset_gpu_type_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='asset', + name='location', + field=models.CharField(blank=True, default='', help_text='楼层/房间/区域', max_length=200, verbose_name='机房'), + ), + ] diff --git a/assetapp/models.py b/assetapp/models.py index 86c91d8..a76861b 100644 --- a/assetapp/models.py +++ b/assetapp/models.py @@ -40,7 +40,7 @@ class Asset(models.Model): serial_number = models.CharField('序列号', max_length=100, blank=True, default='', db_index=True) # 位置信息 - location = models.CharField('设备位置', max_length=200, blank=True, default='', help_text='楼层/房间/区域') + location = models.CharField('机房', max_length=200, blank=True, default='', help_text='楼层/房间/区域') cabinet = models.CharField('机柜', max_length=50, blank=True, default='') cabinet_position = models.CharField('机柜位置', max_length=50, blank=True, default='', help_text='U位') diff --git a/templates/assetapp/asset_detail.html b/templates/assetapp/asset_detail.html index a4c89a9..039bcb5 100644 --- a/templates/assetapp/asset_detail.html +++ b/templates/assetapp/asset_detail.html @@ -52,7 +52,7 @@
| 设备位置 | {{ asset.location|default:"-" }} | |||||||||||||
| 机房 | {{ asset.location|default:"-" }} | |||||||||||||
| 机柜 | {{ asset.cabinet|default:"-" }} | |||||||||||||
| 机柜位置 | {{ asset.cabinet_position|default:"-" }} | |||||||||||||
| BMC地址 | {{ asset.bmc_address|default:"-" }} | |||||||||||||
| ID | -机柜 | -机柜位置 | +机房 | +机柜 | +机柜位置 | 资产编号 | 设备名称 | 分类 | 品牌/型号 | 资产面值 | -位置 | BMC地址 | IP地址 | 显卡类型 | @@ -94,6 +94,7 @@ {% for asset in page_obj %}
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ asset.id|stringformat:"s"|truncatechars:3 }} | +{{ asset.location|default:"-"|truncatechars:5 }} | {{ asset.cabinet|default:"-"|truncatechars:3 }} | {{ asset.cabinet_position|default:"-"|truncatechars:10 }} | {{ asset.asset_number|truncatechars:3 }} | @@ -101,7 +102,6 @@{{ asset.category.name }} | {{ asset.brand }} {% if asset.model %}{{ asset.model }}{% endif %} | {% if asset.asset_value %}¥{{ asset.asset_value }}{% else %}-{% endif %} | -{{ asset.location|default:"-"|truncatechars:5 }} | {{ asset.bmc_address|default:"-" }} |
{{ asset.ip_address|default:"-" }} |
{{ asset.gpu_type|default:"-" }} |