Compare commits
33 Commits
v1.4.0
...
948315979e
| Author | SHA1 | Date | |
|---|---|---|---|
| 948315979e | |||
| 1d2b374d49 | |||
| df24cc14d0 | |||
| 81a438acf3 | |||
| 148ad8d52e | |||
| 2c21af81c4 | |||
| c10ff0de3b | |||
| 9f31be7c04 | |||
| 6c9f2346d1 | |||
| 76008065bf | |||
| be9aeeae33 | |||
| 93976751ca | |||
| dd9bef7855 | |||
| aa7785472b | |||
| 7cd63fa01d | |||
| 9f642a65dd | |||
| d002f4655e | |||
| e006f01b8e | |||
| 4c89789601 | |||
| 5359209956 | |||
| 6b63f75070 | |||
| 164f7fe3a6 | |||
| 312ab74ead | |||
| ad1cb70cdc | |||
| ce01b7ad14 | |||
| 02c7b966eb | |||
| a3d9e1ebb9 | |||
| 40e13ec585 | |||
| bb15c55e46 | |||
| 35c2e07c05 | |||
| 92187fd345 | |||
| 0dbab45651 | |||
| 14ac78982f |
@@ -1,17 +1,18 @@
|
||||
name: Build
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: standard-latest
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||
with:
|
||||
distribution: 'temurin' # See 'Supported distributions' for available options
|
||||
java-version: '21'
|
||||
|
||||
@@ -1,27 +1,28 @@
|
||||
name: Deploy
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: standard-latest
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||
with:
|
||||
distribution: 'temurin' # See 'Supported distributions' for available options
|
||||
java-version: '21'
|
||||
cache: 'gradle'
|
||||
|
||||
- name: Build Jar
|
||||
run: ./gradlew bootJar
|
||||
run: ./gradlew bootJar --no-daemon
|
||||
|
||||
- name: Build Container
|
||||
run: docker build --tag gitea.seeseepuff.be/seeseemelk/pcinv:${{github.ref_name}} .
|
||||
run: docker build --tag gitea.seeseepuff.be/seeseemelk/pcinv:latest .
|
||||
|
||||
- name: Login
|
||||
with: # Set the secret as an input
|
||||
@@ -29,4 +30,4 @@ jobs:
|
||||
run: docker login gitea.seeseepuff.be -u seeseemelk -p ${{ secrets.PACKAGE_RW }}
|
||||
|
||||
- name: Push Container
|
||||
run: docker push gitea.seeseepuff.be/seeseemelk/pcinv:${{github.ref_name}}
|
||||
run: docker push gitea.seeseepuff.be/seeseemelk/pcinv:latest
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM eclipse-temurin:21-alpine
|
||||
FROM eclipse-temurin:25-alpine@sha256:30d9f87d702c2c1c601ed0d31e0c88ea1ea474ee7676cda7b7a59e759181c4dd
|
||||
WORKDIR /app
|
||||
ADD ./build/libs/pcinv-0.0.1-SNAPSHOT.jar /app/pcinv.jar
|
||||
ENTRYPOINT ["java", "-jar", "pcinv.jar"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "3.5.0"
|
||||
id("org.springframework.boot") version "4.0.6"
|
||||
id("io.spring.dependency-management") version "1.1.7"
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-actuator")
|
||||
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.8")
|
||||
implementation("org.modelmapper:modelmapper:3.2.3")
|
||||
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.3")
|
||||
implementation("org.modelmapper:modelmapper:3.2.6")
|
||||
compileOnly("org.projectlombok:lombok")
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||
runtimeOnly("org.postgresql:postgresql")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
database:
|
||||
image: postgres:latest
|
||||
image: postgres:latest@sha256:78481659c47e862334611ccdaf7c369c986b3046da9857112f3b309114a65fb4
|
||||
environment:
|
||||
POSTGRES_USER: pcinv
|
||||
POSTGRES_PASSWORD: pcinv
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
6
renovate.json
Normal file
6
renovate.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"local>seeseemelk/renovate"
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package be.seeseepuff.pcinv.controllers;
|
||||
|
||||
import be.seeseepuff.pcinv.models.Asset;
|
||||
import be.seeseepuff.pcinv.models.WorkLogEntry;
|
||||
import be.seeseepuff.pcinv.services.AssetService;
|
||||
import be.seeseepuff.pcinv.services.BuildService;
|
||||
@@ -94,7 +95,12 @@ public class WebController {
|
||||
model.addAttribute(DESCRIPTOR, assetService.getAssetDescriptor(type));
|
||||
model.addAttribute(DESCRIPTORS, tree);
|
||||
model.addAttribute(PROPERTIES, tree.stream().flatMap(d -> d.getProperties().stream()).toList());
|
||||
model.addAttribute(ASSETS, assetService.getAssetsByType(type));
|
||||
var assets = assetService.getAssetsByType(type);
|
||||
assets.sort(Comparator
|
||||
.comparing((Asset a) -> a.getAsset().getBrand(), Comparator.nullsFirst(Comparator.naturalOrder()))
|
||||
.thenComparing((Asset a) -> a.getAsset().getModel(), Comparator.nullsFirst(Comparator.naturalOrder()))
|
||||
.thenComparing(Asset::getQr));
|
||||
model.addAttribute(ASSETS, assets);
|
||||
return "browse_type";
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,10 @@ public class CapacityInfo {
|
||||
}
|
||||
|
||||
public static CapacityUnit idealUnitForCapacity(long capacity, CapacityUnit[] units) {
|
||||
if (capacity <= 0) {
|
||||
return CapacityUnit.BYTES; // Default to bytes for non-positive capacities
|
||||
}
|
||||
|
||||
return Arrays.stream(units)
|
||||
.sorted(Comparator.comparing(CapacityUnit::getBytes).reversed())
|
||||
.filter(unit -> capacity % unit.getBytes() == 0)
|
||||
|
||||
@@ -57,16 +57,16 @@ public class HddAsset implements Asset
|
||||
@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 heads in the drive.")
|
||||
@Property("Heads")
|
||||
@HideInOverview
|
||||
private Integer heads;
|
||||
|
||||
@Description("Number of sectors in the drive.")
|
||||
@Property("Sectors")
|
||||
@HideInOverview
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
<tr th:each="a : ${assets}">
|
||||
<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>
|
||||
<span th:if="${p.name != 'qr'}" th:text="${p.renderValue(a)}"></span>
|
||||
<a th:if="${p.name == 'build' && a.getAsset().getBuild() != null}" th:href="'/build/'+${a.getAsset().getBuild().getId()}" th:text="${p.renderValue(a)}"></a>
|
||||
<span th:if="${p.name != 'qr' && (p.name != 'build' || a.getAsset().getBuild() == null)}" th:text="${p.renderValue(a)}"></span>
|
||||
</td>
|
||||
<td>
|
||||
<a th:href="'/view/'+${a.getQr()}">View</a>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</tr>
|
||||
<tr th:each="p : ${build.getParts()}">
|
||||
<td><a th:href="'/view/' + ${p.qr}" th:text="${p.qr}"></a></td>
|
||||
<td th:text="${descriptors.getDescriptorForType(p.type).displayName}"></td>
|
||||
<td><a th:href="'/browse/' + ${p.type}" th:text="${descriptors.getDescriptorForType(p.type).displayName}"></a></td>
|
||||
<td th:text="${descriptors.getGenericProperty('brand').renderValue(p)}"></td>
|
||||
<td th:text="${descriptors.getGenericProperty('model').renderValue(p)}"></td>
|
||||
</tr>
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
<table border="1" cellpadding="4">
|
||||
<tr th:each="p : ${d.properties}">
|
||||
<th bgcolor="lightgray"><b th:text="${p.displayName}"></b></th>
|
||||
<td th:if="${p.name == 'build'}"><a th:href="'/build/' + ${asset.getAsset().getBuild().id}" th:text="${p.renderValue(asset)}"></a></td>
|
||||
<td th:if="${p.name == 'build'}">
|
||||
<a th:if="${asset.getAsset().getBuild() != null}" th:href="'/build/' + ${asset.getAsset().getBuild().id}" th:text="${p.renderValue(asset)}"></a>
|
||||
<span th:if="${asset.getAsset().getBuild() == null}" th:text="${p.renderValue(asset)}"></span>
|
||||
</td>
|
||||
<td th:if="${p.name != 'build'}" th:text="${p.renderValue(asset)}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user