fix: use PUBLIC_BASE_URL for function execution URL in FunctionDetail component
This commit is contained in:
@@ -7,6 +7,7 @@ const root = ReactDOM.createRoot(container);
|
||||
root.render(<App />);
|
||||
|
||||
export const BASE_URL = process.env.REACT_APP_API_URL || "";
|
||||
export const PUBLIC_BASE_URL = process.env.REACT_APP_API_URL || window.location.origin;
|
||||
|
||||
export const VERSION: {
|
||||
type: "SHSF API" | "SHSF UI";
|
||||
|
||||
@@ -55,7 +55,7 @@ import {
|
||||
runTrigger,
|
||||
} from "../../services/backend.triggers";
|
||||
import { getNamespace } from "../../services/backend.namespaces";
|
||||
import { BASE_URL } from "../..";
|
||||
import { BASE_URL, PUBLIC_BASE_URL } from "../..";
|
||||
import React from "react";
|
||||
import { ConsoleCard } from "../../components/cards/ConsoleCard";
|
||||
import { LogsCard } from "../../components/cards/LogCard";
|
||||
@@ -488,7 +488,7 @@ function FunctionDetail() {
|
||||
setFiles(filesData.data);
|
||||
if (functionData.data.allow_http) {
|
||||
setFunctionURL(
|
||||
`${BASE_URL}/api/exec/${functionData.data.namespaceId}/${functionData.data.executionId}`,
|
||||
`${PUBLIC_BASE_URL}/api/exec/${functionData.data.namespaceId}/${functionData.data.executionId}`,
|
||||
);
|
||||
} else {
|
||||
setFunctionURL(`No HTTP Access 🚫`);
|
||||
|
||||
Reference in New Issue
Block a user