Fix: subdirectory deployment (#2205)

This commit is contained in:
Isidro Osoria 2023-10-18 23:49:42 +08:00 committed by GitHub
parent 5f7891d8db
commit b8eda91005
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 42 additions and 41 deletions

View file

@ -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,
}
);

View file

@ -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
}
);

View file

@ -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
});

View file

@ -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) {

View file

@ -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) {

View file

@ -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,
});

View file

@ -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,
});

View file

@ -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,
});

View file

@ -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,
});

View file

@ -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,
});

View file

@ -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) {