This commit is contained in:
seb
2026-10-13 17:49:52 +02:00
parent 345d6f5752
commit bc583a180f
3 changed files with 930 additions and 299 deletions

View File

@@ -222,6 +222,7 @@ class OrderSearchField extends PureComponent {
constructor(props) {
super(props);
const s = orderAutomat.state;
const stats = orderAutomat.getChunkStats?.();
this.state = {
input: s.filter ?? '',
onlyUnpaid: s.onlyUnpaid ?? false,
@@ -229,6 +230,9 @@ class OrderSearchField extends PureComponent {
seekMonths: s.seekMonths ?? 0,
seekYears: s.seekYears ?? 0,
negativeSeekMonths: s.negativeSeekMonths ?? 0,
lruChunksCount: stats?.lruChunksCount || 0,
maxLruChunks: stats?.maxLruChunks || 50,
filterCachesCount: stats?.filterCaches?.length || 1,
};
}
@@ -241,10 +245,20 @@ class OrderSearchField extends PureComponent {
seekYears: state.seekYears ?? 0,
negativeSeekMonths: state.negativeSeekMonths ?? 0,
}));
if (import.meta.env.DEV) {
this.unsubStats = orderAutomat.subscribeChunkStats?.((stats) => {
this.setState({
lruChunksCount: stats.lruChunksCount,
maxLruChunks: stats.maxLruChunks,
filterCachesCount: stats.filterCaches?.length || 1,
});
});
}
}
componentWillUnmount() {
this.unsub?.();
this.unsubStats?.();
}
render() {
@@ -427,11 +441,11 @@ class OrderSearchField extends PureComponent {
</Box>
{import.meta.env.DEV && (
<Tooltip title="Chunk-Cache-Monitor öffnen (Alt+Shift+C)">
<Tooltip title={`Chunk-Cache-Monitor öffnen (Alt+Shift+C) — ${this.state.lruChunksCount || 0}/${this.state.maxLruChunks || 50} Chunks im RAM über ${this.state.filterCachesCount || 1} Filter`}>
<Chip
size="small"
icon={<ViewModuleIcon sx={{ fontSize: 16 }} />}
label="Chunk-Cache"
label={this.state.lruChunksCount > 0 ? `Chunk-Cache (${this.state.lruChunksCount}/${this.state.maxLruChunks || 50})` : 'Chunk-Cache'}
onClick={() => window.dispatchEvent(new CustomEvent('dash:toggle-chunk-monitor'))}
sx={{
cursor: 'pointer',