mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
chg: [chats] show NB messages by chat
This commit is contained in:
parent
74e41017a1
commit
61bccecdab
4 changed files with 7 additions and 3 deletions
|
@ -178,7 +178,7 @@ class ChatServiceInstance:
|
||||||
if 'chats' in options:
|
if 'chats' in options:
|
||||||
meta['chats'] = []
|
meta['chats'] = []
|
||||||
for chat_id in self.get_chats():
|
for chat_id in self.get_chats():
|
||||||
meta['chats'].append(Chats.Chat(chat_id, self.uuid).get_meta({'created_at', 'icon', 'nb_subchannels'}))
|
meta['chats'].append(Chats.Chat(chat_id, self.uuid).get_meta({'created_at', 'icon', 'nb_subchannels', 'nb_messages'}))
|
||||||
return meta
|
return meta
|
||||||
|
|
||||||
def get_nb_chats(self):
|
def get_nb_chats(self):
|
||||||
|
|
|
@ -83,6 +83,8 @@ class Chat(AbstractChatObject):
|
||||||
meta['participants'] = self.get_participants()
|
meta['participants'] = self.get_participants()
|
||||||
if 'nb_participants' in options:
|
if 'nb_participants' in options:
|
||||||
meta['nb_participants'] = self.get_nb_participants()
|
meta['nb_participants'] = self.get_nb_participants()
|
||||||
|
if 'nb_messages' in options:
|
||||||
|
meta['nb_messages'] = self.get_nb_messages()
|
||||||
if 'username' in options:
|
if 'username' in options:
|
||||||
meta['username'] = self.get_username()
|
meta['username'] = self.get_username()
|
||||||
if 'subchannels' in options:
|
if 'subchannels' in options:
|
||||||
|
|
|
@ -63,7 +63,7 @@ def chats_explorer_networks():
|
||||||
return render_template('chats_networks.html', protocol=protocol, networks=networks)
|
return render_template('chats_networks.html', protocol=protocol, networks=networks)
|
||||||
|
|
||||||
|
|
||||||
@chats_explorer.route("chats/explorer/instance", methods=['GET'])
|
@chats_explorer.route("chats/explorer/instances", methods=['GET'])
|
||||||
@login_required
|
@login_required
|
||||||
@login_read_only
|
@login_read_only
|
||||||
def chats_explorer_instance():
|
def chats_explorer_instance():
|
||||||
|
|
|
@ -70,7 +70,8 @@
|
||||||
<th>Created at</th>
|
<th>Created at</th>
|
||||||
<th>First Seen</th>
|
<th>First Seen</th>
|
||||||
<th>Last Seen</th>
|
<th>Last Seen</th>
|
||||||
<th>NB SubChannels</th>
|
<th>SubChannels</th>
|
||||||
|
<th>Messages</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody style="font-size: 15px;">
|
<tbody style="font-size: 15px;">
|
||||||
|
@ -94,6 +95,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ chat['nb_subchannels'] }}</td>
|
<td>{{ chat['nb_subchannels'] }}</td>
|
||||||
|
<td>{{ chat['nb_messages'] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in a new issue