mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-16 01:39:49 +00:00
Retrieve ping url from config rather than as query parameter
This commit is contained in:
parent
0d6ccb036e
commit
1fb7be7457
7 changed files with 35 additions and 24 deletions
|
@ -1,9 +1,9 @@
|
|||
import { useTranslation } from "react-i18next";
|
||||
import useSWR from "swr";
|
||||
|
||||
export default function Ping({ service }) {
|
||||
export default function Ping({ group, service }) {
|
||||
const { t } = useTranslation();
|
||||
const { data, error } = useSWR(`/api/ping?${new URLSearchParams({ping: service.ping}).toString()}`, {
|
||||
const { data, error } = useSWR(`/api/ping?${new URLSearchParams({ group, service }).toString()}`, {
|
||||
refreshInterval: 30000
|
||||
});
|
||||
|
||||
|
@ -23,7 +23,7 @@ export default function Ping({ service }) {
|
|||
);
|
||||
}
|
||||
|
||||
const statusText = `${service.ping}: HTTP status ${data.status}`;
|
||||
const statusText = `${service}: HTTP status ${data.status}`;
|
||||
|
||||
if (data.status > 403) {
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue