Instead, for historical logs, redraw every 100 events.
Then do an explicit redraw/sync. And then start the live ones.
Otherwise the CPU of the user browsing the panel is not happy :D
if ($response !== false)
{
/* Only supported in later UnrealIRCd versions */
+ $cnt = 0;
foreach($response as $r)
+ {
+ $r = (ARRAY)$r;
+ $cnt++;
+ if (($cnt % 100) != 0)
+ $r["sync_option"] = "no_sync";
send_sse($r);
+ }
}
+$r = ["sync_option"=>"sync_now"];
+send_sse($r);
+
api_log_loop(["all", "!debug"]);
} catch(e) {
return;
}
- //$('#data_list_table').DataTable()
- data_list_table.row.add({
- 'Time':data.timestamp,
- 'Level':data.level,
- 'Subsystem':data.subsystem,
- 'Event':data.event_id,
- 'Message':data.msg}).draw(true);
+
+ if (data.sync_option != "sync_now")
+ {
+ data_list_table.row.add({
+ 'Time':data.timestamp,
+ 'Level':data.level,
+ 'Subsystem':data.subsystem,
+ 'Event':data.event_id,
+ 'Message':data.msg});
+ if (data.sync_option == "no_sync")
+ return;
+ }
+ data_list_table.draw(true);
data_list_table.rows().invalidate();
data_list_table.searchPanes.rebuildPane();
}