mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-05-19 06:11:43 -04:00
added logs list start date guard
This commit is contained in:
File diff suppressed because one or more lines are too long
2
ui/dist/index.html
vendored
2
ui/dist/index.html
vendored
@@ -13,7 +13,7 @@
|
||||
|
||||
<!-- prism -->
|
||||
<script src="./libs/prism/prism.js" data-manual></script>
|
||||
<script type="module" crossorigin src="./assets/index-CpG9NuT1.js"></script>
|
||||
<script type="module" crossorigin src="./assets/index-Bf0sznwH.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="./assets/pocketbase.es-B_4DUNUU.js">
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-BLsHBFKX.css">
|
||||
</head>
|
||||
|
||||
@@ -19,11 +19,20 @@ export function logsList(logsSettings) {
|
||||
},
|
||||
});
|
||||
|
||||
// used as loose guard to prevent new logs to constantly push the old ones to later pages
|
||||
let loadStartDate;
|
||||
|
||||
async function load(reset = false) {
|
||||
logsSettings.isListLoading = true;
|
||||
|
||||
try {
|
||||
const page = reset ? 1 : data.lastPage + 1;
|
||||
let page;
|
||||
if (reset) {
|
||||
page = 1;
|
||||
loadStartDate = new Date().toISOString().replace("T", " ");
|
||||
} else {
|
||||
page = data.lastPage + 1;
|
||||
}
|
||||
|
||||
const normalizedFilter = (logsSettings.presets || []).concat(
|
||||
app.utils.normalizeSearchFilter(logsSettings.filter, ["level", "message", "data"]),
|
||||
@@ -41,6 +50,8 @@ export function logsList(logsSettings) {
|
||||
const max = app.utils.toRFC3339Datetime(maxDate);
|
||||
|
||||
normalizedFilter.push(`created >= "${min}" && created <= "${max}"`);
|
||||
} else {
|
||||
normalizedFilter.push(`created <= "${loadStartDate}"`);
|
||||
}
|
||||
|
||||
const result = await app.pb.logs.getList(page, perPage, {
|
||||
|
||||
Reference in New Issue
Block a user