2 Commits

Author SHA1 Message Date
3789fee73b Add CHS mapping to hard drive
All checks were successful
Build / build (push) Successful in 1m34s
Deploy / build (push) Successful in 1m53s
2025-06-09 15:41:04 +02:00
18baf239e8 Add custom device 2025-06-09 15:40:05 +02:00
3 changed files with 57 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
/**
* Represents a CPU or similar device.
*/
@Getter
@Setter
@Entity
@AssetInfo(
displayName = "Custom Device",
pluralName = "Custom Devices",
type = "custom"
)
@Table(name = "custom_assets")
public class CustomAsset implements Asset
{
@Id
@GeneratedValue
private long id;
@OneToOne(orphanRemoval = true)
private GenericAsset asset;
}

View File

@@ -40,12 +40,12 @@ public class HddAsset implements Asset
@InputList
private String formFactor;
@Description("The drive's RPM (Revolutions Per Minute) speed, if applicable.")
@Description("The drive's RPM (Revolutions Per Minute) speed.")
@Property("RPM Speed")
@HideInOverview
private Long rpmSpeed;
@Description("The drive's cache size, if applicable.")
@Description("The drive's cache size.")
@Property("Cache Size")
@HideInOverview
private Long cacheSize;
@@ -54,4 +54,19 @@ public class HddAsset implements Asset
@Property("Drive Type")
@InputList
private String driveType;
@Description("Number of heads in the drive.")
@Property("Heads")
@HideInOverview
private Integer heads;
@Description("Number of cylinders in the drive.")
@Property("Cylinders")
@HideInOverview
private Integer cylinders;
@Description("Number of sectors in the drive.")
@Property("Sectors")
@HideInOverview
private Integer sectors;
}

View File

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