Better capacity support
All checks were successful
Build / build (push) Successful in 2m36s
Deploy / build (push) Successful in 2m40s

This commit is contained in:
2025-06-09 15:03:16 +02:00
parent 85de1c0c9f
commit 5d1c65a4c5
6 changed files with 35 additions and 58 deletions

View File

@@ -31,7 +31,7 @@
<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>
<span th:case="CAPACITY">
<input type="number" th:id="${d.asString(p)+'-value'}" th:name="${d.asString(p)+'-value'}" th:required="${p.required}" th:value="${p.asCapacity(asset).getCapacity()}"/>
<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'">
<option value="1" th:selected="${p.asCapacity(asset).getIdealUnit().name() == 'BYTES'}">Bytes</option>
<option th:value="${1000}" th:if="${p.capacityAsSI}" th:selected="${p.asCapacity(asset).getIdealUnit().name() == 'KILOBYTES'}">kB</option>