mirror of
https://github.com/gethomepage/homepage.git
synced 2025-05-24 02:02:35 -04:00
Enhancement: add label formatting for dynamic-list customapi widget (#5217)
This commit is contained in:
parent
d99c3cb691
commit
a35da39c03
@ -189,6 +189,7 @@ widget:
|
|||||||
name: id # required, field in each item to use as the item name (left side)
|
name: id # required, field in each item to use as the item name (left side)
|
||||||
label: ip_address # required, field in each item to use as the item label (right side)
|
label: ip_address # required, field in each item to use as the item label (right side)
|
||||||
limit: 5 # optional, limit the number of items to display
|
limit: 5 # optional, limit the number of items to display
|
||||||
|
format: text # optional - format of the label field
|
||||||
target: https://example.com/server/{id} # optional, makes items clickable with template support
|
target: https://example.com/server/{id} # optional, makes items clickable with template support
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -267,14 +267,14 @@ export default function Component({ service }) {
|
|||||||
>
|
>
|
||||||
<div className="font-thin pl-2">{itemName}</div>
|
<div className="font-thin pl-2">{itemName}</div>
|
||||||
<div className="flex flex-row text-right">
|
<div className="flex flex-row text-right">
|
||||||
<div className="font-bold mr-2">{itemLabel}</div>
|
<div className="font-bold mr-2">{formatValue(t, mappings, itemLabel)}</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
) : (
|
) : (
|
||||||
<div key={`${itemName}-${index}`} className={className}>
|
<div key={`${itemName}-${index}`} className={className}>
|
||||||
<div className="font-thin pl-2">{itemName}</div>
|
<div className="font-thin pl-2">{itemName}</div>
|
||||||
<div className="flex flex-row text-right">
|
<div className="flex flex-row text-right">
|
||||||
<div className="font-bold mr-2">{itemLabel}</div>
|
<div className="font-bold mr-2">{formatValue(t, mappings, itemLabel)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user