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

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

View file

@ -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 = "";

View file

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

View file

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

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