mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-11 06:24:59 +02:00
23 lines
491 B
TypeScript
23 lines
491 B
TypeScript
|
import NodeCache from "node-cache";
|
||
|
import { sendToClient } from "../ws";
|
||
|
|
||
|
export const dockerSocketCache = new NodeCache({
|
||
|
stdTTL: 3600 // seconds
|
||
|
});
|
||
|
|
||
|
export function fetchContainers(newtId: string) {
|
||
|
const payload = {
|
||
|
type: `newt/socket/fetch`,
|
||
|
data: {}
|
||
|
};
|
||
|
sendToClient(newtId, payload);
|
||
|
}
|
||
|
|
||
|
export function dockerSocket(newtId: string) {
|
||
|
const payload = {
|
||
|
type: `newt/socket/check`,
|
||
|
data: {}
|
||
|
};
|
||
|
sendToClient(newtId, payload);
|
||
|
}
|