mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-08 21:38:21 +00:00
Options based on enum values
This commit is contained in:
parent
49a81b47e2
commit
e64a787b01
@ -87,7 +87,7 @@ public class DataExportController {
|
|||||||
.header(HttpHeaders.CONTENT_DISPOSITION,
|
.header(HttpHeaders.CONTENT_DISPOSITION,
|
||||||
"attachment; filename=\"export_" + schema.getJavaClass().getSimpleName() + ".xlsx\"")
|
"attachment; filename=\"export_" + schema.getJavaClass().getSimpleName() + ".xlsx\"")
|
||||||
.body(toXlsx(sheetName, results, fields, raw));
|
.body(toXlsx(sheetName, results, fields, raw));
|
||||||
case JSON:
|
case JSONL:
|
||||||
throw new DbAdminException("JSON TODO");
|
throw new DbAdminException("JSON TODO");
|
||||||
default:
|
default:
|
||||||
throw new DbAdminException("Unable to detect export format");
|
throw new DbAdminException("Unable to detect export format");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package tech.ailef.dbadmin.external.dto;
|
package tech.ailef.dbadmin.external.dto;
|
||||||
|
|
||||||
public enum DataExportFormat {
|
public enum DataExportFormat {
|
||||||
CSV, XLSX, JSON;
|
CSV, XLSX, JSONL;
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<h5 class="fw-bold mt-3">Export format</h3>
|
<h5 class="fw-bold mt-3">Export format</h3>
|
||||||
<select name="format" class="form-select">
|
<select name="format" class="form-select">
|
||||||
<option value="csv">CSV</option>
|
<option th:each="format : ${T(tech.ailef.dbadmin.external.dto.DataExportFormat).values()}"
|
||||||
<option value="xlsx">XLSX</option>
|
th:value="${format}" th:text="${format}">
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="form-check mt-3">
|
<div class="form-check mt-3">
|
||||||
<input class="form-check-input" type="checkbox"
|
<input class="form-check-input" type="checkbox"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user