chg: [chat explorer] show chats tags

This commit is contained in:
terrtia 2025-01-10 10:33:28 +01:00
parent c82ffdb815
commit 5094f9fcde
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
3 changed files with 11 additions and 2 deletions

View file

@ -770,6 +770,7 @@ def enrich_chat_relationships_labels(relationships):
else:
meta[row['target']] = row['target']
return meta
def api_get_chat_service_instance(chat_instance_uuid):
chat_instance = ChatServiceInstance(chat_instance_uuid)
if not chat_instance.exists():

View file

@ -74,7 +74,8 @@ def chats_explorer_instance():
return create_json_response(chat_instance[0], chat_instance[1])
else:
chat_instance = chat_instance[0]
return render_template('chat_instance.html', chat_instance=chat_instance)
return render_template('chat_instance.html', chat_instance=chat_instance,
bootstrap_label=bootstrap_label)
@chats_explorer.route("chats/explorer/chats/selector", methods=['GET'])
@login_required

View file

@ -83,7 +83,14 @@
class="rounded-circle mr-1" alt="{{ chat['id'] }}" width="40" height="40">
</td>
<td><a href="{{ url_for('chats_explorer.chats_explorer_chat') }}?subtype={{ chat_instance['uuid'] }}&id={{ chat['id'] }}">{{ chat['id'] }}</a></td>
<td><b>{{ chat['name'] }}</b></td>
<td>
<b>{{ chat['name'] }}</b>
<div>
{% for tag in chat['tags'] %}
<span class="badge badge-{{ bootstrap_label[loop.index0 % 5] }}">{{ tag }}</span>
{% endfor %}
</div>
</td>
<td>
{% if chat['username'] %}
{{ chat['username'] }}