mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 23:24:52 +09:00
Add limit and order to query log request
Add optional limit to the number of log records to return in the log query request to avoid having the web interface instance console download the entire log for only to show a few hundred lines from it. To make it possible to query the end of the log instead of just the start add an order option as well.
This commit is contained in:
1 parent
9aebeeac02
commit
e3d8aa1a9b
5 files changed
+53
-2
No files matched your search
@@ -456,12 +456,15 @@ class ControlConnection extends BaseConnection {
|
||||
// - The log file is read starting from the beginning
|
||||
let setDuration = lastQueryLogTime.startTimer();
|
||||
let log = await query({
|
||||
order: "asc",
|
||||
order: message.data.order,
|
||||
limit: Infinity,
|
||||
from: new Date(0),
|
||||
});
|
||||
|
||||
log = log.filter(this.constructor.logFilter(message.data));
|
||||
if (message.data.limit) {
|
||||
log = log.slice(0, message.data.limit);
|
||||
}
|
||||
setDuration();
|
||||
return { log };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user