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