feat(dashboard): add price history, caching, and i18n

This commit is contained in:
2026-08-01 21:21:43 +02:00
parent 1cd905ca4a
commit 7fb49131c4
22 changed files with 177 additions and 30 deletions
@@ -1,3 +1,22 @@
export default function DashboardViewModel() {
return {};
import { create } from 'axios';
import { ref } from 'vue';
import DashboardData = App.Features.Dashboard.Data.DashboardData;
export default function useDashboardViewModel() {
const isLoading = ref<boolean>(false);
const dashboardData = ref<DashboardData>();
function getDashboardData() {
isLoading.value = true;
const client = create();
client
.get<DashboardData>('/api/energy-prices')
.then((res) => {
dashboardData.value = res.data;
})
.finally(() => (isLoading.value = false));
}
return { isLoading, dashboardData, getDashboardData };
}