diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index 1347c1af..c026ea12 100644
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -173,5 +173,10 @@
"user_count": "Users",
"status_count": "Posts",
"domain_count": "Domains"
+ },
+ "peertube": {
+ "totalUsers": "Users",
+ "totalVideos": "Videos",
+ "totalLocalVideoFilesSize": "Video Storaged"
}
}
diff --git a/src/components/services/widget.jsx b/src/components/services/widget.jsx
index 5e07618b..7a5f4be4 100644
--- a/src/components/services/widget.jsx
+++ b/src/components/services/widget.jsx
@@ -28,6 +28,7 @@ import Prowlarr from "./widgets/service/prowlarr";
import Jackett from "./widgets/service/jackett";
import AdGuard from "./widgets/service/adguard";
import Mastodon from "./widgets/service/mastodon";
+import Peertube from "./widgets/service/peertube";
const widgetMappings = {
docker: Docker,
@@ -58,6 +59,7 @@ const widgetMappings = {
jackett: Jackett,
adguard: AdGuard,
mastodon: Mastodon,
+ peertube: Peertube
};
export default function Widget({ service }) {
diff --git a/src/components/services/widgets/service/peertube.jsx b/src/components/services/widgets/service/peertube.jsx
new file mode 100644
index 00000000..de02c6ba
--- /dev/null
+++ b/src/components/services/widgets/service/peertube.jsx
@@ -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 Peertube({ service }) {
+ const { t } = useTranslation();
+
+ const config = service.widget;
+
+ const { data: statsData, error: statsError } = useSWR(formatApiUrl(config, `server/stats`));
+
+ if (statsError) {
+ return ;
+ }
+
+ if (!statsData) {
+ return (
+
+
+
+
+
+ );
+ }
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/src/pages/api/services/proxy.js b/src/pages/api/services/proxy.js
index 65dbe88b..d02fcebb 100644
--- a/src/pages/api/services/proxy.js
+++ b/src/pages/api/services/proxy.js
@@ -82,6 +82,7 @@ const serviceProxyHandlers = {
jackett: genericProxyHandler,
adguard: genericProxyHandler,
mastodon: genericProxyHandler,
+ peertube: genericProxyHandler,
// uses X-API-Key (or similar) header auth
gotify: credentialedProxyHandler,
portainer: credentialedProxyHandler,
diff --git a/src/utils/api-helpers.js b/src/utils/api-helpers.js
index a8112efb..c6caf5ef 100644
--- a/src/utils/api-helpers.js
+++ b/src/utils/api-helpers.js
@@ -25,6 +25,7 @@ const formats = {
jackett: `{url}/api/v2.0/{endpoint}?apikey={key}&configured=true`,
adguard: `{url}/control/{endpoint}`,
mastodon: `{url}/api/v1/{endpoint}`,
+ peertube: `{url}/api/v1/{endpoint}`,
};
export function formatApiCall(api, args) {