19 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
c57c429dae Fix 500 problem
All checks were successful
Build / build (push) Successful in 2m56s
Deploy / build (push) Successful in 2m59s
2025-06-09 15:10:31 +02:00
5d1c65a4c5 Better capacity support
All checks were successful
Build / build (push) Successful in 2m36s
Deploy / build (push) Successful in 2m40s
2025-06-09 15:03:16 +02:00
85de1c0c9f Add BigInteger support for capacity handling and enhance UI for capacity selection 2025-06-09 14:53:23 +02:00
a4b88f6dfd Ensure casing is ignored when sorting input list 2025-06-09 10:53:22 +02:00
b9bf2f1d38 Only login into docker once needed 2025-06-09 10:09:50 +02:00
d45b2cc068 Refine deployment
All checks were successful
Build / build (push) Successful in 3m43s
Deploy / build (push) Successful in 3m2s
2025-06-09 10:08:37 +02:00
9c376b3a97 Add support for worklogs 2025-06-09 10:05:39 +02:00
ae010a0e21 Update build and deploy workflows to support branch-specific builds and Java setup
Some checks failed
Build / build (push) Successful in 1m58s
Deploy / build (push) Failing after 3m18s
2025-06-09 09:15:36 +02:00
b47b3abbab Add PowerSupplyAsset model and repository, and implement WorkLogEntry for asset tracking 2025-06-09 09:15:32 +02:00
309bc72405 Rename CdDriveAsset and CdDriveRepository to OpticalDriveAsset and OpticalDriveRepository for consistency 2025-06-09 08:52:17 +02:00
7cd7d11a40 Update deploy workflow
Some checks failed
Build / build (push) Successful in 3m13s
Deploy / build (push) Failing after 4m2s
2025-06-09 08:50:31 +02:00
ab06c37a71 Add CpuAsset model and CpuRepository for CPU asset management 2025-06-09 08:46:04 +02:00
54231df858 Add ReadWrite enum and update CdDriveAsset to use ReadWrite for support properties 2025-06-09 08:42:43 +02:00
5e902dd8b0 Add NIC asset model and repository
Some checks failed
Deploy / build (push) Failing after 29s
Build / build (push) Successful in 1m33s
2025-06-08 16:48:20 +02:00
7f4954a98d Enhance UI: Update headings for asset browsing and creation pages; add CD Drive asset model and repository 2025-06-08 16:48:20 +02:00
af5cd88691 Add floppy drive asset 2025-06-08 16:48:20 +02:00
c1af87f82a Remove tests 2025-06-08 16:48:20 +02:00
33 changed files with 802 additions and 66 deletions

View File

@@ -1,5 +1,8 @@
name: Build name: Build
on: [push] on:
push:
branches:
- '*'
jobs: jobs:
build: build:
runs-on: standard-latest runs-on: standard-latest

View File

@@ -10,13 +10,23 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'
cache: 'gradle'
- name: Build Jar
run: ./gradlew bootJar
- name: Build Container
run: docker build --tag gitea.seeseepuff.be/seeseemelk/pcinv:${{github.ref_name}} .
- name: Login - name: Login
with: # Set the secret as an input with: # Set the secret as an input
package_rw: ${{ secrets.PACKAGE_RW }} package_rw: ${{ secrets.PACKAGE_RW }}
run: docker login gitea.seeseepuff.be -u seeseemelk -p ${{ secrets.PACKAGE_RW }} run: docker login gitea.seeseepuff.be -u seeseemelk -p ${{ secrets.PACKAGE_RW }}
- name: Build - name: Push Container
run: docker build -t gitea.seeseepuff.be/seeseemelk/pcinv:${{github.ref_name}} .
- name: Push
run: docker push gitea.seeseepuff.be/seeseemelk/pcinv:${{github.ref_name}} run: docker push gitea.seeseepuff.be/seeseemelk/pcinv:${{github.ref_name}}

View File

@@ -1,9 +1,5 @@
FROM eclipse-temurin:21-jdk-alpine AS builder
WORKDIR /app
COPY . /app
RUN ./gradlew jar --no-daemon
FROM eclipse-temurin:21-alpine FROM eclipse-temurin:21-alpine
COPY --from=builder /app/build/libs/pcinv-0.0.1-SNAPSHOT.jar ./ WORKDIR /app
ENTRYPOINT ["java", "-jar", "pcinv-0.0.1-SNAPSHOT.jar"] ADD ./build/libs/pcinv-0.0.1-SNAPSHOT.jar /app/pcinv.jar
ENTRYPOINT ["java", "-jar", "pcinv.jar"]
EXPOSE 8088/tcp EXPOSE 8088/tcp

View File

@@ -1,5 +1,6 @@
package be.seeseepuff.pcinv.controllers; package be.seeseepuff.pcinv.controllers;
import be.seeseepuff.pcinv.models.WorkLogEntry;
import be.seeseepuff.pcinv.services.AssetService; import be.seeseepuff.pcinv.services.AssetService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
@@ -12,6 +13,8 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import java.time.format.DateTimeFormatter;
import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
/** /**
@@ -37,6 +40,13 @@ public class WebController {
private static final String TIME = "time"; private static final String TIME = "time";
/// The name of the model attribute that holds the input lists for creating or editing assets. /// The name of the model attribute that holds the input lists for creating or editing assets.
private static final String INPUT_LIST = "inputLists"; private static final String INPUT_LIST = "inputLists";
/// The name of the model attribute that holds the current work log entries.
private static final String WORKLOG = "worklog";
/// The name of the input field for the current size of the work log.
private static final String WORKLOG_SIZE = "worklog_size";
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("dd MMM yyyy 'at' HH:mm");
private final AssetService assetService; private final AssetService assetService;
@@ -84,7 +94,7 @@ public class WebController {
* Handles the view of an asset by its QR code. * Handles the view of an asset by its QR code.
* If the asset does not exist, it redirects to the index page. * If the asset does not exist, it redirects to the index page.
* *
* @param qr The QR code of the asset to view. * @param qr The QR code of the asset to view.
*/ */
@GetMapping("/view/{qr}") @GetMapping("/view/{qr}")
public String view(Model model, @PathVariable long qr) { public String view(Model model, @PathVariable long qr) {
@@ -93,6 +103,35 @@ public class WebController {
return renderView(model, qr); return renderView(model, qr);
} }
/**
* Handles the form submission for adding a work log entry to an asset.
*
* @param qr The QR code of the asset to which the work log entry is added.
*/
@PostMapping("/view/{qr}")
public String viewPost(Model model, @PathVariable long qr, @RequestBody MultiValueMap<String, String> formData) {
model.addAttribute(TIME, System.currentTimeMillis());
model.addAttribute(ACTION, "view");
var asset = assetService.getAssetByQr(qr);
if (asset == null) {
return "redirect:/";
}
var workLogSizeStr = formData.getFirst(WORKLOG_SIZE);
if (workLogSizeStr != null) {
var workLogSize = Integer.parseInt(workLogSizeStr);
if (asset.getAsset().getWorkLog().size() == workLogSize) {
var comment = formData.getFirst("comment");
if (comment != null && !comment.isBlank()) {
assetService.addWorkLogEntry(asset, comment);
}
}
}
return renderView(model, qr);
}
/** /**
* Show a page asking if the user wants to delete an asset. * Show a page asking if the user wants to delete an asset.
* *
@@ -130,6 +169,9 @@ public class WebController {
model.addAttribute(ASSET, asset); model.addAttribute(ASSET, asset);
model.addAttribute(DESCRIPTORS, assetService.getAssetDescriptorTree(asset.getAsset().getType())); model.addAttribute(DESCRIPTORS, assetService.getAssetDescriptorTree(asset.getAsset().getType()));
model.addAttribute(DESCRIPTOR, assetService.getAssetDescriptor(asset.getAsset().getType())); model.addAttribute(DESCRIPTOR, assetService.getAssetDescriptor(asset.getAsset().getType()));
model.addAttribute(WORKLOG, asset.getAsset().getWorkLog().stream()
.sorted(Comparator.comparing(WorkLogEntry::getDate).reversed())
.toList());
return "view"; return "view";
} }

View File

@@ -3,6 +3,7 @@ package be.seeseepuff.pcinv.meta;
import be.seeseepuff.pcinv.models.Asset; import be.seeseepuff.pcinv.models.Asset;
import be.seeseepuff.pcinv.models.AssetCondition; import be.seeseepuff.pcinv.models.AssetCondition;
import be.seeseepuff.pcinv.models.GenericAsset; import be.seeseepuff.pcinv.models.GenericAsset;
import be.seeseepuff.pcinv.models.ReadWrite;
import jakarta.annotation.Nonnull; import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable; import jakarta.annotation.Nullable;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@@ -55,8 +56,10 @@ public class AssetProperty {
public enum Type { public enum Type {
STRING(false), STRING(false),
INTEGER(false), INTEGER(false),
BOOLEAN(false),
CAPACITY(false), CAPACITY(false),
CONDITION(true), CONDITION(true),
READWRITE(true),
; ;
/// Set to `true` if the type is an enum, `false` otherwise. /// Set to `true` if the type is an enum, `false` otherwise.
public final boolean isEnum; public final boolean isEnum;
@@ -150,8 +153,12 @@ public class AssetProperty {
return Type.CAPACITY; return Type.CAPACITY;
} else if (property.getType() == Integer.class || property.getType() == int.class || property.getType() == Long.class || property.getType() == long.class) { } else if (property.getType() == Integer.class || property.getType() == int.class || property.getType() == Long.class || property.getType() == long.class) {
return Type.INTEGER; return Type.INTEGER;
} else if (property.getType() == Boolean.class || property.getType() == boolean.class) {
return Type.BOOLEAN;
} else if (property.getType() == AssetCondition.class) { } else if (property.getType() == AssetCondition.class) {
return Type.CONDITION; return Type.CONDITION;
} else if (property.getType() == ReadWrite.class) {
return Type.READWRITE;
} else { } else {
throw new IllegalArgumentException("Unsupported property type: " + property.getType()); throw new IllegalArgumentException("Unsupported property type: " + property.getType());
} }
@@ -196,11 +203,13 @@ public class AssetProperty {
} }
var value = getValue(asset); var value = getValue(asset);
if (value == null) { if (value == null) {
return "Unknown"; return "?";
} else if (type == Type.BOOLEAN) {
return (boolean) value ? "Yes" : "No";
} else if (type == Type.INTEGER || type == Type.STRING) { } else if (type == Type.INTEGER || type == Type.STRING) {
return value.toString(); return value.toString();
} else if (type == Type.CAPACITY) { } else if (type == Type.CAPACITY) {
return String.format("%s bytes", value); return convertCapacity((Long) value).toString();
} else if (type.isEnum) { } else if (type.isEnum) {
if (value instanceof AssetEnum assetEnum) { if (value instanceof AssetEnum assetEnum) {
return assetEnum.getDisplayName(); return assetEnum.getDisplayName();
@@ -211,6 +220,24 @@ public class AssetProperty {
} }
} }
public CapacityInfo convertCapacity(Long value) {
if (value == null) {
return null;
}
if (type != Type.CAPACITY) {
throw new IllegalStateException("Property '" + name + "' is not a capacity type.");
}
return CapacityInfo.of(value, capacityAsIEC, capacityAsSI);
}
public CapacityInfo asCapacity(@Nullable Object object) {
var value = getValue(object);
if (value == null) {
return null;
}
return convertCapacity((Long) value);
}
@Override @Override
public String toString() { public String toString() {
var enumOptions = ""; var enumOptions = "";

View File

@@ -0,0 +1,62 @@
package be.seeseepuff.pcinv.meta;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import java.util.Arrays;
import java.util.Comparator;
/**
* Represents a capacity in bytes, with various units for display.
* This class is used to encapsulate the capacity information and provide
* a way to represent it in different units.
*/
@Getter
@RequiredArgsConstructor
public class CapacityInfo {
private final long capacity;
private final CapacityUnit idealUnit;
public static CapacityInfo of(long capacity, CapacityUnit idealUnit) {
return new CapacityInfo(capacity, idealUnit);
}
public static CapacityInfo of(long capacity) {
return of(capacity, idealUnitForCapacity(capacity, CapacityUnit.values()));
}
public static CapacityInfo ofSI(long capacity) {
return of(capacity, idealUnitForCapacity(capacity, CapacityUnit.SI_UNITS));
}
public static CapacityInfo ofIEC(long capacity) {
return of(capacity, idealUnitForCapacity(capacity, CapacityUnit.IEC_UNITS));
}
public static CapacityInfo of(long capacity, boolean iec, boolean si) {
if (iec && !si) {
return ofIEC(capacity);
} else if (si && !iec) {
return ofSI(capacity);
} else {
return of(capacity);
}
}
public static CapacityUnit idealUnitForCapacity(long capacity, CapacityUnit[] units) {
return Arrays.stream(units)
.sorted(Comparator.comparing(CapacityUnit::getBytes).reversed())
.filter(unit -> capacity % unit.getBytes() == 0)
.findFirst()
.orElse(CapacityUnit.BYTES);
}
public long getCapacityInUnit() {
return capacity / idealUnit.getBytes();
}
@Override
public String toString() {
return String.format("%d %s", capacity / idealUnit.getBytes(), idealUnit.getDisplayName());
}
}

View File

@@ -0,0 +1,28 @@
package be.seeseepuff.pcinv.meta;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* Represents a unit of capacity, either in binary (IEC) or decimal (SI) format.
*/
@Getter
@RequiredArgsConstructor
public enum CapacityUnit {
BYTES("Bytes", 1),
KIBIBYTES("KiB", 1024),
MEBIBYTES("MiB", 1024 * 1024),
GIBIBYTES("GiB", 1024 * 1024 * 1024),
TEBIBYTES("TiB", 1024L * 1024 * 1024 * 1024),
KILOBYTES("kB", 1000),
MEGABYTES("MB", 1000 * 1000),
GIGABYTES("GB", 1000 * 1000 * 1000),
TERABYTES("TB", 1000L * 1000 * 1000 * 1000),
;
public static final CapacityUnit[] SI_UNITS = {BYTES, KILOBYTES, MEGABYTES, GIGABYTES, TERABYTES};
public static final CapacityUnit[] IEC_UNITS = {BYTES, KIBIBYTES, MEBIBYTES, GIBIBYTES, TEBIBYTES};
private final String displayName;
private final long bytes;
}

View File

@@ -14,7 +14,7 @@ public enum AssetCondition implements AssetEnum
/// The asset is in perfect working order. /// The asset is in perfect working order.
HEALTHY("healthy", "Healthy"), HEALTHY("healthy", "Healthy"),
/// The condition of the asset is unknown. E.g.: it is untested. /// The condition of the asset is unknown. E.g.: it is untested.
UNKNOWN("unknown", "Not known"), UNKNOWN("unknown", "?"),
/// The asset generally works, but has some known issues. /// The asset generally works, but has some known issues.
PARTIAL("partial", "Partially working"), PARTIAL("partial", "Partially working"),
/// The asset is in need of repair, but is not completely broken. /// The asset is in need of repair, but is not completely broken.

View 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;
}

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

@@ -0,0 +1,52 @@
package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@AssetInfo(
displayName = "Floppy Drive",
pluralName = "Floppy Drives",
type = "floppy_drive"
)
@Table(name = "floppy_drive_assets")
public class FloppyDriveAsset implements Asset
{
@Id
@GeneratedValue
private long id;
/// The generic asset associated with this RAM.
@OneToOne(orphanRemoval = true)
private GenericAsset asset;
@Description("Indicates if the floppy drive supports double density (DD) disks.")
@Property("doubleDensitySupported")
@HideInOverview
private Boolean supportsDoubleDensity;
@Description("Indicates if the floppy drive supports high density (HD) disks.")
@Property("highDensitySupported")
@HideInOverview
private Boolean supportsHighDensity;
@Description("Indicates if the floppy drive supports extra high density (ED) disks.")
@Property("extraHighDensitySupported")
@HideInOverview
private Boolean supportsExtraHighDensity;
@Description("The type of interface used by the floppy drive. E.g.: 34-pin, 50-pin, etc.")
@Property("Interface Type")
@HideInOverview
@InputList
private String interfaceType;
@Description("The form factor of the floppy drive. E.g.: 3.5\", 5.25\", etc.")
@Property("Form Factor")
@InputList
private String formFactor;
}

View File

@@ -5,6 +5,8 @@ import jakarta.persistence.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.util.List;
/** /**
* Represents a generic asset in the inventory system. * Represents a generic asset in the inventory system.
*/ */
@@ -65,4 +67,7 @@ public class GenericAsset
@Property("Warranty Expiration Date") @Property("Warranty Expiration Date")
@HideInOverview @HideInOverview
private String warrantyExpirationDate; private String warrantyExpirationDate;
@OneToMany(mappedBy = "asset", cascade = CascadeType.ALL, orphanRemoval = true)
private List<WorkLogEntry> workLog;
} }

View File

@@ -40,12 +40,12 @@ public class HddAsset implements Asset
@InputList @InputList
private String formFactor; 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") @Property("RPM Speed")
@HideInOverview @HideInOverview
private Long rpmSpeed; private Long rpmSpeed;
@Description("The drive's cache size, if applicable.") @Description("The drive's cache size.")
@Property("Cache Size") @Property("Cache Size")
@HideInOverview @HideInOverview
private Long cacheSize; private Long cacheSize;
@@ -54,4 +54,19 @@ public class HddAsset implements Asset
@Property("Drive Type") @Property("Drive Type")
@InputList @InputList
private String driveType; 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,37 @@
package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@AssetInfo(
displayName = "Network Interface Controller",
pluralName = "Network Interface Controllers",
type = "nic"
)
@Table(name = "nic_assets")
public class NICAsset implements Asset
{
@Id
@GeneratedValue
private long id;
/// The generic asset associated with this RAM.
@OneToOne(orphanRemoval = true)
private GenericAsset asset;
@Description("The MAC address of the network interface controller.")
@Property("MAC Address")
@HideInOverview
private String macAddress;
@Description("The type of interface used by the drive. E.g.: SATA, IDE, etc.")
@Property("Interface Type")
@HideInOverview
@InputList
private String interfaceType;
}

View File

@@ -0,0 +1,97 @@
package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@AssetInfo(
displayName = "Optical Drive",
pluralName = "Optical Drives",
type = "optical_drive"
)
@Table(name = "optical_drive_assets")
public class OpticalDriveAsset implements Asset
{
@Id
@GeneratedValue
private long id;
/// The generic asset associated with this RAM.
@OneToOne(orphanRemoval = true)
private GenericAsset asset;
@Description("Indicates if the drive supports CD-ROM discs.")
@Property("CD-ROM Supported")
@HideInOverview
private ReadWrite supportsCdRom;
@Description("Indicates if the drive supports CD-R discs.")
@Property("CD-R Supported")
@HideInOverview
private ReadWrite supportsCdR;
@Description("Indicates if the drive supports CD-RW discs.")
@Property("CD-RW Supported")
@HideInOverview
private ReadWrite supportsCdRw;
@Description("Indicates if the drive supports DVD discs.")
@Property("DVD Supported")
@HideInOverview
private ReadWrite supportsDvd;
@Description("Indicates if the drive supports DVD-R discs.")
@Property("DVD-R Supported")
@HideInOverview
private ReadWrite supportsDvdR;
@Description("Indicates if the drive supports DVD-RW discs.")
@Property("DVD-RW Supported")
@HideInOverview
private ReadWrite supportsDvdRw;
@Description("Indicates if the drive supports DVD+R discs.")
@Property("DVD+R Supported")
@HideInOverview
private ReadWrite supportsDvdPlusR;
@Description("Indicates if the drive supports DVD+RW discs.")
@Property("DVD+RW Supported")
@HideInOverview
private ReadWrite supportsDvdPlusRw;
@Description("Indicates if the drive supports DVD-RAM discs.")
@Property("DVD-RAM Supported")
@HideInOverview
private ReadWrite supportsDvdRam;
@Description("Indicates if the drive supports Blu-ray discs.")
@Property("Blu-ray Supported")
@HideInOverview
private ReadWrite supportsBluRay;
@Description("Indicates if the drive supports HD DVD discs.")
@Property("HD DVD Supported")
@HideInOverview
private ReadWrite supportsHdDvd;
@Description("Indicates if the drive supports Ultra HD Blu-ray discs.")
@Property("Ultra HD Blu-ray Supported")
@HideInOverview
private ReadWrite supportsUltraHdBluRay;
@Description("The type of interface used by the drive. E.g.: SATA, IDE, etc.")
@Property("Interface Type")
@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;
}

View File

@@ -0,0 +1,64 @@
package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.*;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@AssetInfo(
displayName = "Power Supply",
pluralName = "Power Supplies",
type = "psu"
)
@Table(name = "psu_assets")
public class PowerSupplyAsset implements Asset
{
@Id
@GeneratedValue
private long id;
/// The generic asset associated with this RAM.
@OneToOne(orphanRemoval = true)
private GenericAsset asset;
@Description("The wattage rating of the power supply in watts.")
@Property("Wattage")
private int wattage;
@Description("The efficiency rating of the power supply, e.g., 80 Plus Bronze, Silver, Gold, Platinum, Titanium.")
@Property("Efficiency Rating")
@InputList
private String efficiencyRating;
@Description("The form factor of the power supply, e.g., ATX, SFX, etc.")
@Property("Form Factor")
@InputList
private String formFactor;
@Description("The number number of Molex connectors.")
@Property("4-pin Molex Connectors")
private int molexConnectors;
@Description("The number of 4-pin floppy connectors.")
@Property("4-pin Floppy Connectors")
private int floppyConnectors;
@Description("The number of SATA power connectors.")
@Property("15-pin SATA Connectors")
private int sataConnectors;
@Description("The number of 6-pin PCIe connectors.")
@Property("6-pin PCIe Connectors")
private int pcie6Connectors;
@Description("The number of 8-pin PCIe connectors.")
@Property("8-pin PCIe Connectors")
private int pcie8Connectors;
@Description("The number of 4-pin ATX 12V connectors.")
@Property("4-pin ATX 12V Connectors")
private int atx12vConnectors;
}

View File

@@ -37,5 +37,5 @@ public class RamAsset implements Asset
@Description("The speed of the memory in MHz.") @Description("The speed of the memory in MHz.")
@Property("Speed") @Property("Speed")
private Long speed; private Integer speed;
} }

View 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", "?"),
/// 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;
}
}

View File

@@ -0,0 +1,31 @@
package be.seeseepuff.pcinv.models;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
import lombok.Getter;
import lombok.Setter;
import java.time.ZonedDateTime;
/**
* Represents a work log entry in the system.
*/
@Setter
@Getter
@Entity
public class WorkLogEntry {
@Id
@GeneratedValue
private long id;
@ManyToOne(optional = false)
private GenericAsset asset;
/// The description of the work log entry.
private String comment;
/// The date and time when the work log entry was created.
private ZonedDateTime date;
}

View File

@@ -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;
}
}

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;
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,7 @@
package be.seeseepuff.pcinv.repositories;
import be.seeseepuff.pcinv.models.WorkLogEntry;
import org.springframework.data.jpa.repository.JpaRepository;
public interface WorkLogRepository extends JpaRepository<WorkLogEntry, Long> {
}

View File

@@ -6,12 +6,16 @@ import be.seeseepuff.pcinv.meta.AssetInfo;
import be.seeseepuff.pcinv.meta.AssetProperty; import be.seeseepuff.pcinv.meta.AssetProperty;
import be.seeseepuff.pcinv.models.Asset; import be.seeseepuff.pcinv.models.Asset;
import be.seeseepuff.pcinv.models.GenericAsset; import be.seeseepuff.pcinv.models.GenericAsset;
import be.seeseepuff.pcinv.models.WorkLogEntry;
import be.seeseepuff.pcinv.repositories.AssetRepository; import be.seeseepuff.pcinv.repositories.AssetRepository;
import be.seeseepuff.pcinv.repositories.GenericAssetRepository; import be.seeseepuff.pcinv.repositories.GenericAssetRepository;
import be.seeseepuff.pcinv.repositories.WorkLogRepository;
import jakarta.persistence.EntityManager;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.ZonedDateTime;
import java.util.*; import java.util.*;
/** /**
@@ -22,7 +26,9 @@ import java.util.*;
@RequiredArgsConstructor @RequiredArgsConstructor
public class AssetService { public class AssetService {
private final GenericAssetRepository genericRepository; private final GenericAssetRepository genericRepository;
private final WorkLogRepository workLogRepository;
private final Collection<AssetRepository<?>> repositories; private final Collection<AssetRepository<?>> repositories;
private final EntityManager entityManager;
/** /**
* Returns the count of all assets in the repository. * Returns the count of all assets in the repository.
@@ -216,6 +222,12 @@ public class AssetService {
return Integer.parseInt(stringValue); return Integer.parseInt(stringValue);
} else if (property.getType() == AssetProperty.Type.STRING) { } else if (property.getType() == AssetProperty.Type.STRING) {
return stringValue; return stringValue;
} else if (property.getType() == AssetProperty.Type.BOOLEAN) {
return switch (stringValue.toLowerCase()) {
case "true" -> true;
case "false" -> false;
default -> null;
};
} else if (property.getType().isEnum) { } else if (property.getType().isEnum) {
for (var option : property.getOptions()) { for (var option : property.getOptions()) {
if (option.getValue().equals(stringValue)) { if (option.getValue().equals(stringValue)) {
@@ -254,7 +266,7 @@ public class AssetService {
for (var descriptor : tree) { for (var descriptor : tree) {
for (var property : descriptor.getProperties()) { for (var property : descriptor.getProperties()) {
if (property.isInputList()) { if (property.isInputList()) {
var inputList = getInputList(descriptor, property); var inputList = getInputList(descriptor, property, type);
map.put(descriptor.asString(property), inputList); map.put(descriptor.asString(property), inputList);
} }
} }
@@ -267,9 +279,10 @@ public class AssetService {
* *
* @param descriptor the asset descriptor containing the property * @param descriptor the asset descriptor containing the property
* @param property the asset property to retrieve the input list for * @param property the asset property to retrieve the input list for
* @param type Limit the search to a specific type
* @return a set of input values for the specified property * @return a set of input values for the specified property
*/ */
private Set<String> getInputList(AssetDescriptor descriptor, AssetProperty property) { private Set<String> getInputList(AssetDescriptor descriptor, AssetProperty property, String type) {
List<?> entries; List<?> entries;
if (descriptor.getType().equals(GenericAsset.TYPE)) { if (descriptor.getType().equals(GenericAsset.TYPE)) {
entries = genericRepository.findAll(); entries = genericRepository.findAll();
@@ -278,8 +291,21 @@ public class AssetService {
entries = repository.findAll(); entries = repository.findAll();
} }
Set<String> inputList = new TreeSet<>(); var inputList = new TreeSet<String>(Comparator.comparing(String::toLowerCase));
for (var entry : entries) { for (var entry : entries) {
String entryType;
if (entry instanceof Asset asset) {
entryType = asset.getAsset().getType();
} else if (entry instanceof GenericAsset asset) {
entryType = asset.getType();
} else {
throw new IllegalArgumentException("Unsupported entry type: " + entry.getClass().getName());
}
if (!entryType.equals(type)) {
continue; // Skip entries that do not match the specified type
}
var value = property.getValue(entry); var value = property.getValue(entry);
if (value != null) { if (value != null) {
inputList.add(value.toString()); inputList.add(value.toString());
@@ -287,4 +313,23 @@ public class AssetService {
} }
return inputList; return inputList;
} }
/**
* Adds a work log entry to the asset with the specified QR code.
*
* @param asset the asset to which the work log entry will be added
* @param comment the comment for the work log entry
*/
@Transactional
public void addWorkLogEntry(Asset asset, String comment) {
var genericAsset = asset.getAsset();
var workLogEntry = new WorkLogEntry();
workLogEntry.setAsset(genericAsset);
workLogEntry.setComment(comment);
workLogEntry.setDate(ZonedDateTime.now());
workLogRepository.saveAndFlush(workLogEntry);
entityManager.refresh(genericAsset);
}
} }

View File

@@ -1,6 +1,6 @@
<body th:replace="~{fragments :: base(title='Browse assets', content=~{::content})}"> <body th:replace="~{fragments :: base(title='Browse assets', content=~{::content})}">
<div th:fragment="content"> <div th:fragment="content">
View device details <h2>View device details</h2>
<ul> <ul>
<li th:each="d : ${descriptors.getAssets()}" th:if="${d.visible}"> <li th:each="d : ${descriptors.getAssets()}" th:if="${d.visible}">
<a th:href="'/browse/'+${d.getType()}" th:text="${d.pluralName}"></a> <a th:href="'/browse/'+${d.getType()}" th:text="${d.pluralName}"></a>

View File

@@ -1,21 +1,24 @@
<body th:replace="~{fragments :: base(title='View '+${descriptor.pluralName}, content=~{::content})}"> <body th:replace="~{fragments :: base(title='View '+${descriptor.pluralName}, content=~{::content})}">
<div th:fragment="content"> <div th:fragment="content">
There are <span th:text="${assets.size()}"></span> <span th:text="${descriptor.pluralName}"></span> in the database. <h2>There are <span th:text="${assets.size()}"></span> <span th:text="${descriptor.pluralName}"></span> in the database.</h2>
<table border="1" cellpadding="4"> <table border="1" cellpadding="4">
<tr bgcolor="#d3d3d3"> <tr bgcolor="#d3d3d3">
<th th:each="p : ${properties}" th:if="${!p.hideInOverview}" th:text="${p.displayName}"></th> <th th:each="p : ${properties}" th:if="${!p.hideInOverview}" th:text="${p.displayName}"></th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
<tr th:each="a : ${assets}"> <tr th:each="a : ${assets}">
<td th:each="p : ${properties}" th:if="${!p.hideInOverview}"> <td th:each="p : ${properties}" th:if="${!p.hideInOverview}">
<a th:if="${p.name == 'qr'}" th:href="'/view/'+${a.getQr()}" th:text="${p.renderValue(a)}"></a> <a th:if="${p.name == 'qr'}" th:href="'/view/'+${a.getQr()}" th:text="${p.renderValue(a)}"></a>
<span th:if="${p.name != 'qr'}" th:text="${p.renderValue(a)}"></span> <span th:if="${p.name != 'qr'}" th:text="${p.renderValue(a)}"></span>
</td> </td>
<td> <td>
<a th:href="'/view/'+${a.getQr()}">View</a> <a th:href="'/view/'+${a.getQr()}">View</a>
<a th:href="'/edit/'+${a.getQr()}">Edit</a> <a th:href="'/edit/'+${a.getQr()}">Edit</a>
</td> </td>
</tr> </tr>
</table> </table>
<p>
<a th:href="'/create/'+${descriptor.type}">Create a new <span th:text="${descriptor.displayName}"></span></a>
</p>
</div> </div>
</body> </body>

View File

@@ -1,6 +1,6 @@
<body th:replace="~{fragments :: base(title='Create '+${descriptor.displayName}, content=~{::content})}"> <body th:replace="~{fragments :: base(title='Create '+${descriptor.displayName}, content=~{::content})}">
<div th:fragment="content"> <div th:fragment="content">
Create a <span th:text="${descriptor.displayName}"></span> <h2>Create a <span th:text="${descriptor.displayName}"></span></h2>
<form th:action="'/'+${action}+'/'+${asset != null ? asset.getQr() : descriptor.getType()}" method="post"> <form th:action="'/'+${action}+'/'+${asset != null ? asset.getQr() : descriptor.getType()}" method="post">
<div th:each="d : ${descriptors}"> <div th:each="d : ${descriptors}">
<h2 th:text="${d.displayName}"></h2> <h2 th:text="${d.displayName}"></h2>
@@ -18,21 +18,30 @@
</span> </span>
<input th:case="STRING" type="text" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="${p.getValue(asset)}" th:placeholder="${p.displayName}" th:required="${p.required}"/> <input th:case="STRING" type="text" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="${p.getValue(asset)}" th:placeholder="${p.displayName}" th:required="${p.required}"/>
<input th:case="INTEGER" type="number" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="${p.getValue(asset)}" th:required="${p.required}"/> <input th:case="INTEGER" type="number" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="${p.getValue(asset)}" th:required="${p.required}"/>
<!-- <input th:case="BOOLEAN" type="checkbox" th:id="${d.asString(p)}" th:name="${d.asString(p)}" th:value="true" th:checked="${asset != null ? p.getValue(asset) : p.defaultValue}"/>-->
<span th:case="BOOLEAN">
<input th:name="${d.asString(p)}" th:id="${d.asString(p)}+'-null'" type="radio" value="null" th:checked="${asset == null || (p.getValue(asset) == null)}">
<label th:for="${d.asString(p)}+'-null'">Not known</label>
<input th:name="${d.asString(p)}" th:id="${d.asString(p)}+'-true'" type="radio" value="true" th:checked="${asset != null && (p.getValue(asset) == true)}">
<label th:for="${d.asString(p)}+'-true'">Yes</label>
<input th:name="${d.asString(p)}" th:id="${d.asString(p)}+'-false'" type="radio" value="false" th:checked="${asset != null && (p.getValue(asset) == false)}">
<label th:for="${d.asString(p)}+'-false'">No</label>
</span>
<select th:case="enum" th:id="${d.asString(p)}" th:name="${d.asString(p)}"> <select th:case="enum" th:id="${d.asString(p)}" th:name="${d.asString(p)}">
<option th:each="o : ${p.options}" th:value="${o.value}" th:text="${o.displayName}" th:selected="${asset != null ? (p.getValue(asset) == o.enumConstant) : o.defaultValue}">Good</option> <option th:each="o : ${p.options}" th:value="${o.value}" th:text="${o.displayName}" th:selected="${asset != null ? (p.getValue(asset) == o.enumConstant) : o.defaultValue}">Good</option>
</select> </select>
<span th:case="CAPACITY"> <span th:case="CAPACITY">
<input type="number" th:id="${d.asString(p)+'-value'}" th:name="${d.asString(p)+'-value'}" th:required="${p.required}"/> <input type="number" th:id="${d.asString(p)+'-value'}" th:name="${d.asString(p)+'-value'}" th:required="${p.required}" th:value="${p.asCapacity(asset)?.getCapacityInUnit() ?: ''}"/>
<select th:id="${d.asString(p)}+'-unit'" th:name="${d.asString(p)}+'-unit'"> <select th:id="${d.asString(p)}+'-unit'" th:name="${d.asString(p)}+'-unit'">
<option value="1">Bytes</option> <option value="1" th:selected="${p.asCapacity(asset)?.getIdealUnit()?.name() == 'BYTES'}">Bytes</option>
<option th:if="${p.capacityAsSI}">kB</option> <option th:value="${1000}" th:if="${p.capacityAsSI}" th:selected="${p.asCapacity(asset)?.getIdealUnit()?.name() == 'KILOBYTES'}">kB</option>
<option th:if="${p.capacityAsIEC}">KiB</option> <option th:value="${1024}" th:if="${p.capacityAsIEC}" th:selected="${p.asCapacity(asset)?.getIdealUnit()?.name() == 'KIBIBYTES'}">KiB</option>
<option th:if="${p.capacityAsSI}">MB</option> <option th:value="${1000*1000}" th:if="${p.capacityAsSI}" th:selected="${p.asCapacity(asset)?.getIdealUnit()?.name() == 'MEGABYTES'}">MB</option>
<option th:if="${p.capacityAsIEC}">MiB</option> <option th:value="${1024*1024}" th:if="${p.capacityAsIEC}" th:selected="${p.asCapacity(asset)?.getIdealUnit()?.name() == 'MEBIBYTES'}">MiB</option>
<option th:if="${p.capacityAsSI}">GB</option> <option th:value="${1000*1000*1000}" th:if="${p.capacityAsSI}" th:selected="${p.asCapacity(asset)?.getIdealUnit()?.name() == 'GIGABYTES'}">GB</option>
<option th:if="${p.capacityAsIEC}">GiB</option> <option th:value="${1024*1024*1024}" th:if="${p.capacityAsIEC}" th:selected="${p.asCapacity(asset)?.getIdealUnit()?.name() == 'GIBIBYTES'}">GiB</option>
<option th:if="${p.capacityAsSI}">TB</option> <option value="1000000000000" th:if="${p.capacityAsSI}" th:selected="${p.asCapacity(asset)?.getIdealUnit()?.name() == 'TERABYTES'}">TB</option>
<option th:if="${p.capacityAsIEC}">TiB</option> <option value="1099511627776" th:if="${p.capacityAsIEC}" th:selected="${p.asCapacity(asset)?.getIdealUnit()?.name() == 'TEBIBYTES'}">TiB</option>
</select> </select>
</span> </span>
<b th:case="*">Bad input type for <span th:text="${d.type}+'-'+${p.type}"></span></b> <b th:case="*">Bad input type for <span th:text="${d.type}+'-'+${p.type}"></span></b>

View File

@@ -1,6 +1,6 @@
<body th:replace="~{fragments :: base(title='Select type to create', content=~{::content})}"> <body th:replace="~{fragments :: base(title='Select type to create', content=~{::content})}">
<div th:fragment="content"> <div th:fragment="content">
Create a new device <h2>Create a new device</h2>
<ul> <ul>
<li th:each="d : ${descriptors.getAssets()}" th:if="${d.visible}"><a th:href="'/create/'+${d.getType()}" th:text="${d.displayName}"></a></li> <li th:each="d : ${descriptors.getAssets()}" th:if="${d.visible}"><a th:href="'/create/'+${d.getType()}" th:text="${d.displayName}"></a></li>
</ul> </ul>

View File

@@ -6,7 +6,7 @@
<h2 th:text="${d.displayName}"></h2> <h2 th:text="${d.displayName}"></h2>
<table border="1" cellpadding="4"> <table border="1" cellpadding="4">
<tr th:each="p : ${d.properties}"> <tr th:each="p : ${d.properties}">
<td bgcolor="lightgray"><b th:text="${p.displayName}"></b></td> <th bgcolor="lightgray"><b th:text="${p.displayName}"></b></th>
<td th:text="${p.renderValue(asset)}"></td> <td th:text="${p.renderValue(asset)}"></td>
</tr> </tr>
</table> </table>
@@ -15,6 +15,7 @@
<ul th:if="${action == 'view'}"> <ul th:if="${action == 'view'}">
<li><a th:href="'/edit/'+${asset.getQr()}">Edit</a></li> <li><a th:href="'/edit/'+${asset.getQr()}">Edit</a></li>
<li><a th:href="'/delete/'+${asset.getQr()}">Delete</a></li> <li><a th:href="'/delete/'+${asset.getQr()}">Delete</a></li>
<li><a th:href="'/create/'+${asset.getAsset().type}">Create another <span th:text="${descriptor.displayName}">Hard Drive</span> </a></li>
<li><a th:href="'/browse/'+${descriptor.type}">Browse all <span th:text="${descriptor.pluralName}">Hard Drives</span></a></li> <li><a th:href="'/browse/'+${descriptor.type}">Browse all <span th:text="${descriptor.pluralName}">Hard Drives</span></a></li>
</ul> </ul>
<ul th:if="${action == 'delete'}"> <ul th:if="${action == 'delete'}">
@@ -22,5 +23,25 @@
<li><a th:href="'/delete/'+${asset.getQr()}+'?confirm=true'">Yes, delete it</a></li> <li><a th:href="'/delete/'+${asset.getQr()}+'?confirm=true'">Yes, delete it</a></li>
</ul> </ul>
</p> </p>
<p th:if="${action == 'view'}">
<h2>Work Log</h2>
<form th:action="'/view/'+${asset.getQr()}" method="post">
<input type="hidden" th:value="${worklog.size()}" name="worklog_size">
<table border="1" cellpadding="4">
<tr>
<th bgcolor="lightgray"><b>Date</b></th>
<th bgcolor="lightgray"><b>Comment</b></th>
</tr>
<tr>
<td align="center"><input type="submit" value="Post Entry"></td>
<td><input type="text" name="comment" placeholder="Comment"></td>
</tr>
<tr th:each="w : ${worklog}">
<td th:text="${#temporals.format(w.date, 'dd/MM/yyyy')} + ' at ' + ${#temporals.format(w.date, 'HH:mm')}"></td>
<td th:text="${w.comment}"></td>
</tr>
</table>
</form>
</p>
</div> </div>
</body> </body>

View File

@@ -1,13 +0,0 @@
package be.seeseepuff.pcinv;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class PcinvApplicationTests {
@Test
void contextLoads() {
}
}