mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 22:48:46 +00:00
Fix: subdirectory deployment (#2205)
This commit is contained in:
parent
5f7891d8db
commit
b8eda91005
20 changed files with 42 additions and 41 deletions
|
@ -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,
|
||||
}
|
||||
);
|
||||
|
|
|
@ -26,7 +26,7 @@ export default function Widget({ options }) {
|
|||
};
|
||||
|
||||
const { data, error } = useSWR(
|
||||
`/api/widgets/kubernetes?${new URLSearchParams({ lang: i18n.language }).toString()}`, {
|
||||
`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
|
||||
});
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ function Widget({ options }) {
|
|||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(
|
||||
`/api/widgets/openmeteo?${new URLSearchParams({ ...options }).toString()}`
|
||||
`api/widgets/openmeteo?${new URLSearchParams({ ...options }).toString()}`
|
||||
);
|
||||
|
||||
if (error || data?.error) {
|
||||
|
|
|
@ -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