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
+18
View File
@@ -235,6 +235,24 @@ class TandoorClient:
"url": f"{self.base_url}/view/recipe/{recipe_id}",
}
def upload_image_bytes(self, recipe_id: int, 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/recipe/{recipe_id}/image/",
files=files,
timeout=30,
)
r.raise_for_status()
# ------------------------------------------------------------------
# Internal
# ------------------------------------------------------------------