Revert "Fix: subdirectory deployment (#2205)"

This revers commit b8eda91005
This commit is contained in:
shamoon 2023-10-18 11:44:26 -07:00
parent 9e3bc8e64f
commit 8ec488efbd
20 changed files with 41 additions and 42 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

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

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

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

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