if the user scrolls down make 2/3 of the buffer load the downward
(newer) buffer and only 1/3 the upward (older), and vice versa, if
the user scrolls up load 2/3 of the older messages vs. 1/3 of newer
ones.
If the user scrolls around frantically we're roughly as good as
previously and in all other cases we're better now.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
extend: 'Ext.panel.Panel',
xtype: 'proxmoxLogView',
- pageSize: 500,
+ pageSize: 510,
viewBuffer: 50,
lineHeight: 16,
let limit = viewModel.get('params.limit');
let total = viewModel.get('data.total');
+ // heuristic: scroll up? -> load more in front; scroll down? -> load more at end
+ let startRatio = view.lastTargetLine && view.lastTargetLine > targetLine ? 2/3 : 1/3;
+ view.lastTargetLine = targetLine;
+
let newStart = scrolledToBottom
? Math.trunc(total - limit, 10)
- : Math.trunc(targetLine - (limit / 2) + 10);
+ : Math.trunc(targetLine - (startRatio * limit) + 10);
viewModel.set('params.start', Math.max(newStart, 0));
},
params: {
start: 0,
- limit: 500,
+ limit: 510,
},
},
},