1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-02 20:15:24 +02:00
* Changed uvicorn port to 80

* Changed port in docker-compose to match dockerfile

* Readded environment variables in docker-compose

* production image rework

* Use opengraph metadata to make basic recipe cards when full recipe metadata is not available

* fixed instrucitons on parse

* add last_recipe

* automated testing

* roadmap update

* Sqlite (#75)

* file structure

* auto-test

* take 2

* refactor ap scheduler and startup process

* fixed scraper error

* database abstraction

* database abstraction

* port recipes over to new schema

* meal migration

* start settings migration

* finale mongo port

* backup improvements

* migration imports to new DB structure

* unused import cleanup

* docs strings

* settings and theme import logic

* cleanup

* fixed tinydb error

* requirements

* fuzzy search

* remove scratch file

* sqlalchemy models

* improved search ui

* recipe models almost done

* sql modal population

* del scratch

* rewrite database model mixins

* mostly grabage

* recipe updates

* working sqllite

* remove old files and reorganize

* final cleanup

Co-authored-by: Hayden <hay-kot@pm.me>

* Backup card (#78)

* backup / import dialog

* upgrade to new tag method

* New import card

* rename settings.py to app_config.py

* migrate to poetry for development

* fix failing test

Co-authored-by: Hayden <hay-kot@pm.me>

* added mkdocs to docker-compose

* Translations (#72)

* Translations + danish

* changed back proxy target to use ENV

* Resolved more merge conflicts

* Removed test in translation

* Documentation of translations

* Updated translations

* removed old packages

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>

* fail to start bug fixes

* feature: prep/cook/total time slots (#80)

Co-authored-by: Hayden <hay-kot@pm.me>

* missing bind attributes

* Bug fixes (#81)

* fix: url remains after succesful import

* docs: changelog + update todos

* arm image

* arm compose

* compose updates

* update poetry

* arm support

Co-authored-by: Hayden <hay-kot@pm.me>

* dockerfile hotfix

* dockerfile hotfix

* Version Release Final Touches (#84)

* Remove slim

* bug: opacity issues

* bug: startup failure with no database

* ci/cd on dev branch

* formatting

* v0.1.0 documentation

Co-authored-by: Hayden <hay-kot@pm.me>

* db init hotfix

* bug: fix crash in mongo

* fix mongo bug

* fixed version notifier

* finale changelog

* Dropping Mongo From Dev Branch (#89)

* Fix link to Docker Hub

Found an extra s. DESTROYED it.

* initial pass

* second pass cleanup

* backup card framework

* backup card functionality

* translation

* upload button vile creation

* Release v0.1.0 Candidate (#85)

* Changed uvicorn port to 80

* Changed port in docker-compose to match dockerfile

* Readded environment variables in docker-compose

* production image rework

* Use opengraph metadata to make basic recipe cards when full recipe metadata is not available

* fixed instrucitons on parse

* add last_recipe

* automated testing

* roadmap update

* Sqlite (#75)

* file structure

* auto-test

* take 2

* refactor ap scheduler and startup process

* fixed scraper error

* database abstraction

* database abstraction

* port recipes over to new schema

* meal migration

* start settings migration

* finale mongo port

* backup improvements

* migration imports to new DB structure

* unused import cleanup

* docs strings

* settings and theme import logic

* cleanup

* fixed tinydb error

* requirements

* fuzzy search

* remove scratch file

* sqlalchemy models

* improved search ui

* recipe models almost done

* sql modal population

* del scratch

* rewrite database model mixins

* mostly grabage

* recipe updates

* working sqllite

* remove old files and reorganize

* final cleanup

Co-authored-by: Hayden <hay-kot@pm.me>

* Backup card (#78)

* backup / import dialog

* upgrade to new tag method

* New import card

* rename settings.py to app_config.py

* migrate to poetry for development

* fix failing test

Co-authored-by: Hayden <hay-kot@pm.me>

* added mkdocs to docker-compose

* Translations (#72)

* Translations + danish

* changed back proxy target to use ENV

* Resolved more merge conflicts

* Removed test in translation

* Documentation of translations

* Updated translations

* removed old packages

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>

* fail to start bug fixes

* feature: prep/cook/total time slots (#80)

Co-authored-by: Hayden <hay-kot@pm.me>

* missing bind attributes

* Bug fixes (#81)

* fix: url remains after succesful import

* docs: changelog + update todos

* arm image

* arm compose

* compose updates

* update poetry

* arm support

Co-authored-by: Hayden <hay-kot@pm.me>

* dockerfile hotfix

* dockerfile hotfix

* Version Release Final Touches (#84)

* Remove slim

* bug: opacity issues

* bug: startup failure with no database

* ci/cd on dev branch

* formatting

* v0.1.0 documentation

Co-authored-by: Hayden <hay-kot@pm.me>

* db init hotfix

* bug: fix crash in mongo

* fix mongo bug

* fixed version notifier

* finale changelog

Co-authored-by: kentora <=>
Co-authored-by: Hayden <hay-kot@pm.me>
Co-authored-by: Richard Mitic <richard.h.mitic@gmail.com>
Co-authored-by: kentora <kentora@kentora.dk>

* build container

* webscraper hotfix

* dev bug: change data location to prevent reloads

* api docs

* api docs bug

* workflow update

Co-authored-by: David Young <davidy@funkypenguin.co.nz>
Co-authored-by: Hayden <hay-kot@pm.me>
Co-authored-by: Richard Mitic <richard.h.mitic@gmail.com>
Co-authored-by: kentora <kentora@kentora.dk>

* Add French Translation (#93)

* New tests (#94)

* dev-bug: fixed vscode freezes

* test: refactor database init to support tests

Co-authored-by: Hayden <hay-kot@pm.me>

* Mealplan CRUD Tests (#95)

* dev-bug: fixed vscode freezes

* test: refactor database init to support tests

* mealplan CRUD testing

Co-authored-by: Hayden <hay-kot@pm.me>

* Fix typos (#96)

* Settings, Themes and Migration Route Tests (#100)

* dev-bug: fixed vscode freezes

* test: refactor database init to support tests

* mealplan CRUD testing

* restructure test folder

* git attributes

* tests: migration, settings, theme routes testing

Co-authored-by: Hayden <hay-kot@pm.me>

* Refactor + New Docker File (#105)

* dev-bug: fixed vscode freezes

* test: refactor database init to support tests

* mealplan CRUD testing

* restructure test folder

* git attributes

* tests: migration, settings, theme routes testing

* docker-file shrink

* rebuild

* refactor: moving directories around

* adding funding

Co-authored-by: Hayden <hay-kot@pm.me>

* Meal planner improvements (#107)

* dev-bug: fixed vscode freezes

* test: refactor database init to support tests

* mealplan CRUD testing

* restructure test folder

* git attributes

* tests: migration, settings, theme routes testing

* docker-file shrink

* rebuild

* refactor: moving directories around

* adding funding

* mealplan redesign

Co-authored-by: Hayden <hay-kot@pm.me>

* Upload component (#108)

* unified upload button + download backups

* javascript toolings

* fix vuetur config

* fixed type check error

* refactor: clean up bag javascript

Co-authored-by: Hayden <hay-kot@pm.me>

* Upload component (#113)

* unified upload button + download backups

* javascript toolings

* fix vuetur config

* fixed type check error

* refactor: clean up bag javascript

* UI updates + name validation

* docs: changelog + sp

* fixed route links

* changelog

Co-authored-by: Hayden <hay-kot@pm.me>

* fixed menu links

* fixed poetry install on docker.dev build

* Migration redesign (#119)

* migration redesign init

* new color picker

* changelog

* added UI language selection

* fix layout issue on recipe editor

* remove git as dependency

* added UI editor for original URL

* CI/CD Tests

* test: fixed migration routes

Co-authored-by: Hayden <hay-kot@pm.me>

* Fix link to dev-notes.md (#110)

* translation: add swedish (#128)

* language: da is Danish

* translations: add swedish

* scraper: unescape html in instructions (#129)

Some urls erroneously deliver escaped html their instructions,
sometimes they are even escaped on multiple levels like here:

https://www.ica.se/recept/kladdig-kladdkaka-722982/

```
>>> normalize_instruction("S&amp;auml;tt ugnen p&amp;aring; 200&amp;deg;C.")
'Sätt ugnen på 200°C.'
```

* v0.2.0 Updates (#130)

* migration redesign init

* new color picker

* changelog

* added UI language selection

* fix layout issue on recipe editor

* remove git as dependency

* added UI editor for original URL

* CI/CD Tests

* test: fixed migration routes

* test todos

* bug/added docker volume

* chowdow test data

* partial image recipe image testing

* added card section card

* settings form

* homepage cetegory ui

* frontend category placeholder

* fixed broken scheduler

* remove old files

* removed temp test

Co-authored-by: Hayden <hay-kot@pm.me>

* Fix missing translations key (#133)

* translation: add simplified & traditional chinese

* Fix missing translations

* fix chinese translations

* v0.2.0 Release Candidate (#141)

* Fix link to Docker Hub

Found an extra s. DESTROYED it.

* Release v0.1.0 Candidate (#85)

* Changed uvicorn port to 80

* Changed port in docker-compose to match dockerfile

* Readded environment variables in docker-compose

* production image rework

* Use opengraph metadata to make basic recipe cards when full recipe metadata is not available

* fixed instrucitons on parse

* add last_recipe

* automated testing

* roadmap update

* Sqlite (#75)

* file structure

* auto-test

* take 2

* refactor ap scheduler and startup process

* fixed scraper error

* database abstraction

* database abstraction

* port recipes over to new schema

* meal migration

* start settings migration

* finale mongo port

* backup improvements

* migration imports to new DB structure

* unused import cleanup

* docs strings

* settings and theme import logic

* cleanup

* fixed tinydb error

* requirements

* fuzzy search

* remove scratch file

* sqlalchemy models

* improved search ui

* recipe models almost done

* sql modal population

* del scratch

* rewrite database model mixins

* mostly grabage

* recipe updates

* working sqllite

* remove old files and reorganize

* final cleanup

Co-authored-by: Hayden <hay-kot@pm.me>

* Backup card (#78)

* backup / import dialog

* upgrade to new tag method

* New import card

* rename settings.py to app_config.py

* migrate to poetry for development

* fix failing test

Co-authored-by: Hayden <hay-kot@pm.me>

* added mkdocs to docker-compose

* Translations (#72)

* Translations + danish

* changed back proxy target to use ENV

* Resolved more merge conflicts

* Removed test in translation

* Documentation of translations

* Updated translations

* removed old packages

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>

* fail to start bug fixes

* feature: prep/cook/total time slots (#80)

Co-authored-by: Hayden <hay-kot@pm.me>

* missing bind attributes

* Bug fixes (#81)

* fix: url remains after succesful import

* docs: changelog + update todos

* arm image

* arm compose

* compose updates

* update poetry

* arm support

Co-authored-by: Hayden <hay-kot@pm.me>

* dockerfile hotfix

* dockerfile hotfix

* Version Release Final Touches (#84)

* Remove slim

* bug: opacity issues

* bug: startup failure with no database

* ci/cd on dev branch

* formatting

* v0.1.0 documentation

Co-authored-by: Hayden <hay-kot@pm.me>

* db init hotfix

* bug: fix crash in mongo

* fix mongo bug

* fixed version notifier

* finale changelog

Co-authored-by: kentora <=>
Co-authored-by: Hayden <hay-kot@pm.me>
Co-authored-by: Richard Mitic <richard.h.mitic@gmail.com>
Co-authored-by: kentora <kentora@kentora.dk>

* build container

* webscraper hotfix

* notes hot fix

* bug: mongo updates fail #99

* Fix error message (#101)

* gh funding

* Create Issue Templates (#125)

* Create bug_report.md

* Create config.yml

Included a link to feature requests.

* Update config.yml

Fixed link I had for testing to the actual link

* Update bug_report.md

fix capitalization

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>

Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>

* merge kentors changes

* refactor/recipe routers

* category/tag database relationship and endpoints

* frontend category management

* update branch todos

* bug/normalize recipe steps html

* remove console.log +  refactor categories

* fix categories database errors

* refactor/ router endpoint

* refactor/ remove old code

* drag and drop ingredients

* general cleanup

* route refactoring

* changelog

* api refactoring + random cleanup

* fixed backwards sort

* Update mkdocs.yml (#137)

Fix warning from Deploy Docs github action

* fixed navigate on enter in search

* refactor/create global css

* added category scroll

* cleanup todos

* debug routes

* docs/new gifs & general updates

* cleanup

* fix list test

Co-authored-by: David Young <davidy@funkypenguin.co.nz>
Co-authored-by: Hayden <hay-kot@pm.me>
Co-authored-by: Richard Mitic <richard.h.mitic@gmail.com>
Co-authored-by: kentora <kentora@kentora.dk>
Co-authored-by: Alexei Pesic <pesic.alexei@gmail.com>
Co-authored-by: Andrew <dpieski@gmail.com>
Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>

* fix build

* fix duplicate editor

* fixed docker mount problem

* python 3.9

* added tasks for non-docker development

* remove old scripts

* dev updates

* fixed no image upload option

* get version from backend

* final docs pass

* .gitignore

Co-authored-by: kentora <=>
Co-authored-by: Hayden <hay-kot@pm.me>
Co-authored-by: Richard Mitic <richard.h.mitic@gmail.com>
Co-authored-by: kentora <kentora@kentora.dk>
Co-authored-by: David Young <davidy@funkypenguin.co.nz>
Co-authored-by: Bastien <43323819+Batgame@users.noreply.github.com>
Co-authored-by: sephrat <34862846+sephrat@users.noreply.github.com>
Co-authored-by: Nick CJ <17556895+nickcj931@users.noreply.github.com>
Co-authored-by: dekvall <dkvldev@gmail.com>
Co-authored-by: wengtad <wengtad93@gmail.com>
Co-authored-by: Alexei Pesic <pesic.alexei@gmail.com>
Co-authored-by: Andrew <dpieski@gmail.com>
Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>
This commit is contained in:
Hayden 2021-02-08 09:47:40 -09:00 committed by GitHub
parent 3ec0f2ec21
commit b3573dc078
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
233 changed files with 11756 additions and 2491 deletions

View file

@ -1 +1 @@
VUE_APP_API_BASE_URL=http://10.10.10.12:9921
VUE_APP_API_BASE_URL=http://localhost:9000

View file

@ -1,5 +0,0 @@
{
"cSpell.enableFiletypes": [
"!javascript"
]
}

0
frontend/jsconfig.json Normal file
View file

View file

@ -1966,6 +1966,16 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"cacache": {
"version": "13.0.1",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz",
@ -1992,6 +2002,53 @@
"unique-filename": "^1.1.1"
}
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@ -2008,6 +2065,16 @@
"minipass": "^3.1.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"terser-webpack-plugin": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz",
@ -2024,6 +2091,18 @@
"terser": "^4.6.12",
"webpack-sources": "^1.4.3"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.1.2",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.2.tgz",
"integrity": "sha512-8QTxh+Fd+HB6fiL52iEVLKqE9N1JSlMXLR92Ijm6g8PZrwIxckgpqjPDWRP5TWxdiPaHR+alUWsnu1ShQOwt+Q==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
@ -10175,6 +10254,11 @@
"is-plain-obj": "^1.0.0"
}
},
"sortablejs": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.2.tgz",
"integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
},
"source-list-map": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz",
@ -11521,87 +11605,6 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.1.2",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.2.tgz",
"integrity": "sha512-8QTxh+Fd+HB6fiL52iEVLKqE9N1JSlMXLR92Ijm6g8PZrwIxckgpqjPDWRP5TWxdiPaHR+alUWsnu1ShQOwt+Q==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "3.4.9",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.9.tgz",
@ -11641,6 +11644,14 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true
},
"vuedraggable": {
"version": "2.24.3",
"resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.24.3.tgz",
"integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
"requires": {
"sortablejs": "1.10.2"
}
},
"vuetify": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.4.2.tgz",

View file

@ -17,6 +17,7 @@
"vue": "^2.6.11",
"vue-i18n": "^8.22.4",
"vue-router": "^3.4.9",
"vuedraggable": "^2.24.3",
"vuetify": "^2.4.2",
"vuex": "^3.6.0",
"vuex-persistedstate": "^4.0.0-beta.3"
@ -54,5 +55,11 @@
"> 1%",
"last 2 versions",
"not dead"
]
],
"prettier": {
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": false
}
}

View file

@ -8,6 +8,7 @@
<title> Mealie </title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
<link rel="stylesheet" href="./styles/global.css">
</head>
<body>
<noscript>

View file

@ -0,0 +1,11 @@
*::-webkit-scrollbar {
width: 0.25rem;
}
*::-webkit-scrollbar-track {
background: lightgray;
}
*::-webkit-scrollbar-thumb {
background: grey;
}

View file

@ -1,6 +1,6 @@
<template>
<v-app>
<v-app-bar dense app color="primary" dark class="d-print-none">
<v-app-bar clipped-left dense app color="primary" dark class="d-print-none">
<v-btn @click="$router.push('/')" icon>
<v-icon size="40"> mdi-silverware-variant </v-icon>
</v-btn>
@ -17,7 +17,7 @@
@selected="navigateFromSearch"
/>
</v-expand-x-transition>
<v-btn icon @click="toggleSearch">
<v-btn icon @click="search = !search">
<v-icon>mdi-magnify</v-icon>
</v-btn>
@ -58,6 +58,8 @@ export default {
mounted() {
this.$store.dispatch("initTheme");
this.$store.dispatch("requestRecentRecipes");
this.$store.dispatch("requestHomePageSettings");
this.$store.dispatch("initLang");
this.darkModeSystemCheck();
this.darkModeAddEventListener();
},
@ -84,14 +86,6 @@ export default {
this.darkModeSystemCheck();
});
},
toggleSearch() {
if (this.search === true) {
this.search = false;
} else {
this.search = true;
}
},
navigateFromSearch(slug) {
this.$router.push(`/recipe/${slug}`);
},
@ -100,16 +94,5 @@ export default {
</script>
<style>
/* Scroll Bar PageSettings */
body::-webkit-scrollbar {
width: 0.25rem;
}
body::-webkit-scrollbar-track {
background: grey;
}
body::-webkit-scrollbar-thumb {
background: black;
}
</style>

View file

@ -4,6 +4,9 @@ import mealplan from "./api/mealplan";
import settings from "./api/settings";
import themes from "./api/themes";
import migration from "./api/migration";
import myUtils from "./api/upload";
import category from "./api/category";
import meta from "./api/meta";
// import api from "../api";
@ -14,4 +17,7 @@ export default {
settings: settings,
themes: themes,
migrations: migration,
utils: myUtils,
categories: category,
meta: meta,
};

View file

@ -16,8 +16,8 @@ function processResponse(response) {
}
const apiReq = {
post: async function(url, data) {
let response = await axios.post(url, data).catch(function(error) {
post: async function (url, data) {
let response = await axios.post(url, data).catch(function (error) {
if (error.response) {
processResponse(error.response);
return error.response;
@ -27,8 +27,8 @@ const apiReq = {
return response;
},
get: async function(url, data) {
let response = await axios.get(url, data).catch(function(error) {
put: async function (url, data) {
let response = await axios.put(url, data).catch(function (error) {
if (error.response) {
processResponse(error.response);
return response;
@ -38,8 +38,19 @@ const apiReq = {
return response;
},
delete: async function(url, data) {
let response = await axios.delete(url, data).catch(function(error) {
get: async function (url, data) {
let response = await axios.get(url, data).catch(function (error) {
if (error.response) {
processResponse(error.response);
return response;
} else return;
});
// processResponse(response);
return response;
},
delete: async function (url, data) {
let response = await axios.delete(url, data).catch(function (error) {
if (error.response) {
processResponse(error.response);
return response;

View file

@ -6,10 +6,11 @@ const backupBase = baseURL + "backups/";
const backupURLs = {
// Backup
available: `${backupBase}available/`,
createBackup: `${backupBase}export/database/`,
importBackup: (fileName) => `${backupBase}${fileName}/import/`,
deleteBackup: (fileName) => `${backupBase}${fileName}/delete/`,
available: `${backupBase}available`,
createBackup: `${backupBase}export/database`,
importBackup: (fileName) => `${backupBase}${fileName}/import`,
deleteBackup: (fileName) => `${backupBase}${fileName}/delete`,
downloadBackup: (fileName) => `${backupBase}${fileName}/download`,
};
export default {
@ -28,15 +29,12 @@ export default {
await apiReq.delete(backupURLs.deleteBackup(fileName));
},
async create(tag, template) {
if (typeof template == String) {
template = [template];
}
console.log(tag, template);
let response = apiReq.post(backupURLs.createBackup, {
tag: tag,
template: template,
});
async create(data) {
let response = apiReq.post(backupURLs.createBackup, data);
return response;
},
async download(fileName) {
let response = await apiReq.get(backupURLs.downloadBackup(fileName));
return response.data;
},
};

View file

@ -0,0 +1,25 @@
import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
const prefix = baseURL + "categories";
const categoryURLs = {
get_all: `${prefix}`,
get_category: (category) => `${prefix}/${category}`,
delete_category: (category) => `${prefix}/${category}`,
};
export default {
async get_all() {
let response = await apiReq.get(categoryURLs.get_all);
return response.data;
},
async get_recipes_in_category(category) {
let response = await apiReq.get(categoryURLs.get_category(category));
return response.data;
},
async delete(category) {
let response = await apiReq.delete(categoryURLs.delete_category(category));
return response.data;
},
};

View file

@ -1,16 +1,16 @@
import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
const mealplanBase = baseURL + "meal-plan/";
const prefix = baseURL + "meal-plans/";
const mealPlanURLs = {
// Meals
create: `${mealplanBase}create/`,
today: `${mealplanBase}today/`,
thisWeek: `${mealplanBase}this-week/`,
all: `${mealplanBase}all/`,
delete: (planID) => `${mealplanBase}${planID}/delete/`,
update: (planID) => `${mealplanBase}${planID}/update/`,
all: `${prefix}all`,
create: `${prefix}create`,
thisWeek: `${prefix}this-week`,
update: (planID) => `${prefix}${planID}`,
delete: (planID) => `${prefix}${planID}`,
today: `${prefix}today`,
};
export default {
@ -40,7 +40,7 @@ export default {
},
async update(id, body) {
let response = await apiReq.post(mealPlanURLs.update(id), body);
let response = await apiReq.put(mealPlanURLs.update(id), body);
return response;
},
};

15
frontend/src/api/meta.js Normal file
View file

@ -0,0 +1,15 @@
import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
const prefix = baseURL + "debug";
const debugURLs = {
version: `${prefix}/version`,
};
export default {
async get_version() {
let response = await apiReq.get(debugURLs.version);
return response.data;
},
};

View file

@ -2,42 +2,27 @@ import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
import { store } from "../store/store";
const migrationBase = baseURL + "migration/";
const migrationBase = baseURL + "migrations";
const migrationURLs = {
upload: migrationBase + "upload/",
delete: (file) => `${migrationBase}${file}/delete/`,
chowdownURL: migrationBase + "chowdown/repo/",
nextcloudAvaiable: migrationBase + "nextcloud/available/",
nextcloudImport: (selection) =>
`${migrationBase}nextcloud/${selection}/import/`,
// New
all: migrationBase,
delete: (folder, file) => `${migrationBase}/${folder}/${file}/delete`,
import: (folder, file) => `${migrationBase}/${folder}/${file}/import`,
};
export default {
async migrateChowdown(repoURL) {
let postBody = { url: repoURL };
let response = await apiReq.post(migrationURLs.chowdownURL, postBody);
async getMigrations() {
let response = await apiReq.get(migrationURLs.all);
return response.data;
},
async delete(folder, file) {
let response = await apiReq.delete(migrationURLs.delete(folder, file));
return response.data;
},
async import(folder, file) {
let response = await apiReq.post(migrationURLs.import(folder, file));
store.dispatch("requestRecentRecipes");
return response.data;
},
async getNextcloudImports() {
let response = await apiReq.get(migrationURLs.nextcloudAvaiable);
return response.data;
},
async importNextcloud(selected) {
let response = await apiReq.post(migrationURLs.nextcloudImport(selected));
return response.data;
},
async uploadFile(form_data) {
let response = await apiReq.post(migrationURLs.upload, form_data, {
headers: {
"Content-Type": "multipart/form-data",
},
});
return response.data;
},
async delete(file_folder_name) {
let response = await apiReq.delete(migrationURLs.delete(file_folder_name));
return response.data;
},
};

View file

@ -4,18 +4,17 @@ import { store } from "../store/store";
import { router } from "../main";
import qs from "qs";
const recipeBase = baseURL + "recipe/";
const prefix = baseURL + "recipes/";
const recipeURLs = {
// Recipes
allRecipes: baseURL + "all-recipes/",
recipe: (slug) => recipeBase + slug + "/",
recipeImage: (slug) => recipeBase + "image/" + slug + "/",
createByURL: recipeBase + "create-url/",
create: recipeBase + "create/",
updateImage: (slug) => `${recipeBase}${slug}/update/image/`,
update: (slug) => `${recipeBase}${slug}/update/`,
delete: (slug) => `${recipeBase}${slug}/delete/`,
allRecipes: baseURL + "recipes",
create: prefix + "create",
createByURL: prefix + "create-url",
recipe: (slug) => prefix + slug,
update: (slug) => prefix + slug,
delete: (slug) => prefix + slug,
recipeImage: (slug) => `${prefix}${slug}/image`,
updateImage: (slug) => `${prefix}${slug}/image`,
};
export default {
@ -43,7 +42,7 @@ export default {
fd.append("image", fileObject);
fd.append("extension", fileObject.name.split(".").pop());
let response = apiReq.post(recipeURLs.updateImage(recipeSlug), fd);
let response = apiReq.put(recipeURLs.updateImage(recipeSlug), fd);
return response;
},
@ -51,7 +50,7 @@ export default {
async update(data) {
const recipeSlug = data.slug;
let response = await apiReq.post(recipeURLs.update(recipeSlug), data);
let response = await apiReq.put(recipeURLs.update(recipeSlug), data);
store.dispatch("requestRecentRecipes");
return response.data;
},

View file

@ -1,12 +1,12 @@
import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
const settingsBase = baseURL + "site-settings/";
const settingsBase = baseURL + "site-settings";
const settingsURLs = {
siteSettings: `${settingsBase}`,
updateSiteSettings: `${settingsBase}update/`,
testWebhooks: `${settingsBase}webhooks/test/`,
updateSiteSettings: `${settingsBase}`,
testWebhooks: `${settingsBase}/webhooks/test`,
};
export default {
@ -21,7 +21,7 @@ export default {
},
async update(body) {
let response = await apiReq.post(settingsURLs.updateSiteSettings, body);
let response = await apiReq.put(settingsURLs.updateSiteSettings, body);
return response.data;
},
};

View file

@ -1,14 +1,14 @@
import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
const themesBase = baseURL + "site-settings/";
const prefix = baseURL + "themes/";
const settingsURLs = {
allThemes: `${themesBase}themes/`,
specificTheme: (themeName) => `${themesBase}themes/${themeName}/`,
createTheme: `${themesBase}themes/create/`,
updateTheme: (themeName) => `${themesBase}themes/${themeName}/update/`,
deleteTheme: (themeName) => `${themesBase}themes/${themeName}/delete/`,
allThemes: `${baseURL}themes`,
specificTheme: (themeName) => `${prefix}themes/${themeName}`,
createTheme: `${prefix}themes/create`,
updateTheme: (themeName) => `${prefix}themes/${themeName}`,
deleteTheme: (themeName) => `${prefix}themes/${themeName}`,
};
export default {
@ -32,7 +32,7 @@ export default {
name: themeName,
colors: colors,
};
let response = await apiReq.post(settingsURLs.updateTheme(themeName), body);
let response = await apiReq.put(settingsURLs.updateTheme(themeName), body);
return response.data;
},

View file

@ -0,0 +1,13 @@
import { apiReq } from "./api-utils";
export default {
// import api from "../api";
async uploadFile(url, fileObject) {
let response = await apiReq.post(url, fileObject, {
headers: {
"Content-Type": "multipart/form-data",
},
});
return response.data;
},
};

View file

@ -1,10 +1,6 @@
<template>
<v-row>
<MealSelect
:forceDialog="dialog"
@close="dialog = false"
@select="setSlug($event)"
/>
<SearchDialog ref="mealselect" @select="setSlug" />
<v-col
cols="12"
sm="12"
@ -19,10 +15,10 @@
<v-img
height="200"
:src="getImage(meal.slug)"
@click="selectRecipe(index)"
@click="openSearch(index)"
></v-img>
<v-card-title class="my-n3 mb-n6">{{ meal.dateText }}</v-card-title>
<v-card-subtitle> {{ meal.slug }}</v-card-subtitle>
<v-card-subtitle> {{ meal.name }}</v-card-subtitle>
</v-card>
</v-hover>
</v-col>
@ -31,10 +27,10 @@
<script>
import utils from "../../utils";
import MealSelect from "./MealSelect";
import SearchDialog from "../UI/SearchDialog";
export default {
components: {
MealSelect,
SearchDialog,
},
props: {
value: Array,
@ -44,7 +40,6 @@ export default {
recipeData: [],
cardData: [],
activeIndex: 0,
dialog: false,
};
},
methods: {
@ -53,20 +48,14 @@ export default {
return utils.getImageURL(slug);
}
},
setSlug(slug) {
setSlug(name, slug) {
let index = this.activeIndex;
this.value[index]["slug"] = slug;
this.value[index]["name"] = name;
},
selectRecipe(index) {
openSearch(index) {
this.activeIndex = index;
this.dialog = true;
},
getProperty(index, property) {
try {
return this.recipeData[index][property];
} catch {
return null;
}
this.$refs.mealselect.open();
},
},
};

View file

@ -1,13 +1,17 @@
<template>
<v-card>
<v-card-title class="headline"> {{$t('meal-plan.edit-meal-plan')}} </v-card-title>
<v-card-title class="headline">
{{ $t("meal-plan.edit-meal-plan") }}
</v-card-title>
<v-divider></v-divider>
<v-card-text>
<MealPlanCard v-model="mealPlan.meals" />
<v-row align="center" justify="end">
<v-card-actions>
<v-btn color="success" text @click="update"> {{$t('general.update')}} </v-btn>
<v-btn color="success" text @click="update">
{{ $t("general.update") }}
</v-btn>
<v-spacer></v-spacer>
</v-card-actions>
</v-row>

View file

@ -1,7 +1,7 @@
<template>
<v-card>
<v-card-title class="headline">
{{$t('meal-plan.create-a-new-meal-plan')}}
{{ $t("meal-plan.create-a-new-meal-plan") }}
</v-card-title>
<v-divider></v-divider>
<v-card-text>
@ -71,9 +71,11 @@
<v-row align="center" justify="end">
<v-card-actions>
<v-btn color="success" @click="random" v-if="meals[1]" text>
{{$t('general.random')}}
{{ $t("general.random") }}
</v-btn>
<v-btn color="success" @click="save" text>
{{ $t("general.save") }}
</v-btn>
<v-btn color="success" @click="save" text> {{$t('general.save')}} </v-btn>
<v-spacer></v-spacer>
<v-btn icon @click="show = !show"> </v-btn>
@ -149,11 +151,13 @@ export default {
methods: {
get_random(list) {
const object = list[Math.floor(Math.random() * list.length)];
return object.slug;
return object;
},
random() {
this.meals.forEach((element, index) => {
this.meals[index]["slug"] = this.get_random(this.items);
let recipe = this.get_random(this.items);
this.meals[index]["slug"] = recipe.slug;
this.meals[index]["name"] = recipe.name;
});
},
processTime(index) {

View file

@ -1,100 +0,0 @@
<template>
<v-row justify="center">
<v-dialog v-model="dialog" persistent max-width="800">
<v-card>
<v-card-title class="headline"> {{$t('meal-plan.choose-a-recipe')}} </v-card-title>
<v-card-text>
<v-autocomplete
:items="availableRecipes"
v-model="selected"
clearable
return
dense
hide-details
hide-selected
item-text="slug"
:label="$t('search.search-for-a-recipe')"
single-line
>
<template v-slot:no-data>
<v-list-item>
<v-list-item-title :v-html="$t('search.search-for-your-favorite-recipe')">
</v-list-item-title>
</v-list-item>
</template>
<template v-slot:item="{ item }">
<v-row align="center" @click="dialog = false">
<v-col sm="2">
<v-img
max-height="100"
max-width="100"
:src="getImage(item.image)"
></v-img>
</v-col>
<v-col sm="10">
<h3>
{{ item.name }}
</h3>
</v-col>
</v-row>
</template>
</v-autocomplete>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="secondary" text @click="dialog = false"> {{$t('general.close')}} </v-btn>
<v-btn color="secondary" text @click="dialog = false"> {{$t('general.select')}} </v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
</template>
<script>
import utils from "../../utils";
export default {
props: {
forceDialog: Boolean,
},
data() {
return {
dialog: false,
selected: "",
};
},
watch: {
forceDialog() {
this.dialog = this.forceDialog;
},
selected() {
if (this.selected) {
this.$emit("select", this.selected);
}
},
dialog() {
if (this.dialog === false) {
this.$emit("close");
} else {
this.selected = "";
}
},
},
computed: {
availableRecipes() {
return this.$store.getters.getRecentRecipes;
},
},
methods: {
getImage(slug) {
return utils.getImageURL(slug);
},
},
};
</script>
<style>
</style>

View file

@ -2,11 +2,11 @@
<div class="text-center">
<v-dialog v-model="dialog" width="700">
<template v-slot:activator="{ on, attrs }">
<v-btn color="accent" dark v-bind="attrs" v-on="on"> API Extras </v-btn>
<v-btn color="accent" dark v-bind="attrs" v-on="on"> {{ $t("recipe.api-extras") }} </v-btn>
</template>
<v-card>
<v-card-title> API Extras </v-card-title>
<v-card-title> {{ $t("recipe.api-extras") }} </v-card-title>
<v-card-text :key="formKey">
<v-row
@ -28,14 +28,14 @@
</v-col>
<v-col cols="12" md="3" sm="6">
<v-text-field
label="Object Key"
:label="$t('recipe.object-key')"
:value="key"
@input="updateKey(index)"
>
</v-text-field>
</v-col>
<v-col cols="12" md="8" sm="6">
<v-text-field label="Object Value" v-model="extras[key]">
<v-text-field :label="$t('recipe.object-value')" v-model="extras[key]">
</v-text-field>
</v-col>
</v-row>
@ -46,17 +46,17 @@
<v-card-actions>
<v-form ref="addKey">
<v-text-field
label="New Key Name"
:label="$t('recipe.new-key-name')"
v-model="newKeyName"
class="pr-4"
:rules="[rules.required, rules.whiteSpace]"
></v-text-field>
</v-form>
<v-btn color="info" text @click="append"> Add Key</v-btn>
<v-btn color="info" text @click="append"> {{ $t("recipe.add-key") }} </v-btn>
<v-spacer></v-spacer>
<v-btn color="success" text @click="save"> Save </v-btn>
<v-btn color="success" text @click="save"> {{ $t("general.save") }} </v-btn>
</v-card-actions>
</v-card>
</v-dialog>
@ -74,9 +74,9 @@ export default {
dialog: false,
formKey: 1,
rules: {
required: (v) => !!v || "Key Name Required",
required: (v) => !!v || this.$i18n.t("recipe.key-name-required"),
whiteSpace: (v) =>
!v || v.split(" ").length <= 1 || "No White Space Allowed",
!v || v.split(" ").length <= 1 || this.$i18n.t("recipe.no-white-space-allowed"),
},
};
},

View file

@ -1,5 +1,5 @@
<template>
<div>
<v-form ref="form">
<v-card-text>
<v-row dense>
<v-col cols="3"></v-col>
@ -12,35 +12,47 @@
></v-file-input>
</v-col>
<v-col cols="3"></v-col>
<v-row>
<v-col>
<v-text-field
label="Total Time"
v-model="value.totalTime"
></v-text-field>
</v-col>
<v-col
><v-text-field
label="Prep Time"
v-model="value.prepTime"
></v-text-field
></v-col>
<v-col
><v-text-field
label="Cook Time / Perform Time"
v-model="value.performTime"
></v-text-field
></v-col>
</v-row>
</v-row>
<v-text-field class="my-3" :label="$t('recipe.recipe-name')" v-model="value.name">
<v-row dense>
<v-col>
<v-text-field
:label="$t('recipe.total-time')"
v-model="value.totalTime"
></v-text-field>
</v-col>
<v-col
><v-text-field
:label="$t('recipe.prep-time')"
v-model="value.prepTime"
></v-text-field
></v-col>
<v-col
><v-text-field
:label="$t('recipe.perform-time')"
v-model="value.performTime"
></v-text-field
></v-col>
</v-row>
<v-text-field
class="my-3"
:label="$t('recipe.recipe-name')"
v-model="value.name"
:rules="[rules.required]"
>
</v-text-field>
<v-textarea height="100" :label="$t('recipe.description')" v-model="value.description">
<v-textarea
height="100"
:label="$t('recipe.description')"
v-model="value.description"
>
</v-textarea>
<div class="my-2"></div>
<v-row dense disabled>
<v-col sm="5">
<v-text-field :label="$t('recipe.servings')" v-model="value.recipeYield">
<v-text-field
:label="$t('recipe.servings')"
v-model="value.recipeYield"
>
</v-text-field>
</v-col>
<v-col></v-col>
@ -54,34 +66,50 @@
</v-row>
<v-row>
<v-col cols="12" sm="12" md="4" lg="4">
<h2 class="mb-4">{{$t('recipe.ingredients')}}</h2>
<div
v-for="(ingredient, index) in value.recipeIngredient"
:key="generateKey('ingredient', index)"
<h2 class="mb-4">{{ $t("recipe.ingredients") }}</h2>
<draggable
v-model="value.recipeIngredient"
@start="drag = true"
@end="drag = false"
>
<v-row align="center">
<v-btn
fab
x-small
color="white"
class="mr-2"
elevation="0"
@click="removeIngredient(index)"
<transition-group
type="transition"
:name="!drag ? 'flip-list' : null"
>
<div
v-for="(ingredient, index) in value.recipeIngredient"
:key="generateKey('ingredient', index)"
>
<v-icon color="error">mdi-delete</v-icon>
</v-btn>
<v-text-field
:label="$t('recipe.ingredient')"
v-model="value.recipeIngredient[index]"
></v-text-field>
</v-row>
</div>
<v-row align="center">
<v-text-field
class="mr-2"
:label="$t('recipe.ingredient')"
v-model="value.recipeIngredient[index]"
append-outer-icon="mdi-menu"
mdi-move-resize
solo
dense
>
<v-icon
class="mr-n1"
slot="prepend"
color="error"
@click="removeIngredient(index)"
>
mdi-delete
</v-icon>
</v-text-field>
</v-row>
</div>
</transition-group>
</draggable>
<v-btn color="secondary" fab dark small @click="addIngredient">
<v-icon>mdi-plus</v-icon>
</v-btn>
<BulkAdd @bulk-data="appendIngredients" />
<h2 class="mt-6">{{$t('recipe.categories')}}</h2>
<h2 class="mt-6">{{ $t("recipe.categories") }}</h2>
<v-combobox
dense
multiple
@ -89,6 +117,11 @@
item-color="secondary"
deletable-chips
v-model="value.categories"
hide-selected
:items="categories"
text="name"
:search-input.sync="categoriesSearchInput"
@change="categoriesSearchInput = ''"
>
<template v-slot:selection="data">
<v-chip
@ -103,8 +136,18 @@
</template>
</v-combobox>
<h2 class="mt-4">{{$t('recipe.tags')}}</h2>
<v-combobox dense multiple chips deletable-chips v-model="value.tags">
<h2 class="mt-4">{{ $t("recipe.tags") }}</h2>
<v-combobox
dense
multiple
chips
deletable-chips
v-model="value.tags"
hide-selected
:items="tags"
:search-input.sync="tagsSearchInput"
@change="tagssSearchInput = ''"
>
<template v-slot:selection="data">
<v-chip
:input-value="data.selected"
@ -118,7 +161,7 @@
</template>
</v-combobox>
<h2 class="my-4">{{$t('recipe.notes')}}</h2>
<h2 class="my-4">{{ $t("recipe.notes") }}</h2>
<v-card
class="mt-1"
v-for="(note, index) in value.notes"
@ -137,12 +180,15 @@
<v-icon color="error">mdi-delete</v-icon>
</v-btn>
<v-text-field
label="Title"
:label="$t('recipe.title')"
v-model="value.notes[index]['title']"
></v-text-field>
</v-row>
<v-textarea :label="$t('recipe.note')" v-model="value.notes[index]['text']">
<v-textarea
:label="$t('recipe.note')"
v-model="value.notes[index]['text']"
>
</v-textarea>
</v-card-text>
</v-card>
@ -155,7 +201,7 @@
<v-divider class="my-divider" :vertical="true"></v-divider>
<v-col cols="12" sm="12" md="8" lg="8">
<h2 class="mb-4">{{$t('recipe.instructions')}}</h2>
<h2 class="mb-4">{{ $t("recipe.instructions") }}</h2>
<div v-for="(step, index) in value.recipeInstructions" :key="index">
<v-hover v-slot="{ hover }">
<v-card
@ -173,7 +219,9 @@
@click="removeStep(index)"
>
<v-icon color="error">mdi-delete</v-icon> </v-btn
>{{ $t('recipe.step-index', {step: index + 1}) }}</v-card-title
>{{
$t("recipe.step-index", { step: index + 1 })
}}</v-card-title
>
<v-card-text>
<v-textarea
@ -189,13 +237,19 @@
<v-icon>mdi-plus</v-icon>
</v-btn>
<BulkAdd @bulk-data="appendSteps" />
<v-text-field
v-model="value.orgURL"
class="mt-10"
:label="$t('recipe.original-url')"
></v-text-field>
</v-col>
</v-row>
</v-card-text>
</div>
</v-form>
</template>
<script>
import draggable from "vuedraggable";
import api from "../../../api";
import utils from "../../../utils";
import BulkAdd from "./BulkAdd";
@ -204,16 +258,36 @@ export default {
components: {
BulkAdd,
ExtrasEditor,
draggable,
},
props: {
value: Object,
},
data() {
return {
drag: false,
fileObject: null,
rules: {
required: v => !!v || this.$i18n.t("recipe.key-name-required"),
whiteSpace: v =>
!v ||
v.split(" ").length <= 1 ||
this.$i18n.t("recipe.no-white-space-allowed"),
},
categoriesSearchInput: "",
tagsSearchInput: "",
categories: [],
tags: [],
};
},
mounted() {
this.getCategories();
},
methods: {
async getCategories() {
let response = await api.categories.get_all();
this.categories = response.map(cat => cat.name);
},
uploadImage() {
this.$emit("upload", this.fileObject);
},
@ -259,7 +333,7 @@ export default {
appendSteps(steps) {
let processSteps = [];
steps.forEach((element) => {
steps.forEach(element => {
processSteps.push({ text: element });
});
@ -289,6 +363,13 @@ export default {
saveExtras(extras) {
this.value.extras = extras;
},
validateRecipe() {
if (this.$refs.form.validate()) {
return true;
} else {
return false;
}
},
},
};
</script>

View file

@ -20,7 +20,7 @@
v-if="totalTime"
></v-divider>
<v-col v-if="totalTime">
<div><strong> Total Time </strong></div>
<div><strong> {{ $t("recipe.total-time") }} </strong></div>
<div>{{ totalTime }}</div>
</v-col>
<v-divider
@ -30,7 +30,7 @@
v-if="prepTime"
></v-divider>
<v-col v-if="prepTime">
<div><strong> Prep Time </strong></div>
<div><strong> {{ $t("recipe.prep-time") }} </strong></div>
<div>{{ prepTime }}</div>
</v-col>
<v-divider
@ -40,7 +40,7 @@
v-if="performTime"
></v-divider>
<v-col v-if="performTime">
<div><strong> Cook Time </strong></div>
<div><strong> {{ $t("recipe.perform-time") }} </strong></div>
<div>{{ performTime }}</div>
</v-col>
</v-row>

View file

@ -121,7 +121,7 @@
target="_blank"
class="rounded-sm mr-4"
>
{{$t('recipe.original-recipe')}}
{{$t('recipe.original-url')}}
</v-btn>
</v-row>
</v-card-text>

View file

@ -0,0 +1,90 @@
<template>
<div>
<ImportDialog
:name="selectedName"
:date="selectedDate"
ref="import_dialog"
@import="importBackup"
@delete="deleteBackup"
/>
<v-row>
<v-col
:sm="6"
:md="6"
:lg="4"
:xl="4"
v-for="backup in backups"
:key="backup.name"
>
<v-card hover outlined @click="openDialog(backup)">
<v-card-text>
<v-row align="center">
<v-col cols="12" sm="2">
<v-icon large color="primary"> mdi-backup-restore </v-icon>
</v-col>
<v-col cols="12" sm="10">
<div>
<strong>{{ backup.name }}</strong>
</div>
<div>{{ readableTime(backup.date) }}</div>
</v-col>
</v-row>
</v-card-text>
</v-card>
</v-col>
</v-row>
</div>
</template>
<script>
import ImportDialog from "./ImportDialog";
import api from "../../../api";
import utils from "../../../utils";
export default {
props: {
backups: Array,
},
components: {
ImportDialog,
},
data() {
return {
selectedName: "",
selectedDate: "",
loading: false,
};
},
methods: {
openDialog(backup) {
this.selectedDate = this.readableTime(backup.date);
this.selectedName = backup.name;
this.$refs.import_dialog.open();
},
readableTime(timestamp) {
let date = new Date(timestamp);
return utils.getDateAsText(date);
},
async importBackup(data) {
this.$emit("loading");
let response = await api.backups.import(data.name, data);
let failed = response.data.failed;
let succesful = response.data.successful;
this.$emit("finished", succesful, failed);
},
deleteBackup(data) {
this.$emit("loading");
api.backups.delete(data.name);
this.selectedBackup = null;
this.backupLoading = false;
this.$emit("finished");
},
},
};
</script>
<style>
</style>

View file

@ -65,15 +65,15 @@
<v-divider></v-divider>
<v-card-actions>
<v-btn disabled color="success" text @click="raiseEvent('download')">
{{$t('general.download')}}
<v-btn color="accent" text :href="`/api/backups/${name}/download`">
{{ $t("general.download") }}
</v-btn>
<v-spacer></v-spacer>
<v-btn color="error" text @click="raiseEvent('delete')">
{{$t('general.delete')}}
{{ $t("general.delete") }}
</v-btn>
<v-btn color="success" text @click="raiseEvent('import')">
{{$t('general.import')}}
<v-btn color="success" outlined @click="raiseEvent('import')">
{{ $t("general.import") }}
</v-btn>
</v-card-actions>
</v-card>

View file

@ -0,0 +1,123 @@
<template>
<v-card :loading="loading">
<v-card-title> {{ $t("settings.backup.create-heading") }} </v-card-title>
<v-card-text class="mt-n3">
<v-text-field
dense
:label="$t('settings.backup.backup-tag')"
v-model="tag"
></v-text-field>
</v-card-text>
<v-card-actions class="mt-n9">
<v-switch v-model="fullBackup" :label="switchLabel"></v-switch>
<v-spacer></v-spacer>
<v-btn color="success" text @click="createBackup()">
{{ $t("general.create") }}
</v-btn>
</v-card-actions>
<v-card-text v-if="!fullBackup" class="mt-n6">
<v-row>
<v-col sm="4">
<p>{{ $t("general.options") }}:</p>
<v-checkbox
v-for="option in options"
:key="option.text"
class="mb-n4 mt-n3"
dense
:label="option.text"
v-model="option.value"
></v-checkbox>
</v-col>
<v-col>
<p>{{ $t("general.templates") }}:</p>
<v-checkbox
v-for="template in availableTemplates"
:key="template"
class="mb-n4 mt-n3"
dense
:label="template"
@click="appendTemplate(template)"
></v-checkbox>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
<script>
import api from "../../../api";
export default {
data() {
return {
tag: null,
fullBackup: true,
loading: false,
options: {
recipes: {
value: true,
text: this.$t("general.recipes"),
},
settings: {
value: true,
text: this.$t("general.settings"),
},
themes: {
value: true,
text: this.$t("general.themes"),
},
},
availableTemplates: [],
selectedTemplates: [],
};
},
mounted() {
this.getAvailableBackups();
},
computed: {
switchLabel() {
if (this.fullBackup) {
return this.$t("settings.backup.full-backup");
} else return this.$t("settings.backup.partial-backup");
},
},
methods: {
async getAvailableBackups() {
let response = await api.backups.requestAvailable();
response.templates.forEach((element) => {
this.availableTemplates.push(element);
});
},
async createBackup() {
this.loading = true;
let data = {
tag: this.tag,
options: {
recipes: this.options.recipes.value,
settings: this.options.settings.value,
themes: this.options.themes.value,
},
templates: this.selectedTemplates,
};
await api.backups.create(data);
this.loading = false;
this.$emit("created");
},
appendTemplate(templateName) {
if (this.selectedTemplates.includes(templateName)) {
let index = this.selectedTemplates.indexOf(templateName);
if (index !== -1) {
this.selectedTemplates.splice(index, 1);
}
} else this.selectedTemplates.push(templateName);
},
},
};
</script>
<style>
</style>

View file

@ -1,42 +1,44 @@
<template>
<v-card :loading="backupLoading" class="mt-3">
<v-card-title class="headline">
{{$t('settings.backup-and-exports')}}
{{ $t("settings.backup-and-exports") }}
</v-card-title>
<v-divider></v-divider>
<v-card-text>
<p>
{{$t('settings.backup-info')}}
</p>
<v-row dense align="center">
<v-col dense cols="12" sm="12" md="4">
<v-text-field v-model="backupTag" :label="$t('settings.backup-tag')"></v-text-field>
<v-row>
<v-col cols="12" md="6" ss="12">
<NewBackupCard @created="processFinished" />
</v-col>
<v-col cols="12" sm="12" md="3">
<v-combobox
auto-select-first
:label="$t('settings.markdown-template')"
:items="availableTemplates"
v-model="selectedTemplate"
></v-combobox>
</v-col>
<v-col dense cols="12" sm="12" md="2">
<v-btn block text color="accent" @click="createBackup" width="165">
{{$t('settings.backup-recipes')}}
</v-btn>
<v-col cols="12" md="6" sm="12">
<p>
{{ $t("settings.backup-info") }}
</p>
</v-col>
</v-row>
<BackupCard
<v-divider class="my-3"></v-divider>
<v-card-title class="mt-n6">
{{ $t("settings.available-backups") }}
<span>
<UploadBtn
class="mt-1"
url="/api/backups/upload"
@uploaded="getAvailableBackups"
/>
</span>
<v-spacer></v-spacer>
</v-card-title>
<AvailableBackupCard
@loading="backupLoading = true"
@finished="processFinished"
:backups="availableBackups"
/>
<SuccessFailureAlert
success-header="Successfully Imported"
ref="report"
:title="$t('settings.backup.backup-restore-report')"
:success-header="$t('settings.backup.successfully-imported')"
:success="successfulImports"
failed-header="Failed Imports"
:failed-header="$t('settings.backup.failed-imports')"
:failed="failedImports"
/>
</v-card-text>
@ -46,23 +48,23 @@
<script>
import api from "../../../api";
import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
import BackupCard from "./BackupCard";
import UploadBtn from "../../UI/UploadBtn";
import AvailableBackupCard from "./AvailableBackupCard";
import NewBackupCard from "./NewBackupCard";
export default {
components: {
SuccessFailureAlert,
BackupCard,
UploadBtn,
AvailableBackupCard,
NewBackupCard,
},
data() {
return {
failedImports: [],
successfulImports: [],
backupLoading: false,
backupTag: null,
selectedBackup: null,
selectedTemplate: null,
availableBackups: [],
availableTemplates: [],
};
},
mounted() {
@ -85,22 +87,12 @@ export default {
this.backupLoading = false;
}
},
async createBackup() {
this.backupLoading = true;
let response = await api.backups.create(this.backupTag, this.templates);
if (response.status == 201) {
this.selectedBackup = null;
this.getAvailableBackups();
this.backupLoading = false;
}
},
processFinished(successful = null, failed = null) {
this.getAvailableBackups();
this.backupLoading = false;
this.successfulImports = successful;
this.failedImports = failed;
this.$refs.report.open();
},
},
};

View file

@ -0,0 +1,177 @@
<template>
<v-card flat>
<v-card-text>
<h2 class="mt-1 mb-1">Home Page</h2>
<v-row align="center" justify="center" dense class="mb-n7 pb-n5">
<v-col sm="2">
<v-switch v-model="showRecent" label="Show Recent"></v-switch>
</v-col>
<v-col>
<v-slider
class="pt-4"
label="Card Per Section"
v-model="showLimit"
max="30"
dense
color="primary"
min="3"
thumb-label
>
</v-slider>
</v-col>
<v-spacer></v-spacer>
</v-row>
</v-card-text>
<v-card-text>
<v-row>
<v-col>
<v-card outlined min-height="250">
<v-card-text class="pt-2 pb-1">
<h3>Homepage Categories</h3>
</v-card-text>
<v-divider></v-divider>
<v-list
min-height="200"
dense
max-height="200"
style="overflow:auto"
>
<v-list-item-group>
<draggable
v-model="homeCategories"
group="categories"
:style="{
minHeight: `150px`,
}"
>
<v-list-item
v-for="(item, index) in homeCategories"
:key="`${item.name}-${index}`"
>
<v-list-item-icon>
<v-icon>mdi-menu</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title v-text="item.name"></v-list-item-title>
</v-list-item-content>
<v-list-item-icon @click="deleteActiveCategory(index)">
<v-icon>mdi-delete</v-icon>
</v-list-item-icon>
</v-list-item>
</draggable>
</v-list-item-group>
</v-list>
</v-card>
</v-col>
<v-col>
<v-card outlined min-height="250px">
<v-card-text class="pt-2 pb-1">
<h3>
All Categories
<span>
<v-btn absolute right x-small color="success" icon>
<v-icon>mdi-plus</v-icon></v-btn
>
</span>
</h3>
</v-card-text>
<v-divider></v-divider>
<v-list
min-height="200"
dense
max-height="200"
style="overflow:auto"
>
<v-list-item-group>
<draggable
v-model="categories"
group="categories"
:style="{
minHeight: `150px`,
}"
>
<v-list-item
v-for="(item, index) in categories"
:key="`${item.name}-${index}`"
>
<v-list-item-icon>
<v-icon>mdi-menu</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title v-text="item.name"></v-list-item-title>
</v-list-item-content>
<v-list-item-icon
@click="deleteCategoryfromDatabase(item.slug)"
>
<v-icon>mdi-delete</v-icon>
</v-list-item-icon>
</v-list-item>
</draggable>
</v-list-item-group>
</v-list>
</v-card>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="success" @click="saveSettings" class="mr-2">
<v-icon left> mdi-content-save </v-icon>
{{ $t("general.save") }}
</v-btn>
</v-card-actions>
</v-card>
</template>
<script>
import api from "../../../api";
import draggable from "vuedraggable";
export default {
components: {
draggable,
},
data() {
return {
homeCategories: null,
showLimit: null,
showRecent: true,
};
},
mounted() {
this.getOptions();
},
computed: {
categories() {
return this.$store.getters.getCategories;
},
},
methods: {
deleteCategoryfromDatabase(category) {
api.categories.delete(category);
this.$store.dispatch("requestHomePageSettings");
},
getOptions() {
this.showLimit = this.$store.getters.getShowLimit;
this.showRecent = this.$store.getters.getShowRecent;
this.homeCategories = this.$store.getters.getHomeCategories;
},
deleteActiveCategory(index) {
this.homeCategories.splice(index, 1);
},
saveSettings() {
this.homeCategories.forEach((element, index) => {
element.position = index + 1;
});
this.$store.commit("setShowRecent", this.showRecent);
this.$store.commit("setShowLimit", this.showLimit);
this.$store.commit("setHomeCategories", this.homeCategories);
},
},
};
</script>
<style>
</style>

View file

@ -0,0 +1,67 @@
<template>
<v-card>
<v-card-title>
{{ $t("settings.general-settings") }}
<v-spacer></v-spacer>
<span>
<v-btn class="pt-1" text href="/docs">
{{ $t("settings.local-api") }}
<v-icon right>mdi-open-in-new</v-icon>
</v-btn>
</span>
</v-card-title>
<v-divider></v-divider>
<HomePageSettings />
<v-divider></v-divider>
<v-card-text>
<h2 class="mt-1 mb-4">{{ $t("settings.language") }}</h2>
<v-row>
<v-col cols="3">
<v-select
dense
v-model="selectedLang"
:items="langOptions"
item-text="name"
item-value="value"
:label="$t('settings.language')"
>
</v-select>
</v-col>
</v-row>
</v-card-text>
<v-divider></v-divider>
</v-card>
</template>
<script>
import HomePageSettings from "./HomePageSettings";
export default {
components: {
HomePageSettings,
},
data() {
return {
langOptions: [],
selectedLang: "en",
};
},
mounted() {
this.getOptions();
},
watch: {
selectedLang() {
this.$store.commit("setLang", this.selectedLang);
},
},
methods: {
getOptions() {
this.langOptions = this.$store.getters.getAllLangs;
this.selectedLang = this.$store.getters.getActiveLang;
},
},
};
</script>
<style>
</style>

View file

@ -1,72 +0,0 @@
<template>
<v-card-text>
<p>
{{$t('migration.currently-chowdown-via-public-repo-url-is-the-only-supported-type-of-migration')}}
</p>
<v-form ref="form">
<v-row dense align="center">
<v-col cols="12" md="5" sm="5">
<v-text-field
v-model="repo"
:label="$t('migration.chowdown-repo-url')"
:rules="[rules.required]"
>
</v-text-field>
</v-col>
<v-col cols="12" md="4" sm="5">
<v-btn text color="info" @click="importRepo"> {{$t('migration.migrate')}} </v-btn>
</v-col>
</v-row>
</v-form>
<v-alert v-if="failedRecipes[1]" outlined dense type="error">
<h4>{{$t('migration.failed-recipes')}}</h4>
<v-list dense>
<v-list-item v-for="fail in this.failedRecipes" :key="fail">
{{ fail }}
</v-list-item>
</v-list>
</v-alert>
<v-alert v-if="failedImages[1]" outlined dense type="error">
<h4>{{$t('migration.failed-images')}}</h4>
<v-list dense>
<v-list-item v-for="fail in this.failedImages" :key="fail">
{{ fail }}
</v-list-item>
</v-list>
</v-alert>
</v-card-text>
</template>
<script>
import api from "../../../api";
// import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
// import TimePicker from "./Webhooks/TimePicker";
export default {
data() {
return {
processRan: false,
failedImages: [],
failedRecipes: [],
repo: "",
rules: {
required: (v) => !!v || "Selection Required",
},
};
},
methods: {
async importRepo() {
if (this.$refs.form.validate()) {
this.$emit("loading");
let response = await api.migrations.migrateChowdown(this.repo);
this.failedImages = response.failedImages;
this.failedRecipes = response.failedRecipes;
this.$emit("finished");
this.processRan = true;
}
},
},
};
</script>
<style>
</style>

View file

@ -0,0 +1,96 @@
<template>
<v-card class="my-2" :loading="loading">
<v-card-title>
{{ title }}
<v-spacer></v-spacer>
<span>
<UploadBtn
class="mt-1"
:url="`/api/migrations/${folder}/upload`"
@uploaded="$emit('refresh')"
/>
</span>
</v-card-title>
<v-card-text> {{ description }}</v-card-text>
<div v-if="available[0]">
<v-card
outlined
v-for="migration in available"
:key="migration.name"
class="ma-2"
>
<v-card-text>
<v-row align="center">
<v-col cols="12" sm="2">
<v-icon large color="primary"> mdi-import </v-icon>
</v-col>
<v-col cols="12" sm="10">
<div>
<strong>{{ migration.name }}</strong>
</div>
<div>{{ readableTime(migration.date) }}</div>
</v-col>
</v-row>
</v-card-text>
<v-card-actions class="mt-n6">
<v-spacer></v-spacer>
<v-btn color="error" text @click="deleteMigration(migration.name)">
{{ $t("general.delete") }}
</v-btn>
<v-btn color="accent" text @click="importMigration(migration.name)">
{{ $t("general.import") }}
</v-btn>
</v-card-actions>
</v-card>
</div>
<div v-else>
<v-card class="text-center ma-2">
<v-card-text>
{{ $t("migration.no-migration-data-available") }}
</v-card-text>
</v-card>
</div>
<br />
</v-card>
</template>
<script>
import UploadBtn from "../../UI/UploadBtn";
import utils from "../../../utils";
import api from "../../../api";
export default {
props: {
folder: String,
title: String,
description: String,
available: Array,
},
components: {
UploadBtn,
},
data() {
return {
loading: false,
};
},
methods: {
deleteMigration(file_name) {
api.migrations.delete(this.folder, file_name);
this.$emit("refresh");
},
async importMigration(file_name) {
this.loading == true;
let response = await api.migrations.import(this.folder, file_name);
this.$emit("imported", response.successful, response.failed);
this.loading == false;
},
readableTime(timestamp) {
let date = new Date(timestamp);
return utils.getDateAsText(date);
},
},
};
</script>
<style>
</style>

View file

@ -1,101 +0,0 @@
<template>
<v-card-text>
<p>
{{$t('migration.you-can-import-recipes-from-either-a-zip-file-or-a-directory-located-in-the-app-data-migraiton-folder-please-review-the-documentation-to-ensure-your-directory-structure-matches-what-is-expected')}}
</p>
<v-form ref="form">
<v-row align="center">
<v-col cols="12" md="5" sm="12">
<v-select
:items="availableImports"
v-model="selectedImport"
:label="$t('migration.nextcloud-data')"
:rules="[rules.required]"
></v-select>
</v-col>
<v-col cols="12" md="2" sm="12">
<v-btn text color="info" @click="importRecipes"> {{$t('migration.migrate')}} </v-btn>
</v-col>
<v-col cols="12" md="1" sm="12">
<v-btn text color="error" @click="deleteImportValidation">
{{$t('general.delete')}}
</v-btn>
<Confirmation
:title="$t('general.delete-data')"
:message="$t('migration.delete-confirmation')"
color="error"
icon="mdi-alert-circle"
ref="deleteThemeConfirm"
v-on:confirm="deleteImport()"
/>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="5" sm="12">
<UploadMigrationButton @uploaded="getAvaiableImports" />
</v-col>
</v-row>
</v-form>
<SuccessFailureAlert
:success-header="$t('migration.successfully-imported-from-nextcloud')"
:success="successfulImports"
failed-header="$t('migration.failed-imports')"
:failed="failedImports"
/>
</v-card-text>
</template>
<script>
import api from "../../../api";
import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
import UploadMigrationButton from "./UploadMigrationButton";
import Confirmation from "../../UI/Confirmation";
export default {
components: {
SuccessFailureAlert,
UploadMigrationButton,
Confirmation,
},
data() {
return {
successfulImports: [],
failedImports: [],
availableImports: [],
selectedImport: null,
rules: {
required: (v) => !!v || "Selection Required",
},
};
},
async mounted() {
this.getAvaiableImports();
},
methods: {
async getAvaiableImports() {
this.availableImports = await api.migrations.getNextcloudImports();
},
async importRecipes() {
if (this.$refs.form.validate()) {
this.$emit("loading");
let data = await api.migrations.importNextcloud(this.selectedImport);
this.successfulImports = data.successful;
this.failedImports = data.failed;
this.$emit("finished");
}
},
deleteImportValidation() {
if (this.$refs.form.validate()) {
this.$refs.deleteThemeConfirm.open();
}
},
async deleteImport() {
await api.migrations.delete(this.selectedImport);
this.getAvaiableImports();
},
},
};
</script>
<style>
</style>

View file

@ -1,49 +0,0 @@
<template>
<v-form ref="file">
<v-file-input
:loading="loading"
:label="$t('migration.upload-an-archive')"
v-model="file"
accept=".zip"
@change="upload"
:prepend-icon="icon"
class="file-icon"
>
</v-file-input>
</v-form>
</template>
<script>
import api from "../../../api";
export default {
data() {
return {
file: null,
loading: false,
icon: "mdi-paperclip",
};
},
methods: {
async upload() {
if (this.file != null) {
this.loading = true;
let formData = new FormData();
formData.append("archive", this.file);
await api.migrations.uploadFile(formData);
this.loading = false;
this.$emit("uploaded");
this.file = null;
this.icon = "mdi-check";
}
},
},
};
</script>
<style>
.file-icon {
transition-duration: 5s;
}
</style>

View file

@ -1,44 +1,96 @@
<template>
<v-card :loading="loading">
<v-card-title class="headline"> {{$t('migration.recipe-migration')}} </v-card-title>
<v-divider></v-divider>
<div>
<SuccessFailureAlert
:title="$t('migration.migration-report')"
ref="report"
:failedHeader="$t('migration.failed-imports')"
:failed="failed"
:successHeader="$t('migration.successful-imports')"
:success="success"
/>
<v-card :loading="loading">
<v-card-title class="headline">
{{ $t("migration.recipe-migration") }}
</v-card-title>
<v-divider></v-divider>
</v-card>
<v-tabs v-model="tab">
<v-tab>Chowdown</v-tab>
<v-tab>Nextcloud Recipes</v-tab>
<v-tab-item>
<ChowdownCard @loading="loading = true" @finished="finished" />
</v-tab-item>
<v-tab-item>
<NextcloudCard @loading="loading = true" @finished="finished" />
</v-tab-item>
</v-tabs>
</v-card>
<v-row dense>
<v-col
:sm="12"
:md="6"
:lg="4"
:xl="3"
v-for="migration in migrations"
:key="migration.title"
>
<MigrationCard
:title="migration.title"
:folder="migration.urlVariable"
:description="migration.description"
:available="migration.availableImports"
@refresh="getAvailableMigrations"
@imported="showReport"
/>
</v-col>
</v-row>
</div>
</template>
<script>
import ChowdownCard from "./ChowdownCard";
import NextcloudCard from "./NextcloudCard";
// import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
// import TimePicker from "./Webhooks/TimePicker";
import MigrationCard from "./MigrationCard";
import SuccessFailureAlert from "../../UI/SuccessFailureAlert";
import api from "../../../api";
export default {
components: {
ChowdownCard,
NextcloudCard,
MigrationCard,
SuccessFailureAlert,
},
data() {
return {
tab: null,
loading: false,
success: [],
failed: [],
migrations: {
nextcloud: {
title: this.$t("migration.nextcloud.title"),
description: this.$t("migration.nextcloud.description"),
urlVariable: "nextcloud",
availableImports: [],
},
chowdown: {
title: this.$t("migration.chowdown.title"),
description: this.$t("migration.chowdown.description"),
urlVariable: "chowdown",
availableImports: [],
},
},
};
},
mounted() {
this.getAvailableMigrations();
},
methods: {
finished() {
this.loading = false;
this.$store.dispatch("requestRecentRecipes");
},
async getAvailableMigrations() {
let response = await api.migrations.getMigrations();
response.forEach((element) => {
if (element.type === "nextcloud") {
this.migrations.nextcloud.availableImports = element.files;
} else if (element.type === "chowdown") {
this.migrations.chowdown.availableImports = element.files;
}
});
},
showReport(successful, failed) {
this.success = successful;
this.failed = failed;
this.$refs.report.open();
},
},
};
</script>

View file

@ -1,36 +1,28 @@
<template>
<div>
<v-btn block :color="value" @click="dialog = true">
{{ buttonText }}
</v-btn>
<v-dialog v-model="dialog" width="400">
<v-card>
<v-card-title> {{ buttonText }} {{$t('settings.color')}} </v-card-title>
<v-card-text>
<v-text-field v-model="color"> </v-text-field>
<v-row>
<v-col></v-col>
<v-col>
<v-color-picker
dot-size="28"
hide-inputs
hide-mode-switch
mode="hexa"
:show-swatches="swatches"
swatches-max-height="300"
v-model="color"
@change="updateColor"
></v-color-picker>
</v-col>
<v-col></v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-btn text @click="toggleSwatches"> {{$t('settings.swatches')}} </v-btn>
<v-btn text @click="dialog = false"> {{$t('general.select')}} </v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<div class="text-center">
<h3>{{ buttonText }}</h3>
</div>
<v-text-field v-model="color" hide-details class="ma-0 pa-0" solo>
<template v-slot:append>
<v-menu
v-model="menu"
top
nudge-bottom="105"
nudge-left="16"
:close-on-content-click="false"
>
<template v-slot:activator="{ on }">
<div :style="swatchStyle" v-on="on" swatches-max-height="300" />
</template>
<v-card>
<v-card-text class="pa-0">
<v-color-picker v-model="color" flat show-swatches />
</v-card-text>
</v-card>
</v-menu>
</template>
</v-text-field>
</div>
</template>
@ -44,21 +36,30 @@ export default {
return {
dialog: false,
swatches: false,
color: "#FF00FF",
color: "#1976D2",
mask: "!#XXXXXXXX",
menu: false,
};
},
computed: {
swatchStyle() {
const { value, menu } = this;
return {
backgroundColor: value,
cursor: "pointer",
height: "30px",
width: "30px",
borderRadius: menu ? "50%" : "4px",
transition: "border-radius 200ms ease-in-out",
};
},
},
watch: {
color() {
this.updateColor();
},
},
methods: {
toggleSwatches() {
if (this.swatches) {
this.swatches = false;
} else this.swatches = true;
},
updateColor() {
this.$emit("input", this.color);
},

View file

@ -6,7 +6,7 @@
<v-card-title> {{$t('settings.add-a-new-theme')}} </v-card-title>
<v-card-text>
<v-text-field
label="Theme Name"
:label="$t('settings.theme.theme-name')"
v-model="themeName"
:rules="[rules.required]"
></v-text-field>
@ -34,7 +34,7 @@ export default {
dialog: false,
themeName: "",
rules: {
required: (val) => !!val || "Required.",
required: (val) => !!val || this.$t("settings.theme.theme-name-is-required"),
},
};
},

View file

@ -21,7 +21,9 @@
mandatory
@change="setStoresDarkMode"
>
<v-btn value="system"> Default to system </v-btn>
<v-btn value="system">
{{ $t("settings.theme.default-to-system") }}
</v-btn>
<v-btn value="light"> {{ $t("settings.theme.light") }} </v-btn>
@ -43,7 +45,7 @@
<v-form ref="form" lazy-validation>
<v-row dense align="center">
<v-col cols="12" md="4" sm="3">
<v-col md="4" sm="3">
<v-select
:label="$t('settings.theme.saved-color-theme')"
:items="availableThemes"
@ -56,13 +58,13 @@
>
</v-select>
</v-col>
<v-col cols="12" sm="1">
<NewThemeDialog @new-theme="appendTheme" />
</v-col>
<v-col cols="12" sm="1">
<v-btn text color="error" @click="deleteSelectedThemeValidation">
Delete
</v-btn>
<v-col>
<v-btn-toggle group class="mt-n5">
<NewThemeDialog @new-theme="appendTheme" class="mt-1" />
<v-btn text color="error" @click="deleteSelectedThemeValidation">
{{ $t("general.delete") }}
</v-btn>
</v-btn-toggle>
<Confirmation
:title="$t('settings.theme.delete-theme')"
:message="
@ -74,6 +76,7 @@
v-on:confirm="deleteSelectedTheme()"
/>
</v-col>
<v-spacer></v-spacer>
</v-row>
</v-form>
<v-row dense align-content="center" v-if="selectedTheme.colors">
@ -123,15 +126,11 @@
</v-card-text>
<v-card-actions>
<v-row>
<v-col> </v-col>
<v-col></v-col>
<v-col align="end">
<v-btn text color="success" @click="saveThemes">
{{ $t("settings.theme.save-colors-and-apply-theme") }}
</v-btn>
</v-col>
</v-row>
<v-spacer></v-spacer>
<v-btn color="success" @click="saveThemes" class="mr-2">
<v-icon left> mdi-content-save </v-icon>
{{ $t("general.save") }}
</v-btn>
</v-card-actions>
</v-card>
</template>

View file

@ -1,25 +1,30 @@
<template>
<v-card>
<v-card-title class="headline">
{{$t('settings.webhooks.meal-planner-webhooks')}}
{{ $t("settings.webhooks.meal-planner-webhooks") }}
</v-card-title>
<v-card-text>
<p v-html="$t('settings.webhooks.the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at', {time: time})"></p>
<p>
{{
$t(
"settings.webhooks.the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at"
)
}}
<strong>{{ time }}</strong>
</p>
<v-row dense align="center">
<v-col cols="12" md="2" sm="5">
<v-switch
v-model="enabled"
inset
:label="$t('general.enabled')"
class="my-n3"
></v-switch>
<v-switch v-model="enabled" :label="$t('general.enabled')"></v-switch>
</v-col>
<v-col cols="12" md="3" sm="5">
<TimePickerDialog @save-time="saveTime" />
</v-col>
<v-col cols="12" md="4" sm="5">
<v-btn text color="info" @click="testWebhooks"> {{$t('settings.webhooks.test-webhooks')}} </v-btn>
<v-btn text color="info" @click="testWebhooks">
<v-icon left> mdi-webhook </v-icon>
{{ $t("settings.webhooks.test-webhooks") }}
</v-btn>
</v-col>
</v-row>
@ -38,19 +43,14 @@
</v-row>
</v-card-text>
<v-card-actions>
<v-row>
<v-col>
<v-btn icon color="success" @click="addWebhook">
<v-icon>mdi-plus</v-icon>
</v-btn>
</v-col>
<v-col> </v-col>
<v-col align="end">
<v-btn text color="success" @click="saveWebhooks">
{{$t('settings.webhooks.save-webhooks')}}
</v-btn>
</v-col>
</v-row>
<v-btn icon color="success" @click="addWebhook">
<v-icon>mdi-plus</v-icon>
</v-btn>
<v-spacer></v-spacer>
<v-btn color="success" @click="saveWebhooks" class="mr-2 mb-1">
<v-icon left> mdi-content-save </v-icon>
{{ $t("general.save") }}
</v-btn>
</v-card-actions>
</v-card>
</template>

View file

@ -14,8 +14,8 @@
<v-icon>mdi-delete</v-icon>
</v-btn>
<Confirmation
title="Delete Recpie"
message="Are you sure you want to delete this recipie?"
:title="$t('recipe.delete-recipe')"
:message="$t('recipe.delete-confirmation')"
color="error"
icon="mdi-alert-circle"
ref="deleteRecipieConfirm"
@ -43,12 +43,12 @@ export default {
props: {
open: {
type: Boolean,
default: true
}
default: true,
},
},
components: {
Confirmation
Confirmation,
},
methods: {
@ -66,8 +66,8 @@ export default {
},
json() {
this.$emit("json");
}
}
},
},
};
</script>

View file

@ -0,0 +1,81 @@
<template>
<div class="mt-n5">
<v-card flat class="transparent" height="60px">
<v-card-text>
<v-row>
<v-col>
<v-btn-toggle group>
<v-btn text :to="`/recipes/${title.toLowerCase()}`">
{{ title.toUpperCase() }}
</v-btn>
</v-btn-toggle>
</v-col>
<v-spacer></v-spacer>
<v-col align="end">
<v-menu offset-y v-if="sortable">
<template v-slot:activator="{ on, attrs }">
<v-btn-toggle group>
<v-btn text v-bind="attrs" v-on="on"> Sort </v-btn>
</v-btn-toggle>
</template>
<v-list>
<v-list-item @click="$emit('sort-recent')">
<v-list-item-title> Recent </v-list-item-title>
</v-list-item>
<v-list-item @click="$emit('sort')">
<v-list-item-title> A-Z </v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-col>
</v-row>
</v-card-text>
</v-card>
<v-row>
<v-col
:sm="6"
:md="6"
:lg="4"
:xl="3"
v-for="recipe in recipes.slice(0, cardLimit)"
:key="recipe.name"
>
<RecipeCard
:name="recipe.name"
:description="recipe.description"
:slug="recipe.slug"
:rating="recipe.rating"
:image="recipe.image"
/>
</v-col>
</v-row>
</div>
</template>
<script>
import RecipeCard from "./RecipeCard";
export default {
components: {
RecipeCard,
},
props: {
sortable: {
default: false,
},
title: String,
recipes: Array,
cardLimit: {
default: 6,
},
},
data() {
return {};
},
};
</script>
<style>
.transparent {
opacity: 1;
}
</style>

View file

@ -0,0 +1,64 @@
<template>
<v-navigation-drawer width="175px" clipped app permanent expand-on-hover>
<v-list nav dense>
<v-list-item v-for="nav in links" :key="nav.title" link :to="nav.to">
<v-list-item-icon>
<v-icon>{{ nav.icon }}</v-icon>
</v-list-item-icon>
<v-list-item-title>{{ nav.title | titleCase }}</v-list-item-title>
</v-list-item>
</v-list>
</v-navigation-drawer>
</template>
<script>
export default {
data() {
return {
links: [],
baseLinks: [
{
icon: "mdi-home",
to: "/",
title: "Home",
},
{
icon: "mdi-view-module",
to: "/recipes/all",
title: "All Recipes",
},
],
};
},
computed: {
allCategories() {
return this.$store.getters.getCategories;
},
},
watch: {
allCategories() {
this.buildSidebar();
},
},
mounted() {
this.buildSidebar();
},
methods: {
async buildSidebar() {
this.links = [];
this.links.push(...this.baseLinks);
this.allCategories.forEach(async (element) => {
this.links.push({
title: element.name,
to: `/recipes/${element.slug}`,
icon: "mdi-tag",
});
});
},
},
};
</script>
<style>
</style>

View file

@ -21,8 +21,8 @@
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="grey" text @click="cancel"> Cancel </v-btn>
<v-btn :color="color" text @click="confirm"> Confirm </v-btn>
<v-btn color="grey" text @click="cancel"> {{ $t("general.cancel") }} </v-btn>
<v-btn :color="color" text @click="confirm"> {{ $t("general.confirm") }} </v-btn>
</v-card-actions>
</v-card>
</v-dialog>

View file

@ -15,11 +15,11 @@
</template>
<v-list>
<v-list-item v-for="(item, i) in items" :key="i" link>
<v-list-item-icon @click="navRouter(item.nav)">
<v-list-item v-for="(item, i) in items" :key="i" link :to="item.nav">
<v-list-item-icon>
<v-icon>{{ item.icon }}</v-icon>
</v-list-item-icon>
<v-list-item-content @click="navRouter(item.nav)">
<v-list-item-content>
<v-list-item-title>
{{ item.title }}
</v-list-item-title>
@ -32,7 +32,7 @@
<script>
export default {
data: function () {
data: function() {
return {
items: [
{

View file

@ -1,40 +0,0 @@
<template>
<v-row>
<v-col
:sm="6"
:md="6"
:lg="4"
:xl="3"
v-for="recipe in recipes"
:key="recipe.name"
>
<RecipeCard
:name="recipe.name"
:description="recipe.description"
:slug="recipe.slug"
:rating="recipe.rating"
:image="recipe.image"
/>
</v-col>
</v-row>
</template>
<script>
import RecipeCard from "./RecipeCard";
export default {
components: {
RecipeCard,
},
data: () => ({}),
mounted() {},
computed: {
recipes() {
return this.$store.getters.getRecentRecipes;
},
},
};
</script>
<style scoped>
</style>

View file

@ -3,7 +3,8 @@
<v-card
:class="{ 'on-hover': hover }"
:elevation="hover ? 12 : 2"
@click="moreInfo(slug)"
:to="route ? `/recipe/${slug}` : ''"
@click="$emit('click')"
>
<v-img height="200" :src="getImage(image)"></v-img>
<v-card-title class="my-n3 mb-n6">{{ name | truncate(30) }}</v-card-title>
@ -25,9 +26,9 @@
<v-col align="end">
<v-tooltip top color="secondary" max-width="400" open-delay="50">
<template v-slot:activator="{ on, attrs }">
<v-btn color="secondary" v-on="on" v-bind="attrs" text
>{{$t('recipe.description')}}</v-btn
>
<v-btn color="secondary" v-on="on" v-bind="attrs" text>{{
$t("recipe.description")
}}</v-btn>
</template>
<span>{{ description }}</span>
</v-tooltip>
@ -47,11 +48,11 @@ export default {
description: String,
rating: Number,
image: String,
route: {
default: true,
},
},
methods: {
moreInfo(recipeSlug) {
this.$router.push(`/recipe/${recipeSlug}`);
},
getImage(image) {
return utils.getImageURL(image);
},

View file

@ -1,63 +0,0 @@
<template>
<v-autocomplete
:items="items"
:loading="isLoading"
v-model="selected"
clearable
return
dense
hide-details
hide-selected
item-text="slug"
:label="$t('search.search-for-a-recipe')"
single-line
@keyup.enter.native="moreInfo(selected)"
>
<template v-slot:no-data>
<v-list-item>
<v-list-item-title :v-html="$t('search.search-for-your-favorite-recipe')">
</v-list-item-title>
</v-list-item>
</template>
<template v-slot:item="{ item }">
<v-list-item-avatar
color="primary"
class="headline font-weight-light white--text"
>
<v-img :src="getImage(item.image)"></v-img>
</v-list-item-avatar>
<v-list-item-content @click="moreInfo(item.slug)">
<v-list-item-title v-text="item.name"></v-list-item-title>
</v-list-item-content>
</template>
</v-autocomplete>
</template>
<script>
import utils from "../../utils";
export default {
data: () => ({
selected: null,
isLoading: false,
}),
computed: {
items() {
return this.$store.getters.getRecentRecipes;
},
},
methods: {
moreInfo(recipeSlug) {
this.$router.push(`/recipe/${recipeSlug}`);
},
getImage(image) {
return utils.getImageURL(image);
},
},
};
</script>
<style>
</style>

View file

@ -2,11 +2,12 @@
<div>
<v-autocomplete
:items="autoResults"
v-model="searchSlug"
item-value="item.slug"
item-text="item.name"
dense
light
label="Search Mealie"
:label="$t('search.search-mealie')"
:search-input.sync="search"
hide-no-data
cache-items
@ -52,7 +53,8 @@ export default {
},
data() {
return {
search: "",
searchSlug: "",
search: " ",
result: [],
autoResults: [],
isDark: false,
@ -82,13 +84,15 @@ export default {
search() {
if (this.search.trim() === "") this.result = this.list;
else this.result = this.fuse.search(this.search.trim());
console.log("test");
this.$emit("results", this.result);
if (this.showResults === true) {
this.autoResults = this.result;
}
},
searchSlug() {
this.selected(this.searchSlug);
},
},
methods: {
getImage(image) {

View file

@ -0,0 +1,75 @@
<template>
<div class="text-center">
<v-dialog v-model="dialog" min-height="700" max-width="1000">
<v-card min-height="725" height="100%">
<v-card-text>
<v-card-title></v-card-title>
<v-row justify="center">
<v-col cols="1"> </v-col>
<v-col>
<SearchBar @results="updateResults" :show-results="false" />
</v-col>
<v-col cols="2">
<v-btn icon>
<v-icon large> mdi-filter </v-icon>
</v-btn>
</v-col>
</v-row>
<v-row v-if="searchResults">
<v-col
:sm="6"
:md="6"
:lg="4"
:xl="3"
v-for="item in searchResults.slice(0, 10)"
:key="item.item.name"
>
<RecipeCard
:route="false"
:name="item.item.name"
:description="item.item.description"
:slug="item.item.slug"
:rating="item.item.rating"
:image="item.item.image"
@click="emitSelect(item.item.name, item.item.slug)"
/>
</v-col>
</v-row>
</v-card-text>
</v-card>
</v-dialog>
</div>
</template>
<script>
import SearchBar from "../UI/SearchBar";
import RecipeCard from "../UI/RecipeCard";
export default {
components: {
SearchBar,
RecipeCard,
},
data() {
return {
searchResults: null,
dialog: false,
};
},
methods: {
updateResults(results) {
this.searchResults = results;
},
emitSelect(name, slug) {
this.$emit("select", name, slug);
this.dialog = false;
},
open() {
this.dialog = true;
},
},
};
</script>
<style>
</style>

View file

@ -1,32 +1,50 @@
<template>
<div>
<v-alert v-if="success[0]" outlined dense type="success">
<h4>{{ successHeader }}</h4>
<v-list dense>
<v-list-item v-for="success in this.success" :key="success">
{{ success }}
</v-list-item>
</v-list>
</v-alert>
<v-alert v-if="failed[0]" outlined dense type="error">
<h4>{{ failedHeader }}</h4>
<v-list dense>
<v-list-item v-for="fail in this.failed" :key="fail">
{{ fail }}
</v-list-item>
</v-list>
</v-alert>
</div>
<v-dialog v-model="dialog" max-width="900px">
<v-card>
<v-card-title> {{ title }} </v-card-title>
<v-card-text class="mt-3">
<v-row>
<v-col>
<v-alert outlined dense type="success">
<h4>{{ successHeader }}</h4>
<p v-for="success in this.success" :key="success" class="my-1">
- {{ success }}
</p>
</v-alert>
</v-col>
<v-col>
<v-alert v-if="failed[0]" outlined dense type="error">
<h4>{{ failedHeader }}</h4>
<p v-for="fail in this.failed" :key="fail" class="my-1">
- {{ fail }}
</p>
</v-alert>
</v-col>
</v-row>
</v-card-text>
</v-card>
</v-dialog>
</template>
<script>
export default {
props: {
title: String,
successHeader: String,
success: Array,
failedHeader: String,
failed: Array,
},
data() {
return {
dialog: false,
};
},
methods: {
open() {
this.dialog = true;
},
},
};
</script>

View file

@ -0,0 +1,56 @@
<template>
<v-form ref="file">
<input ref="uploader" class="d-none" type="file" @change="onFileChanged" />
<v-btn :loading="isSelecting" @click="onButtonClick" color="accent" text>
<v-icon left> mdi-cloud-upload </v-icon>
{{ $t("general.upload") }}
</v-btn>
</v-form>
</template>
<script>
import api from "../../api";
export default {
props: {
url: String,
},
data: () => ({
file: null,
isSelecting: false,
}),
methods: {
async upload() {
if (this.file != null) {
this.isSelecting = true;
let formData = new FormData();
formData.append("archive", this.file);
await api.utils.uploadFile(this.url, formData);
this.isSelecting = false;
this.$emit("uploaded");
}
},
onButtonClick() {
this.isSelecting = true;
window.addEventListener(
"focus",
() => {
this.isSelecting = false;
},
{ once: true }
);
this.$refs.uploader.click();
},
onFileChanged(e) {
this.file = e.target.files[0];
this.upload();
},
},
};
</script>
<style>
</style>

View file

@ -1,23 +1,27 @@
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import Vue from "vue";
import VueI18n from "vue-i18n";
Vue.use(VueI18n)
Vue.use(VueI18n);
function loadLocaleMessages () {
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
const messages = {}
function loadLocaleMessages() {
const locales = require.context(
"./locales",
true,
/[A-Za-z0-9-_,\s]+\.json$/i
);
const messages = {};
locales.keys().forEach(key => {
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
const matched = key.match(/([A-Za-z0-9-_]+)\./i);
if (matched && matched.length > 1) {
const locale = matched[1]
messages[locale] = locales(key)
const locale = matched[1];
messages[locale] = locales(key);
}
})
return messages
});
return messages;
}
export default new VueI18n({
locale: process.env.VUE_APP_I18N_LOCALE || 'en',
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en',
messages: loadLocaleMessages()
})
locale: "en",
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || "en",
messages: loadLocaleMessages(),
});

View file

@ -27,7 +27,6 @@
"save": "Gem",
"select": "Vælg",
"update": "Opdater",
"delete-data": "Slet data",
"download": "Hent",
"import": "Importere"
},
@ -42,7 +41,6 @@
"dinner-this-week": "Madplan denne uge",
"dinner-today": "Madplan i dag",
"planner": "Planlægger",
"choose-a-recipe": "Vælg en opskrift",
"create-a-new-meal-plan": "Opret en ny måltidsplan",
"edit-meal-plan": "Rediger måltidsplan",
"end-date": "Slutdato",
@ -57,7 +55,7 @@
"instructions": "Instruktioner",
"note": "Bemærk",
"notes": "Bemærkninger",
"original-recipe": "Oprindelig opskrift",
"original-url": "Oprindelig opskrift",
"recipe-name": "Opskriftens navn",
"servings": "Portioner",
"step-index": "Trin: {step}",
@ -65,36 +63,20 @@
"view-recipe": "Se opskrift"
},
"search": {
"search-for-a-recipe": "Søg efter en opskrift",
"search-for-your-favorite-recipe": "Søg efter din foretrukne <strong>opskrift</strong>"
"search-mealie": "Search Mealie"
},
"migration": {
"chowdown-repo-url": "Chowdown Repo URL",
"currently-chowdown-via-public-repo-url-is-the-only-supported-type-of-migration": "I øjeblikket er Chowdown via offentlig Repo URL den eneste understøttede migreringstype",
"failed-images": "Mislykkede billeder",
"failed-recipes": "Mislykkede opskrifter",
"migrate": "Migrere",
"recipe-migration": "Migrering af opskrifter",
"delete-confirmation": "Er du sikker på, at du vil slette disse migrationsdata?",
"failed-imports": "Mislykket import",
"nextcloud-data": "Nextcloud data",
"successfully-imported-from-nextcloud": "Importeret fra Nextcloud",
"upload-an-archive": "Upload et arkiv",
"you-can-import-recipes-from-either-a-zip-file-or-a-directory-located-in-the-app-data-migraiton-folder-please-review-the-documentation-to-ensure-your-directory-structure-matches-what-is-expected": "Du kan importere opskrifter fra enten en zip-fil eller et bibliotek i /app/data/migraiton/ folderen. \nGennemse dokumentationen for at sikre, at din bibliotekstruktur svarer til det, der forventes"
"failed-imports": "Mislykket import"
},
"settings": {
"add-a-new-theme": "Tilføj et nyt tema",
"backup-and-exports": "Backup og eksport",
"backup-info": "Sikkerhedskopier eksporteres i standard JSON-format sammen med alle de billeder, der er gemt på filsystemet. \nI din sikkerhedskopimappe finder du en .zip-fil, der indeholder alle opskrifterne JSON og billeder fra databasen. \nDerudover, hvis du valgte en markdown-fil, gemmes disse også i .zip-filen. \nFor at importere en sikkerhedskopi skal den være placeret i din sikkerhedskopimappe. \nAutomatiske sikkerhedskopier udføres hver dag kl. 3:00.",
"backup-recipes": "Sikkerhedskopier opksrifter",
"backup-tag": "Sikkerhedskopier tags",
"color": "Farve",
"contribute": "Bidrag",
"explore-the-docs": "Udforsk dokumentation",
"markdown-template": "Markdown skabelon",
"new-version-available": "En ny version af Mealie er tilgængelig. <a {aContents}> Besøg repoen </a>",
"set-new-time": "Indstil ny tid",
"swatches": "Prøver",
"current": "Version:",
"latest": "Seneste:",
"theme": {
@ -114,13 +96,11 @@
"dark": "Mørkt",
"delete-theme": "Slet tema",
"light": "Lyst",
"save-colors-and-apply-theme": "Gem farver og anvend tema",
"saved-color-theme": "Gemt farvetema",
"theme": "Tema"
},
"webhooks": {
"meal-planner-webhooks": "Måltidsplanlægning Webhooks",
"save-webhooks": "Gem Webhooks",
"test-webhooks": "Test Webhooks",
"the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "Webadresserne, der er anført nedenfor, modtager webhooks, der indeholder opskriftsdataene for måltidsplanen på den planlagte dag. \nWebhooks udføres i øjeblikket på <strong> {time} </strong>",
"webhook-url": "Webhook adresse"
@ -131,4 +111,4 @@
"import-themes": "Importer temaer"
}
}
}
}

View file

@ -11,6 +11,7 @@
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Paste in your recipe data. Each line will be treated as an item in a list"
},
"general": {
"upload": "Upload",
"submit": "Submit",
"name": "Name",
"settings": "Settings",
@ -29,7 +30,11 @@
"enabled": "Enabled",
"download": "Download",
"import": "Import",
"delete-data": "Delete Data"
"options": "Options",
"templates": "Templates",
"recipes": "Recipes",
"themes": "Themes",
"confirm": "Confirm"
},
"login": {
"stay-logged-in": "Stay logged in?",
@ -44,7 +49,6 @@
"planner": "Planner",
"edit-meal-plan": "Edit Meal Plan",
"meal-plans": "Meal Plans",
"choose-a-recipe": "Choose a Recipe",
"create-a-new-meal-plan": "Create a New Meal Plan",
"start-date": "Start Date",
"end-date": "End Date"
@ -61,28 +65,40 @@
"ingredient": "Ingredient",
"notes": "Notes",
"note": "Note",
"original-recipe": "Original Recipe",
"view-recipe": "View Recipe"
"original-url": "Original URL",
"view-recipe": "View Recipe",
"title": "Title",
"total-time": "Total Time",
"prep-time": "Prep Time",
"perform-time": "Cook Time",
"api-extras": "API Extras",
"object-key": "Object Key",
"object-value": "Object Value",
"new-key-name": "New Key Name",
"add-key": "Add Key",
"key-name-required": "Key Name Required",
"no-white-space-allowed": "No White Space Allowed",
"delete-recipe": "Delete Recipe",
"delete-confirmation": "Are you sure you want to delete this recipe?"
},
"search": {
"search-for-a-recipe": "Search for a Recipe",
"search-for-your-favorite-recipe": "Search for your Favorite <strong>Recipe</strong>"
"search-mealie": "Search Mealie"
},
"settings": {
"color": "Color",
"swatches": "Swatches",
"general-settings": "General Settings",
"local-api": "Local API",
"language": "Language",
"add-a-new-theme": "Add a New Theme",
"set-new-time": "Set New Time",
"current": "Version:",
"latest": "Latest",
"explore-the-docs": "Explore the Docs",
"contribute": "Contribute",
"backup-and-exports": "Backup and Exports",
"backup-and-exports": "Backups",
"backup-info": "Backups are exported in standard JSON format along with all the images stored on the file system. In your backup folder you'll find a .zip file that contains all of the recipe JSON and images from the database. Additionally, if you selected a markdown file, those will also be stored in the .zip file. To import a backup, it must be located in your backups folder. Automated backups are done each day at 3:00 AM.",
"backup-tag": "Backup Tag",
"markdown-template": "Markdown Template",
"backup-recipes": "Backup Recipes",
"available-backups": "Available Backups",
"theme": {
"theme-name": "Theme Name",
"theme-settings": "Theme Settings",
"select-a-theme-from-the-dropdown-or-create-a-new-theme-note-that-the-default-theme-will-be-served-to-all-users-who-have-not-set-a-theme-preference": "Select a theme from the dropdown or create a new theme. Note that the default theme will be served to all users who have not set a theme preference.",
"dark-mode": "Dark Mode",
@ -94,41 +110,49 @@
"info": "Info",
"warning": "Warning",
"error": "Error",
"default-to-system": "Default to system",
"light": "Light",
"dark": "Dark",
"theme": "Theme",
"saved-color-theme": "Saved Color Theme",
"delete-theme": "Delete Theme",
"are-you-sure-you-want-to-delete-this-theme": "Are you sure you want to delete this theme?",
"save-colors-and-apply-theme": "Save Colors and Apply Theme",
"choose-how-mealie-looks-to-you-set-your-theme-preference-to-follow-your-system-settings-or-choose-to-use-the-light-or-dark-theme": "Choose how Mealie looks to you. Set your theme preference to follow your system settings, or choose to use the light or dark theme."
"choose-how-mealie-looks-to-you-set-your-theme-preference-to-follow-your-system-settings-or-choose-to-use-the-light-or-dark-theme": "Choose how Mealie looks to you. Set your theme preference to follow your system settings, or choose to use the light or dark theme.",
"theme-name-is-required": "Theme Name is required."
},
"webhooks": {
"meal-planner-webhooks": "Meal Planner Webhooks",
"the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "The URLs listed below will recieve webhooks containing the recipe data for the meal plan on it's scheduled day. Currently Webhooks will execute at <strong>{ time }</strong>",
"the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "The URLs listed below will receive webhooks containing the recipe data for the meal plan on it's scheduled day. Currently Webhooks will execute at",
"test-webhooks": "Test Webhooks",
"webhook-url": "Webhook URL",
"save-webhooks": "Save Webhooks"
"webhook-url": "Webhook URL"
},
"new-version-available": "A New Version of Mealie is Avaiable, <a {aContents}> Visit the Repo </a>",
"new-version-available": "A New Version of Mealie is Available, <a {aContents}> Visit the Repo </a>",
"backup": {
"import-recipes": "Import Recipes",
"import-themes": "Import Themes",
"import-settings": "Import Settings"
"import-settings": "Import Settings",
"create-heading": "Create a Backup",
"backup-tag": "Backup Tag",
"full-backup": "Full Backup",
"partial-backup": "Partial Backup",
"backup-restore-report": "Backup Restore Report",
"successfully-imported": "Successfully Imported",
"failed-imports": "Failed Imports"
}
},
"migration": {
"recipe-migration": "Recipe Migration",
"currently-chowdown-via-public-repo-url-is-the-only-supported-type-of-migration": "Currently Chowdown via public Repo URL is the only supported type of migration",
"chowdown-repo-url": "Chowdown Repo URL",
"migrate": "Migrate",
"failed-recipes": "Failed Recipes",
"failed-images": "Failed Images",
"you-can-import-recipes-from-either-a-zip-file-or-a-directory-located-in-the-app-data-migraiton-folder-please-review-the-documentation-to-ensure-your-directory-structure-matches-what-is-expected": "You can import recipes from either a zip file or a directory located in the /app/data/migraiton/ folder. Please review the documentation to ensure your directory structure matches what is expected",
"nextcloud-data": "Nextcloud Data",
"delete-confirmation": "Are you sure you want to delete this migration data?",
"successfully-imported-from-nextcloud": "Successfully Imported from Nextcloud",
"failed-imports": "Failed Imports",
"upload-an-archive": "Upload an Archive"
"migration-report": "Migration Report",
"successful-imports": "Successful Imports",
"no-migration-data-available": "No Migration Data Avaiable",
"nextcloud": {
"title": "Nextcloud Cookbook",
"description": "Migrate data from a Nextcloud Cookbook intance"
},
"chowdown": {
"title": "Chowdown",
"description": "Migrate data from Chowdown"
}
}
}

View file

@ -0,0 +1,114 @@
{
"404": {
"page-not-found": "404 Page non trouvée",
"take-me-home": "Retour à l'accueil"
},
"new-recipe": {
"from-url": "Depuis une adresse web",
"recipe-url": "Adresse de la recette",
"error-message": "Il y a eu une erreur en récupérant la recette. Veuillez vérifier les logs ainsi que le fichier debug/last_recipe.json pour localiser le problème.",
"bulk-add": "Ajouter en bloc",
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Copiez votre recette ici. Chaque ligne sera traitée comme un objet de la liste."
},
"general": {
"submit": "Soumettre",
"name": "Nom",
"settings": "Options",
"close": "Supprimer",
"save": "Sauvegarder",
"image-file": "Image",
"update": "Mettre à jour",
"edit": "Editer",
"delete": "Supprimer",
"select": "Sélectionner",
"random": "Aléatoire",
"new": "Nouveau",
"create": "Créer",
"cancel": "Annuler",
"ok": "OK",
"enabled": "Activé",
"download": "Télécharger",
"import": "Importer"
},
"login": {
"stay-logged-in": "Rester connecté(e) ?",
"email": "Email",
"password": "Mot de passe",
"sign-in": "Se connecter",
"sign-up": "S'inscrire"
},
"meal-plan": {
"dinner-this-week": "Repas cette semaine",
"dinner-today": "Repas aujourd'hui",
"planner": "Planificateur",
"edit-meal-plan": "Éditer le plan de menu",
"meal-plans": "Plans de menu",
"create-a-new-meal-plan": "Créer un nouveau plan de menu",
"start-date": "Date de début",
"end-date": "Date de fin"
},
"recipe": {
"description": "Description",
"ingredients": "Ingrédients",
"categories": "Catégories",
"tags": "Tags",
"instructions": "Instructions",
"step-index": "Etape: {step}",
"recipe-name": "Nom de la recette",
"servings": "Portions",
"ingredient": "Ingrédient",
"notes": "Notes",
"note": "Note",
"original-url": "Recette originale",
"view-recipe": "Voir la recette"
},
"search": {
"search-mealie": "Search Mealie"
},
"settings": {
"add-a-new-theme": "Ajouter un nouveau thème",
"set-new-time": "Définir une nouvelle heure d'exécution",
"current": "Version :",
"latest": "Dernière",
"explore-the-docs": "Parcourir la documentation",
"contribute": "Contribuer",
"backup-and-exports": "Sauver et exporter",
"backup-info": "Les sauvegardes sont exportées en format JSON standard, ainsi que toutes les images stockées sur le système. Dans votre dossier de sauvegarde, vous trouverez un dossier .zip qui contient toutes les recettes en JSON et les images de la base de données. De plus, si vous avez sélectionné le format de fichier markdown, il sera sauvegardé dans le même dossier .zip. Pour importer une sauvegarde, celle-ci doit être enregistrée dans votre dossier de sauvegardes. Une sauvegarde automatique est effectuée quotidiennement à 03h00.",
"theme": {
"theme-settings": "Paramètres du thème",
"select-a-theme-from-the-dropdown-or-create-a-new-theme-note-that-the-default-theme-will-be-served-to-all-users-who-have-not-set-a-theme-preference": "Sélectionnez un thème depuis la liste ou créez-en un nouveau. Le thème par défaut sera utilisé pour tous les utilisateurs qui n'ont pas choisi de thème personnalisé.",
"dark-mode": "Mode sombre",
"theme-is-required": "Un thème est requis.",
"primary": "Primaire",
"secondary": "Secondaire",
"accent": "Accentué",
"success": "Succès",
"info": "Information",
"warning": "Avertissement",
"error": "Erreur",
"light": "Clair",
"dark": "Sombre",
"theme": "Thème",
"saved-color-theme": "Thèmes sauvegardés",
"delete-theme": "Supprimer le thème",
"are-you-sure-you-want-to-delete-this-theme": "Etes-vous sûr(e) de vouloir supprimer ce thème ?",
"choose-how-mealie-looks-to-you-set-your-theme-preference-to-follow-your-system-settings-or-choose-to-use-the-light-or-dark-theme": "Personnalisez l'apparence de Mealie. Utilisez le thème par défaut de votre système ou choisissez manuellement entre le thème clair ou sombre."
},
"webhooks": {
"meal-planner-webhooks": "Webhooks du planificateur de repas",
"the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "Les liens dans cette liste recevront les webhooks contenant les recettes pour le plan de menu du jour défini. Actuellement, les webhooks s'executeront à <strong>{ time }</strong>",
"test-webhooks": "Tester les webhooks",
"webhook-url": "Lien du webhook"
},
"new-version-available": "Une nouvelle version de Mealie est disponible, <a {aContents}> vérifiez la source ! </a>",
"backup": {
"import-recipes": "Importer des recettes",
"import-themes": "Importer des thèmes",
"import-settings": "Importer des paramètres"
}
},
"migration": {
"recipe-migration": "Migrer les recettes",
"failed-imports": "Importations échouées"
}
}

View file

@ -0,0 +1,116 @@
{
"404": {
"page-not-found": "404 sidan kan inte hittas",
"take-me-home": "Ta mig hem"
},
"new-recipe": {
"from-url": "Från länk",
"recipe-url": "Recept URL",
"error-message": "Ett fel uppstod när receptet skulle läsas in. Undersök loggen och debug/last_recipe.json för att felsöka problemet.",
"bulk-add": "Lägg till flera",
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "Klistra in din receptdata, varje rad kommer att hanteras som ett listelement"
},
"general": {
"submit": "Skicka",
"name": "Namn",
"settings": "Inställningar",
"cancel": "Avbryt",
"close": "Stäng",
"create": "Skapa",
"delete": "Ta bort",
"edit": "Redigera",
"enabled": "Aktiverad",
"image-file": "Bildfil",
"new": "Ny",
"ok": "Ok",
"random": "Slumpa",
"save": "Spara",
"select": "Välj",
"update": "Uppdatera",
"download": "Ladda ner",
"import": "Importera"
},
"login": {
"email": "E-mail",
"password": "Lösenord",
"sign-in": "Logga in",
"sign-up": "Logga ut",
"stay-logged-in": "Kom ihåg mig"
},
"meal-plan": {
"dinner-this-week": "Veckans middagar",
"dinner-today": "Middag idag",
"planner": "Planeringkalender",
"create-a-new-meal-plan": "Skapa en ny måltidsplan",
"edit-meal-plan": "Redigera måltidsplan",
"end-date": "Slutdatum",
"meal-plans": "Måltidsplaner",
"start-date": "Startdatum"
},
"recipe": {
"description": "Beskrivning",
"categories": "Kategorier",
"ingredient": "Ingrediens",
"ingredients": "Ingredienser",
"instructions": "Instruktioner",
"note": "Anteckning",
"notes": "Anteckningar",
"original-url": "Originalrecept",
"recipe-name": "Receptets namn",
"servings": "Portioner",
"step-index": "Steg: {step}",
"tags": "Taggar",
"view-recipe": "Visa recept"
},
"search": {
"search-mealie": "Search Mealie"
},
"settings": {
"add-a-new-theme": "Lägg till ett nytt tema",
"set-new-time": "Välj ny tid",
"current": "Version:",
"latest": "Senaste",
"explore-the-docs": "Utforska dokumentationen",
"contribute": "Bidra",
"backup-and-exports": "Backups",
"backup-info": "Säkerhetskopior exporteras i JSON-format tillsammans med de bilder som finns i systemet. I din mapp för säkerhetskopior finner du en zip-fil som innehåller alla recept i JSON samt bilder från databasen. Om du dessutom valde att exportera till markdown så hittas också de i samma zip-fil. För att importera en säkerhetskopia så måste den ligga i din backup-mapp. Automatisk säkerhetskopiering genomförs varje dag kl. 03:00.",
"theme": {
"theme-settings": "Temainställningar",
"select-a-theme-from-the-dropdown-or-create-a-new-theme-note-that-the-default-theme-will-be-served-to-all-users-who-have-not-set-a-theme-preference": "Välj ett tema från menyn eller skapa ett nytt. Standardtemat kommer att användas för alla användare som inte gjort något val.",
"dark-mode": "Mörkt läge",
"theme-is-required": "Tema krävs",
"primary": "Primär",
"secondary": "Sekundär",
"accent": "Accent",
"success": "Success",
"info": "Info",
"warning": "Varning",
"error": "Error",
"light": "Ljust",
"dark": "Mörkt",
"theme": "Tema",
"saved-color-theme": "Sparat färgschema",
"delete-theme": "Radera tema",
"are-you-sure-you-want-to-delete-this-theme": "Är du säker på att du vill radera temat?",
"choose-how-mealie-looks-to-you-set-your-theme-preference-to-follow-your-system-settings-or-choose-to-use-the-light-or-dark-theme": "Välj hur Mealie ska se ut för dig. Låt Mealie följa dina systeminställningar, eller välj mörkt eller ljust tema."
},
"webhooks": {
"meal-planner-webhooks": "Webhooks för denna måltidsplan",
"the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "Följande URLer kommer att mottaga webhooks med receptdata för dagens planerade måltid. Datan kommer att skickas klockan <strong>{ time }</strong>",
"test-webhooks": "Testa Webhooks",
"webhook-url": "Webhook URL"
},
"new-version-available": "En ny version av Mealie finns tillgänglig, <a {aContents}> Besök repot </a>",
"backup": {
"import-recipes": "Importera recept",
"import-themes": "Importera färgscheman",
"import-settings": "Importera recept",
"create-heading": "Skapa en säkerhetskopia",
"backup-tag": "Backup tagg"
}
},
"migration": {
"recipe-migration": "Migrera recept",
"failed-imports": "Misslyckade importer"
}
}

View file

@ -0,0 +1,158 @@
{
"404": {
"page-not-found": "404页面不存在",
"take-me-home": "返回主页"
},
"new-recipe": {
"from-url": "输入网址",
"recipe-url": "食谱网址",
"error-message": "貌似在解析网址时出错。请检查log和debug/last_recipe.json文件并找寻更多有关资讯。",
"bulk-add": "批量添加",
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "请粘贴您的食谱资料。每行将被视为列表中的一项。"
},
"general": {
"upload": "上传",
"submit": "提交",
"name": "名称",
"settings": "设定",
"close": "关闭",
"save": "保存",
"image-file": "图像文件",
"update": "更新",
"edit": "编辑",
"delete": "删除",
"select": "选择",
"random": "随机",
"new": "新建",
"create": "创建",
"cancel": "取消",
"ok": "好的",
"enabled": "启用",
"download": "下载",
"import": "导入",
"options": "选项",
"templates": "模板",
"recipes": "食谱",
"themes": "布景主题",
"confirm": "确定"
},
"login": {
"stay-logged-in": "保持登录状态?",
"email": "电子邮件",
"password": "密码",
"sign-in": "登入",
"sign-up": "注册"
},
"meal-plan": {
"dinner-this-week": "本周晚餐",
"dinner-today": "今日晚餐",
"planner": "策划人",
"edit-meal-plan": "编辑用餐计划",
"meal-plans": "用餐计划",
"create-a-new-meal-plan": "创建一个新的用餐计划",
"start-date": "开始日期",
"end-date": "结束日期"
},
"recipe": {
"description": "描述",
"ingredients": "材料",
"categories": "分类目录",
"tags": "标签",
"instructions": "做法",
"step-index": "步骤:{step}",
"recipe-name": "食谱名称",
"servings": "份量",
"ingredient": "材料",
"notes": "贴士",
"note": "贴士",
"original-url": "原食谱链接",
"view-recipe": "查看食谱",
"add-key": "Add Key",
"api-extras": "API Extras",
"delete-confirmation": "您确定要删除此食谱吗?",
"delete-recipe": "删除食谱",
"key-name-required": "Key Name Required",
"new-key-name": "New Key Name",
"no-white-space-allowed": "No White Space Allowed",
"object-key": "Object Key",
"object-value": "Object Value",
"perform-time": "烹饪时间 / 执行时间",
"prep-time": "准备时间",
"title": "标题",
"total-time": "总时间"
},
"search": {
"search-mealie": "搜索Mealie"
},
"settings": {
"add-a-new-theme": "新增布景主题",
"set-new-time": "设定新的时间",
"current": "版本号:",
"latest": "最新版本:",
"explore-the-docs": "浏览文档",
"contribute": "参与贡献",
"backup-and-exports": "备份",
"backup-info": "备份以标准JSON格式导出并连同储存在系统文件中的所有图像。在备份文件夹中您将找到一个.zip文件其中包含数据库中的所有食谱JSON和图像。此外如果您选择了Markdown文件这些文件也将一并储存在.zip文件中。当需要要导入备份它必须位于您的备份文件夹中。每天3:00 AM将进行自动备份。",
"theme": {
"theme-settings": "布景主题设置",
"select-a-theme-from-the-dropdown-or-create-a-new-theme-note-that-the-default-theme-will-be-served-to-all-users-who-have-not-set-a-theme-preference": "从以下列表中选择一个主题或创建一个新主题。请注意,默认主题将提供给尚未设置主题首选的所有用户。",
"dark-mode": "暗黑模式",
"theme-is-required": "必须选择主题",
"primary": "主要Primary",
"secondary": "次要Secondary",
"accent": "强调Accent",
"success": "成功Success",
"info": "信息Info",
"warning": "警告Warning",
"error": "错误Error",
"light": "浅色",
"dark": "深色",
"theme": "布景主题",
"saved-color-theme": "已保存主题色调",
"delete-theme": "删除主题",
"are-you-sure-you-want-to-delete-this-theme": "您确定要删除此主题吗?",
"choose-how-mealie-looks-to-you-set-your-theme-preference-to-follow-your-system-settings-or-choose-to-use-the-light-or-dark-theme": "选择Mealie的外观模式。设置布景主题首选并依据您的主机系统设置或者选择使用浅色或深色主题。",
"default-to-system": "默认为系统",
"theme-name": "主题名称",
"theme-name-is-required": "主题名称是必填项。"
},
"webhooks": {
"meal-planner-webhooks": "用餐计划器Webhooks",
"the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "下方列出的网址将在预定日期接收到有关用餐计划的食谱资料。Webhooks将在<strong>{ time }</strong>执行",
"test-webhooks": "测试Webhooks",
"webhook-url": "Webhook网址"
},
"new-version-available": "检测到Mealie最新版本出现<a {aContents}>浏览仓库</a>",
"backup": {
"import-recipes": "导入食谱",
"import-themes": "导入主题",
"import-settings": "导入设置",
"create-heading": "创建备份",
"backup-tag": "标签备份",
"backup-restore-report": "备份还原报告",
"failed-imports": "导入失败",
"full-backup": "完整备份",
"partial-backup": "部分备份",
"successfully-imported": "成功导入"
},
"available-backups": "可用备份",
"general-settings": "基本设置",
"language": "语言",
"local-api": "Local API"
},
"migration": {
"recipe-migration": "食谱迁移",
"failed-imports": "导入失败",
"chowdown": {
"description": "从Chowdown迁移数据",
"title": "Chowdown"
},
"migration-report": "迁移报告",
"nextcloud": {
"description": "从Nextcloud Cookbook迁移数据",
"title": "Nextcloud Cookbook"
},
"no-migration-data-available": "没有迁移数据可用",
"successful-imports": "成功导入"
}
}

View file

@ -0,0 +1,158 @@
{
"404": {
"page-not-found": "404頁面不存在",
"take-me-home": "返回主頁"
},
"new-recipe": {
"from-url": "輸入網址",
"recipe-url": "食譜網址",
"error-message": "貌似在解析網址時出錯。請檢查log和debug/last_recipe.json文件並找尋更多有關資訊。",
"bulk-add": "批量添加",
"paste-in-your-recipe-data-each-line-will-be-treated-as-an-item-in-a-list": "請粘貼您的食譜資料。每行將被視為列表中的一項。"
},
"general": {
"upload": "上傳",
"submit": "提交",
"name": "名稱",
"settings": "設定",
"close": "關閉",
"save": "保存",
"image-file": "圖像文件",
"update": "更新",
"edit": "编辑",
"delete": "删除",
"select": "選擇",
"random": "隨機",
"new": "新建",
"create": "創建",
"cancel": "取消",
"ok": "好的",
"enabled": "启用",
"download": "下载",
"import": "導入",
"options": "選項",
"templates": "模板",
"recipes": "食譜",
"themes": "佈景主題",
"confirm": "確定"
},
"login": {
"stay-logged-in": "保持登錄狀態?",
"email": "電子郵件",
"password": "密碼",
"sign-in": "登入",
"sign-up": "註冊"
},
"meal-plan": {
"dinner-this-week": "本週晚餐",
"dinner-today": "今日晚餐",
"planner": "策劃人",
"edit-meal-plan": "編輯用餐計劃",
"meal-plans": "用餐計劃",
"create-a-new-meal-plan": "創建一個新的用餐計劃",
"start-date": "開始日期",
"end-date": "結束日期"
},
"recipe": {
"description": "描述",
"ingredients": "材料",
"categories": "分類目錄",
"tags": "標籤",
"instructions": "做法",
"step-index": "步驟:{step}",
"recipe-name": "食譜名稱",
"servings": "份量",
"ingredient": "材料",
"notes": "貼士",
"note": "貼士",
"original-url": "原食譜鏈接",
"view-recipe": "查看食譜",
"add-key": "Add Key",
"api-extras": "API Extras",
"delete-confirmation": "您確定要刪除此食譜嗎?",
"delete-recipe": "刪除食譜",
"key-name-required": "Key Name Required",
"new-key-name": "New Key Name",
"no-white-space-allowed": "No White Space Allowed",
"object-key": "Object Key",
"object-value": "Object Value",
"perform-time": "烹飪時間 / 執行時間",
"prep-time": "準備時間",
"title": "標題",
"total-time": "總時間"
},
"search": {
"search-mealie": "搜索Mealie"
},
"settings": {
"add-a-new-theme": "新增佈景主題",
"set-new-time": "設定新的時間",
"current": "版本號:",
"latest": "最新版本:",
"explore-the-docs": "瀏覽文檔",
"contribute": "參與貢獻",
"backup-and-exports": "備份",
"backup-info": "備份以標準JSON格式導出並連同儲存在系統文件中的所有圖像。在備份文件夾中您將找到一個.zip文件其中包含數據庫中的所有食譜JSON和圖像。此外如果您選擇了Markdown文件這些文件也將一併儲存在.zip文件中。當需要要導入備份它必須位於您的備份文件夾中。每天3:00 AM將進行自動備份。",
"theme": {
"theme-settings": "佈景主題設置",
"select-a-theme-from-the-dropdown-or-create-a-new-theme-note-that-the-default-theme-will-be-served-to-all-users-who-have-not-set-a-theme-preference": "從以下列表中選擇一個主題或創建一個新主題。請注意,默認主題將提供給尚未設置主題首選的所有用戶。",
"dark-mode": "暗黑模式",
"theme-is-required": "必須選擇主題",
"primary": "主要Primary",
"secondary": "次要Secondary",
"accent": "強調Accent",
"success": "成功Success",
"info": "信息Info",
"warning": "警告Warning",
"error": "錯誤Error",
"light": "淺色",
"dark": "深色",
"theme": "佈景主題",
"saved-color-theme": "已保存主題色調",
"delete-theme": "刪除主題",
"are-you-sure-you-want-to-delete-this-theme": "您確定要刪除此主題嗎?",
"choose-how-mealie-looks-to-you-set-your-theme-preference-to-follow-your-system-settings-or-choose-to-use-the-light-or-dark-theme": "選擇Mealie的外觀模式。設置佈景主題首選並依據您的主機系統設置或者選擇使用淺色或深色主題。",
"default-to-system": "默認爲系統",
"theme-name": "主題名稱",
"theme-name-is-required": "主題名稱是必填項。"
},
"webhooks": {
"meal-planner-webhooks": "用餐計劃器Webhooks",
"the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at": "下方列出的網址將在預定日期接收到有關用餐計劃的食譜資料。Webhooks將在<strong>{ time }</strong>執行",
"test-webhooks": "測試Webhooks",
"webhook-url": "Webhook網址"
},
"new-version-available": "檢測到Mealie最新版本出現<a {aContents}>瀏覽倉庫</a>",
"backup": {
"import-recipes": "導入食譜",
"import-themes": "導入主題",
"import-settings": "導入設置",
"create-heading": "創建備份",
"backup-tag": "標籤備份",
"backup-restore-report": "備份還原報告",
"failed-imports": "導入失敗",
"full-backup": "完整備份",
"partial-backup": "部分備份",
"successfully-imported": "成功導入"
},
"available-backups": "可用備份",
"general-settings": "基本設置",
"language": "語言",
"local-api": "Local API"
},
"migration": {
"recipe-migration": "食譜遷移",
"failed-imports": "導入失敗",
"chowdown": {
"description": "從Chowdown遷移數據",
"title": "Chowdown"
},
"migration-report": "遷移報告",
"nextcloud": {
"description": "從Nextcloud Cookbook遷移數據",
"title": "Nextcloud Cookbook"
},
"no-migration-data-available": "無遷移數據可用",
"successful-imports": "成功導入"
}
}

View file

@ -4,7 +4,7 @@ import vuetify from "./plugins/vuetify";
import store from "./store/store";
import VueRouter from "vue-router";
import { routes } from "./routes";
import i18n from './i18n'
import i18n from "./i18n";
Vue.config.productionTip = false;
Vue.use(VueRouter);
@ -19,11 +19,11 @@ new Vue({
store,
router,
i18n,
render: (h) => h(App)
render: (h) => h(App),
}).$mount("#app");
// Truncate
let filter = function(text, length, clamp) {
let truncate = function (text, length, clamp) {
clamp = clamp || "...";
let node = document.createElement("div");
node.innerHTML = text;
@ -31,6 +31,11 @@ let filter = function(text, length, clamp) {
return content.length > length ? content.slice(0, length) + clamp : content;
};
Vue.filter("truncate", filter);
let titleCase = function (value) {
return value.replace(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
};
Vue.filter("truncate", truncate);
Vue.filter("titleCase", titleCase);
export { router };

View file

@ -0,0 +1,43 @@
<template>
<div>
<CategorySidebar />
<CardSection
:sortable="true"
title="All Recipes"
:recipes="allRecipes"
:card-limit="9999"
@sort="sortAZ"
@sort-recent="sortRecent"
/>
</div>
</template>
<script>
import CardSection from "../components/UI/CardSection";
import CategorySidebar from "../components/UI/CategorySidebar";
export default {
components: {
CardSection,
CategorySidebar,
},
data() {
return {};
},
computed: {
allRecipes() {
return this.$store.getters.getRecentRecipes;
},
},
methods: {
sortAZ() {
this.allRecipes.sort((a, b) => (a.name > b.name ? 1 : -1));
},
sortRecent() {
this.allRecipes.sort((a, b) => (a.dateAdded > b.dateAdded ? -1 : 1));
},
},
};
</script>
<style>
</style>

View file

@ -0,0 +1,62 @@
<template>
<div>
<CategorySidebar />
<CardSection
:sortable="true"
:title="title"
:recipes="recipes"
:card-limit="9999"
@sort="sortAZ"
@sort-recent="sortRecent"
/>
</div>
</template>
<script>
import api from "../api";
import CardSection from "../components/UI/CardSection";
import CategorySidebar from "../components/UI/CategorySidebar";
export default {
components: {
CardSection,
CategorySidebar,
},
data() {
return {
title: "",
recipes: [],
};
},
computed: {
currentCategory() {
return this.$route.params.category;
},
},
watch: {
async currentCategory() {
this.getRecipes();
},
},
mounted() {
this.getRecipes();
},
methods: {
async getRecipes() {
let data = await api.categories.get_recipes_in_category(
this.currentCategory
);
this.title = data.name;
this.recipes = data.recipes;
},
sortAZ() {
this.recipes.sort((a, b) => (a.name > b.name ? 1 : -1));
},
sortRecent() {
this.recipes.sort((a, b) => (a.dateAdded > b.dateAdded ? -1 : 1));
},
},
};
</script>
<style>
</style>

View file

@ -1,15 +1,82 @@
<template>
<div>
<RecentRecipes />
<CategorySidebar />
<CardSection
v-if="showRecent"
title="Recent"
:recipes="recentRecipes"
:card-limit="showLimit"
/>
<CardSection
:sortable="true"
v-for="(section, index) in recipeByCategory"
:key="section.name + section.position"
:title="section.name"
:recipes="section.recipes"
:card-limit="showLimit"
@sort="sortAZ(index)"
@sort-recent="sortRecent(index)"
/>
</div>
</template>
<script>
import RecentRecipes from "../components/UI/RecentRecipes";
import api from "../api";
import CardSection from "../components/UI/CardSection";
import CategorySidebar from "../components/UI/CategorySidebar";
export default {
components: {
RecentRecipes,
CardSection,
CategorySidebar,
},
data() {
return {
recipeByCategory: [],
};
},
computed: {
showRecent() {
return this.$store.getters.getShowRecent;
},
showLimit() {
return this.$store.getters.getShowLimit;
},
homeCategories() {
return this.$store.getters.getHomeCategories;
},
recentRecipes() {
let recipes = this.$store.getters.getRecentRecipes;
return recipes.sort((a, b) => (a.dateAdded > b.dateAdded ? -1 : 1));
},
},
async mounted() {
await this.buildPage();
this.recipeByCategory.sort((a, b) => a.position - b.position);
},
methods: {
async buildPage() {
this.homeCategories.forEach(async (element) => {
let recipes = await this.getRecipeByCategory(element.slug);
recipes.position = element.position;
this.recipeByCategory.push(recipes);
});
},
async getRecipeByCategory(category) {
return await api.categories.get_recipes_in_category(category);
},
getRecentRecipes() {
this.$store.dispatch("requestRecentRecipes");
},
sortAZ(index) {
this.recipeByCategory[index].recipes.sort((a, b) =>
a.name > b.name ? 1 : -1
);
},
sortRecent(index) {
this.recipeByCategory[index].recipes.sort((a, b) =>
a.dateAdded > b.dateAdded ? -1 : 1
);
},
},
};
</script>

View file

@ -5,67 +5,71 @@
:meal-plan="editMealPlan"
@updated="planUpdated"
/>
<NewMeal v-else @created="requestMeals" />
<NewMeal v-else @created="requestMeals" class="mb-5" />
<v-card class="my-1">
<v-card-title class="headline"> {{$t('meal-plan.meal-plans')}} </v-card-title>
<v-card class="my-2">
<v-card-title class="headline">
{{ $t("meal-plan.meal-plans") }}
</v-card-title>
<v-divider></v-divider>
<v-timeline align-top :dense="$vuetify.breakpoint.smAndDown">
<v-timeline-item
class="mx-4"
v-for="(mealplan, i) in plannedMeals"
:key="i"
color="accent lighten-2"
icon="mdi-silverware-variant"
fill-dot
>
<v-card>
<v-card-title class="white--text secondary lighten-1">
{{ formatDate(mealplan.startDate) }} -
{{ formatDate(mealplan.endDate) }}
</v-card-title>
<v-card-text>
<v-row dense align="center">
<v-col></v-col>
<v-col
v-for="(meal, index) in mealplan.meals"
:key="generateKey(meal.slug, index)"
>
<v-img
class="rounded-lg info"
:src="getImage(meal.image)"
height="80"
width="80"
>
</v-img>
</v-col>
<v-col></v-col>
</v-row>
<v-row class="mt-2 ml-1">
<v-btn
color="accent lighten-2"
class="mx-0"
text
@click="editPlan(mealplan.uid)"
>
{{$t('general.edit')}}
</v-btn>
<v-btn
color="error lighten-2"
class="mx-2"
text
@click="deletePlan(mealplan.uid)"
>
{{$t('general.delete')}}
</v-btn>
</v-row>
</v-card-text>
</v-card>
</v-timeline-item>
</v-timeline>
</v-card>
<v-row dense>
<v-col
:sm="6"
:md="6"
:lg="4"
:xl="3"
v-for="(mealplan, i) in plannedMeals"
:key="i"
>
<v-card class="mt-1">
<v-card-title>
{{ formatDate(mealplan.startDate) }} -
{{ formatDate(mealplan.endDate) }}
</v-card-title>
<v-list nav>
<v-list-item-group color="primary">
<v-list-item
v-for="(meal, index) in mealplan.meals"
:key="generateKey(meal.slug, index)"
@click="$router.push(`/recipe/${meal.slug}`)"
>
<v-list-item-avatar
color="primary"
class="headline font-weight-light white--text"
>
<v-img :src="getImage(meal.image)"></v-img>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="meal.name"></v-list-item-title>
<v-list-item-subtitle v-text="meal.dateText">
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</v-list-item-group>
</v-list>
<v-card-actions class="mt-n5">
<v-spacer></v-spacer>
<v-btn
color="accent lighten-2"
class="mx-0"
text
@click="editPlan(mealplan.uid)"
>
{{ $t("general.edit") }}
</v-btn>
<v-btn
color="error lighten-2"
class="mx-2"
text
@click="deletePlan(mealplan.uid)"
>
{{ $t("general.delete") }}
</v-btn>
</v-card-actions>
</v-card>
</v-col>
</v-row>
</div>
</template>
@ -104,7 +108,7 @@ export default {
},
editPlan(id) {
this.plannedMeals.forEach((element) => {
this.plannedMeals.forEach(element => {
if (element.uid === id) {
this.editMealPlan = element;
}

View file

@ -23,14 +23,16 @@
<v-card-text> {{ meal.description }} </v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
align="center"
color="secondary"
text
@click="$router.push(`/recipe/${meal.slug}`)"
>
{{$t('recipe.view-recipe')}}
{{ $t("recipe.view-recipe") }}
</v-btn>
<v-spacer></v-spacer>
</v-card-actions>
</v-card>
</v-col>

View file

@ -29,7 +29,12 @@
/>
</div>
<RecipeEditor v-else v-model="recipeDetails" @upload="getImage" />
<RecipeEditor
ref="recipeEditor"
v-else
v-model="recipeDetails"
@upload="getImage"
/>
</v-card>
</template>
@ -85,20 +90,22 @@ export default {
},
async createRecipe() {
this.isLoading = true;
if (this.$refs.recipeEditor.validateRecipe()) {
this.isLoading = true;
if (this.fileObject) {
this.recipeDetails.image = this.fileObject.name;
if (this.fileObject) {
this.recipeDetails.image = this.fileObject.name;
}
let slug = await api.recipes.create(this.recipeDetails);
if (this.fileObject) {
await api.recipes.updateImage(slug, this.fileObject);
}
this.isLoading = false;
this.$router.push(`/recipe/${slug}`);
}
let slug = await api.recipes.create(this.recipeDetails);
if (this.fileObject) {
await api.recipes.updateImage(slug, this.fileObject);
}
this.isLoading = false;
this.$router.push(`/recipe/${slug}`);
},
},
};

View file

@ -22,6 +22,7 @@
"
@save="saveRecipe"
@delete="deleteRecipe"
class="sticky"
/>
<RecipeViewer
@ -45,7 +46,12 @@
height="1500px"
:options="jsonEditorOptions"
/>
<RecipeEditor v-else v-model="recipeDetails" @upload="getImageFile" />
<RecipeEditor
v-else
v-model="recipeDetails"
ref="recipeEditor"
@upload="getImageFile"
/>
</v-card>
</template>
@ -137,16 +143,30 @@ export default {
deleteRecipe() {
api.recipes.delete(this.recipeDetails.slug);
},
async saveRecipe() {
let slug = await api.recipes.update(this.recipeDetails);
if (this.fileObject) {
await api.recipes.updateImage(this.recipeDetails.slug, this.fileObject);
validateRecipe() {
if (this.jsonEditor) {
return true;
} else {
return this.$refs.recipeEditor.validateRecipe();
}
},
async saveRecipe() {
if (this.validateRecipe()) {
let slug = await api.recipes.update(this.recipeDetails);
this.form = false;
this.imageKey += 1;
this.$router.push(`/recipe/${slug}`);
if (this.fileObject) {
await api.recipes.updateImage(
this.recipeDetails.slug,
this.fileObject
);
}
this.form = false;
this.imageKey += 1;
if (slug != this.recipeDetails.slug) {
this.$router.push(`/recipe/${slug}`);
}
}
},
showForm() {
this.form = true;
@ -169,4 +189,9 @@ export default {
width: 100%;
bottom: 0;
}
.sticky {
position: sticky !important;
top: 0;
z-index: 2;
}
</style>

View file

@ -43,7 +43,7 @@ export default {
},
data() {
return {
searchResults: null,
searchResults: [],
};
},
methods: {

View file

@ -13,7 +13,8 @@
"
>
</v-alert>
<Theme />
<General />
<Theme class="mt-2" />
<Backup class="mt-2" />
<Webhooks class="mt-2" />
<Migration class="mt-2" />
@ -39,9 +40,11 @@
<script>
import Backup from "../components/Settings/Backup";
import General from "../components/Settings/General";
import Webhooks from "../components/Settings/Webhook";
import Theme from "../components/Settings/Theme";
import Migration from "../components/Settings/Migration";
import api from "../api";
import axios from "axios";
export default {
@ -50,15 +53,18 @@ export default {
Webhooks,
Theme,
Migration,
General,
},
data() {
return {
latestVersion: null,
version: "v0.1.0",
version: null,
};
},
mounted() {
async mounted() {
this.getVersion();
let versionData = await api.meta.get_version();
this.version = versionData.version;
},
computed: {
newVersion() {

View file

@ -4,6 +4,8 @@ import SearchPage from "./pages/SearchPage";
import RecipePage from "./pages/RecipePage";
import RecipeNewPage from "./pages/RecipeNewPage";
import SettingsPage from "./pages/SettingsPage";
import AllRecipesPage from "./pages/AllRecipesPage";
import CategoryPage from "./pages/CategoryPage";
import MeaplPlanPage from "./pages/MealPlanPage";
import MealPlanThisWeekPage from "./pages/MealPlanThisWeekPage";
import api from "./api";
@ -12,6 +14,8 @@ export const routes = [
{ path: "/", component: HomePage },
{ path: "/mealie", component: HomePage },
{ path: "/search", component: SearchPage },
{ path: "/recipes/all", component: AllRecipesPage },
{ path: "/recipes/:category", component: CategoryPage },
{ path: "/recipe/:recipe", component: RecipePage },
{ path: "/new/", component: RecipeNewPage },
{ path: "/settings/site", component: SettingsPage },

View file

@ -0,0 +1,44 @@
import api from "../../api";
const state = {
showRecent: true,
showLimit: 9,
categories: [],
homeCategories: [],
};
const mutations = {
setShowRecent(state, payload) {
state.showRecent = payload;
},
setShowLimit(state, payload) {
state.showLimit = payload;
},
setCategories(state, payload) {
state.categories = payload;
},
setHomeCategories(state, payload) {
state.homeCategories = payload;
},
};
const actions = {
async requestHomePageSettings() {
let categories = await api.categories.get_all();
this.commit("setCategories", categories);
},
};
const getters = {
getShowRecent: (state) => state.showRecent,
getShowLimit: (state) => state.showLimit,
getCategories: (state) => state.categories,
getHomeCategories: (state) => state.homeCategories,
};
export default {
state,
mutations,
actions,
getters,
};

View file

@ -0,0 +1,56 @@
import VueI18n from "../../i18n";
const state = {
lang: "en",
allLangs: [
{
name: "English",
value: "en",
},
{
name: "Danish",
value: "da",
},
{
name: "French",
value: "fr",
},
{
name: "Swedish",
value: "sv",
},
{
name: "简体中文",
value: "zh-CN",
},
{
name: "繁體中文",
value: "zh-TW",
},
],
};
const mutations = {
setLang(state, payload) {
VueI18n.locale = payload;
state.lang = payload;
},
};
const actions = {
initLang({ getters }) {
VueI18n.locale = getters.getActiveLang;
},
};
const getters = {
getActiveLang: (state) => state.lang,
getAllLangs: (state) => state.allLangs,
};
export default {
state,
mutations,
actions,
getters,
};

View file

View file

@ -3,19 +3,24 @@ import Vuex from "vuex";
import api from "../api";
import createPersistedState from "vuex-persistedstate";
import userSettings from "./modules/userSettings";
import language from "./modules/language";
import homePage from "./modules/homePage";
Vue.use(Vuex);
const store = new Vuex.Store({
plugins: [
createPersistedState({
paths: ["userSettings"],
paths: ["userSettings", "language", "homePage"],
}),
],
modules: {
userSettings,
language,
homePage,
},
state: {
// Home Page Settings
// Snackbar
snackActive: false,
snackText: "",

View file

@ -43,7 +43,7 @@ const monthsShort = [
export default {
getImageURL(image) {
return `/api/recipe/image/${image}/`;
return `/api/recipes/${image}/image`;
},
generateUniqueKey(item, index) {
const uniqueKey = `${item}-${index}`;
@ -53,17 +53,17 @@ export default {
const dow = days[dateObject.getUTCDay()];
const month = months[dateObject.getUTCMonth()];
const day = dateObject.getUTCDate();
const year = dateObject.getFullYear();
// const year = dateObject.getFullYear();
return `${dow}, ${month} ${day}, ${year}`;
return `${dow}, ${month} ${day}`;
},
getDateAsTextAlt(dateObject) {
const dow = days[dateObject.getUTCDay()];
const month = monthsShort[dateObject.getUTCMonth()];
const day = dateObject.getUTCDate();
const year = dateObject.getFullYear();
// const year = dateObject.getFullYear();
return `${dow}, ${month} ${day}, ${year}`;
return `${dow}, ${month} ${day}`;
},
getDateAsPythonDate(dateObject) {
const month = dateObject.getMonth() + 1;