diff --git a/common/utils/model_utils.py b/common/utils/model_utils.py index 36a0719..10108b1 100644 --- a/common/utils/model_utils.py +++ b/common/utils/model_utils.py @@ -56,7 +56,11 @@ def replace_variable_in_template(template: str, variable: str, value: str) -> st Returns: str: Template with variable placeholder replaced """ - return template.replace(variable, value or "") + + current_app.logger.info(f"Replacing variable {variable} with value {value}") + modified_template = template.replace(f"{{{variable}}}", value or "") + current_app.logger.info(f"Modified template: {modified_template}") + return modified_template def get_embedding_model_and_class(tenant_id, catalog_id, full_embedding_name="mistral.mistral-embed"): diff --git a/eveai_app/templates/base.html b/eveai_app/templates/base.html index aab5399..0d3e4ea 100644 --- a/eveai_app/templates/base.html +++ b/eveai_app/templates/base.html @@ -6,6 +6,24 @@ {% include 'session_defaults.html' %} + +{# #} {% include 'navbar.html' %} {% include 'header.html' %}
diff --git a/eveai_app/templates/session_defaults.html b/eveai_app/templates/session_defaults.html index 96213f8..896c5c6 100644 --- a/eveai_app/templates/session_defaults.html +++ b/eveai_app/templates/session_defaults.html @@ -1,3 +1,4 @@ +
@@ -8,7 +9,7 @@ partner_exchange -
+
{% if 'partner' in session and session['partner'] %} {{ session['partner'].get('id', 'Not selected') }}: {{ session['partner'].get('name', 'None') }} @@ -24,7 +25,7 @@ source_environment -
+
{% if 'tenant' in session and session['tenant'] %} {{ session['tenant'].get('id', 'Not selected') }}: {{ session['tenant'].get('name', 'None') }} @@ -34,13 +35,14 @@
+ {% else %}
source_environment -
+
{% if 'tenant' in session and session['tenant'] %} {{ session['tenant'].get('id', 'Not selected') }}: {{ session['tenant'].get('name', 'None') }} @@ -57,7 +59,7 @@ note_stack -
+
{% if 'catalog_id' in session and session['catalog_id'] %} {{ session.get('catalog_id', 'Not selected') }}: {{ session.get('catalog_name', 'None') }} @@ -70,4 +72,54 @@ {% endif %}
-
\ No newline at end of file +
+ + + + \ No newline at end of file diff --git a/eveai_app/views/document_views.py b/eveai_app/views/document_views.py index 0d3e208..f7b216c 100644 --- a/eveai_app/views/document_views.py +++ b/eveai_app/views/document_views.py @@ -395,11 +395,11 @@ def add_document(): return redirect(prefixed_url_for('document_bp.documents_processing')) except EveAIException as e: - flash(str(e), 'error') + flash(str(e), 'danger') current_app.logger.error(f"Error adding document: {str(e)}") except Exception as e: current_app.logger.error(f'Error adding document: {str(e)}') - flash('An error occurred while adding the document.', 'error') + flash('An error occurred while adding the document.', 'danger') return render_template('document/add_document.html', form=form) @@ -501,7 +501,7 @@ def handle_document_selection(): try: doc_id = ast.literal_eval(document_identification).get('value') except (ValueError, AttributeError): - flash('Invalid document selection.', 'error') + flash('Invalid document selection.', 'danger') return redirect(prefixed_url_for('document_bp.documents')) action = request.form['action'] diff --git a/eveai_app/views/list_views/document_list_views.py b/eveai_app/views/list_views/document_list_views.py index 96e06c9..a7c1883 100644 --- a/eveai_app/views/list_views/document_list_views.py +++ b/eveai_app/views/list_views/document_list_views.py @@ -272,7 +272,7 @@ def get_documents_processing_list_view(catalog_id): data.append({ 'id': doc.id, 'name': doc.name, - 'processing': doc.processing, + 'processing_finished': not doc.processing, 'processing_started_at': doc.processing_started_at.strftime('%Y-%m-%d %H:%M:%S') if doc.processing_started_at else '', 'processing_finished_at': doc.processing_finished_at.strftime('%Y-%m-%d %H:%M:%S') if doc.processing_finished_at else '', 'processing_error': doc.processing_error, @@ -282,7 +282,7 @@ def get_documents_processing_list_view(catalog_id): columns = [ {'title': 'ID', 'field': 'id', 'width': 80}, {'title': 'Name', 'field': 'name'}, - {'title': 'Processing', 'field': 'processing', 'formatter': 'tickCross'}, + {'title': 'Finished Processing', 'field': 'processing_finished', 'formatter': 'tickCross'}, {'title': 'Start', 'field': 'processing_started_at'}, {'title': 'Finish', 'field': 'processing_finished_at'}, {'title': 'Error', 'field': 'processing_error'},