|
15 | 15 | ################################## |
16 | 16 | from lib.ConfigLoader import ConfigLoader |
17 | 17 | from lib.objects import ail_objects |
18 | | -from lib.objects import BarCodes |
19 | | -from lib.objects import CookiesNames |
20 | | -from lib.objects import CryptoCurrencies |
21 | | -from lib.objects import Domains |
22 | | -from lib.objects import Favicons |
23 | | -from lib.objects import FilesNames |
24 | | -from lib.objects import GTrackers |
25 | | -from lib.objects import Mails |
26 | | -from lib.objects import Pgps |
27 | | -from lib.objects import QrCodes |
28 | | -from lib.objects import Titles |
29 | | -from lib.objects import Usernames |
30 | 18 | from lib.crawlers import get_crawlers_stats |
| 19 | +from lib import ail_core |
31 | 20 | from lib import ail_orgs |
32 | 21 | from lib import ail_users |
33 | | -from lib import chats_viewer |
34 | 22 | from lib import Tag |
35 | 23 | from lib import Tracker |
36 | 24 |
|
@@ -133,25 +121,13 @@ def get_tracked_objs_dashboard(user_org, user_id): |
133 | 121 | return trackers |
134 | 122 |
|
135 | 123 |
|
136 | | -def get_global_stats(): # decoded ?? domhash, hhhash etag ??? |
| 124 | +def get_global_stats(): |
137 | 125 | stats = {'orgs': ail_orgs.get_nb_orgs(), |
138 | 126 | 'users': ail_users.get_nb_users(), |
139 | | - 'objs': |
140 | | - {'barcode': BarCodes.Barcodes().get_nb(), |
141 | | - 'chat': chats_viewer.get_nb_chats_stats(), |
142 | | - 'cookie-name': CookiesNames.CookiesNames().get_nb(), |
143 | | - 'cryptocurrency': CryptoCurrencies.CryptoCurrencies().get_nb(), |
144 | | - 'domain': {'onion': Domains.get_nb_domains_up_by_type('onion'), |
145 | | - 'web': Domains.get_nb_domains_up_by_type('web') |
146 | | - }, |
147 | | - 'favicon': Favicons.Favicons().get_nb(), |
148 | | - 'file-name': FilesNames.FilesNames().get_nb(), |
149 | | - 'gtracker': GTrackers.GTrackers().get_nb(), |
150 | | - 'mail': Mails.Mails().get_nb(), |
151 | | - 'pgp': Pgps.Pgps().get_nb(), |
152 | | - 'qrcode': QrCodes.Qrcodes().get_nb(), |
153 | | - 'title': Titles.Titles().get_nb(), |
154 | | - 'username': Usernames.Usernames().get_nb(), |
155 | | - }, |
| 127 | + 'objs': {}, |
156 | 128 | } |
| 129 | + for obj_type in ail_core.get_all_objects(): |
| 130 | + nb = ail_objects.get_nb_objects(obj_type) |
| 131 | + if nb: |
| 132 | + stats['objs'][obj_type] = nb |
157 | 133 | return stats |
0 commit comments