pagination + sql expressions + frontend improvements

This commit is contained in:
2023-01-19 18:12:16 +01:00
parent 878cd62bbe
commit 92c78356ed
16 changed files with 216 additions and 71 deletions

View File

@@ -1,6 +1,17 @@
import {format, parse} from "date-fns";
import {API_DATE_FORMAT, API_DATETIME_FORMAT} from "./constants";
function createDownload(name, data) {
const url = window.URL.createObjectURL(new Blob([data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', name);
link.setAttribute("target", "_blank");
document.body.appendChild(link);
link.click();
link.remove();
}
function humanReadableSize(bytes, dp = 1) {
const thresh = 1024;
@@ -87,4 +98,4 @@ const isInt = (value) => {
}
export { humanReadableSize, removeParameter, getParameter, encodeText, decodeText, getBaseUrl,
formatDate, formatDateTime, upperFirstChars, isInt };
formatDate, formatDateTime, upperFirstChars, isInt, createDownload };