Add translations for en & de in Dashdot; Fix PR comments

This commit is contained in:
MauriceNino
2023-02-14 13:01:12 +01:00
parent 2a5a0a7699
commit 368707ed76
25 changed files with 177 additions and 61 deletions

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -4,23 +4,77 @@
"description": "Zeigt die Graphen einer externen Dash.-Instanz innerhalb von Homarr an.",
"settings": {
"title": "Einstellungen für Dash. Widget",
"cpuMultiView": {
"label": "CPU Multi-Core View"
},
"storageMultiView": {
"label": "Speicher Multi-Drive View"
},
"useCompactView": {
"label": "Kompaktmodus verwenden"
},
"graphs": {
"label": "Graphen"
},
"url": {
"label": "Dash. URL"
},
"usePercentages": {
"label": "Prozentangaben anzeigen"
},
"columns": {
"label": "Anzahl Spalten"
},
"graphHeight": {
"label": "Höhe der Graphen"
},
"graphsOrder": {
"label": "Graphen (Reihenfolge)",
"storage": {
"label": "Speicher",
"enabled": {
"label": "Im Widget anzeigen"
},
"span": {
"label": "Spaltenbreite"
},
"compactView": {
"label": "Als Text anzeigen (Kompakt)"
},
"multiView": {
"label": "Als Multi-Laufwerk anzeigen"
}
},
"network": {
"label": "Netzwerk",
"enabled": {
"label": "Im Widget anzeigen"
},
"span": {
"label": "Spaltenbreite"
},
"compactView": {
"label": "Als Text anzeigen (Kompakt)"
}
},
"cpu": {
"label": "CPU",
"enabled": {
"label": "Im Widget anzeigen"
},
"span": {
"label": "Spaltenbreite"
},
"multiView": {
"label": "Als Multi-Core anzeigen"
}
},
"ram": {
"label": "RAM",
"enabled": {
"label": "Im Widget anzeigen"
},
"span": {
"label": "Spaltenbreite"
}
},
"gpu": {
"label": "GPU",
"enabled": {
"label": "Im Widget anzeigen"
},
"span": {
"label": "Spaltenbreite"
}
}
}
}
},
@@ -50,7 +104,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "Μνήμη RAM"
},
"gpu": {

View File

@@ -4,23 +4,77 @@
"description": "Displays the graphs of an external Dash. instance inside of Homarr.",
"settings": {
"title": "Settings for Dash. widget",
"cpuMultiView": {
"label": "CPU Multi-Core View"
},
"storageMultiView": {
"label": "Storage Multi-Drive View"
},
"useCompactView": {
"label": "Use Compact View"
},
"graphs": {
"label": "Graphs"
},
"url": {
"label": "Dash. URL"
},
"usePercentages": {
"label": "Display percentages"
},
"columns": {
"label": "Display columns"
},
"graphHeight": {
"label": "Height of graphs"
},
"graphsOrder": {
"label": "Graphs (Order)",
"storage": {
"label": "Storage",
"enabled": {
"label": "Show in widget"
},
"span": {
"label": "Column span"
},
"compactView": {
"label": "Show as text (compact)"
},
"multiView": {
"label": "Show as multi-drive-view"
}
},
"network": {
"label": "Network",
"enabled": {
"label": "Show in widget"
},
"span": {
"label": "Column span"
},
"compactView": {
"label": "Show as text (compact)"
}
},
"cpu": {
"label": "CPU",
"enabled": {
"label": "Show in widget"
},
"span": {
"label": "Column span"
},
"multiView": {
"label": "Show as multi-core-view"
}
},
"ram": {
"label": "RAM",
"enabled": {
"label": "Show in widget"
},
"span": {
"label": "Column span"
}
},
"gpu": {
"label": "GPU",
"enabled": {
"label": "Show in widget"
},
"span": {
"label": "Column span"
}
}
}
}
},
@@ -50,7 +104,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "מעבד"
},
"memory": {
"ram": {
"title": "זיכרון פנימי"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "ラム"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "ЦП"
},
"memory": {
"ram": {
"title": "ОЗУ"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "Процесор"
},
"memory": {
"ram": {
"title": "Оперативна пам'ять"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "RAM"
},
"gpu": {

View File

@@ -50,7 +50,7 @@
"cpu": {
"title": "CPU"
},
"memory": {
"ram": {
"title": "内存"
},
"gpu": {

View File

@@ -1,7 +1,8 @@
import { Collapse, createStyles, Stack, Text } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import { IconChevronDown, IconGripVertical } from '@tabler/icons';
import { Reorder, useDragControls } from 'framer-motion';
import { FC, ReactNode, useState } from 'react';
import { FC, ReactNode } from 'react';
import { IDraggableListInputValue } from '../../../../widgets/widgets';
const useStyles = createStyles((theme) => ({
@@ -14,7 +15,6 @@ const useStyles = createStyles((theme) => ({
}`,
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.white,
marginBottom: theme.spacing.xs,
gap: theme.spacing.xs,
},
row: {
display: 'flex',
@@ -80,7 +80,7 @@ const ListItem: FC<{
const { classes, cx } = useStyles();
const controls = useDragControls();
const [showContent, setShowContent] = useState(false);
const [opened, handlers] = useDisclosure(false);
const hasContent = props.children != null && Object.keys(props.children).length !== 0;
return (
@@ -100,8 +100,8 @@ const ListItem: FC<{
{hasContent && (
<IconChevronDown
className={cx(classes.clickableIcons, { [classes.rotate]: showContent })}
onClick={() => setShowContent(!showContent)}
className={cx(classes.clickableIcons, { [classes.rotate]: opened })}
onClick={() => handlers.toggle()}
size={18}
stroke={1.5}
/>
@@ -109,7 +109,7 @@ const ListItem: FC<{
</div>
{hasContent && (
<Collapse in={showContent}>
<Collapse in={opened}>
<Stack className={classes.collapseContent}>{props.children}</Stack>
</Collapse>
)}

View File

@@ -205,7 +205,7 @@ const WidgetOptionTypeSwitch: FC<{
labels={Object.fromEntries(
Object.entries(option.items).map(([graphName]) => [
graphName,
t(`descriptor.settings.${graphName}.label`),
t(`descriptor.settings.${key}.${graphName}.label`),
])
)}
>
@@ -217,7 +217,7 @@ const WidgetOptionTypeSwitch: FC<{
key={`${graphName}.${subKey}.${i}`}
option={setting as IWidgetOptionValue}
widgetId={widgetId}
propName={`${graphName}.${subKey}`}
propName={`${key}.${graphName}.${subKey}`}
value={typedVal.find((v) => v.key === graphName)?.subValues?.[subKey]}
handleChange={(_, newVal) =>
handleChange(

View File

@@ -1,4 +1,5 @@
import { createStyles, Title, useMantineTheme } from '@mantine/core';
import { useTranslation } from 'next-i18next';
import { DashDotCompactNetwork, DashDotInfo } from './DashDotCompactNetwork';
import { DashDotCompactStorage } from './DashDotCompactStorage';
@@ -21,21 +22,28 @@ export const DashDotGraph = ({
usePercentages,
info,
}: DashDotGraphProps) => {
const { t } = useTranslation('modules/dashdot');
const { classes } = useStyles();
return graph === 'storage' && isCompact ? (
<DashDotCompactStorage info={info} />
) : graph === 'network' && isCompact ? (
<DashDotCompactNetwork info={info} />
) : (
if (graph === 'storage' && isCompact) {
return <DashDotCompactStorage info={info} />;
}
if (graph === 'network' && isCompact) {
return <DashDotCompactNetwork info={info} />;
}
const title = t(`card.graphs.${graph}.title`);
return (
<div className={classes.graphContainer}>
<Title className={classes.graphTitle} order={4}>
{graph}
{title}
</Title>
<iframe
className={classes.iframe}
key={graph}
title={graph}
title={title}
src={useIframeSrc(dashDotUrl, graph, multiView, usePercentages)}
style={{
height: `${graphHeight}px`,