Options based on enum values

This commit is contained in:
Francesco 2023-10-14 11:24:49 +02:00
parent 49a81b47e2
commit e64a787b01
3 changed files with 5 additions and 4 deletions

View File

@ -87,7 +87,7 @@ public class DataExportController {
.header(HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename=\"export_" + schema.getJavaClass().getSimpleName() + ".xlsx\"")
.body(toXlsx(sheetName, results, fields, raw));
case JSON:
case JSONL:
throw new DbAdminException("JSON TODO");
default:
throw new DbAdminException("Unable to detect export format");

View File

@ -1,5 +1,5 @@
package tech.ailef.dbadmin.external.dto;
public enum DataExportFormat {
CSV, XLSX, JSON;
CSV, XLSX, JSONL;
}

View File

@ -54,8 +54,9 @@
</div>
<h5 class="fw-bold mt-3">Export format</h3>
<select name="format" class="form-select">
<option value="csv">CSV</option>
<option value="xlsx">XLSX</option>
<option th:each="format : ${T(tech.ailef.dbadmin.external.dto.DataExportFormat).values()}"
th:value="${format}" th:text="${format}">
</option>
</select>
<div class="form-check mt-3">
<input class="form-check-input" type="checkbox"