mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 06:48:47 +00:00
Revert "Fix: subdirectory deployment (#2205)"
This revers commit b8eda91005
This commit is contained in:
parent
9e3bc8e64f
commit
8ec488efbd
20 changed files with 41 additions and 42 deletions
|
@ -3,7 +3,7 @@ import useSWR from "swr";
|
|||
|
||||
export default function Ping({ group, service, style }) {
|
||||
const { t } = useTranslation();
|
||||
const { data, error } = useSWR(`api/ping?${new URLSearchParams({ group, service }).toString()}`, {
|
||||
const { data, error } = useSWR(`/api/ping?${new URLSearchParams({ group, service }).toString()}`, {
|
||||
refreshInterval: 30000,
|
||||
});
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import useSWR from "swr";
|
|||
export default function Status({ service, style }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(`api/docker/status/${service.container}/${service.server || ""}`);
|
||||
const { data, error } = useSWR(`/api/docker/status/${service.container}/${service.server || ""}`);
|
||||
|
||||
let statusLabel = t("docker.unknown");
|
||||
let statusTitle = "";
|
||||
|
|
|
@ -2,7 +2,7 @@ import { MdRefresh } from "react-icons/md";
|
|||
|
||||
export default function Revalidate() {
|
||||
const revalidate = () => {
|
||||
fetch("api/revalidate").then((res) => {
|
||||
fetch("/api/revalidate").then((res) => {
|
||||
if (res.ok) {
|
||||
window.location.reload();
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ export default function Version() {
|
|||
const revision = process.env.NEXT_PUBLIC_REVISION?.length ? process.env.NEXT_PUBLIC_REVISION : "dev";
|
||||
const version = process.env.NEXT_PUBLIC_VERSION?.length ? process.env.NEXT_PUBLIC_VERSION : "dev";
|
||||
|
||||
const { data: releaseData } = useSWR("api/releases");
|
||||
const { data: releaseData } = useSWR("/api/releases");
|
||||
|
||||
// use Intl.DateTimeFormat to format the date
|
||||
const formatDate = (date) => {
|
||||
|
|
|
@ -23,7 +23,7 @@ export default function Widget({ options }) {
|
|||
const { settings } = useContext(SettingsContext);
|
||||
|
||||
const { data, error } = useSWR(
|
||||
`api/widgets/glances?${new URLSearchParams({ lang: i18n.language, ...options }).toString()}`,
|
||||
`/api/widgets/glances?${new URLSearchParams({ lang: i18n.language, ...options }).toString()}`,
|
||||
{
|
||||
refreshInterval: 1500,
|
||||
},
|
||||
|
|
|
@ -25,7 +25,7 @@ export default function Widget({ options }) {
|
|||
},
|
||||
};
|
||||
|
||||
const { data, error } = useSWR(`api/widgets/kubernetes?${new URLSearchParams({ lang: i18n.language }).toString()}`, {
|
||||
const { data, error } = useSWR(`/api/widgets/kubernetes?${new URLSearchParams({ lang: i18n.language }).toString()}`, {
|
||||
refreshInterval: 1500,
|
||||
});
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import Node from "./node";
|
|||
|
||||
export default function Longhorn({ options }) {
|
||||
const { expanded, total, labels, include, nodes } = options;
|
||||
const { data, error } = useSWR(`api/widgets/longhorn`, {
|
||||
const { data, error } = useSWR(`/api/widgets/longhorn`, {
|
||||
refreshInterval: 1500,
|
||||
});
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import mapIcon from "../../../utils/weather/openmeteo-condition-map";
|
|||
function Widget({ options }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(`api/widgets/openmeteo?${new URLSearchParams({ ...options }).toString()}`);
|
||||
const { data, error } = useSWR(`/api/widgets/openmeteo?${new URLSearchParams({ ...options }).toString()}`);
|
||||
|
||||
if (error || data?.error) {
|
||||
return <Error options={options} />;
|
||||
|
|
|
@ -16,7 +16,7 @@ function Widget({ options }) {
|
|||
const { t, i18n } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(
|
||||
`api/widgets/openweathermap?${new URLSearchParams({ lang: i18n.language, ...options }).toString()}`,
|
||||
`/api/widgets/openweathermap?${new URLSearchParams({ lang: i18n.language, ...options }).toString()}`,
|
||||
);
|
||||
|
||||
if (error || data?.cod === 401 || data?.error) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import Error from "../widget/error";
|
|||
export default function Cpu({ expanded, refresh = 1500 }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(`api/widgets/resources?type=cpu`, {
|
||||
const { data, error } = useSWR(`/api/widgets/resources?type=cpu`, {
|
||||
refreshInterval: refresh,
|
||||
});
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ function convertToFahrenheit(t) {
|
|||
export default function CpuTemp({ expanded, units, refresh = 1500 }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(`api/widgets/resources?type=cputemp`, {
|
||||
const { data, error } = useSWR(`/api/widgets/resources?type=cputemp`, {
|
||||
refreshInterval: refresh,
|
||||
});
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import Error from "../widget/error";
|
|||
export default function Disk({ options, expanded, refresh = 1500 }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(`api/widgets/resources?type=disk&target=${options.disk}`, {
|
||||
const { data, error } = useSWR(`/api/widgets/resources?type=disk&target=${options.disk}`, {
|
||||
refreshInterval: refresh,
|
||||
});
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import Error from "../widget/error";
|
|||
export default function Memory({ expanded, refresh = 1500 }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(`api/widgets/resources?type=memory`, {
|
||||
const { data, error } = useSWR(`/api/widgets/resources?type=memory`, {
|
||||
refreshInterval: refresh,
|
||||
});
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import Error from "../widget/error";
|
|||
export default function Uptime({ refresh = 1500 }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(`api/widgets/resources?type=uptime`, {
|
||||
const { data, error } = useSWR(`/api/widgets/resources?type=uptime`, {
|
||||
refreshInterval: refresh,
|
||||
});
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ function Widget({ options }) {
|
|||
const { t, i18n } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(
|
||||
`api/widgets/weather?${new URLSearchParams({ lang: i18n.language, ...options }).toString()}`,
|
||||
`/api/widgets/weather?${new URLSearchParams({ lang: i18n.language, ...options }).toString()}`,
|
||||
);
|
||||
|
||||
if (error || data?.error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue