Skip to content

Commit

Permalink
chg: [chat explorer] show chats tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Jan 10, 2025
1 parent c82ffdb commit 5094f9f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions bin/lib/chats_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
3 changes: 2 additions & 1 deletion var/www/blueprints/chats_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion var/www/templates/chats_explorer/chat_instance.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ <h4 class="text-secondary">{{ chat_instance["protocol"] }} :</h4>
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'] }}
Expand Down

0 comments on commit 5094f9f

Please sign in to comment.