🔧 add configuration to docker module

This commit is contained in:
Noan
2022-08-22 21:51:23 +02:00
parent 02fd62afaa
commit 7d08646a29
4 changed files with 47 additions and 19 deletions

View File

@@ -11,9 +11,9 @@ import {
} from '@tabler/icons';
import axios from 'axios';
import Dockerode from 'dockerode';
import { useState } from 'react';
import { tryMatchService } from '../../tools/addToHomarr';
import { AddAppShelfItemForm } from '../../components/AppShelf/AddAppShelfItem';
import { useState } from 'react';
function sendDockerCommand(
action: string,
@@ -30,7 +30,7 @@ function sendDockerCommand(
disallowClose: true,
});
axios
.get(`/api/docker/container/${containerId}?action=${action}`)
.get(`localhost:2375/containers/${containerId}/${action}`)
.then((res) => {
updateNotification({
id: containerId,
@@ -88,6 +88,7 @@ export default function ContainerActionBar({ selected, reload }: ContainerAction
variant="light"
color="orange"
radius="md"
disabled={selected.length === 0}
>
Restart
</Button>
@@ -103,6 +104,7 @@ export default function ContainerActionBar({ selected, reload }: ContainerAction
variant="light"
color="red"
radius="md"
disabled={selected.length === 0}
>
Stop
</Button>
@@ -118,10 +120,11 @@ export default function ContainerActionBar({ selected, reload }: ContainerAction
variant="light"
color="green"
radius="md"
disabled={selected.length === 0}
>
Start
</Button>
<Button leftIcon={<IconRefresh />} onClick={() => reload()} variant="light" radius="md">
<Button leftIcon={<IconRefresh />} onClick={() => reload()} variant="light" color="violet" radius="md">
Refresh data
</Button>
<Button
@@ -141,6 +144,7 @@ export default function ContainerActionBar({ selected, reload }: ContainerAction
setOpened(true);
}
}}
disabled={selected.length === 0}
>
Add to Homarr
</Button>
@@ -156,6 +160,7 @@ export default function ContainerActionBar({ selected, reload }: ContainerAction
)
)
}
disabled={selected.length === 0}
>
Remove
</Button>