feat: added restart button for containers

This commit is contained in:
sashagoncharov19
2024-09-03 19:25:51 +00:00
parent 9bac042498
commit b1b01373ca
3 changed files with 124 additions and 68 deletions
+10
View File
@@ -1,6 +1,7 @@
import { z } from "zod";
import {
getConfig,
containerRestart,
getContainers,
getContainersByAppLabel,
getContainersByAppNameMatch,
@@ -12,6 +13,15 @@ export const dockerRouter = createTRPCRouter({
return await getContainers();
}),
restartContainer: protectedProcedure
.input(
z.object({
containerId: z.string().min(1),
}),
).mutation(async ({ input }) => {
return await containerRestart(input.containerId);
}),
getConfig: protectedProcedure
.input(
z.object({