- Fix form parameter handling for recipe_id (empty string vs None) - Remove interfering hx-on attributes from HTMX forms - Add explicit hx-swap="innerHTML" for proper content replacement - Implement global exception handler with detailed DEBUG logging - Add request middleware for comprehensive request/response logging - Enhanced modal closing logic with fallbacks - Add debug logging to recipe/button creation endpoints - Create error template for better error display - Update CLI to support --log-level per subcommand - Add CLAUDE.md with development guidelines and conventions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
62 lines
2.5 KiB
HTML
62 lines
2.5 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Buttons - ECM Control{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<h1>Button Configuration</h1>
|
|
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addButtonModal">
|
|
Add Button
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-4">
|
|
<div class="col-md-12">
|
|
<div id="button-list">
|
|
{% include "partials/button_list.html" %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Add Button Modal -->
|
|
<div class="modal fade" id="addButtonModal" tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Add New Button</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<form hx-post="/buttons" hx-target="#button-list" hx-swap="innerHTML">
|
|
<div class="modal-body">
|
|
<div class="mb-3">
|
|
<label for="name" class="form-label">Button Name</label>
|
|
<input type="text" class="form-control" id="name" name="name" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="gpio_pin" class="form-label">GPIO Pin</label>
|
|
<input type="number" class="form-control" id="gpio_pin" name="gpio_pin"
|
|
min="0" max="40" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="recipe_id" class="form-label">Recipe</label>
|
|
<select class="form-select" id="recipe_id" name="recipe_id">
|
|
<option value="">Select a recipe (optional)</option>
|
|
{% for recipe in recipes %}
|
|
<option value="{{ recipe.id }}">{{ recipe.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="submit" class="btn btn-primary">Add Button</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |