mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-17 02:31:18 +01:00
Merge pull request #856 from LarveyOfficial/dashName
✨ Dash Integration: Ability to re-name widget for multiple instances
This commit is contained in:
@@ -4,6 +4,9 @@
|
|||||||
"description": "Displays the graphs of an external Dash. Instance inside Homarr.",
|
"description": "Displays the graphs of an external Dash. Instance inside Homarr.",
|
||||||
"settings": {
|
"settings": {
|
||||||
"title": "Settings for Dash. widget",
|
"title": "Settings for Dash. widget",
|
||||||
|
"dashName": {
|
||||||
|
"label": "Dash. Name"
|
||||||
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"label": "Dash. URL"
|
"label": "Dash. URL"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ const definition = defineWidget({
|
|||||||
id: 'dashdot',
|
id: 'dashdot',
|
||||||
icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/dashdot.png',
|
icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/dashdot.png',
|
||||||
options: {
|
options: {
|
||||||
|
dashName: {
|
||||||
|
type: 'text',
|
||||||
|
defaultValue: 'Dash.',
|
||||||
|
},
|
||||||
url: {
|
url: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
@@ -177,11 +181,11 @@ function DashDotTile({ widget }: DashDotTileProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { graphsOrder, usePercentages, columns, graphHeight } = widget.properties;
|
const { dashName, graphsOrder, usePercentages, columns, graphHeight } = widget.properties;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack spacing="xs">
|
<Stack spacing="xs">
|
||||||
<Title order={3}>{t('card.title')}</Title>
|
<Title order={3}>{dashName || t('card.title')}</Title>
|
||||||
{!info && <p>{t('card.errors.noInformation')}</p>}
|
{!info && <p>{t('card.errors.noInformation')}</p>}
|
||||||
{info && (
|
{info && (
|
||||||
<div className={classes.graphsContainer}>
|
<div className={classes.graphsContainer}>
|
||||||
|
|||||||
Reference in New Issue
Block a user