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

View File

@@ -150,3 +150,20 @@ export const getContainersByAppLabel = async (appName: string) => {
return [];
};
export const containerRestart = async (containerId: string) => {
try {
const { stdout, stderr } = await execAsync(
`docker container restart ${containerId}`,
);
if (stderr) {
console.error(`Error: ${stderr}`);
return;
}
const config = JSON.parse(stdout);
return config;
} catch (error) {}
};