Skip to content

Commit e48aec1

Browse files
committed
feat: shows first 1000 records now
1 parent 412b599 commit e48aec1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

assets/components/LogViewer/LogAnalytics.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
></textarea>
1616
<div class="label">
1717
<span class="label-text-alt text-error" v-if="error">{{ error }}</span>
18-
<span class="label-text-alt" v-else>Total {{ results.numRows }} records</span>
18+
<span class="label-text-alt" v-else>
19+
Total {{ results.numRows }} records
20+
<template v-if="results.numRows > pageLimit">. Showing first {{ page.numRows }}.</template></span
21+
>
1922
</div>
2023
</label>
2124
</section>
@@ -58,6 +61,7 @@ const query = ref("SELECT * FROM logs");
5861
const error = ref<string | null>(null);
5962
const debouncedQuery = debouncedRef(query, 500);
6063
const evaluating = ref(false);
64+
const pageLimit = 1000;
6165
6266
const url = withBase(
6367
`/api/hosts/${container.host}/containers/${container.id}/logs?stdout=1&stderr=1&everything&jsonOnly`,
@@ -118,6 +122,6 @@ whenever(evaluating, () => {
118122
const columns = computed(() =>
119123
results.value.numRows > 0 ? Object.keys(results.value.get(0) as Record<string, any>) : [],
120124
);
121-
const page = computed(() => (results.value.numRows > 0 ? results.value.slice(0, 20) : []));
125+
const page = computed(() => (results.value.numRows > 0 ? results.value.slice(0, pageLimit) : []));
122126
</script>
123127
<style lang="postcss" scoped></style>

0 commit comments

Comments
 (0)