mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-04 01:36:39 +00:00
docker socket
This commit is contained in:
22
server/routers/newt/dockerSocket.ts
Normal file
22
server/routers/newt/dockerSocket.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user