Skip to content

Commit

Permalink
tweak limit warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vabene1111 committed Jan 13, 2025
1 parent 1822a62 commit 3e55e04
Show file tree
Hide file tree
Showing 35 changed files with 104 additions and 15 deletions.
9 changes: 8 additions & 1 deletion vue3/src/apps/tandoor/Tandoor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,18 @@
</v-menu>
</v-avatar>
</v-app-bar>
<v-app-bar color="warning" density="compact" v-if="useUserPreferenceStore().activeSpace.maxRecipes == 10 && useUserPreferenceStore().serverSettings.hosted">
<v-app-bar color="info" density="compact" v-if="useUserPreferenceStore().activeSpace.maxRecipes == 10 && useUserPreferenceStore().serverSettings.hosted">
<p class="text-center w-100">
{{ $t('HostedFreeVersion') }}
<v-btn color="success" variant="flat" href="https://tandoor.dev/manage">{{ $t('UpgradeNow') }}</v-btn>
</p>
</v-app-bar>
<v-app-bar color="warning" density="compact" v-if="isSpaceAboveLimit(useUserPreferenceStore().activeSpace)">
<p class="text-center w-100">
{{ $t('SpaceLimitExceeded') }}
<v-btn color="success" variant="flat" :to="{name: 'view_settings_space'}">{{ $t('SpaceSettings') }}</v-btn>
</p>
</v-app-bar>

<v-app-bar color="info" density="compact" v-if="useUserPreferenceStore().activeSpace.message != ''">
<p class="text-center w-100">
Expand Down Expand Up @@ -172,6 +178,7 @@ import {useDjangoUrls} from "@/composables/useDjangoUrls";
import {onMounted, ref} from "vue";
import {ErrorMessageType, useMessageStore} from "@/stores/MessageStore";
import {ApiApi, Space} from "@/openapi";
import {isSpaceAboveLimit, isSpaceAtLimit} from "@/utils/logic_utils";
const {lgAndUp} = useDisplay()
const {getDjangoUrl} = useDjangoUrls()
Expand Down
19 changes: 15 additions & 4 deletions vue3/src/components/model_editors/RecipeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<v-tab value="settings">{{ $t('Settings') }}</v-tab>

</v-tabs>
<v-card-text>
<v-card-text v-if="!isSpaceAtRecipeLimit(useUserPreferenceStore().activeSpace)">
<v-tabs-window v-model="tab">
<v-tabs-window-item value="recipe">

Expand All @@ -26,7 +26,7 @@
<v-textarea :label="$t('Description')" v-model="editingObj.description" clearable counter="512" rows="2"></v-textarea>

<v-row>
<v-col cols="12" md="6" >
<v-col cols="12" md="6">
<v-file-upload v-model="file" @update:modelValue="updateUserFileName"
:title="(mobile) ? $t('Select_File') : $t('DragToUpload')"
:browse-text="$t('Select_File')"
Expand All @@ -37,7 +37,10 @@
</v-col>
<v-col cols="12" md="6" v-if="editingObj.image">
<v-img style="max-height: 180px" cover class="mb-2" :src="editingObj.image">
<v-btn color="delete" class="float-right mt-2 mr-2" prepend-icon="$delete" v-if="editingObj.image" @click="deleteImage()">{{ $t('Delete') }}</v-btn>
<v-btn color="delete" class="float-right mt-2 mr-2" prepend-icon="$delete" v-if="editingObj.image" @click="deleteImage()">{{
$t('Delete')
}}
</v-btn>
</v-img>
</v-col>
</v-row>
Expand Down Expand Up @@ -97,12 +100,18 @@
<v-text-field :label="$t('Imported_From')" v-model="editingObj.sourceUrl"></v-text-field>
<v-checkbox :label="$t('Private_Recipe')" :hint="$t('Private_Recipe_Help')" persistent-hint v-model="editingObj._private"></v-checkbox>
<model-select mode="tags" model="User" :label="$t('Private_Recipe')" :hint="$t('Private_Recipe_Help')" persistent-hint v-model="editingObj.shared"
append-to-body></model-select>
append-to-body></model-select>

</v-form>
</v-tabs-window-item>
</v-tabs-window>
</v-card-text>
<v-card-text v-if="isSpaceAtRecipeLimit(useUserPreferenceStore().activeSpace)">
<v-alert color="warning" icon="fa-solid fa-triangle-exclamation">
{{$t('SpaceLimitReached')}}
<v-btn color="success" variant="flat" :to="{name: 'view_settings_space'}">{{ $t('SpaceSettings') }}</v-btn>
</v-alert>
</v-card-text>
</model-editor-base>

<v-dialog max-width="600px" v-model="dialogStepManager">
Expand Down Expand Up @@ -139,6 +148,8 @@ import {useFileApi} from "@/composables/useFileApi";
import {VFileUpload} from 'vuetify/labs/VFileUpload'
import ClosableHelpAlert from "@/components/display/ClosableHelpAlert.vue";
import {useDisplay} from "vuetify";
import {isSpaceAtRecipeLimit} from "@/utils/logic_utils";
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore";
const props = defineProps({
Expand Down
7 changes: 4 additions & 3 deletions vue3/src/components/settings/SpaceSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
<v-card>
<v-card-title><i class="fa-solid fa-book"></i> {{ $t('Recipes') }}</v-card-title>
<v-card-text>{{ $n(space.recipeCount) }} / {{ space.maxRecipes == 0 ? '∞' : $n(space.maxRecipes) }}</v-card-text>
<v-progress-linear color="success" height="10" :model-value="(space.recipeCount / space.maxRecipes) * 100"></v-progress-linear>
<v-progress-linear :color="isSpaceAboveRecipeLimit(space) ? 'error' : 'success'" height="10" :model-value="(space.recipeCount / space.maxRecipes) * 100"></v-progress-linear>
</v-card>
</v-col>
<v-col cols="12" md="4">
<v-card>

<v-card-title><i class="fa-solid fa-users"></i> {{ $t('Users') }}</v-card-title>
<v-card-text>{{ $n(space.userCount) }} / {{ space.maxUsers == 0 ? '∞' : $n(space.maxUsers) }}</v-card-text>
<v-progress-linear color="success" height="10" :model-value="(space.userCount / space.maxUsers) * 100"></v-progress-linear>
<v-progress-linear :color="isSpaceAboveUserLimit(space) ? 'error' : 'success'" height="10" :model-value="(space.userCount / space.maxUsers) * 100"></v-progress-linear>
</v-card>
</v-col>
<v-col cols="12" md="4">
Expand All @@ -26,7 +26,7 @@
MB
</v-card-text>
<v-card-text v-if="space.maxFileStorageMb == -1">{{ $t('file_upload_disabled') }}</v-card-text>
<v-progress-linear v-if="space.maxFileStorageMb > -1" color="success" height="10"
<v-progress-linear v-if="space.maxFileStorageMb > -1" :color="isSpaceAboveStorageLimit(space) ? 'error' : 'success'" height="10"
:model-value="(space.fileSizeMb / space.maxFileStorageMb) * 100"></v-progress-linear>
</v-card>
</v-col>
Expand Down Expand Up @@ -108,6 +108,7 @@ import {ApiApi, Space} from "@/openapi";
import {ErrorMessageType, PreparedMessage, useMessageStore} from "@/stores/MessageStore";
import UserFileField from "@/components/inputs/UserFileField.vue";
import ModelSelect from "@/components/inputs/ModelSelect.vue";
import {isSpaceAboveRecipeLimit, isSpaceAboveStorageLimit, isSpaceAboveUserLimit} from "@/utils/logic_utils";
const space = ref({} as Space)
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@
"Size": "",
"Social_Authentication": "",
"Sort_by_new": "",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@
"Size": "Размер",
"Social_Authentication": "",
"Sort_by_new": "Сортиране по ново",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@
"Size": "",
"Social_Authentication": "",
"Sort_by_new": "Ordenar a partir del més nou",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@
"Size": "Velikost",
"Social_Authentication": "Přihlašování pomocí účtů sociálních sítí",
"Sort_by_new": "Seřadit od nejnovějšího",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@
"Size": "Størrelse",
"Social_Authentication": "Social authenticering",
"Sort_by_new": "Sorter efter nylige",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@
"Size": "Größe",
"Social_Authentication": "Login über Drittanbieter",
"Sort_by_new": "Nach Neueste sortieren",
"SpaceLimitExceeded": "Dein Space hat ein Limit überschritten, manche Funktionen wurden eingeschränkt.",
"SpaceLimitReached": "Dieser Space hat ein Limit erreicht. Es können keine neuen Objekte von diesem Typ angelegt werden.",
"SpaceMemberHelp": "Füge Benutzer hinzu indem du Einladungen erstellst und Sie an die gewünschte Person sendest.",
"SpaceMembers": "Space Mitglieder",
"SpaceSettings": "Space Einstellungen",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@
"Size": "Μέγεθος",
"Social_Authentication": "Ταυτοποίηση μέσω κοινωνικών δικτύων",
"Sort_by_new": "Ταξινόμηση κατά νέο",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@
"Size": "Size",
"Social_Authentication": "Social Authentication",
"Sort_by_new": "Sort by new",
"SpaceLimitExceeded": "Your space has surpassed one of its limits, some functions might be restricted.",
"SpaceLimitReached": "This Space has reached a limit. No more objects of this type can be created.",
"SpaceMemberHelp": "Add users to your space by creating an Invite Link and sending it to the person you want to add.",
"SpaceMembers": "Space Members",
"SpaceSettings": "Space Settings",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@
"Size": "Tamaño",
"Social_Authentication": "Autenticación Social",
"Sort_by_new": "Ordenar por novedades",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@
"Size": "Koko",
"Social_Authentication": "",
"Sort_by_new": "Lajittele uusien mukaan",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@
"Size": "Taille",
"Social_Authentication": "Authentification Sociale",
"Sort_by_new": "Trier par nouveautés",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@
"Size": "גודל",
"Social_Authentication": "אימות חברתי",
"Sort_by_new": "סדר ע\"י חדש",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@
"Size": "Méret",
"Social_Authentication": "",
"Sort_by_new": "Rendezés legújabbak szerint",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/hy.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@
"Size": "",
"Social_Authentication": "",
"Sort_by_new": "Տեսակավորել ըստ նորերի",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@
"Size": "Ukuran",
"Social_Authentication": "",
"Sort_by_new": "Urutkan berdasarkan baru",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/is.json
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@
"Size": "",
"Social_Authentication": "",
"Sort_by_new": "",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@
"Size": "Dimensione",
"Social_Authentication": "Autenticazione social",
"Sort_by_new": "Prima i nuovi",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@
"Size": "",
"Social_Authentication": "",
"Sort_by_new": "Rūšiuoti pagal naujumą",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/nb_NO.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@
"Size": "Størrelse",
"Social_Authentication": "",
"Sort_by_new": "Sorter etter nyest",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@
"Size": "Grootte",
"Social_Authentication": "Authenticeren met sociale media-account",
"Sort_by_new": "Sorteer op nieuw",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@
"Size": "Rozmiar",
"Social_Authentication": "Uwierzytelnianie społecznościowe",
"Sort_by_new": "Sortuj według nowych",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@
"Size": "Tamanho",
"Social_Authentication": "",
"Sort_by_new": "Ordenar por mais recente",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@
"Size": "Tamanho",
"Social_Authentication": "",
"Sort_by_new": "Ordenar por novos",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@
"Size": "Marime",
"Social_Authentication": "Autentificare socială",
"Sort_by_new": "Sortare după nou",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@
"Size": "Размер",
"Social_Authentication": "",
"Sort_by_new": "Сортировка по новизне",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@
"Size": "Velikost",
"Social_Authentication": "",
"Sort_by_new": "Razvrsti po novih",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@
"Size": "Storlek",
"Social_Authentication": "Social autentisering",
"Sort_by_new": "Sortera efter ny",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@
"Size": "Boyut",
"Social_Authentication": "Sosyal Kimlik Doğrulama",
"Sort_by_new": "Yeniye göre sırala",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@
"Size": "Розмір",
"Social_Authentication": "",
"Sort_by_new": "",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
2 changes: 2 additions & 0 deletions vue3/src/locales/zh_Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@
"Size": "大小",
"Social_Authentication": "社交认证",
"Sort_by_new": "按新旧排序",
"SpaceLimitExceeded": "",
"SpaceLimitReached": "",
"SpaceMemberHelp": "",
"SpaceMembers": "",
"SpaceSettings": "",
Expand Down
Loading

0 comments on commit 3e55e04

Please sign in to comment.