mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-09 23:15:46 +01:00
✨Re-add the docker component
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { Box, createStyles, Group, Header as MantineHeader, Indicator } from '@mantine/core';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { REPO_URL, CURRENT_VERSION } from '../../../../data/constants';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { CURRENT_VERSION, REPO_URL } from '../../../../data/constants';
|
||||
import { useConfigContext } from '../../../config/provider';
|
||||
import DockerMenuButton from '../../../modules/docker/DockerModule';
|
||||
import { Logo } from '../Logo';
|
||||
import { useCardStyles } from '../useCardStyles';
|
||||
import { AddElementAction } from './Actions/AddElementAction/AddElementAction';
|
||||
@@ -39,6 +40,7 @@ export function Header(props: any) {
|
||||
<Search />
|
||||
<AddElementAction />
|
||||
<ToggleEditModeAction />
|
||||
<DockerMenuButton />
|
||||
<Indicator size={15} color="blue" withBorder processing disabled={!newVersionAvailable}>
|
||||
<SettingsMenu newVersionAvailable={newVersionAvailable} />
|
||||
</Indicator>
|
||||
|
||||
@@ -7,17 +7,9 @@ import { useTranslation } from 'next-i18next';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { useConfigContext } from '../../config/provider';
|
||||
import { IModule } from '../ModuleTypes';
|
||||
import ContainerActionBar from './ContainerActionBar';
|
||||
import DockerTable from './DockerTable';
|
||||
|
||||
export const DockerModule: IModule = {
|
||||
title: 'Docker',
|
||||
icon: IconBrandDocker,
|
||||
component: DockerMenuButton,
|
||||
id: 'docker',
|
||||
};
|
||||
|
||||
export default function DockerMenuButton(props: any) {
|
||||
const [opened, setOpened] = useState(false);
|
||||
const [containers, setContainers] = useState<Docker.ContainerInfo[]>([]);
|
||||
@@ -61,8 +53,7 @@ export default function DockerMenuButton(props: any) {
|
||||
if (!dockerEnabled) {
|
||||
return null;
|
||||
}
|
||||
// Check if the user has at least one container
|
||||
if (containers.length < 1) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Drawer
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export { DockerModule } from './DockerModule';
|
||||
@@ -1,3 +1,2 @@
|
||||
export * from './ping';
|
||||
export * from './docker';
|
||||
export * from './overseerr';
|
||||
|
||||
Reference in New Issue
Block a user