Add build management features and views
All checks were successful
Build / build (push) Successful in 2m10s

This commit is contained in:
2025-06-15 09:03:47 +02:00
parent 8cbededc79
commit 8e26a73243
12 changed files with 291 additions and 17 deletions

View File

@@ -0,0 +1,24 @@
<body th:replace="~{fragments :: base(title=${'Build ' + build.getName()}, content=~{::content})}">
<div th:fragment="content">
<ul>
<li><b>Name: </b><span th:text="${build.name}"></span></li>
<li><b>Description: </b><span th:text="${build.description}"></span></li>
<li><b>Part Count: </b><span th:text="${build.getParts()?.size() ?: 0}"></span></li>
<li><b>Total RAM: </b><span th:text="${buildInfo.getTotalRamCapacity().getCapacityInUnit()} + ' ' + ${buildInfo.getTotalRamCapacity().getIdealUnit().displayName}"></span></li>
</ul>
<table border="1" cellpadding="4">
<tr bgcolor="#d3d3d3">
<th>QR</th>
<th>Type</th>
<th>Brand</th>
<th>Model</th>
</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 th:text="${descriptors.getGenericProperty('brand').renderValue(p)}"></td>
<td th:text="${descriptors.getGenericProperty('model').renderValue(p)}"></td>
</tr>
</table>
</div>
</body>

View File

@@ -0,0 +1,28 @@
<body th:replace="~{fragments :: base(title='Builds', content=~{::content})}">
<div th:fragment="content">
<table border="1" cellpadding="4">
<tr bgcolor="#d3d3d3">
<th>Name</th>
<th>Description</th>
<th>Part Count</th>
<th>Actions</th>
</tr>
<tr th:each="b : ${builds}">
<td><a th:href="'/build/' + ${b.id}" th:text="${b.getName()}"></a></td>
<td th:text="${b.getDescription()}"></td>
<td th:text="${b.getParts()?.size() ?: 0}"></td>
<td>
<a th:if="${!b.isMeta()}" th:href="${'/delete_build/' + b.id}">Delete</a>
</td>
</tr>
<form action="/create_build" method="post">
<tr>
<td><label><input type="text" name="name" placeholder="Name"></label></td>
<td><label><input type="text" name="description" placeholder="Description"></label></td>
<td></td>
<td><input type="submit" value="Create"></td>
</tr>
</form>
</table>
</div>
</body>

View File

@@ -7,7 +7,8 @@
<table border="1" cellpadding="4">
<tr th:each="p : ${d.properties}">
<th bgcolor="lightgray"><b th:text="${p.displayName}"></b></th>
<td th:text="${p.renderValue(asset)}"></td>
<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'}" th:text="${p.renderValue(asset)}"></td>
</tr>
</table>
</div>