feat: custom widgets (#5889)
This commit is contained in:
1 parent
48e1844b5b
commit
aecbca2b81
69 files changed
+14620
-142
No files matched your search
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"$schema": "homarr-custom-widget-v2",
|
||||
"name": "Currency Exchange (JPY)",
|
||||
"description": "Converts 50 Japanese Yen to EUR and USD using European Central Bank rates",
|
||||
"url": "https://api.frankfurter.dev/v1/latest?from=JPY&to=EUR,USD&amount=50",
|
||||
"authType": "none",
|
||||
"method": "GET",
|
||||
"displayType": "keyValue",
|
||||
"displayConfig": {
|
||||
"type": "keyValue",
|
||||
"mappings": [
|
||||
{ "label": "50 JPY → EUR", "jsonPath": "$.rates.EUR", "unit": "€" },
|
||||
{ "label": "50 JPY → USD", "jsonPath": "$.rates.USD", "unit": "$" }
|
||||
],
|
||||
"layout": "list",
|
||||
"columns": 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "homarr-custom-widget-v2",
|
||||
"name": "Random Dog Fact",
|
||||
"description": "Displays a random fun fact about dogs",
|
||||
"url": "https://dogapi.dog/api/v2/facts",
|
||||
"authType": "none",
|
||||
"method": "GET",
|
||||
"displayType": "singleValue",
|
||||
"displayConfig": {
|
||||
"type": "singleValue",
|
||||
"jsonPath": "$.data[0].attributes.body",
|
||||
"label": "Dog Fact",
|
||||
"unit": "",
|
||||
"valueSize": "sm",
|
||||
"labelPosition": "above"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"$schema": "homarr-custom-widget-v2",
|
||||
"name": "Jellyfin library",
|
||||
"description": "Counts the number of movies, series, episodes and songs in the library",
|
||||
"iconUrl": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/jellyfin.svg",
|
||||
"url": "https://jellyfin.homelab.com/Items/Counts",
|
||||
"authType": "apiKeyHeader",
|
||||
"headerName": "X-Emby-Token",
|
||||
"method": "GET",
|
||||
"requestBody": null,
|
||||
"displayType": "countGrid",
|
||||
"displayConfig": {
|
||||
"type": "countGrid",
|
||||
"items": [
|
||||
{ "label": "Movies", "jsonPath": "$.MovieCount", "unit": "" },
|
||||
{ "label": "Series", "jsonPath": "$.SeriesCount", "unit": "" },
|
||||
{ "label": "Episodes", "jsonPath": "$.EpisodeCount", "unit": "" },
|
||||
{ "label": "Songs", "jsonPath": "$.SongCount", "unit": "" }
|
||||
],
|
||||
"columns": 4,
|
||||
"valueSize": "lg"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "homarr-custom-widget-v2",
|
||||
"name": "Pokédex — Charizard",
|
||||
"description": "Detailed Pokémon card with types, stats, tabs, pagination, and collapsible info",
|
||||
"iconUrl": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/items/poke-ball.png",
|
||||
"url": "https://pokeapi.co/api/v2/pokemon/charizard",
|
||||
"authType": "none",
|
||||
"method": "GET",
|
||||
"displayType": "customJsx",
|
||||
"displayConfig": {
|
||||
"type": "customJsx",
|
||||
"template": "<Stack gap=\"sm\" p=\"xs\">\n <Group wrap=\"nowrap\">\n <Avatar\n src={data.sprites.front_default}\n size={80}\n radius=\"sm\"\n />\n <Stack gap={4} style={{flex: 1}}>\n <Title order={3} tt=\"capitalize\">{data.name}</Title>\n <Text size=\"xs\" c=\"dimmed\">#{String(data.id).padStart(3, \"0\")} · {data.height / 10} m · {data.weight / 10} kg</Text>\n <Group gap=\"xs\">\n {data.types.map(t =>\n <TypeBadge type={t.type.name} />\n )}\n </Group>\n </Stack>\n </Group>\n <TabsContainer defaultTab=\"stats\">\n <TabPanel value=\"stats\" label=\"Stats\">\n <Stack gap=\"xs\" pt=\"xs\">\n {data.stats.map(s =>\n <StatBar label={s.stat.name} value={s.base_stat} max={255} color={s.base_stat > 100 ? \"green\" : s.base_stat > 60 ? \"yellow\" : \"red\"} />\n )}\n </Stack>\n </TabPanel>\n <TabPanel value=\"abilities\" label=\"Abilities\">\n <Collapsible title=\"Abilities\" defaultOpen={true}>\n <Group gap=\"xs\" pt=\"xs\">\n {data.abilities.map(a =>\n <Badge variant={a.is_hidden ? \"outline\" : \"filled\"} color={a.is_hidden ? \"gray\" : \"blue\"} tt=\"capitalize\">\n {a.ability.name}{a.is_hidden ? \" (hidden)\" : \"\"}\n </Badge>\n )}\n </Group>\n </Collapsible>\n </TabPanel>\n <TabPanel value=\"moves\" label=\"Moves\">\n <PaginatedList pageSize={12}>\n {data.moves.map(m =>\n <Badge size=\"xs\" variant=\"light\" tt=\"capitalize\" mb={4}>{m.move.name}</Badge>\n )}\n </PaginatedList>\n </TabPanel>\n </TabsContainer>\n</Stack>"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user