Edit page: auto-expand step textareas, wider layout, image management

- Textareas auto-resize to fit content (min 120px)
- Edit page container widened to 1100px
- Show recipe image with URL input and file upload options
- Add image upload endpoint (POST /api/recipes/<backend>/<id>/image)
- Add upload_image_bytes() to both Mealie and Tandoor clients

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 09:07:56 +01:00
parent ae2f0e062f
commit e746dc10c9
4 changed files with 218 additions and 16 deletions
+19
View File
@@ -214,6 +214,25 @@ class MealieClient:
r = self.session.delete(f"{self.api_url}/api/recipes/{slug}", timeout=10)
r.raise_for_status()
def upload_image_bytes(self, slug: str, image_data: bytes,
content_type: str = "image/jpeg") -> None:
"""Upload raw image bytes to a recipe."""
ext = "jpg"
if "png" in content_type:
ext = "png"
elif "webp" in content_type:
ext = "webp"
files = {
"image": (f"recipe.{ext}", io.BytesIO(image_data), content_type),
}
r = self.session.put(
f"{self.api_url}/api/recipes/{slug}/image",
files=files,
data={"extension": ext},
timeout=30,
)
r.raise_for_status()
def create_recipe(self, recipe: dict) -> str:
"""Create a recipe in Mealie from a scraper result dict.