fix core historical stats query filter: specify server_id

This commit is contained in:
beckerinj
2023-01-12 17:08:09 -05:00
parent d604b28d91
commit 56b21f0d9e
4 changed files with 13 additions and 16 deletions

View File

@@ -486,7 +486,7 @@ impl State {
"ts",
limit,
query.page as u64 * limit as u64,
doc! { "ts": { "$mod": [ts_mod, 0] } },
doc! { "server_id": server_id, "ts": { "$mod": [ts_mod, 0] } },
projection,
)
.await

View File

@@ -25,7 +25,7 @@ const Home: Component<{}> = (p) => {
<Match when={width() >= 1200}>
<Grid class={combineClasses(s.Home)}>
<Servers />
<Grid>
<Grid style={{ height: "fit-content" }}>
<Summary />
<Updates />
</Grid>

View File

@@ -107,7 +107,7 @@ const Server: Component<{ id: string }> = (p) => {
<Icon type="refresh" width="0.85rem" />
</button>
</Show>
<A href={`/server/${p.id}/stats`} class="blue">
<A href={`/server/${p.id}/stats`} class="blue" onClick={e => e.stopPropagation()}>
<Icon type="timeline-line-chart" />
</A>
</Flex>

View File

@@ -60,12 +60,12 @@ export const LoadChart: Component<{
disableScroll?: boolean;
}> = (p) => {
const line = () => {
return p.stats()?.filter(s => s.system_load !== undefined).map((s) => {
return p.stats()?.map((s) => {
return {
time: convertTsMsToLocalUnixTsInSecs(
(s as SystemStatsRecord).ts || (s as SystemStats).refresh_ts
),
value: s.system_load!,
value: s.system_load || 0,
};
});
};
@@ -114,17 +114,14 @@ export const CpuFreqChart: Component<{
disableScroll?: boolean;
}> = (p) => {
const line = () => {
return p
.stats()
?.filter((s) => s.cpu_freq_mhz !== undefined)
.map((s) => {
return {
time: convertTsMsToLocalUnixTsInSecs(
(s as SystemStatsRecord).ts || (s as SystemStats).refresh_ts
),
value: s.cpu_freq_mhz! / 1000,
};
});
return p.stats()?.map((s) => {
return {
time: convertTsMsToLocalUnixTsInSecs(
(s as SystemStatsRecord).ts || (s as SystemStats).refresh_ts
),
value: (s.cpu_freq_mhz || 0) / 1000,
};
});
};
return (
<SingleStatChart