{% import 'macros/form.html' as form %}

<div class="">
    <form class="form-control border-0 shadow-none p-0" hx-post="{{ h.url_for('selftools_htmx.selftools_redis_update') }}" hx-trigger="submit" hx-target="#redis-update-resp" hx-swap="innerHTML">
        <div class="mb-3">
            <div class="info-block mb-2">
                <i class="fa fa-info-circle"></i>
                {{ _('Updates the Key if exists or creates it if not.') }}
            </div>
        </div>
        <div class="row">
            <div class="col-lg-6">
                <label for="redis_key">Key</label>
                <input type="text" name="redis_key" id="redis_key_update" class="form-control" required>                
            </div>
            <div class="col-lg-6">
                <label for="redis_value_update">Value</label>
                <textarea id="redis_value_update" name="value" rows="5" class="form-control" required></textarea>              
            </div>
        </div>
        <button type="button" class="btn btn-dark mt-2" data-bs-toggle="modal" data-bs-target="#redis-update-confirmation">
            Submit
        </button>

        {% snippet "selftools/snippets/confirmation.html", modal_id='redis-update-confirmation', modal_label_id='redis-update-label-id' %}
    </form>
</div>

<div id="redis-update-resp" class="bg-light p-3 border rounded mt-3">Output here...</div>
