File browser on admin page
This commit is contained in:
@@ -9,6 +9,7 @@ import { useLocationStore } from '@/stores/location.store';
|
||||
import { ref } from 'vue';
|
||||
import { useExerciseStore } from '@/stores/exercise.store';
|
||||
import { useGenreStore } from '@/stores/genre.store';
|
||||
import { usePreferencesStore } from '@/stores/preferences.store';
|
||||
|
||||
const router = useRouter()
|
||||
const concertStore = useConcertStore()
|
||||
@@ -16,21 +17,17 @@ const bandStore = useBandStore()
|
||||
const accountStore = useAccountStore()
|
||||
const genreStore = useGenreStore()
|
||||
const locationStore = useLocationStore()
|
||||
const soldOutConcerts = ref(0)
|
||||
const exerciseStore = useExerciseStore()
|
||||
const preferencesStore = usePreferencesStore()
|
||||
|
||||
exerciseStore.solveExercise(2, 1)
|
||||
|
||||
preferencesStore.getStaticFiles()
|
||||
bandStore.getBands()
|
||||
locationStore.getLocations()
|
||||
genreStore.getGenres()
|
||||
accountStore.getAllAccounts()
|
||||
concertStore.getConcerts()
|
||||
.then(result => {
|
||||
for(let concert of concertStore.concerts) {
|
||||
concert.inStock == 0 ? soldOutConcerts.value++ : ""
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -64,8 +61,14 @@ concertStore.getConcerts()
|
||||
{{ concertStore.concerts.length }} {{ $t('concert.concert', 2) }}
|
||||
</div>
|
||||
|
||||
<div class="text-disabled text-center">
|
||||
{{ soldOutConcerts }} {{ $t('concert.concertSoldOut') }}
|
||||
<div class="text-h6 text-disabled text-center">
|
||||
{{ concertStore.concerts.reduce((counter, obj) => {
|
||||
if (obj.inStock == 0) {
|
||||
counter += 1
|
||||
}
|
||||
|
||||
return counter
|
||||
}, 0) }} {{ $t('concert.concertSoldOut') }}
|
||||
</div>
|
||||
|
||||
<template #actions>
|
||||
@@ -88,6 +91,18 @@ concertStore.getConcerts()
|
||||
{{ locationStore.locations.length }} {{ $t('location.location', 2) }}
|
||||
</div>
|
||||
|
||||
<div class="text-h6 text-disabled text-center">
|
||||
{{
|
||||
locationStore.locations.reduce((city, obj) => {
|
||||
city[obj.city.name] =
|
||||
city[obj.city.name] === undefined ? city.push(obj.city.name) : city[obj.city.name] += 1
|
||||
|
||||
return city
|
||||
}, []).length
|
||||
}}
|
||||
{{ $t('location.city', 2) }}
|
||||
</div>
|
||||
|
||||
<template #actions>
|
||||
<outlined-button
|
||||
@click="router.push('/admin/locations')"
|
||||
@@ -139,7 +154,34 @@ concertStore.getConcerts()
|
||||
</template>
|
||||
</card-view>
|
||||
</v-col>
|
||||
|
||||
<v-col>
|
||||
<card-view
|
||||
:title="$t('misc.file', 2)"
|
||||
icon="mdi-file"
|
||||
>
|
||||
<div class="text-h4 text-center">
|
||||
{{ preferencesStore.staticFiles.reduce((counter, obj) => {
|
||||
return counter += obj.files.length
|
||||
}, 0) }} {{ $t('misc.file', 2) }}
|
||||
</div>
|
||||
|
||||
<div class="text-h6 text-center text-disabled">
|
||||
{{ preferencesStore.staticFiles.length }} {{ $t('misc.folder', 2) }}
|
||||
</div>
|
||||
|
||||
<template #actions>
|
||||
<outlined-button
|
||||
@click="router.push('/admin/files')"
|
||||
>
|
||||
{{ $t('misc.actions.more') }}
|
||||
</outlined-button>
|
||||
</template>
|
||||
</card-view>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- todo: Orders -->
|
||||
|
||||
</v-container>
|
||||
</template>
|
||||
Reference in New Issue
Block a user