Skip to content

Commit

Permalink
Early version 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Zorlin committed Dec 31, 2023
1 parent b34d06c commit 6666cb5
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 17 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
These are notes from the early development versions.

v0.0.2 - Backwards Forwards
* [BREAKING] Removes the "Mount point" option for now
* [bugfix] Fix display of serial numbers in the main StorageDevice view

v0.0.1 - The First Drop
* Basic functionality
* Can set the following:
* Name
* Type of storage device (SAS, SATA, NVMe)
* Serial number
* Mount point
25 changes: 25 additions & 0 deletions example_data/serials.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Name,Storage device type,Serial number
sda,SATA,YJUVWOLX9NVBDBT
sdb,SATA,DVZN508A04J9FY3
sdc,SATA,YKVL6QF3G0KS475
sdd,SATA,AM03LTQZJJCXEU7
sde,SATA,WEZF9U6L6Z0EBES
sdf,SATA,857E8NR8576M
sdg,SATA,EQT6FUEWPFWK
sdh,SATA,HJSAPO0Z7HQ4
sdi,SATA,ET5QMRQTRHDX
sdj,SATA,JP1ICH9UE9XR
sdk,SATA,938HUI8O0MTZ
sdl,SATA,ZIX8620FN0VS
sdm,SATA,JZ1VF24H1M5J
sdn,SATA,4XFK605F3OMH
sdo,SATA,L8AD04F7818K
sdp,SATA,SKRX0B9YLDJ6
sdq,SATA,UTHL9IE30NT5
sdr,SATA,WKYJURN90S87
sds,SATA,QO6EPIE1AIGL
sdt,SATA,KQ01YBPGWR1E
sdu,SATA,LKXLG49AV4KA
sdv,SATA,HJ0AWJQ0OB06
sdw,SATA,1NCYZM1X5BS1
sdx,SATA,PSVROJ7H0NIL
2 changes: 1 addition & 1 deletion netbox_physical_storage/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class StorageDeviceSerializer(NetBoxModelSerializer):
class Meta:
model = StorageDevice
fields = [
'id', 'url', 'name', 'storage_device_type', 'serial_number', 'mount_point', 'comments', 'tags', 'custom_fields', 'created',
'id', 'url', 'name', 'storage_device_type', 'serial_number', 'comments', 'tags', 'custom_fields', 'created',
'last_updated',
]

Expand Down
4 changes: 2 additions & 2 deletions netbox_physical_storage/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class StorageDeviceFilterSet(NetBoxModelFilterSet):

class Meta:
model = StorageDevice
fields = ('name', 'storage_device_type', 'serial_number', 'mount_point', 'comments')
fields = ('name', 'storage_device_type', 'serial_number', 'comments')

def search(self, queryset, name, value):
return queryset.filter(description__icontains=value)
return queryset.filter(description__icontains=value)
2 changes: 1 addition & 1 deletion netbox_physical_storage/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ class StorageDeviceForm(NetBoxModelForm):

class Meta:
model = StorageDevice
fields = ('name', 'storage_device_type', 'serial_number', 'mount_point', 'comments')
fields = ('name', 'storage_device_type', 'serial_number', 'comments')
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.8 on 2023-12-31 04:42

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('netbox_physical_storage', '0001_initial'),
]

operations = [
migrations.RemoveField(
model_name='storagedevice',
name='mount_point',
),
]
4 changes: 0 additions & 4 deletions netbox_physical_storage/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ class StorageDevice(NetBoxModel):
max_length=100,
blank=True
)
mount_point = models.CharField(
max_length=100,
blank=True
)
comments = models.TextField(
blank=True
)
Expand Down
3 changes: 1 addition & 2 deletions netbox_physical_storage/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ class StorageDeviceIndex(SearchIndex):
('name', 100),
('storage_device_type', 50),
('serial_number', 50),
('mount_point', 50),
('comments', 50),
)
)
4 changes: 2 additions & 2 deletions netbox_physical_storage/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ class StorageDeviceTable(NetBoxTable):

class Meta(NetBoxTable.Meta):
model = StorageDevice
fields = ('pk', 'id', 'name', 'storage_device_type', 'serial_number', 'mount_point', 'comments')
default_columns = ('name', 'storage_device_type')
fields = ('pk', 'id', 'name', 'storage_device_type', 'serial_number', 'comments')
default_columns = ('name', 'storage_device_type', 'serial_number')
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ <h5 class="card-header">Storage Device</h5>
</tr>
<tr>
<th scope="row">Serial Number</th>
<td>{{ object.serial }}</td>
</tr>
<tr>
<th scope="row">Mount Point</th>
<td>{{ object.mount_point }}</td>
<td>{{ object.serial_number }}</td>
</tr>
</table>
</div>
Expand Down

0 comments on commit 6666cb5

Please sign in to comment.