feat: new homepage statistic API's (#167)

* add date format and orDefault helpers

* introduce new statistics calculations queries

* rework statistics endpoints

* code generation

* fix styles on photo card

* label and location aggregation endpoints

* code-gen

* cleanup parser and defaults

* remove debug point

* setup E2E Testing

* linters

* formatting

* fmt plus name support on time series data

* code gen
This commit is contained in:
Hayden 2022-12-05 12:36:32 -09:00 committed by GitHub
parent de419dc37d
commit d6da63187b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 925 additions and 149 deletions

View file

@ -22,7 +22,7 @@
const labels = computed(() => labelsStore.labels);
const { data: statistics } = useAsyncData(async () => {
const { data } = await api.group.statistics();
const { data } = await api.stats.group();
return data;
});

View file

@ -396,9 +396,11 @@
<DetailsSection :details="itemDetails" />
</BaseCard>
<BaseCard>
<BaseCard v-if="photos && photos.length > 0">
<template #title> Photos </template>
<div class="container p-4 flex flex-wrap gap-2 mx-auto max-h-[500px] overflow-scroll">
<div
class="container border-t border-gray-300 p-4 flex flex-wrap gap-2 mx-auto max-h-[500px] overflow-y-scroll scroll-bg"
>
<button v-for="(img, i) in photos" :key="i" @click="openDialog(img)">
<img class="rounded max-h-[200px]" :src="img.src" />
</button>
@ -465,9 +467,18 @@
</BaseContainer>
</template>
<style>
<style lang="css" scoped>
/* Style dialog background */
dialog::backdrop {
background: rgba(0, 0, 0, 0.5);
}
.scroll-bg::-webkit-scrollbar {
width: 0.5rem;
}
.scroll-bg::-webkit-scrollbar-thumb {
border-radius: 0.25rem;
@apply bg-base-300;
}
</style>