- Specialist Editor Change (all components in same overview), modal editors to allow for more complex configuration of Agents, Tasks and Tools
- Strengthening dynamic forms
This commit is contained in:
@@ -4,25 +4,51 @@
|
||||
{% block content_description %}{{ description }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% set disabled_fields = [] %}
|
||||
{% set exclude_fields = [] %}
|
||||
{% for field in form.get_static_fields() %}
|
||||
{{ render_field(field, disabled_fields, exclude_fields) }}
|
||||
{% endfor %}
|
||||
{% if form.get_dynamic_fields is defined %}
|
||||
{% for collection_name, fields in form.get_dynamic_fields().items() %}
|
||||
{% if fields|length > 0 %}
|
||||
<h4 class="mt-4">{{ collection_name }}</h4>
|
||||
{% endif %}
|
||||
{% for field in fields %}
|
||||
{{ render_field(field, disabled_fields, exclude_fields) }}
|
||||
{% endfor %}
|
||||
<form id="componentEditForm" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
{% set disabled_fields = [] %}
|
||||
{% set exclude_fields = [] %}
|
||||
{% for field in form.get_static_fields() %}
|
||||
{{ render_field(field, disabled_fields, exclude_fields) }}
|
||||
{% endfor %}
|
||||
{% if form.get_dynamic_fields is defined %}
|
||||
{% for collection_name, fields in form.get_dynamic_fields().items() %}
|
||||
{% if fields|length > 0 %}
|
||||
<h4 class="mt-4">{{ collection_name }}</h4>
|
||||
{% endif %}
|
||||
{% for field in fields %}
|
||||
{{ render_field(field, disabled_fields, exclude_fields) }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<div class="btn-group mt-3">
|
||||
{% if enable_reset_defaults %}
|
||||
<button type="button" class="btn btn-outline-secondary" id="resetDefaults"
|
||||
data-model-default="{{ model_default | default('') }}"
|
||||
data-temperature-default="{{ temperature_default | default('') }}">Reset to defaults</button>
|
||||
{% endif %}
|
||||
<button type="submit" class="btn btn-primary ms-2">{{ submit_text }}</button>
|
||||
<button type="button" class="btn btn-secondary ms-2" data-bs-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
{% if enable_reset_defaults %}
|
||||
<script>
|
||||
(function(){
|
||||
const btn = document.getElementById('resetDefaults');
|
||||
if (!btn) return;
|
||||
btn.addEventListener('click', function(){
|
||||
const modelDef = btn.getAttribute('data-model-default');
|
||||
const tempDef = btn.getAttribute('data-temperature-default');
|
||||
const modelEl = document.querySelector('#componentEditForm select[name="llm_model"]');
|
||||
const tempEl = document.querySelector('#componentEditForm input[name="temperature"]');
|
||||
if (modelEl && modelDef) { modelEl.value = modelDef; }
|
||||
if (tempEl && tempDef) {
|
||||
tempEl.value = tempDef;
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{% endif %}
|
||||
<div class="btn-group mt-3">
|
||||
<button type="submit" class="btn btn-primary component-submit">{{ submit_text }}</button>
|
||||
<button type="button" class="btn btn-secondary ms-2" id="cancelEdit">Cancel</button>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content_footer %}
|
||||
|
||||
Reference in New Issue
Block a user