Add ChangeDetection.io widget

pull/386/head
Bruno Rossetto 2 years ago
parent 4ea279856f
commit 86d1f5c6c3

@ -1,216 +1,220 @@
{ {
"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": {
"cpu": "CPU", "cpu": "CPU",
"total": "Total", "total": "Total",
"free": "Free", "free": "Free",
"used": "Used", "used": "Used",
"load": "Load" "load": "Load"
}, },
"unifi": { "unifi": {
"users": "Users", "users": "Users",
"uptime": "System Uptime", "uptime": "System Uptime",
"days": "Days", "days": "Days",
"wan": "WAN", "wan": "WAN",
"lan_users": "LAN Users", "lan_users": "LAN Users",
"wlan_users": "WLAN Users", "wlan_users": "WLAN Users",
"up": "UP", "up": "UP",
"down": "DOWN", "down": "DOWN",
"wait": "Please wait" "wait": "Please wait"
}, },
"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": { "changedetectionio": {
"playing": "Playing", "totalObserved": "Total Observed",
"transcoding": "Transcoding", "diffsDetected": "Diffs Detected"
"bitrate": "Bitrate", },
"no_active": "No Active Streams" "tautulli": {
}, "playing": "Playing",
"nzbget": { "transcoding": "Transcoding",
"rate": "Rate", "bitrate": "Bitrate",
"remaining": "Remaining", "no_active": "No Active Streams"
"downloaded": "Downloaded" },
}, "nzbget": {
"plex": { "rate": "Rate",
"streams": "Active Streams", "remaining": "Remaining",
"movies": "Movies", "downloaded": "Downloaded"
"tv": "TV Shows" },
}, "plex": {
"sabnzbd": { "streams": "Active Streams",
"rate": "Rate", "movies": "Movies",
"queue": "Queue", "tv": "TV Shows"
"timeleft": "Time Left" },
}, "sabnzbd": {
"rutorrent": { "rate": "Rate",
"active": "Active", "queue": "Queue",
"upload": "Upload", "timeleft": "Time Left"
"download": "Download" },
}, "rutorrent": {
"transmission": { "active": "Active",
"download": "Download", "upload": "Upload",
"upload": "Upload", "download": "Download"
"leech": "Leech", },
"seed": "Seed" "transmission": {
}, "download": "Download",
"qbittorrent": { "upload": "Upload",
"download": "Download", "leech": "Leech",
"upload": "Upload", "seed": "Seed"
"leech": "Leech", },
"seed": "Seed" "qbittorrent": {
}, "download": "Download",
"sonarr": { "upload": "Upload",
"wanted": "Wanted", "leech": "Leech",
"queued": "Queued", "seed": "Seed"
"series": "Series" },
}, "sonarr": {
"radarr": { "wanted": "Wanted",
"wanted": "Wanted", "queued": "Queued",
"queued": "Queued", "series": "Series"
"movies": "Movies" },
}, "radarr": {
"lidarr": { "wanted": "Wanted",
"wanted": "Wanted", "queued": "Queued",
"queued": "Queued", "movies": "Movies"
"albums": "Albums" },
}, "lidarr": {
"readarr": { "wanted": "Wanted",
"wanted": "Wanted", "queued": "Queued",
"queued": "Queued", "albums": "Albums"
"books": "Books" },
}, "readarr": {
"bazarr": { "wanted": "Wanted",
"missingEpisodes": "Missing Episodes", "queued": "Queued",
"missingMovies": "Missing Movies" "books": "Books"
}, },
"ombi": { "bazarr": {
"pending": "Pending", "missingEpisodes": "Missing Episodes",
"approved": "Approved", "missingMovies": "Missing Movies"
"available": "Available" },
}, "ombi": {
"jellyseerr": { "pending": "Pending",
"pending": "Pending", "approved": "Approved",
"approved": "Approved", "available": "Available"
"available": "Available" },
}, "jellyseerr": {
"overseerr": { "pending": "Pending",
"pending": "Pending", "approved": "Approved",
"approved": "Approved", "available": "Available"
"available": "Available" },
}, "overseerr": {
"pihole": { "pending": "Pending",
"queries": "Queries", "approved": "Approved",
"blocked": "Blocked", "available": "Available"
"gravity": "Gravity" },
}, "pihole": {
"adguard": { "queries": "Queries",
"queries": "Queries", "blocked": "Blocked",
"blocked": "Blocked", "gravity": "Gravity"
"filtered": "Filtered", },
"latency": "Latency" "adguard": {
}, "queries": "Queries",
"speedtest": { "blocked": "Blocked",
"upload": "Upload", "filtered": "Filtered",
"download": "Download", "latency": "Latency"
"ping": "Ping" },
}, "speedtest": {
"portainer": { "upload": "Upload",
"running": "Running", "download": "Download",
"stopped": "Stopped", "ping": "Ping"
"total": "Total" },
}, "portainer": {
"traefik": { "running": "Running",
"routers": "Routers", "stopped": "Stopped",
"services": "Services", "total": "Total"
"middleware": "Middleware" },
}, "traefik": {
"npm": { "routers": "Routers",
"enabled": "Enabled", "services": "Services",
"disabled": "Disabled", "middleware": "Middleware"
"total": "Total" },
}, "npm": {
"coinmarketcap": { "enabled": "Enabled",
"configure": "Configure one or more crypto currencies to track", "disabled": "Disabled",
"1hour": "1 Hour", "total": "Total"
"1day": "1 Day", },
"7days": "7 Days", "coinmarketcap": {
"30days": "30 Days" "configure": "Configure one or more crypto currencies to track",
}, "1hour": "1 Hour",
"gotify": { "1day": "1 Day",
"apps": "Applications", "7days": "7 Days",
"clients": "Clients", "30days": "30 Days"
"messages": "Messages" },
}, "gotify": {
"prowlarr":{ "apps": "Applications",
"enableIndexers": "Indexers", "clients": "Clients",
"numberOfGrabs": "Grabs", "messages": "Messages"
"numberOfQueries": "Queries", },
"numberOfFailGrabs": "Fail Grabs", "prowlarr": {
"numberOfFailQueries": "Fail Queries" "enableIndexers": "Indexers",
}, "numberOfGrabs": "Grabs",
"jackett": { "numberOfQueries": "Queries",
"configured": "Configured", "numberOfFailGrabs": "Fail Grabs",
"errored": "Errored" "numberOfFailQueries": "Fail Queries"
}, },
"strelaysrv": { "jackett": {
"numActiveSessions": "Sessions", "configured": "Configured",
"numConnections": "Connections", "errored": "Errored"
"dataRelayed": "Relayed", },
"transferRate": "Rate" "strelaysrv": {
}, "numActiveSessions": "Sessions",
"mastodon": { "numConnections": "Connections",
"user_count": "Users", "dataRelayed": "Relayed",
"status_count": "Posts", "transferRate": "Rate"
"domain_count": "Domains" },
}, "mastodon": {
"authentik": { "user_count": "Users",
"users": "Users", "status_count": "Posts",
"loginsLast24H": "Logins (24h)", "domain_count": "Domains"
"failedLoginsLast24H": "Failed Logins (24h)" },
}, "authentik": {
"proxmox": { "users": "Users",
"mem": "MEM", "loginsLast24H": "Logins (24h)",
"cpu": "CPU", "failedLoginsLast24H": "Failed Logins (24h)"
"lxc": "LXC", },
"vms": "VMs" "proxmox": {
}, "mem": "MEM",
"glances": { "cpu": "CPU",
"cpu": "CPU", "lxc": "LXC",
"mem": "MEM", "vms": "VMs"
"wait": "Please wait" },
} "glances": {
"cpu": "CPU",
"mem": "MEM",
"wait": "Please wait"
}
} }

@ -0,0 +1,33 @@
import { useTranslation } from "next-i18next";
import Container from "components/services/widget/container";
import Block from "components/services/widget/block";
import useWidgetAPI from "utils/proxy/use-widget-api";
export default function Component({ service }) {
const { t } = useTranslation();
const { widget } = service;
const { data } = useWidgetAPI(widget, "info");
if (!data) {
return <Container error="widget.api_error" />;
}
const totalObserved = Object.keys(data).length;
let diffsDetected = 0;
Object.keys(data).forEach((key) => {
if (data[key].last_checked === data[key].last_changed) {
diffsDetected += 1;
}
});
return (
<Container service={service}>
<Block label="changedetectionio.diffsDetected" value={t("common.number", { value: diffsDetected })} />
<Block label="changedetectionio.totalObserved" value={t("common.number", { value: totalObserved })} />
</Container>
);
}

@ -0,0 +1,15 @@
import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
const widget = {
api: "{url}/api/v1/{endpoint}",
proxyHandler: credentialedProxyHandler,
mappings: {
info: {
method: "GET",
endpoint: "watch",
},
},
};
export default widget;

@ -4,6 +4,7 @@ const components = {
adguard: dynamic(() => import("./adguard/component")), adguard: dynamic(() => import("./adguard/component")),
authentik: dynamic(() => import("./authentik/component")), authentik: dynamic(() => import("./authentik/component")),
bazarr: dynamic(() => import("./bazarr/component")), bazarr: dynamic(() => import("./bazarr/component")),
changedetectionio: dynamic(() => import("./changedetectionio/component")),
coinmarketcap: dynamic(() => import("./coinmarketcap/component")), coinmarketcap: dynamic(() => import("./coinmarketcap/component")),
docker: dynamic(() => import("./docker/component")), docker: dynamic(() => import("./docker/component")),
emby: dynamic(() => import("./emby/component")), emby: dynamic(() => import("./emby/component")),

@ -1,6 +1,7 @@
import adguard from "./adguard/widget"; import adguard from "./adguard/widget";
import authentik from "./authentik/widget"; import authentik from "./authentik/widget";
import bazarr from "./bazarr/widget"; import bazarr from "./bazarr/widget";
import changedetectionio from "./changedetectionio/widget";
import coinmarketcap from "./coinmarketcap/widget"; import coinmarketcap from "./coinmarketcap/widget";
import emby from "./emby/widget"; import emby from "./emby/widget";
import gotify from "./gotify/widget"; import gotify from "./gotify/widget";
@ -34,6 +35,7 @@ const widgets = {
adguard, adguard,
authentik, authentik,
bazarr, bazarr,
changedetectionio,
coinmarketcap, coinmarketcap,
emby, emby,
gotify, gotify,
@ -63,7 +65,7 @@ const widgets = {
traefik, traefik,
transmission, transmission,
unifi, unifi,
unifi_console: unifi unifi_console: unifi,
}; };
export default widgets; export default widgets;

Loading…
Cancel
Save