added stats

This commit is contained in:
vabene1111
2024-11-30 11:41:46 +01:00
parent 38b72c8c72
commit 557954a259
33 changed files with 54 additions and 4 deletions

View File

@@ -2,8 +2,8 @@
<v-tabs v-model="currentTab">
<v-tab value="shopping"><i class="fas fa-fw"
:class="{'fa-circle-notch fa-spin':useShoppingStore().currentlyUpdating, 'fa-shopping-cart ': !useShoppingStore().currentlyUpdating}"></i> <span
class="d-none d-md-block ms-1">{{ $t('Shopping_list') }}</span></v-tab>
<v-tab value="recipes"><i class="fas fa-book fa-fw"></i> <span class="d-none d-md-block ms-1">{{ $t('Recipes') }}</span></v-tab>
class="d-none d-md-block ms-1">{{ $t('Shopping_list') }} ({{useShoppingStore().stats.countUnchecked}})</span></v-tab>
<v-tab value="recipes"><i class="fas fa-book fa-fw"></i> <span class="d-none d-md-block ms-1">{{ $t('Recipes') }} ({{useShoppingStore().getAssociatedRecipes().length}})</span></v-tab>
<v-menu :close-on-content-click="false">
<template v-slot:activator="{ props }">
@@ -13,7 +13,6 @@
rounded="0"
variant="plain"
v-bind="props"
>
<i class="fa-solid fa-sliders"></i>
</v-btn>
@@ -41,6 +40,16 @@
<v-switch color="primary" hide-details :label="$t('ShowRecentlyCompleted')"
v-model="useUserPreferenceStore().deviceSettings.shopping_show_checked_entries"></v-switch>
</v-list-item>
<v-list-subheader>{{$t('Information')}}</v-list-subheader>
<v-list-item>
<v-switch color="primary" hide-details :label="$t('Recipe')" v-model="useUserPreferenceStore().deviceSettings.shopping_item_info_recipe"></v-switch>
</v-list-item>
<v-list-item>
<v-switch color="primary" hide-details :label="$t('Meal_Plan')" v-model="useUserPreferenceStore().deviceSettings.shopping_item_info_mealplan"></v-switch>
</v-list-item>
<v-list-item>
<v-switch color="primary" hide-details :label="$t('CreatedBy')" v-model="useUserPreferenceStore().deviceSettings.shopping_item_info_created_by"></v-switch>
</v-list-item>
</v-list>
</v-menu>

View File

@@ -57,6 +57,7 @@
"Create_New_Shopping Category": "",
"Create_New_Shopping_Category": "",
"Create_New_Unit": "",
"CreatedBy": "",
"Current_Period": "",
"Custom Filter": "",
"Database": "",

View File

@@ -54,6 +54,7 @@
"Create_New_Meal_Type": "Добавете нов тип хранене",
"Create_New_Shopping Category": "Създайте нова категория за пазаруване",
"Create_New_Unit": "Добавяне на нова единица",
"CreatedBy": "",
"Current_Period": "Текущ период",
"Custom Filter": "Персонализиран филтър",
"Database": "",

View File

@@ -73,6 +73,7 @@
"Create_New_Shopping_Category": "",
"Create_New_Unit": "",
"Created": "",
"CreatedBy": "",
"Current_Period": "",
"Custom Filter": "",
"CustomImageHelp": "",

View File

@@ -72,6 +72,7 @@
"Create_New_Shopping Category": "Vytvořit novou nákupní kategorii",
"Create_New_Shopping_Category": "Přidat novou nákupní kategorii",
"Create_New_Unit": "Přidat novou jednotku",
"CreatedBy": "",
"Current_Period": "Současné období",
"Custom Filter": "Uživatelský filtr",
"CustomImageHelp": "Nahrajte obrázek, který se zobrazí v přehledu prostoru.",

View File

@@ -71,6 +71,7 @@
"Create_New_Shopping Category": "Opret ny indkøbskategori",
"Create_New_Shopping_Category": "Opret ny indkøbskategori",
"Create_New_Unit": "Tilføj ny enhed",
"CreatedBy": "",
"Current_Period": "Nuværende periode",
"Custom Filter": "Tilpasset filter",
"Data_Import_Info": "Udbyg dit Space og gør din opskriftsamling bedre ved at importere en netværkskurateret liste af ingredienser, enheder og mere.",

View File

@@ -74,6 +74,7 @@
"Create_New_Shopping_Category": "Neue Einkaufskategorie hinzufügen",
"Create_New_Unit": "Neue Einheit hinzufügen",
"Created": "Erstellt",
"CreatedBy": "Erstellt von",
"Current_Period": "Aktueller Zeitraum",
"Custom Filter": "Benutzerdefinierter Filter",
"CustomImageHelp": "Laden Sie ein Bild hoch, das in der Space-Übersicht angezeigt werden soll.",

View File

@@ -70,6 +70,7 @@
"Create_New_Shopping Category": "Δημιουργία νέας κατηγορίας αγορών",
"Create_New_Shopping_Category": "Προσθήκη νέας κατηγορίας αγορών",
"Create_New_Unit": "Προσθήκη νέας μονάδας μέτρησης",
"CreatedBy": "",
"Current_Period": "Τρέχουσα περίοδος",
"Custom Filter": "Προσαρμοσμένο φίλτρο",
"Data_Import_Info": "Βελτιώστε τον χώρο και τη συλλογή συνταγών σας κάνοντας εισαγωγή μιας λίστας από φαγητά, μονάδες μέτρησης κ.α., επιμελημένη από την κοινότητα.",

View File

@@ -73,6 +73,7 @@
"Create_New_Shopping_Category": "Add New Shopping Category",
"Create_New_Unit": "Add New Unit",
"Created": "Created",
"CreatedBy": "Created by",
"Current_Period": "Current Period",
"Custom Filter": "Custom Filter",
"CustomImageHelp": "Upload an image to show in the space overview.",

View File

@@ -73,6 +73,7 @@
"Create_New_Shopping_Category": "Añadir nueva Categoría de Compras",
"Create_New_Unit": "Añadir nueva unidad",
"Created": "Creada",
"CreatedBy": "",
"Current_Period": "Período Actual",
"Custom Filter": "Filtro Personalizado",
"CustomImageHelp": "Subir una imagen para mostrar en la vista general del espacio.",

View File

@@ -38,6 +38,7 @@
"Create_New_Meal_Type": "Lisää Uusi Ateriatyyppi",
"Create_New_Shopping Category": "Luo Uusi Ostoskategoria",
"Create_New_Unit": "Lisää Uusi Yksikkö",
"CreatedBy": "",
"Current_Period": "Nykyinen Jakso",
"Database": "",
"Date": "Päivämäärä",

View File

@@ -72,6 +72,7 @@
"Create_New_Shopping_Category": "Ajouter une nouvelle catégorie de courses",
"Create_New_Unit": "Ajouter une nouvelle unité",
"Created": "Créé",
"CreatedBy": "",
"Current_Period": "Période actuelle",
"Custom Filter": "Filtre personnalisé",
"CustomImageHelp": "Téléchargez une image à afficher dans l'aperçu de l'espace.",

View File

@@ -73,6 +73,7 @@
"Create_New_Shopping_Category": "הוסף קטגוריות קניות חדשה",
"Create_New_Unit": "הוסף יחידה",
"Created": "נוצר",
"CreatedBy": "",
"Current_Period": "תקופה נוכחית",
"Custom Filter": "פילטר מותאם",
"CustomImageHelp": "העלאת תמונה שתראה באזור הסקירה.",

View File

@@ -70,6 +70,7 @@
"Create_New_Shopping Category": "Új vásárlási kategória létrehozása",
"Create_New_Shopping_Category": "Új vásárlási kategória hozzáadása",
"Create_New_Unit": "Új mértékegység hozzáadása",
"CreatedBy": "",
"Current_Period": "Jelenlegi periódus",
"Custom Filter": "Egyéni szűrő",
"Data_Import_Info": "Bővítse Terét alapanyagok, mértékegységek és egyebek közösség által összeállított listájának importálásával, hogy ezzel is javítsa a receptgyűjteményét.",

View File

@@ -26,6 +26,7 @@
"Create_New_Food": "Ավելացնել նոր սննդամթերք",
"Create_New_Keyword": "Ավելացնել նոր բանալի բառ",
"Create_New_Shopping Category": "Ստեղծել գնումների նոր կատեգորիա",
"CreatedBy": "",
"Database": "",
"Date": "",
"Default": "",

View File

@@ -62,6 +62,7 @@
"Create_New_Shopping Category": "",
"Create_New_Shopping_Category": "",
"Create_New_Unit": "",
"CreatedBy": "",
"Current_Period": "",
"Custom Filter": "",
"Database": "",

View File

@@ -73,6 +73,7 @@
"Create_New_Shopping_Category": "",
"Create_New_Unit": "",
"Created": "",
"CreatedBy": "",
"Current_Period": "",
"Custom Filter": "",
"CustomImageHelp": "",

View File

@@ -66,6 +66,7 @@
"Create_New_Shopping Category": "Crea nuova categoria della spesa",
"Create_New_Shopping_Category": "Aggiungi nuova categoria di spesa",
"Create_New_Unit": "Aggiungi nuova unità",
"CreatedBy": "",
"Current_Period": "Periodo attuale",
"Custom Filter": "Filtro personalizzato",
"Database": "",

View File

@@ -71,6 +71,7 @@
"Create_New_Shopping Category": "",
"Create_New_Shopping_Category": "",
"Create_New_Unit": "",
"CreatedBy": "",
"Current_Period": "",
"Custom Filter": "",
"Data_Import_Info": "",

View File

@@ -69,6 +69,7 @@
"Create_New_Shopping Category": "Opprett ny handle kategori",
"Create_New_Shopping_Category": "Opprett new handle kategori",
"Create_New_Unit": "Opprett ny enhet",
"CreatedBy": "",
"Current_Period": "Gjeldende periode",
"Custom Filter": "Egendefinert Filter",
"Database": "",

View File

@@ -72,6 +72,7 @@
"Create_New_Shopping Category": "Maak nieuwe boodschappencategorie",
"Create_New_Shopping_Category": "Voeg nieuwe boodschappencategorie toe",
"Create_New_Unit": "Voeg nieuwe Eenheid toe",
"CreatedBy": "",
"Current_Period": "Huidige periode",
"Custom Filter": "Aangepast filter",
"Data_Import_Info": "Verbeter je Space door een door de community samengestelde lijst van voedingsmiddelen, eenheden en meer te importeren om je receptenverzameling te verbeteren.",

View File

@@ -74,6 +74,7 @@
"Create_New_Shopping_Category": "Dodaj nową kategorię zakupów",
"Create_New_Unit": "Dodaj nowa jednostkę",
"Created": "Utworzony",
"CreatedBy": "",
"Current_Period": "Bieżący okres",
"Custom Filter": "Filtr niestandardowy",
"CustomImageHelp": "Prześlij obraz, który będzie wyświetlany w przeglądzie przestrzeni.",

View File

@@ -56,6 +56,7 @@
"Create_New_Shopping Category": "Criar nova categoria de Compras",
"Create_New_Shopping_Category": "Adicionar nova categoria de compras",
"Create_New_Unit": "Adicionar nova unidade",
"CreatedBy": "",
"Current_Period": "Período atual",
"Custom Filter": "",
"Database": "",

View File

@@ -71,6 +71,7 @@
"Create_New_Shopping Category": "Criar Nova Categoria de Compras",
"Create_New_Shopping_Category": "Incluir Nova Categoria de Compras",
"Create_New_Unit": "Incluir Nova Unidade",
"CreatedBy": "",
"Current_Period": "Período Atual",
"Custom Filter": "Filtro Customizado",
"CustomImageHelp": "Faça upload de uma imagem para mostrar na visão geral do espaço.",

View File

@@ -68,6 +68,7 @@
"Create_New_Shopping Category": "Creați o nouă categorie de cumpărături",
"Create_New_Shopping_Category": "Adaugă categorie de cumpărături nouă",
"Create_New_Unit": "Adaugă unitate nouă",
"CreatedBy": "",
"Current_Period": "Perioada curentă",
"Custom Filter": "Filtru personalizat",
"Database": "",

View File

@@ -48,6 +48,7 @@
"Create_New_Shopping Category": "Создание новой категории покупок",
"Create_New_Shopping_Category": "Добавить новую категорию в список покупок",
"Create_New_Unit": "Добавить единицу измерения",
"CreatedBy": "",
"Current_Period": "Текущий период",
"Custom Filter": "Пользовательский фильтр",
"Database": "",

View File

@@ -48,6 +48,7 @@
"Create_New_Meal_Type": "Dodaj nov tip obroka",
"Create_New_Shopping Category": "Ustvari novo kategorijo nakupovalnega listka",
"Create_New_Unit": "Dodaj novo enoto",
"CreatedBy": "",
"Current_Period": "Trenutno obdobje",
"Data_Import_Info": "Izboljšajte svoj prostor z uvozom seznama živil, enot in drugega, ker je pripravila skupnost, ter s tem izboljšajte svojo zbirko receptov.",
"Database": "",

View File

@@ -74,6 +74,7 @@
"Create_New_Shopping_Category": "Lägg till ny shoppingkategori",
"Create_New_Unit": "Lägg till enhet",
"Created": "Skapad",
"CreatedBy": "",
"Current_Period": "Nuvarande period",
"Custom Filter": "Anpassat filter",
"CustomImageHelp": "Ladda upp en bild som visas i överblicken.",

View File

@@ -73,6 +73,7 @@
"Create_New_Shopping_Category": "Yeni Alışveriş Kategorisi Ekle",
"Create_New_Unit": "Yeni Birim Ekle",
"Created": "Oluşturuldu",
"CreatedBy": "",
"Current_Period": "Mevcut Dönem",
"Custom Filter": "Özel Filtre",
"CustomImageHelp": "Alan genel bakışında gösterilecek bir resim yükleyin.",

View File

@@ -60,6 +60,7 @@
"Create_New_Shopping Category": "Створити Нову Категорію Покупок",
"Create_New_Shopping_Category": "Додати Нову Категорію Покупок",
"Create_New_Unit": "Додати Нову Одиницю",
"CreatedBy": "",
"Current_Period": "Теперішній Період",
"Custom Filter": "",
"Database": "",

View File

@@ -71,6 +71,7 @@
"Create_New_Shopping Category": "创建新的购物类别",
"Create_New_Shopping_Category": "添加新的购物类别",
"Create_New_Unit": "添加新的单位",
"CreatedBy": "",
"Current_Period": "本期",
"Custom Filter": "自定义筛选器",
"CustomImageHelp": "上传图片以在空间概览中显示。",

View File

@@ -21,6 +21,7 @@
"Copy": "",
"Copy_template_reference": "複製參考模板",
"Create": "",
"CreatedBy": "",
"Database": "",
"Date": "",
"Default": "",

View File

@@ -51,6 +51,15 @@ export const useShoppingStore = defineStore(_STORE_ID, () => {
const getEntriesByGroup = computed(() => {
//TODO why is this called many times on each auto sync
console.log('running getEntriesByGroup')
stats.value = {
countChecked: 0,
countUnchecked: 0,
countCheckedFood: 0,
countUncheckedFood: 0,
countUncheckedDelayed: 0,
} as ShoppingListStats
let structure = {} as IShoppingList
structure.categories = new Map<string, IShoppingListCategory>
@@ -268,7 +277,7 @@ export const useShoppingStore = defineStore(_STORE_ID, () => {
let recipes = [] as ShoppingListRecipe[]
entries.value.forEach(e => {
if(e.recipeMealplan != null && recipes.findIndex(x => x.id == e.recipeMealplan.id) == -1){
if (e.recipeMealplan != null && recipes.findIndex(x => x.id == e.recipeMealplan.id) == -1) {
recipes.push(e.recipeMealplan)
}
})
@@ -518,6 +527,7 @@ export const useShoppingStore = defineStore(_STORE_ID, () => {
hasFailedItems,
itemCheckSyncQueue,
undoStack,
stats,
refreshFromAPI,
autoSync,
createObject,