mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-01 21:13:39 +01:00
Merge pull request #1384 from fancybits/add-channels
Add Channels DVR Server widget
This commit is contained in:
commit
7b697a88de
@ -106,6 +106,12 @@
|
|||||||
"totalObserved": "Total Observed",
|
"totalObserved": "Total Observed",
|
||||||
"diffsDetected": "Diffs Detected"
|
"diffsDetected": "Diffs Detected"
|
||||||
},
|
},
|
||||||
|
"channelsdvrserver": {
|
||||||
|
"shows": "Shows",
|
||||||
|
"recordings": "Recordings",
|
||||||
|
"scheduled": "Scheduled",
|
||||||
|
"passes": "Passes"
|
||||||
|
},
|
||||||
"tautulli": {
|
"tautulli": {
|
||||||
"playing": "Playing",
|
"playing": "Playing",
|
||||||
"transcoding": "Transcoding",
|
"transcoding": "Transcoding",
|
||||||
|
36
src/widgets/channelsdvrserver/component.jsx
Normal file
36
src/widgets/channelsdvrserver/component.jsx
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
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: channelsData, error: channelsError } = useWidgetAPI(widget, "status");
|
||||||
|
|
||||||
|
if (channelsError) {
|
||||||
|
return <Container error={channelsError} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!channelsData) {
|
||||||
|
return (
|
||||||
|
<Container service={service}>
|
||||||
|
<Block label="channelsdvrserver.shows" />
|
||||||
|
<Block label="channelsdvrserver.recordings" />
|
||||||
|
<Block label="channelsdvrserver.scheduled" />
|
||||||
|
<Block label="channelsdvrserver.passes" />
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Container service={service}>
|
||||||
|
<Block label="channelsdvrserver.shows" value={t("common.number", { value: channelsData.stats.groups })} />
|
||||||
|
<Block label="channelsdvrserver.recordings" value={t("common.number", { value: channelsData.stats.files })} />
|
||||||
|
<Block label="channelsdvrserver.scheduled" value={t("common.number", { value: channelsData.stats.jobs })} />
|
||||||
|
<Block label="channelsdvrserver.passes" value={t("common.number", { value: channelsData.stats.rules })} />
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
14
src/widgets/channelsdvrserver/widget.js
Normal file
14
src/widgets/channelsdvrserver/widget.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||||
|
|
||||||
|
const widget = {
|
||||||
|
api: "{url}/{endpoint}",
|
||||||
|
proxyHandler: genericProxyHandler,
|
||||||
|
|
||||||
|
mappings: {
|
||||||
|
status: {
|
||||||
|
endpoint: "dvr",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default widget;
|
@ -7,6 +7,7 @@ const components = {
|
|||||||
autobrr: dynamic(() => import("./autobrr/component")),
|
autobrr: dynamic(() => import("./autobrr/component")),
|
||||||
bazarr: dynamic(() => import("./bazarr/component")),
|
bazarr: dynamic(() => import("./bazarr/component")),
|
||||||
changedetectionio: dynamic(() => import("./changedetectionio/component")),
|
changedetectionio: dynamic(() => import("./changedetectionio/component")),
|
||||||
|
channelsdvrserver: dynamic(() => import("./channelsdvrserver/component")),
|
||||||
cloudflared: dynamic(() => import("./cloudflared/component")),
|
cloudflared: dynamic(() => import("./cloudflared/component")),
|
||||||
coinmarketcap: dynamic(() => import("./coinmarketcap/component")),
|
coinmarketcap: dynamic(() => import("./coinmarketcap/component")),
|
||||||
deluge: dynamic(() => import("./deluge/component")),
|
deluge: dynamic(() => import("./deluge/component")),
|
||||||
|
@ -4,6 +4,7 @@ import authentik from "./authentik/widget";
|
|||||||
import autobrr from "./autobrr/widget";
|
import autobrr from "./autobrr/widget";
|
||||||
import bazarr from "./bazarr/widget";
|
import bazarr from "./bazarr/widget";
|
||||||
import changedetectionio from "./changedetectionio/widget";
|
import changedetectionio from "./changedetectionio/widget";
|
||||||
|
import channelsdvrserver from "./channelsdvrserver/widget";
|
||||||
import cloudflared from "./cloudflared/widget";
|
import cloudflared from "./cloudflared/widget";
|
||||||
import coinmarketcap from "./coinmarketcap/widget";
|
import coinmarketcap from "./coinmarketcap/widget";
|
||||||
import deluge from "./deluge/widget";
|
import deluge from "./deluge/widget";
|
||||||
@ -13,7 +14,7 @@ import emby from "./emby/widget";
|
|||||||
import fileflows from "./fileflows/widget";
|
import fileflows from "./fileflows/widget";
|
||||||
import flood from "./flood/widget";
|
import flood from "./flood/widget";
|
||||||
import freshrss from "./freshrss/widget";
|
import freshrss from "./freshrss/widget";
|
||||||
import ghostfolio from "./ghostfolio/widget"
|
import ghostfolio from "./ghostfolio/widget";
|
||||||
import gluetun from "./gluetun/widget";
|
import gluetun from "./gluetun/widget";
|
||||||
import gotify from "./gotify/widget";
|
import gotify from "./gotify/widget";
|
||||||
import grafana from "./grafana/widget";
|
import grafana from "./grafana/widget";
|
||||||
@ -83,6 +84,7 @@ const widgets = {
|
|||||||
autobrr,
|
autobrr,
|
||||||
bazarr,
|
bazarr,
|
||||||
changedetectionio,
|
changedetectionio,
|
||||||
|
channelsdvrserver,
|
||||||
cloudflared,
|
cloudflared,
|
||||||
coinmarketcap,
|
coinmarketcap,
|
||||||
deluge,
|
deluge,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user