Skip to content

Commit

Permalink
feat: shows first 1000 records now
Browse files Browse the repository at this point in the history
  • Loading branch information
amir20 committed Sep 26, 2024
1 parent 412b599 commit e48aec1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions assets/components/LogViewer/LogAnalytics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
></textarea>
<div class="label">
<span class="label-text-alt text-error" v-if="error">{{ error }}</span>
<span class="label-text-alt" v-else>Total {{ results.numRows }} records</span>
<span class="label-text-alt" v-else>
Total {{ results.numRows }} records
<template v-if="results.numRows > pageLimit">. Showing first {{ page.numRows }}.</template></span

Check failure on line 20 in assets/components/LogViewer/LogAnalytics.vue

View workflow job for this annotation

GitHub Actions / Typecheck

Property 'numRows' does not exist on type 'never[] | Table<Record<string, any>>'.
>
</div>
</label>
</section>
Expand Down Expand Up @@ -58,6 +61,7 @@ const query = ref("SELECT * FROM logs");
const error = ref<string | null>(null);
const debouncedQuery = debouncedRef(query, 500);
const evaluating = ref(false);
const pageLimit = 1000;
const url = withBase(
`/api/hosts/${container.host}/containers/${container.id}/logs?stdout=1&stderr=1&everything&jsonOnly`,
Expand Down Expand Up @@ -118,6 +122,6 @@ whenever(evaluating, () => {
const columns = computed(() =>
results.value.numRows > 0 ? Object.keys(results.value.get(0) as Record<string, any>) : [],
);
const page = computed(() => (results.value.numRows > 0 ? results.value.slice(0, 20) : []));
const page = computed(() => (results.value.numRows > 0 ? results.value.slice(0, pageLimit) : []));
</script>
<style lang="postcss" scoped></style>

0 comments on commit e48aec1

Please sign in to comment.