]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Logs: you can now enter an IP address or nickid in the search field.
authorBram Matthys <redacted>
Fri, 5 May 2023 16:51:19 +0000 (18:51 +0200)
committerBram Matthys <redacted>
Fri, 5 May 2023 16:52:33 +0000 (18:52 +0200)
This because it now searches in all JSON data, include IP addresses,
nickid, nicks, hostnames, etc... makes it very easy to filter on
all events of a particular person or host.

js/unrealircd-admin.js
logs/index.php

index 15a2e1c54ba3af3ea6e05a6d4b5681e4c59cda7c..688fc3b5a3a596753f800ff92a39b55019350097 100644 (file)
@@ -160,7 +160,7 @@ function NewLogEntry(e)
             'Subsystem':data.subsystem,
             'Event':data.event_id,
             'Message':data.msg,
-            'Raw':data});
+            'Raw':JSON.stringify(data)});
 
         if (!sync)
             return;
index 43b8399afb6c1c71d33139abc3e444db9af9d29a..193328ed1b2b731cbf05f472cd8dd6e293d7a3bf 100644 (file)
@@ -175,7 +175,7 @@ $(document).ready( function () {
                        { 'data': 'Event', 'responsivePriority': 5, 'render': log_colorizer },
                        //{ 'data': 'Message', 'responsivePriority': 2, 'render': DataTable.render.ellipsis(100, false) },
                        { 'data': 'Message', 'responsivePriority': 2, 'render': log_text },
-                       { 'data': 'Raw', 'visible': false, 'searchable': false },
+                       { 'data': 'Raw', 'visible': false, 'searchable': true },
                ],
                'pageLength':100,
                'order':[[0,'desc']],
@@ -215,7 +215,8 @@ function view_log_entry(e)
        $('#view_log_entry_subsystem').html('<code>' + data['Subsystem'] + '</code>')
        $('#view_log_entry_event').html('<code>' + data['Event'] + '</code>')
        $('#view_log_entry_message').html('<pre class="tdwrap">' + data['Message'] + '</pre>')
-       j = new JSONFormatter(data['Raw'], 99);
+       j = JSON.parse(data['Raw']);
+       j = new JSONFormatter(j, 99);
        $('#view_log_entry_json').html(j.render());
        $('#view_log_entry').modal('show');
 }