diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 9895115..37d3c47 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -21,8 +21,9 @@ onMounted(() => { class="sr-only focus:not-sr-only focus:absolute focus:start-2 focus:top-2 focus:z-(--z-toast) focus:rounded-md focus:bg-primary focus:px-3 focus:py-2 focus:text-sm focus:text-primary-foreground" >Skip to main content + - + @@ -211,16 +220,19 @@ interface TimeSeriesStats { const timeSeriesData = ref(null) const chartLoading = ref(false) +const chartError = ref(null) // Fetch time-series data from API async function fetchTimeSeriesData() { chartLoading.value = true + chartError.value = null try { const response = await axios.get(`/api/stats/timeseries?period=${selectedPeriod.value}`) timeSeriesData.value = response.data } catch (err) { console.error('Failed to fetch time-series data:', err) timeSeriesData.value = null + chartError.value = err instanceof Error ? err.message : 'Failed to load download activity' } finally { chartLoading.value = false } diff --git a/frontend/src/components/NotFound.vue b/frontend/src/components/NotFound.vue new file mode 100644 index 0000000..7d89106 --- /dev/null +++ b/frontend/src/components/NotFound.vue @@ -0,0 +1,26 @@ + + + diff --git a/frontend/src/components/PackageList.vue b/frontend/src/components/PackageList.vue index 1080e89..5693d9c 100644 --- a/frontend/src/components/PackageList.vue +++ b/frontend/src/components/PackageList.vue @@ -16,16 +16,16 @@ + + - - { }) it('displays error message when error occurs', async () => { - const wrapper = mount(Stats) const store = usePackageStore() + vi.spyOn(store, 'fetchStats').mockResolvedValue() + const wrapper = mount(Stats) + store.loading = false store.error = 'Failed to fetch statistics' await wrapper.vm.$nextTick() diff --git a/frontend/src/components/Stats.vue b/frontend/src/components/Stats.vue index e9a1cf3..d6ea180 100644 --- a/frontend/src/components/Stats.vue +++ b/frontend/src/components/Stats.vue @@ -2,16 +2,16 @@
+ + - -