Add motherboard asset model and repository; hide specific properties in overview

This commit is contained in:
2025-06-08 14:59:08 +02:00
parent c8829c5f7c
commit 5a480faca0
6 changed files with 155 additions and 3 deletions

View File

@@ -5,9 +5,6 @@ import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
/**
* Represents a RAM DIMM or similar memory asset in the inventory system.
*/
@Getter
@Setter
@Entity
@@ -33,16 +30,19 @@ public class DisplayAdapterAsset implements Asset
@Description("The type of interface. E.g.: AGP, PCIe, ISA-8, etc...")
@Property("Interface")
@HideInOverview
@InputList
private String interfaceType;
@Description("The highest version of DirectX supported by this display adapter.")
@Property("DirectX Version")
@HideInOverview
@InputList
private String directXVersion;
@Description("The highest version of OpenGL supported by this display adapter.")
@Property("OpenGL Version")
@HideInOverview
@InputList
private String openGLVersion;
}

View File

@@ -44,6 +44,7 @@ public class GenericAsset
private String model;
@Property("Serial Number")
@HideInOverview
private String serialNumber;
@Property("Description")
@@ -52,4 +53,16 @@ public class GenericAsset
@Property("Condition")
private AssetCondition condition;
@Property("Manufacture Date")
@HideInOverview
private String manufactureDate;
@Property("Purchase Date")
@HideInOverview
private String purchaseDate;
@Property("Warranty Expiration Date")
@HideInOverview
private String warrantyExpirationDate;
}

View File

@@ -39,4 +39,19 @@ public class HddAsset implements Asset
@Property("Form Factor")
@InputList
private String formFactor;
@Description("The drive's RPM (Revolutions Per Minute) speed, if applicable.")
@Property("RPM Speed")
@HideInOverview
private Long rpmSpeed;
@Description("The drive's cache size, if applicable.")
@Property("Cache Size")
@HideInOverview
private Long cacheSize;
@Description("The drive's type, such as HDD, SSD, etc.")
@Property("Drive Type")
@InputList
private String driveType;
}

View File

@@ -0,0 +1,108 @@
package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@AssetInfo(
displayName = "Motherboard",
pluralName = "Motherboards",
type = "motherboard"
)
@Table(name = "motherboard_assets")
public class MotherboardAsset implements Asset
{
@Id
@GeneratedValue
private long id;
/// The generic asset associated with this RAM.
@OneToOne(orphanRemoval = true)
private GenericAsset asset;
@Description("The number of 16-bit ISA slots on the motherboard.")
@Property("ISA-16 Slots")
@HideInOverview
private Long isa16Count;
@Description("The number of 8-bit ISA slots on the motherboard.")
@Property("ISA-8 Slots")
@HideInOverview
private Long isa8Count;
@Description("The number of PCI slots on the motherboard.")
@Property("PCI Slots")
@HideInOverview
private Long pciCount;
@Description("The number of PCIe x1 slots on the motherboard.")
@Property("PCIe x1 Slots")
@HideInOverview
private Long pcieX1Count;
@Description("The number of PCIe x4 slots on the motherboard.")
@Property("PCIe x4 Slots")
@HideInOverview
private Long pcieX4Count;
@Description("The number of PCIe x8 slots on the motherboard.")
@Property("PCIe x8 Slots")
@HideInOverview
private Long pcieX8Count;
@Description("The number of PCIe x16 slots on the motherboard.")
@Property("PCIe x16 Slots")
@HideInOverview
private Long pcieX16Count;
@Description("The number of AGP slots on the motherboard.")
@Property("AGP Slots")
@HideInOverview
private Long agpCount;
@Description("The number of RAM slots on the motherboard.")
@Property("RAM Slots")
@HideInOverview
private Long ramSlotCount;
@Description("The maximum amount of RAM supported by the motherboard, in bytes.")
@Property("Max RAM Capacity")
@HideInOverview
@Capacity
private Long maxRamCapacity;
@Description("The type of memory supported by the motherboard. E.g.: DDR2, SDRAM, etc...")
@Property("Memory Type")
@HideInOverview
@InputList
private String memoryType;
@Description("The type of CPU socket on the motherboard. E.g.: Socket 370, Socket A, etc...")
@Property("CPU Socket Type")
@InputList
private String cpuSocketType;
@Description("The chipset used by the motherboard.")
@Property("Chipset")
@InputList
private String chipset;
@Description("The type of BIOS used by the motherboard. E.g.: AMI, Phoenix, etc...")
@Property("BIOS Type")
@InputList
private String biosType;
@Description("The version of the BIOS used by the motherboard.")
@Property("BIOS Version")
@HideInOverview
private String biosVersion;
@Description("The form factor of the motherboard. E.g.: ATX, Micro-ATX, Mini-ITX, etc...")
@Property("Form Factor")
@InputList
private String formFactor;
}

View File

@@ -34,4 +34,8 @@ public class RamAsset implements Asset
@Property("Type")
@InputList
private String type;
@Description("The speed of the memory in MHz.")
@Property("Speed")
private Long speed;
}

View File

@@ -0,0 +1,12 @@
package be.seeseepuff.pcinv.repositories;
import be.seeseepuff.pcinv.models.MotherboardAsset;
import org.springframework.data.jpa.repository.JpaRepository;
@SuppressWarnings("unused")
public interface MotherboardRepository extends JpaRepository<MotherboardAsset, Long>, AssetRepository<MotherboardAsset> {
@Override
default Class<MotherboardAsset> getAssetType() {
return MotherboardAsset.class;
}
}