Add Tdarr integration and widget (#1882)

This commit is contained in:
Janik Brüll
2024-04-18 23:01:20 +02:00
committed by GitHub
parent 39f416c6a9
commit 2b92c98975
17 changed files with 1219 additions and 4 deletions

View File

@@ -16,7 +16,11 @@ import { useTranslation } from 'next-i18next';
import { highlight, languages } from 'prismjs';
import Editor from 'react-simple-code-editor';
import { useColorTheme } from '~/tools/color';
import { BackgroundImageAttachment, BackgroundImageRepeat, BackgroundImageSize } from '~/types/settings';
import {
BackgroundImageAttachment,
BackgroundImageRepeat,
BackgroundImageSize,
} from '~/types/settings';
import { useBoardCustomizationFormContext } from '../form';

View File

@@ -202,5 +202,10 @@ export const availableIntegrations = [
value: 'proxmox',
image: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/png/proxmox.png',
label: 'Proxmox',
},
{
value: 'tdarr',
image: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/tdarr.png',
label: 'Tdarr',
}
] as const satisfies Readonly<SelectItem[]>;

View File

@@ -85,7 +85,7 @@ export const WidgetsEditModal = ({
return (
<Stack>
{items.map(([key, _], index) => {
{items.map(([key], index) => {
const option = (currentWidgetDefinition as any).options[key] as IWidgetOptionValue;
const value = moduleProperties[key] ?? option.defaultValue;
@@ -395,6 +395,7 @@ const WidgetOptionTypeSwitch: FC<{
</Flex>
</Stack>
);
/* eslint-enable no-case-declarations */
default:
return null;

View File

@@ -63,7 +63,7 @@ export const WidgetsMenu = ({ integration, widget }: WidgetsMenuProps) => {
const handleEditClick = () => {
openContextModalGeneric<WidgetEditModalInnerProps>({
modal: 'integrationOptions',
title: <Title order={4}>{t('descriptor.settings.title')}</Title>,
title: t('descriptor.settings.title'),
innerProps: {
widgetId: widget.id,
widgetType: integration,