mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-06 12:18:48 +00:00

* Restrict emby endpoints and proxy segments * Dont allow path traversal in segments * Restrict qbittorrent proxy endpoints * Restrict npm proxy endpoints * Restrict flood proxy endpoints * Restrict tdarr proxy endpoints * Restrict xteve proxy endpoints * Restrict transmission proxy endpoints * disallow non-mapped endpoints this change drops all requests that have un-mapped endpoint queries allowedEndpoints is added as a method to pass proxy requests via a regex on the endpoint most widgets with custom proxies use either no endpoint, or a static one Co-Authored-By: Ben Phelps <ben@phelps.io>
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
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: xteveData, error: xteveError } = useWidgetAPI(widget);
|
|
|
|
if (xteveError) {
|
|
return <Container service={service} error={xteveError} />;
|
|
}
|
|
|
|
if (!xteveData) {
|
|
return (
|
|
<Container service={service}>
|
|
<Block label="xteve.streams_all" />
|
|
<Block label="xteve.streams_active " />
|
|
<Block label="xteve.streams_xepg" />
|
|
</Container>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Container service={service}>
|
|
<Block label="xteve.streams_all" value={t("common.number", { value: xteveData["streams.all"] ?? 0 })} />
|
|
<Block label="xteve.streams_active" value={t("common.number", { value: xteveData["streams.active"] ?? 0 })} />
|
|
<Block label="xteve.streams_xepg" value={t("common.number", { value: xteveData["streams.xepg"] ?? 0 })} />
|
|
</Container>
|
|
);
|
|
}
|