commit
15a0e6cc54
@ -1,114 +1,124 @@
|
|||||||
{
|
{
|
||||||
"common": {
|
"common": {
|
||||||
"bytes": "{{value, bytes}}",
|
"bytes": "{{value, bytes}}",
|
||||||
"bits": "{{value, bytes(bits: true)}}",
|
"bits": "{{value, bytes(bits: true)}}",
|
||||||
"bbytes": "{{value, bytes(binary: true)}}",
|
"bbytes": "{{value, bytes(binary: true)}}",
|
||||||
"bbits": "{{value, bytes(bits: true, binary: true)}}",
|
"bbits": "{{value, bytes(bits: true, binary: true)}}",
|
||||||
"byterate": "{{value, rate}}",
|
"byterate": "{{value, rate}}",
|
||||||
"bitrate": "{{value, rate(bits: true)}}",
|
"bitrate": "{{value, rate(bits: true)}}",
|
||||||
"percent": "{{value, percent}}",
|
"percent": "{{value, percent}}",
|
||||||
"number": "{{value, number}}",
|
"number": "{{value, number}}",
|
||||||
"ms": "{{value, number}}"
|
"ms": "{{value, number}}"
|
||||||
},
|
},
|
||||||
"widget": {
|
"widget": {
|
||||||
"missing_type": "Missing Widget Type: {{type}}",
|
"missing_type": "Missing Widget Type: {{type}}",
|
||||||
"api_error": "API Error",
|
"api_error": "API Error",
|
||||||
"status": "Status"
|
"status": "Status"
|
||||||
},
|
},
|
||||||
"weather": {
|
"weather": {
|
||||||
"current": "Current Location",
|
"current": "Current Location",
|
||||||
"allow": "Click to allow",
|
"allow": "Click to allow",
|
||||||
"updating": "Updating",
|
"updating": "Updating",
|
||||||
"wait": "Please wait"
|
"wait": "Please wait"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"placeholder": "Search…"
|
"placeholder": "Search…"
|
||||||
},
|
},
|
||||||
"resources": {
|
"resources": {
|
||||||
"total": "Total",
|
"total": "Total",
|
||||||
"free": "Free",
|
"free": "Free",
|
||||||
"used": "Used"
|
"used": "Used"
|
||||||
},
|
},
|
||||||
"docker": {
|
"docker": {
|
||||||
"rx": "RX",
|
"rx": "RX",
|
||||||
"tx": "TX",
|
"tx": "TX",
|
||||||
"mem": "MEM",
|
"mem": "MEM",
|
||||||
"cpu": "CPU",
|
"cpu": "CPU",
|
||||||
"offline": "Offline"
|
"offline": "Offline"
|
||||||
},
|
},
|
||||||
"emby": {
|
"emby": {
|
||||||
"playing": "Playing",
|
"playing": "Playing",
|
||||||
"transcoding": "Transcoding",
|
"transcoding": "Transcoding",
|
||||||
"bitrate": "Bitrate",
|
"bitrate": "Bitrate",
|
||||||
"no_active": "No Active Streams"
|
"no_active": "No Active Streams"
|
||||||
},
|
},
|
||||||
"tautulli": {
|
"tautulli": {
|
||||||
"playing": "Playing",
|
"playing": "Playing",
|
||||||
"transcoding": "Transcoding",
|
"transcoding": "Transcoding",
|
||||||
"bitrate": "Bitrate",
|
"bitrate": "Bitrate",
|
||||||
"no_active": "No Active Streams"
|
"no_active": "No Active Streams"
|
||||||
},
|
},
|
||||||
"nzbget": {
|
"nzbget": {
|
||||||
"rate": "Rate",
|
"rate": "Rate",
|
||||||
"remaining": "Remaining",
|
"remaining": "Remaining",
|
||||||
"downloaded": "Downloaded"
|
"downloaded": "Downloaded"
|
||||||
},
|
},
|
||||||
"rutorrent": {
|
"sabnzbd": {
|
||||||
"active": "Active",
|
"rate": "Rate",
|
||||||
"upload": "Upload",
|
"queue": "Queue",
|
||||||
"download": "Download"
|
"timeleft": "Time Left"
|
||||||
},
|
},
|
||||||
"sonarr": {
|
"rutorrent": {
|
||||||
"wanted": "Wanted",
|
"active": "Active",
|
||||||
"queued": "Queued",
|
"upload": "Upload",
|
||||||
"series": "Series"
|
"download": "Download"
|
||||||
},
|
},
|
||||||
"radarr": {
|
"sonarr": {
|
||||||
"wanted": "Wanted",
|
"wanted": "Wanted",
|
||||||
"queued": "Queued",
|
"queued": "Queued",
|
||||||
"movies": "Movies"
|
"series": "Series"
|
||||||
},
|
},
|
||||||
"ombi": {
|
"radarr": {
|
||||||
"pending": "Pending",
|
"wanted": "Wanted",
|
||||||
"approved": "Approved",
|
"queued": "Queued",
|
||||||
"available": "Available"
|
"movies": "Movies"
|
||||||
},
|
},
|
||||||
"jellyseerr": {
|
"readarr": {
|
||||||
"pending": "Pending",
|
"wanted": "Wanted",
|
||||||
"approved": "Approved",
|
"queued": "Queued",
|
||||||
"available": "Available"
|
"books": "Books"
|
||||||
},
|
},
|
||||||
"overseerr": {
|
"ombi": {
|
||||||
"pending": "Pending",
|
"pending": "Pending",
|
||||||
"approved": "Approved",
|
"approved": "Approved",
|
||||||
"available": "Available"
|
"available": "Available"
|
||||||
},
|
},
|
||||||
"pihole": {
|
"jellyseerr": {
|
||||||
"queries": "Queries",
|
"pending": "Pending",
|
||||||
"blocked": "Blocked",
|
"approved": "Approved",
|
||||||
"gravity": "Gravity"
|
"available": "Available"
|
||||||
},
|
},
|
||||||
"speedtest": {
|
"overseerr": {
|
||||||
"upload": "Upload",
|
"pending": "Pending",
|
||||||
"download": "Download",
|
"approved": "Approved",
|
||||||
"ping": "Ping"
|
"available": "Available"
|
||||||
},
|
},
|
||||||
"portainer": {
|
"pihole": {
|
||||||
"running": "Running",
|
"queries": "Queries",
|
||||||
"stopped": "Stopped",
|
"blocked": "Blocked",
|
||||||
"total": "Total"
|
"gravity": "Gravity"
|
||||||
},
|
},
|
||||||
"traefik": {
|
"speedtest": {
|
||||||
"routers": "Routers",
|
"upload": "Upload",
|
||||||
"services": "Services",
|
"download": "Download",
|
||||||
"middleware": "Middleware"
|
"ping": "Ping"
|
||||||
},
|
},
|
||||||
"npm": {
|
"portainer": {
|
||||||
"enabled": "Enabled",
|
"running": "Running",
|
||||||
"disabled": "Disabled",
|
"stopped": "Stopped",
|
||||||
"total": "Total"
|
"total": "Total"
|
||||||
},
|
},
|
||||||
"coinmarketcap": {
|
"traefik": {
|
||||||
"configure": "Configure one or more crypto currencies to track"
|
"routers": "Routers",
|
||||||
}
|
"services": "Services",
|
||||||
|
"middleware": "Middleware"
|
||||||
|
},
|
||||||
|
"npm": {
|
||||||
|
"enabled": "Enabled",
|
||||||
|
"disabled": "Disabled",
|
||||||
|
"total": "Total"
|
||||||
|
},
|
||||||
|
"coinmarketcap": {
|
||||||
|
"configure": "Configure one or more crypto currencies to track"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
import useSWR from "swr";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
import Widget from "../widget";
|
||||||
|
import Block from "../block";
|
||||||
|
|
||||||
|
import { formatApiUrl } from "utils/api-helpers";
|
||||||
|
|
||||||
|
export default function Readarr({ service }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const config = service.widget;
|
||||||
|
|
||||||
|
const { data: booksData, error: booksError } = useSWR(formatApiUrl(config, "book"));
|
||||||
|
const { data: wantedData, error: wantedError } = useSWR(formatApiUrl(config, "wanted/missing"));
|
||||||
|
const { data: queueData, error: queueError } = useSWR(formatApiUrl(config, "queue/status"));
|
||||||
|
|
||||||
|
if (booksError || wantedError || queueError) {
|
||||||
|
return <Widget error={t("widget.api_error")} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!booksData || !wantedData || !queueData) {
|
||||||
|
return (
|
||||||
|
<Widget>
|
||||||
|
<Block label={t("readarr.wanted")} />
|
||||||
|
<Block label={t("readarr.queued")} />
|
||||||
|
<Block label={t("readarr.books")} />
|
||||||
|
</Widget>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const have = booksData.filter((book) => book.statistics.bookFileCount > 0);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Widget>
|
||||||
|
<Block label={t("readarr.wanted")} value={wantedData.totalRecords} />
|
||||||
|
<Block label={t("readarr.queued")} value={queueData.totalCount} />
|
||||||
|
<Block label={t("readarr.books")} value={have.length} />
|
||||||
|
</Widget>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
import useSWR from "swr";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
import Widget from "../widget";
|
||||||
|
import Block from "../block";
|
||||||
|
|
||||||
|
import { formatApiUrl } from "utils/api-helpers";
|
||||||
|
|
||||||
|
export default function SABnzbd({ service }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const config = service.widget;
|
||||||
|
|
||||||
|
const { data: queueData, error: queueError } = useSWR(formatApiUrl(config, "queue"));
|
||||||
|
|
||||||
|
if (queueError) {
|
||||||
|
return <Widget error={t("widget.api_error")} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!queueData) {
|
||||||
|
return (
|
||||||
|
<Widget>
|
||||||
|
<Block label={t("sabnzbd.rate")} />
|
||||||
|
<Block label={t("sabnzbd.queue")} />
|
||||||
|
<Block label={t("sabnzbd.timeleft")} />
|
||||||
|
</Widget>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Widget>
|
||||||
|
<Block label={t("sabnzbd.rate")} value={`${queueData.queue.speed}bps`} />
|
||||||
|
<Block label={t("sabnzbd.queue")} value={queueData.queue.noofslots} />
|
||||||
|
<Block label={t("sabnzbd.timeleft")} value={queueData.queue.timeleft} />
|
||||||
|
</Widget>
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in new issue