Merge pull request #944 from ajnart/docker-usequery

This commit is contained in:
Thomas Camlong
2023-05-22 06:33:02 +09:00
committed by GitHub
3 changed files with 28 additions and 41 deletions

View File

@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { Button, Group } from '@mantine/core';
import { showNotification, updateNotification } from '@mantine/notifications';
import { notifications } from '@mantine/notifications';
import {
IconCheck,
IconPlayerPlay,
@@ -27,7 +27,7 @@ function sendDockerCommand(
reload: () => void,
t: (key: string) => string,
) {
showNotification({
notifications.show({
id: containerId,
loading: true,
title: `${t(`actions.${action}.start`)} ${containerName}`,
@@ -38,7 +38,7 @@ function sendDockerCommand(
axios
.get(`/api/docker/container/${containerId}?action=${action}`)
.then((res) => {
updateNotification({
notifications.show({
id: containerId,
title: containerName,
message: `${t(`actions.${action}.end`)} ${containerName}`,
@@ -47,7 +47,7 @@ function sendDockerCommand(
});
})
.catch((err) => {
updateNotification({
notifications.update({
id: containerId,
color: 'red',
title: t('errors.unknownError.title'),
@@ -71,6 +71,10 @@ export default function ContainerActionBar({ selected, reload }: ContainerAction
const { name: configName, config } = useConfigContext();
const getLowestWrapper = () => config?.wrappers.sort((a, b) => a.position - b.position)[0];
if (process.env.DISABLE_EDIT_MODE === 'true') {
return null;
}
return (
<Group spacing="xs">
<Button