mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-12 08:25:47 +01:00
✨ Add configuration info in about modal
This commit is contained in:
@@ -15,7 +15,9 @@ import {
|
|||||||
import {
|
import {
|
||||||
IconBrandDiscord,
|
IconBrandDiscord,
|
||||||
IconBrandGithub,
|
IconBrandGithub,
|
||||||
|
IconFile,
|
||||||
IconLanguage,
|
IconLanguage,
|
||||||
|
IconSchema,
|
||||||
IconVersions,
|
IconVersions,
|
||||||
IconVocabulary,
|
IconVocabulary,
|
||||||
IconWorldWww,
|
IconWorldWww,
|
||||||
@@ -26,6 +28,8 @@ import { i18n, Trans, useTranslation } from 'next-i18next';
|
|||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
import { CURRENT_VERSION } from '../../../data/constants';
|
import { CURRENT_VERSION } from '../../../data/constants';
|
||||||
|
import { useConfigContext } from '../../config/provider';
|
||||||
|
import { useConfigStore } from '../../config/store';
|
||||||
import { usePrimaryGradient } from '../layout/useGradient';
|
import { usePrimaryGradient } from '../layout/useGradient';
|
||||||
|
|
||||||
interface AboutModalProps {
|
interface AboutModalProps {
|
||||||
@@ -127,6 +131,9 @@ const useInformationTableItems = (newVersionAvailable?: string): InformationTabl
|
|||||||
// TODO: Fix this to not request. Pass it as a prop.
|
// TODO: Fix this to not request. Pass it as a prop.
|
||||||
const colorGradiant = usePrimaryGradient();
|
const colorGradiant = usePrimaryGradient();
|
||||||
|
|
||||||
|
const { configVersion } = useConfigContext();
|
||||||
|
const { configs } = useConfigStore();
|
||||||
|
|
||||||
let items: InformationTableItem[] = [];
|
let items: InformationTableItem[] = [];
|
||||||
|
|
||||||
if (i18n !== null) {
|
if (i18n !== null) {
|
||||||
@@ -157,7 +164,24 @@ const useInformationTableItems = (newVersionAvailable?: string): InformationTabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
items = [
|
items = [
|
||||||
...items,
|
{
|
||||||
|
icon: <IconSchema size={20} />,
|
||||||
|
label: 'Configuration schema version',
|
||||||
|
content: (
|
||||||
|
<Badge variant="gradient" gradient={colorGradiant}>
|
||||||
|
{configVersion}
|
||||||
|
</Badge>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: <IconFile size={20} />,
|
||||||
|
label: 'Available configurations',
|
||||||
|
content: (
|
||||||
|
<Badge variant="gradient" gradient={colorGradiant}>
|
||||||
|
{configs.length}
|
||||||
|
</Badge>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
icon: <IconVersions size={20} />,
|
icon: <IconVersions size={20} />,
|
||||||
label: 'version',
|
label: 'version',
|
||||||
@@ -199,6 +223,7 @@ const useInformationTableItems = (newVersionAvailable?: string): InformationTabl
|
|||||||
</Group>
|
</Group>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
...items,
|
||||||
];
|
];
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
|
|||||||
Reference in New Issue
Block a user