mirror of
https://github.com/CyberL1/dlinux-dashboard.git
synced 2025-01-22 01:19:18 -05:00
fix(server): expose container stats
This commit is contained in:
parent
85a8dc9ccb
commit
63ae224084
10
src/routes/containers/_id/stats.ts
Normal file
10
src/routes/containers/_id/stats.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import type { Container } from "#src/types/Container.ts";
|
||||||
|
import { getContainer } from "#src/utils/containers.ts";
|
||||||
|
import type { FastifyInstance, FastifyRequest } from "fastify";
|
||||||
|
|
||||||
|
export default (fastify: FastifyInstance) => {
|
||||||
|
fastify.get("/", (req: FastifyRequest<{ Params: Container }>) => {
|
||||||
|
const container = getContainer(req.params.id);
|
||||||
|
return container.stats();
|
||||||
|
});
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user