diff --git a/app.vue b/app.vue index 4e512ed..4d4a7f4 100644 --- a/app.vue +++ b/app.vue @@ -17,6 +17,13 @@ useHead({ htmlAttrs: { lang: 'en', }, + meta: [ + { + name: 'viewport', + content: 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0', + tagPosition: 'head', + }, + ], link: [ { rel: 'icon', diff --git a/components/dashboard/Counters.vue b/components/dashboard/Counters.vue index 528de8e..3f6a78d 100644 --- a/components/dashboard/Counters.vue +++ b/components/dashboard/Counters.vue @@ -11,36 +11,38 @@ const defaultData = Object.freeze({ const counters = ref(defaultData) const id = inject('id') -const startAt = inject('startAt') -const endAt = inject('endAt') - +const time = inject('time') +const filters = inject('filters') async function getLinkCounters() { counters.value = defaultData const { data } = await useAPI('/api/stats/counters', { query: { id: id.value, - startAt: startAt.value, - endAt: endAt.value, + startAt: time.value.startAt, + endAt: time.value.endAt, + ...filters.value, }, }) counters.value = data?.[0] } -const stopWatchTime = watch([startAt, endAt], getLinkCounters) +const stopWatchQueryChange = watch([time, filters], getLinkCounters, { + deep: true, +}) onMounted(async () => { getLinkCounters() }) onBeforeUnmount(() => { - stopWatchTime() + stopWatchQueryChange() })