Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7cd7d11a40 | |||
| ab06c37a71 | |||
| 54231df858 |
@@ -16,7 +16,7 @@ jobs:
|
||||
run: docker login gitea.seeseepuff.be -u seeseemelk -p ${{ secrets.PACKAGE_RW }}
|
||||
|
||||
- name: Build
|
||||
run: docker build -t gitea.seeseepuff.be/seeseemelk/pcinv:${{github.ref_name}} .
|
||||
run: ./gradlew bootBuildImage --no-daemon --imageName=gitea.seeseepuff.be/seeseemelk/pcinv:${{github.ref_name}}
|
||||
|
||||
- name: Push
|
||||
run: docker push gitea.seeseepuff.be/seeseemelk/pcinv:${{github.ref_name}}
|
||||
|
||||
@@ -3,6 +3,7 @@ package be.seeseepuff.pcinv.meta;
|
||||
import be.seeseepuff.pcinv.models.Asset;
|
||||
import be.seeseepuff.pcinv.models.AssetCondition;
|
||||
import be.seeseepuff.pcinv.models.GenericAsset;
|
||||
import be.seeseepuff.pcinv.models.ReadWrite;
|
||||
import jakarta.annotation.Nonnull;
|
||||
import jakarta.annotation.Nullable;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -58,6 +59,7 @@ public class AssetProperty {
|
||||
BOOLEAN(false),
|
||||
CAPACITY(false),
|
||||
CONDITION(true),
|
||||
READWRITE(true),
|
||||
;
|
||||
/// Set to `true` if the type is an enum, `false` otherwise.
|
||||
public final boolean isEnum;
|
||||
@@ -155,6 +157,8 @@ public class AssetProperty {
|
||||
return Type.BOOLEAN;
|
||||
} else if (property.getType() == AssetCondition.class) {
|
||||
return Type.CONDITION;
|
||||
} else if (property.getType() == ReadWrite.class) {
|
||||
return Type.READWRITE;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported property type: " + property.getType());
|
||||
}
|
||||
|
||||
@@ -24,104 +24,74 @@ public class CdDriveAsset implements Asset
|
||||
@OneToOne(orphanRemoval = true)
|
||||
private GenericAsset asset;
|
||||
|
||||
@Description("Indicates if the drive supports reading CD-ROM discs.")
|
||||
@Description("Indicates if the drive supports CD-ROM discs.")
|
||||
@Property("CD-ROM Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsCdRom;
|
||||
private ReadWrite supportsCdRom;
|
||||
|
||||
@Description("Indicates if the drive supports reading CD-R discs.")
|
||||
@Description("Indicates if the drive supports CD-R discs.")
|
||||
@Property("CD-R Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsCdR;
|
||||
private ReadWrite supportsCdR;
|
||||
|
||||
@Description("Indicates if the drive supports writing CD-R discs.")
|
||||
@Property("CD-R Writing Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsCdRwriting;
|
||||
|
||||
@Description("Indicates if the drive supports reading CD-RW discs.")
|
||||
@Description("Indicates if the drive supports CD-RW discs.")
|
||||
@Property("CD-RW Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsCdRw;
|
||||
private ReadWrite supportsCdRw;
|
||||
|
||||
@Description("Indicates if the drive supports writing CD-RW discs.")
|
||||
@Property("CD-RW Writing Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsCdRwwriting;
|
||||
|
||||
@Description("Indicates if the drive supports reading DVD discs.")
|
||||
@Description("Indicates if the drive supports DVD discs.")
|
||||
@Property("DVD Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsDvd;
|
||||
private ReadWrite supportsDvd;
|
||||
|
||||
@Description("Indicates if the drive supports reading DVD-R discs.")
|
||||
@Description("Indicates if the drive supports DVD-R discs.")
|
||||
@Property("DVD-R Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsDvdR;
|
||||
private ReadWrite supportsDvdR;
|
||||
|
||||
@Description("Indicates if the drive supports writing DVD-R discs.")
|
||||
@Property("DVD-R Writing Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsDvdRwriting;
|
||||
|
||||
@Description("Indicates if the drive supports reading DVD-RW discs.")
|
||||
@Description("Indicates if the drive supports DVD-RW discs.")
|
||||
@Property("DVD-RW Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsDvdRw;
|
||||
private ReadWrite supportsDvdRw;
|
||||
|
||||
@Description("Indicates if the drive supports writing DVD-RW discs.")
|
||||
@Property("DVD-RW Writing Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsDvdRwwriting;
|
||||
|
||||
@Description("Indicates if the drive supports reading DVD+R discs.")
|
||||
@Description("Indicates if the drive supports DVD+R discs.")
|
||||
@Property("DVD+R Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsDvdPlusR;
|
||||
private ReadWrite supportsDvdPlusR;
|
||||
|
||||
@Description("Indicates if the drive supports writing DVD+R discs.")
|
||||
@Property("DVD+R Writing Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsDvdPlusRwriting;
|
||||
|
||||
@Description("Indicates if the drive supports reading DVD+RW discs.")
|
||||
@Description("Indicates if the drive supports DVD+RW discs.")
|
||||
@Property("DVD+RW Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsDvdPlusRw;
|
||||
private ReadWrite supportsDvdPlusRw;
|
||||
|
||||
@Description("Indicates if the drive supports writing DVD+RW discs.")
|
||||
@Property("DVD+RW Writing Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsDvdPlusRwwriting;
|
||||
|
||||
@Description("Indicates if the drive supports reading DVD-RAM discs.")
|
||||
@Description("Indicates if the drive supports DVD-RAM discs.")
|
||||
@Property("DVD-RAM Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsDvdRam;
|
||||
private ReadWrite supportsDvdRam;
|
||||
|
||||
@Description("Indicates if the drive supports reading Blu-ray discs.")
|
||||
@Description("Indicates if the drive supports Blu-ray discs.")
|
||||
@Property("Blu-ray Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsBluRay;
|
||||
private ReadWrite supportsBluRay;
|
||||
|
||||
@Description("Indicates if the drive supports reading HD DVD discs.")
|
||||
@Description("Indicates if the drive supports HD DVD discs.")
|
||||
@Property("HD DVD Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsHdDvd;
|
||||
private ReadWrite supportsHdDvd;
|
||||
|
||||
@Description("Indicates if the drive supports reading Ultra HD Blu-ray discs.")
|
||||
@Description("Indicates if the drive supports Ultra HD Blu-ray discs.")
|
||||
@Property("Ultra HD Blu-ray Supported")
|
||||
@HideInOverview
|
||||
private Boolean supportsUltraHdBluRay;
|
||||
private ReadWrite supportsUltraHdBluRay;
|
||||
|
||||
@Description("The type of interface used by the drive. E.g.: SATA, IDE, etc.")
|
||||
@Property("Interface Type")
|
||||
@HideInOverview
|
||||
@InputList
|
||||
private String interfaceType;
|
||||
|
||||
@Description("The form factor of the CD drive. E.g.: 5.25\", 3.5\", etc.")
|
||||
@Property("Form Factor")
|
||||
@HideInOverview
|
||||
@InputList
|
||||
private String formFactor;
|
||||
}
|
||||
|
||||
65
src/main/java/be/seeseepuff/pcinv/models/CpuAsset.java
Normal file
65
src/main/java/be/seeseepuff/pcinv/models/CpuAsset.java
Normal file
@@ -0,0 +1,65 @@
|
||||
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 = "Central Processing Unit",
|
||||
pluralName = "Central Processing Units",
|
||||
type = "cpu"
|
||||
)
|
||||
@Table(name = "cpu_assets")
|
||||
public class CpuAsset implements Asset
|
||||
{
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private long id;
|
||||
|
||||
@OneToOne(orphanRemoval = true)
|
||||
private GenericAsset asset;
|
||||
|
||||
@Description("The number of cores in the CPU.")
|
||||
@Property("Cores")
|
||||
private int cores;
|
||||
|
||||
@Description("The number of threads in the CPU.")
|
||||
@Property("Threads")
|
||||
private int threads;
|
||||
|
||||
@Description("The base clock speed of the CPU in MHz.")
|
||||
@Property("Base Clock Speed (MHz)")
|
||||
private int baseClockSpeed;
|
||||
|
||||
@Description("The boost clock speed of the CPU in MHz.")
|
||||
@Property("Boost Clock Speed (MHz)")
|
||||
@HideInOverview
|
||||
private int boostClockSpeed;
|
||||
|
||||
@Description("The thermal design power (TDP) of the CPU in watts.")
|
||||
@Property("Thermal Design Power (TDP) (W)")
|
||||
private int tdp;
|
||||
|
||||
@Description("The socket type of the CPU.")
|
||||
@Property("Socket Type")
|
||||
@InputList
|
||||
private String socketType;
|
||||
|
||||
@Description("The architecture of the CPU, e.g., x86, ARM, etc.")
|
||||
@Property("Architecture")
|
||||
@HideInOverview
|
||||
@InputList
|
||||
private String architecture;
|
||||
|
||||
@Description("The manufacturing process of the CPU in nanometers.")
|
||||
@Property("Manufacturing Process (nm)")
|
||||
@HideInOverview
|
||||
private int manufacturingProcess;
|
||||
}
|
||||
30
src/main/java/be/seeseepuff/pcinv/models/ReadWrite.java
Normal file
30
src/main/java/be/seeseepuff/pcinv/models/ReadWrite.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package be.seeseepuff.pcinv.models;
|
||||
|
||||
import be.seeseepuff.pcinv.meta.AssetEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* An enum representing the read/write capabilities of a device.
|
||||
* This is used to indicate whether a device can read, write, or both.
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ReadWrite implements AssetEnum {
|
||||
/// The capacbilities are unknown.
|
||||
UNKNOWN("unknown", "Unknown"),
|
||||
/// The device can only read data.
|
||||
READ("read", "Read Only"),
|
||||
/// The device can only write data.
|
||||
WRITE("write", "Write Only"),
|
||||
/// The device can both read and write data.
|
||||
READ_WRITE("read_write", "Read and Write")
|
||||
;
|
||||
private final String value;
|
||||
private final String displayName;
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue() {
|
||||
return this == UNKNOWN;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package be.seeseepuff.pcinv.repositories;
|
||||
|
||||
import be.seeseepuff.pcinv.models.CpuAsset;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public interface CpuRepository extends JpaRepository<CpuAsset, Long>, AssetRepository<CpuAsset> {
|
||||
@Override
|
||||
default Class<CpuAsset> getAssetType() {
|
||||
return CpuAsset.class;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user