From f1fcd071a85e475144116b45e199951d490e69cd Mon Sep 17 00:00:00 2001 From: ajnart Date: Fri, 19 May 2023 09:49:29 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Switch=20docker=20module=20to=20`ta?= =?UTF-8?q?nstack/react-query`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/header/Header.tsx | 2 +- src/modules/Docker/ContainerActionBar.tsx | 12 +++-- src/modules/Docker/DockerModule.tsx | 55 ++++++++--------------- 3 files changed, 28 insertions(+), 41 deletions(-) diff --git a/src/components/layout/header/Header.tsx b/src/components/layout/header/Header.tsx index 5eeadc149..44bb12b51 100644 --- a/src/components/layout/header/Header.tsx +++ b/src/components/layout/header/Header.tsx @@ -42,7 +42,7 @@ export function Header(props: any) { > {!editModeEnabled && } - {!editModeEnabled && } + void ) { - showNotification({ + notifications.show({ id: containerId, loading: true, title: `${t(`actions.${action}.start`)} ${containerName}`, @@ -40,7 +40,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}`, @@ -49,7 +49,7 @@ function sendDockerCommand( }); }) .catch((err) => { - updateNotification({ + notifications.update({ id: containerId, color: 'red', title: t('errors.unknownError.title'), @@ -73,6 +73,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 (