Improved core structure
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
"use server";
|
||||
|
||||
import axios from "axios";
|
||||
import { Node } from "@/lib/types";
|
||||
|
||||
export async function getDocker(node: Node): Promise<{ version: string }> {
|
||||
return await (
|
||||
await axios.get(`http://${node.ip}:3000/api/get-docker`, {
|
||||
headers: { Authorization: `ApiKey ${node.key}` },
|
||||
})
|
||||
).data;
|
||||
}
|
||||
+8
-7
@@ -1,11 +1,12 @@
|
||||
"use server";
|
||||
|
||||
import Docker from "dockerode";
|
||||
import axios from "axios";
|
||||
import { Node } from "@/lib/types";
|
||||
|
||||
const docker = new Docker();
|
||||
|
||||
export async function getDocker() {
|
||||
const version = await docker.version();
|
||||
const containers = await docker.listContainers();
|
||||
return { version, containers };
|
||||
export async function getDocker(node: Node): Promise<{ version: string }> {
|
||||
return await (
|
||||
await axios.get(`http://${node.ip}:3000/api/get-docker`, {
|
||||
headers: { Authorization: `ApiKey ${node.key}` },
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
"use server";
|
||||
|
||||
import Docker from "dockerode";
|
||||
|
||||
const docker = new Docker();
|
||||
|
||||
export async function getDocker() {
|
||||
const version = await docker.version();
|
||||
const containers = await docker.listContainers();
|
||||
return { version, containers };
|
||||
}
|
||||
Reference in New Issue
Block a user